Skip to content

Commit

Permalink
Update cmake library definition for libiothsm (#546)
Browse files Browse the repository at this point in the history
* Update cmake library definition for libiothsm

* Remove SOVERSION

* Add version constraints on the packages

* Move to build shared only

* Add archive destination

* Add lib path to dh_shlibdeps

* Add -l to dh_shlibdeps

* Don't include install target on windows

* Update win32 config for install

* Fix -l

* Fix shlibdeps for arm32
  • Loading branch information
myagley authored Nov 28, 2018
1 parent 92601ab commit 5667a9f
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 9 deletions.
Empty file modified edgelet/build/linux/debian8/aarch64/package-iotedged.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian8/aarch64/package-libiothsm.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian8/amd64/package-iotedged.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian8/amd64/package-libiothsm.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian8/arm32v7/package-iotedged.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian8/arm32v7/package-libiothsm.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian9/aarch64/package-iotedged.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian9/aarch64/package-libiothsm.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian9/amd64/package-iotedged.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian9/amd64/package-libiothsm.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian9/arm32v7/package-iotedged.sh
100644 → 100755
Empty file.
Empty file modified edgelet/build/linux/debian9/arm32v7/package-libiothsm.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion edgelet/contrib/centos/iotedge.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ URL: https://github.com/azure/iotedge
%{?systemd_requires}
BuildRequires: systemd
Requires(pre): shadow-utils
Requires: libiothsm-std
Requires: libiothsm-std > 1.0.4
Source0: iotedge-%{version}.tar.gz

%description
Expand Down
2 changes: 1 addition & 1 deletion edgelet/contrib/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Homepage: https://github.com/azure/iot-edge
Package: iotedge
Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}, adduser, ca-certificates, hostname, libiothsm, sed
Depends: ${misc:Depends}, ${shlibs:Depends}, adduser, ca-certificates, hostname, libiothsm-std (>> 1.0.4), sed
Description: Azure IoT Edge Security Daemon
Azure IoT Edge is a fully managed service that delivers cloud intelligence
locally by deploying and running artificial intelligence (AI), Azure services,
Expand Down
8 changes: 5 additions & 3 deletions edgelet/contrib/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ override_dh_systemd_start:

override_dh_shlibdeps:
ifeq ($(CARGO), cross)
dh_shlibdeps -l /usr/arm-linux-gnueabihf/lib/ -- --ignore-missing-info
cp $(CURDIR)/../build/hsm-sys*/out/lib/libiothsm.so* $(CURDIR)
dh_shlibdeps -l /usr/arm-linux-gnueabihf/lib/:$(CURDIR) -- --ignore-missing-info
else
ifndef SYSROOT
dh_shlibdeps
dh_shlibdeps -l $(CURDIR)/../build/hsm-sys*/out/lib -- --ignore-missing-info
else
dh_shlibdeps -l $(SYSROOT)/lib/:$(SYSROOT)/usr/lib -- --ignore-missing-info
cp $(CURDIR)/../build/hsm-sys*/out/lib/libiothsm.so* $(CURDIR)
dh_shlibdeps -l $(CURDIR):$(SYSROOT)/lib/:$(SYSROOT)/usr/lib -- --ignore-missing-info
endif
endif
8 changes: 5 additions & 3 deletions edgelet/contrib/debian8/rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ override_dh_systemd_start:

override_dh_shlibdeps:
ifeq ($(CARGO), cross)
dh_shlibdeps -l /usr/arm-linux-gnueabihf/lib/ -- --ignore-missing-info
cp $(CURDIR)/../build/hsm-sys*/out/lib/libiothsm.so* $(CURDIR)
dh_shlibdeps -l /usr/arm-linux-gnueabihf/lib/:$(CURDIR) -- --ignore-missing-info
else
ifndef SYSROOT
dh_shlibdeps
dh_shlibdeps -l $(CURDIR)/../build/hsm-sys*/out/lib -- --ignore-missing-info
else
dh_shlibdeps -l $(SYSROOT)/lib/:$(SYSROOT)/usr/lib -- --ignore-missing-info
cp $(CURDIR)/../build/hsm-sys*/out/lib/libiothsm.so* $(CURDIR)
dh_shlibdeps -l $(CURDIR):$(SYSROOT)/lib/:$(SYSROOT)/usr/lib -- --ignore-missing-info
endif
endif
13 changes: 12 additions & 1 deletion edgelet/hsm-sys/azure-iot-hsm-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ if (${run_unittests})
add_subdirectory(tests)
endif()

install(TARGETS iothsm DESTINATION ${CMAKE_INSTALL_LIBDIR})
set_target_properties(iothsm PROPERTIES
VERSION ${iothsm_VERSION_MAJOR}.${iothsm_VERSION_MINOR}.${iothsm_VERSION_PATCH}
SOVERSION 1)

if(WIN32)
install(TARGETS iothsm DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
install(TARGETS iothsm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif(WIN32)

# CPack
include (InstallRequiredSystemLibraries)
Expand All @@ -154,6 +164,7 @@ endif()
set (CPACK_DEBIAN_PACKAGE_PROVIDES "libiothsm")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Azure IoT Edge Devs")
set (CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON")

set (CPACK_RPM_FILE_NAME RPM-DEFAULT)
set (CPACK_RPM_PACKAGE_RELEASE_DIST On)
Expand Down

0 comments on commit 5667a9f

Please sign in to comment.