From 5fd61725bdee2dc5d6830a6aaa2535a244516a0d Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 21 Jan 2020 23:15:15 +0100 Subject: [PATCH] Fixes for debian packaging --- cmake/Deb.cmake | 20 ++++++--- debian/changelog.in | 2 +- debian/compat | 2 +- debian/control | 6 +-- debian/copyright-scan-patterns.yml | 2 + debian/rules | 70 ++++++------------------------ 6 files changed, 35 insertions(+), 67 deletions(-) diff --git a/cmake/Deb.cmake b/cmake/Deb.cmake index 3df5e4db..7d50b435 100644 --- a/cmake/Deb.cmake +++ b/cmake/Deb.cmake @@ -1,5 +1,15 @@ -add_custom_target(deb - COMMAND cp -r -p ${CMAKE_SOURCE_DIR}/debian ${CMAKE_BINARY_DIR}/ - COMMAND dpkg-buildpackage -b -d -uc -us - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) +find_program(LSB_RELEASE_EXEC lsb_release) +find_program(DPKG_BUILDPACKAGE dpkg-buildpackage) + +if (LSB_RELEASE_EXEC AND DPKG_BUILDPACKAGE) + execute_process(COMMAND /bin/sh "-c" "${LSB_RELEASE_EXEC} -cs" + OUTPUT_VARIABLE DEB_CODENAME + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (DEB_CODENAME) + add_custom_target(deb + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${DPKG_BUILDPACKAGE} -b -d -uc -us + ) + endif() +endif() diff --git a/debian/changelog.in b/debian/changelog.in index fcb12a53..f9c98440 100644 --- a/debian/changelog.in +++ b/debian/changelog.in @@ -1,4 +1,4 @@ -strawberry (${STRAWBERRY_VERSION_DISPLAY}) unstable; urgency=low +strawberry (${STRAWBERRY_VERSION_DISPLAY}-${DEB_CODENAME}) ${DEB_CODENAME}; urgency=low * Version ${STRAWBERRY_VERSION_DISPLAY} diff --git a/debian/compat b/debian/compat index ec635144..b4de3947 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +11 diff --git a/debian/control b/debian/control index 8856d200..bf3da4e3 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: strawberry Section: sound Priority: optional Maintainer: Jonas Kvinge -Build-Depends: debhelper (>= 7), +Build-Depends: debhelper (>= 11), make, cmake, gcc, @@ -16,10 +16,8 @@ Build-Depends: debhelper (>= 7), libasound2-dev, libpulse-dev, libtag1-dev, - libqt5-dev, qtbase5-dev, qtbase5-dev-tools, - qtbase5-private-dev, qttools5-dev, libqt5x11extras5-dev, libgstreamer1.0-dev, @@ -32,7 +30,7 @@ Build-Depends: debhelper (>= 7), libusbmuxd-dev, libchromaprint-dev, libfftw3-dev -Standards-Version: 3.9.8 +Standards-Version: 4.2.1 Package: strawberry Architecture: any diff --git a/debian/copyright-scan-patterns.yml b/debian/copyright-scan-patterns.yml index b643cc1f..f222259c 100644 --- a/debian/copyright-scan-patterns.yml +++ b/debian/copyright-scan-patterns.yml @@ -11,7 +11,9 @@ ignore: - /cmake/ - /data/ - /dist/ + - /snap/ suffixes: - jpg - png + - gif diff --git a/debian/rules b/debian/rules index d1485db7..32bf3aa7 100755 --- a/debian/rules +++ b/debian/rules @@ -1,61 +1,19 @@ #!/usr/bin/make -f -# -*- makefile -*- -MY_MAKEFLAGS= -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MY_MAKEFLAGS=-j$(NUMJOBS) -endif +%: + dh $@ --buildsystem=cmake -builddirectory=build -configure: configure-stamp -configure-stamp: - dh_testdir - cmake .. \ - -DCMAKE_INSTALL_PREFIX=$(CURDIR)/debian/strawberry/usr - touch configure-stamp +override_dh_auto_clean: + rm -f dist/macos/Info.plist + rm -f dist/macos/create-dmg.sh + rm -f dist/pacman/PKGBUILD + rm -f dist/rpm/strawberry.spec + rm -f dist/scripts/maketarball.sh + rm -f dist/windows/strawberry.nsi + rm -f src/translations/translations.pot + dh_auto_clean -build: build-stamp -build-stamp: configure-stamp - dh_testdir - make $(MY_MAKEFLAGS) - touch $@ +override_dh_installchangelogs: + dh_installchangelogs Changelog -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - -make clean - -rm Makefile src/Makefile - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - - make install - -binary-indep: install - -binary-arch: install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installmenu - dh_installdocs - dh_gconf - dh_link - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +override_dh_auto_test: