Skip to content

Commit

Permalink
Merge pull request #485 from nekromant/deb-pkg-fixup
Browse files Browse the repository at this point in the history
Fix debian packaging
  • Loading branch information
xor-gate authored Oct 4, 2016
2 parents ee3f7a1 + 650a88a commit 2e50937
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 38 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ install(TARGETS st-flash st-info
RUNTIME DESTINATION bin
)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(GLOB RULES_FILES etc/udev/rules.d/*.rules)
install(FILES etc/modprobe.d/stlink_v1.conf
DESTINATION /etc)
install(FILES ${RULES_FILES}
DESTINATION /lib/udev/rules.d/)
endif()

add_subdirectory(src/gdbserver)
add_subdirectory(src/tools/gui)

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ release: build/Release
@echo "[RELEASE]"
@$(MAKE) -C build/Release

package: build/Release
@echo "[PACKAGE] Release"
@$(MAKE) -C build/Release package

test: debug
@$(MAKE) -C build/Debug test

Expand Down
2 changes: 2 additions & 0 deletions cmake/CPackConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set (CPACK_SOURCE_GENERATOR "TBZ2;ZIP")
set (CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
set (CPACK_SET_DESTDIR "ON")
set (CPACK_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/cpack/staging")
if (APPLE)
set(CPACK_GENERATOR "ZIP")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist/osx")
Expand Down
2 changes: 2 additions & 0 deletions debian/libstlink-dev.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
usr/include/*
usr/lib/*/lib*.a
usr/lib/*/pkgconfig/*
usr/lib/*/lib*.so

4 changes: 2 additions & 2 deletions debian/libstlink.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
usr/lib/*/lib*.so*
usr/lib/*/lib*.so.*
lib/udev/rules.d/*.rules
lib/modprobe.d/*.conf
etc/modprobe.d/*.conf
40 changes: 5 additions & 35 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,12 @@ include /usr/share/dpkg/default.mk
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


# main packaging script based on dh7 syntax
%:
dh $@


OUTDIR=build/Release
ROOTDIR=debian/tmp
DSTDIR=$(ROOTDIR)/usr
BINDIR=$(DSTDIR)/bin
SHAREDIR=$(DSTDIR)/share/stlink
LIBDIR=$(DSTDIR)/lib/$(if $(DEB_TARGET_MULTIARCH),$(DEB_TARGET_MULTIARCH),$(DEB_BUILD_MULTIARCH))
UDEVDIR=$(ROOTDIR)/lib/udev/rules.d/
MODDIR=$(ROOTDIR)/lib/modprobe.d/

export CMAKEFLAGS = \
-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
-DCMAKE_INSTALL_PREFIX=/usr \

dh $@ --buildsystem cmake

# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
override_dh_auto_configure:

override_dh_auto_install:
install -d $(DSTDIR)/include/stlink/tools
install -d $(LIBDIR)/pkgconfig
install -d $(BINDIR)
install -d $(SHAREDIR)
install -d $(UDEVDIR)
install -d $(MODDIR)
install -m644 $(wildcard include/*.h) $(DSTDIR)/include
install -m644 $(wildcard include/stlink/*.h) $(DSTDIR)/include/stlink
install -m644 $(wildcard include/stlink/tools/*.h) $(DSTDIR)/include/stlink/tools
install -m755 $(wildcard $(OUTDIR)/st-* $(OUTDIR)/src/gdbserver/st-* $(OUTDIR)/src/tools/gui/stlink-gui*) $(BINDIR)
cp -d $(wildcard $(OUTDIR)/libstlink.*) $(LIBDIR)
install -m644 $(OUTDIR)/usr/lib/pkgconfig/stlink.pc $(LIBDIR)/pkgconfig
install -m644 src/tools/gui/stlink-gui.ui $(SHAREDIR)
install -m644 etc/udev/rules.d/*.rules $(UDEVDIR)
install -m644 etc/modprobe.d/*.conf $(MODDIR)

dh_auto_configure -- \
-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
2 changes: 1 addition & 1 deletion debian/stlink-gui.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/usr/bin/stlink-gui*
/usr/share/*
/usr/share/stlink/stlink-gui.ui

0 comments on commit 2e50937

Please sign in to comment.