From 6050051e04c9d3c294a150f109120027a5ad5d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Fri, 15 Nov 2024 14:59:07 +0100 Subject: [PATCH] adapt to official debian aptly packaging --- .github/workflows/ci.yml | 2 +- .gitignore | 8 ++-- debian/aptly-api.maintscript | 1 + debian/aptly-api.postinst | 48 ++++--------------- debian/aptly-api.preinst | 38 --------------- debian/aptly.bash-completion | 1 + debian/aptly.install | 8 +--- debian/aptly.manpages | 1 + debian/changelog | 93 ++---------------------------------- debian/compat | 1 - debian/control | 17 ++++--- debian/copyright | 3 +- debian/manpages | 1 + debian/rules | 30 +++++------- 14 files changed, 42 insertions(+), 210 deletions(-) create mode 100644 debian/aptly-api.maintscript mode change 100644 => 100755 debian/aptly-api.postinst delete mode 100644 debian/aptly-api.preinst create mode 100644 debian/aptly.bash-completion create mode 100644 debian/aptly.manpages delete mode 100644 debian/compat create mode 100644 debian/manpages diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17f28d64..7e3c40a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,7 +142,7 @@ jobs: - name: "Install packages" run: | apt-get update - apt-get install -y --no-install-recommends make ca-certificates git curl build-essential devscripts dh-golang binutils-i686-linux-gnu binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf jq + apt-get install -y --no-install-recommends make ca-certificates git curl build-essential devscripts dh-golang binutils-i686-linux-gnu binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf jq bash-completion git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: "Checkout repository" diff --git a/.gitignore b/.gitignore index 6b1b2081..7250967f 100644 --- a/.gitignore +++ b/.gitignore @@ -53,18 +53,16 @@ obj-x86_64-linux-gnu/ # debian debian/.debhelper/ -debian/aptly.debhelper.log -debian/aptly.postrm.debhelper debian/aptly.substvars debian/aptly/ debian/debhelper-build-stamp debian/files debian/aptly-api/ -debian/aptly-api.debhelper.log -debian/aptly-api.postrm.debhelper +debian/*.debhelper +debian/*.debhelper.log debian/aptly-api.substvars -debian/aptly-dbg.debhelper.log debian/aptly-dbg.substvars debian/aptly-dbg/ +usr docs/ diff --git a/debian/aptly-api.maintscript b/debian/aptly-api.maintscript new file mode 100644 index 00000000..dbc52ad4 --- /dev/null +++ b/debian/aptly-api.maintscript @@ -0,0 +1 @@ +mv_conffile /etc/aptly-api.conf /etc/aptly.conf 1.6~ diff --git a/debian/aptly-api.postinst b/debian/aptly-api.postinst old mode 100644 new mode 100755 index e930a02b..01edd3a1 --- a/debian/aptly-api.postinst +++ b/debian/aptly-api.postinst @@ -1,28 +1,13 @@ #!/bin/sh -# -# see: dh_installdeb(1) set -e -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - # source debconf library . /usr/share/debconf/confmodule - case "$1" in - configure) - # create an aptly group and user + configure|reconfigure) + # create an aptly-api group and user if ! getent passwd aptly-api > /dev/null; then useradd --system --user-group --create-home --home-dir /var/lib/aptly-api aptly-api fi @@ -30,32 +15,17 @@ case "$1" in # set config file permissions not world readable as it may contain secrets chown root:aptly-api /etc/aptly.conf chmod 640 /etc/aptly.conf + ;; - if [ -f /etc/aptly-api.conf.migrate ]; then - rootDir=`grep rootDir /etc/aptly-api.conf.migrate | sed 's_/var/lib/aptly-api_~_' | sed -n 's/.\+: "\([^"]\+\)".*/\1/p'` - if [ -n "$rootDir" ]; then - sed -i 's/\(.*"rootDir": "\)[^"]*\(".*\)/\1'$rootDir'\2/' /etc/aptly.conf - fi - echo "backing up /etc/aptly-api.conf to /etc/aptly-api.conf.old..." - mv /etc/aptly-api.conf.migrate /etc/aptly-api.conf.old - fi - ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; - abort-upgrade|abort-remove|abort-deconfigure) - exit 0 - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; esac -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - #DEBHELPER# -db_stop - exit 0 diff --git a/debian/aptly-api.preinst b/debian/aptly-api.preinst deleted file mode 100644 index e2543af1..00000000 --- a/debian/aptly-api.preinst +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - install|upgrade) - if [ -f /etc/aptly-api.conf ]; then - echo "migrating /etc/aptly-api.conf ..." - mv /etc/aptly-api.conf /etc/aptly-api.conf.migrate - fi - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff --git a/debian/aptly.bash-completion b/debian/aptly.bash-completion new file mode 100644 index 00000000..af08cb0b --- /dev/null +++ b/debian/aptly.bash-completion @@ -0,0 +1 @@ +completion.d/aptly diff --git a/debian/aptly.install b/debian/aptly.install index 777b94c9..27a513c6 100644 --- a/debian/aptly.install +++ b/debian/aptly.install @@ -1,6 +1,2 @@ -build/aptly usr/bin/ -README.rst usr/share/aptly/ -LICENSE usr/share/aptly/ -AUTHORS usr/share/aptly/ -completion.d/_aptly usr/share/zsh/vendor-completions/ -completion.d/aptly usr/share/bash-completion/completions/ +usr/bin/aptly +completion.d/_aptly usr/share/zsh/vendor-completions diff --git a/debian/aptly.manpages b/debian/aptly.manpages new file mode 100644 index 00000000..c261d746 --- /dev/null +++ b/debian/aptly.manpages @@ -0,0 +1 @@ +man/aptly.1 diff --git a/debian/changelog b/debian/changelog index 4702c6a8..47d58eb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,92 +1,5 @@ -aptly (1.6.0~beta1) stable; urgency=medium +aptly (1.6.0~rc1) stable; urgency=medium - * upstream aptly debianization + * release candidate - -- André Roth Tue, 17 Sep 2024 16:47:44 +0200 - -aptly (1.5.0+ds1-1) unstable; urgency=medium - - * Team upload. - * New upstream release (Closes: #1022721), including fix for "Order of - fields in Packages/Sources is unpredictable" (Closes: #907121). - - -- Roland Mas Tue, 31 Jan 2023 14:47:04 +0100 - -aptly (1.4.0+ds1-7) unstable; urgency=medium - - * Team upload. - * Add support for zstd compression (Closes: #1010465) - - -- Anton Gladky Tue, 17 May 2022 22:42:29 +0200 - -aptly (1.4.0+ds1-6) unstable; urgency=medium - - * Conflict on gpgv1 (Closes: #990821) - - -- Sebastien Delafond Thu, 04 Nov 2021 10:24:53 +0100 - -aptly (1.4.0+ds1-5) unstable; urgency=medium - - * Conflict on gnupg1 (Closes: #990821) - - -- Sebastien Delafond Thu, 14 Oct 2021 18:43:04 +0200 - -aptly (1.4.0+ds1-4) unstable; urgency=medium - - * Install correct bash completion snippet (Closes: #984979) - - -- Sebastien Delafond Thu, 11 Mar 2021 15:20:57 +0100 - -aptly (1.4.0+ds1-3) unstable; urgency=medium - - * Fix s3 etag issue (Closes: #983877) - * Bump-up d/watch version - * Bump-up Standards-Version - - -- Sebastien Delafond Wed, 03 Mar 2021 10:50:51 +0100 - -aptly (1.4.0+ds1-2) unstable; urgency=medium - - * Use pipeline from salsa-ci-team - * Allow reprotest failure - * Pass version from d/rules (Closes: #968585) - - -- Sebastien Delafond Fri, 21 Aug 2020 10:13:44 +0200 - -aptly (1.4.0+ds1-1) unstable; urgency=medium - - * New upstream version 1.4.0+ds1 - * Rediff patches - * Depend on gnupg 2 - - -- Sebastien Delafond Sun, 22 Dec 2019 15:16:25 +0100 - -aptly (1.3.0+ds1-4) unstable; urgency=medium - - [ Debian Janitor ] - * Rename obsolete path debian/tests/control.autodep8 to debian/tests/control. - * Use secure URI in Homepage field. - * Bump debhelper from old 11 to 12. - * Set debhelper-compat version in Build-Depends. - - [ Sébastien Delafond ] - * Bump up Standards-Version - - -- Sebastien Delafond Sun, 22 Dec 2019 14:10:19 +0100 - -aptly (1.3.0+ds1-3) unstable; urgency=medium - - * Build-Depend on golang-golang-x-tools-dev instead of golang-go.tools (Closes: #945884) - * Lintian fix - - -- Sebastien Delafond Sat, 21 Dec 2019 10:29:09 +0100 - -aptly (1.3.0+ds1-2.3) unstable; urgency=medium - - * Non-maintainer upload. - * Remove myself from uploaders. - - -- Alexandre Viau Sun, 15 Sep 2019 19:27:47 -0400 - -# Older entries have been removed from this changelog. -# To read the complete changelog use `apt changelog aptly`. + -- André Roth Sat, 16 Nov 2024 12:44:06 +0100 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index b4de3947..00000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -11 diff --git a/debian/control b/debian/control index 2c5fb3fe..c7fd55ab 100644 --- a/debian/control +++ b/debian/control @@ -1,9 +1,9 @@ Source: aptly -Section: devel +Section: utils Priority: optional -Maintainer: Debian Go Packaging Team -Uploaders: TODO -Build-Depends: debhelper (>= 11), +Maintainer: André Roth +Build-Depends: bash-completion, + debhelper-compat (= 13), dh-golang, golang-go, golang-github-aleksi-pointer-dev, @@ -78,12 +78,11 @@ Build-Depends: debhelper (>= 11), golang-go.uber-zap-dev, golang-etcd-server-dev (>= 3.5.15-7), git -Standards-Version: 4.2.1 -Homepage: https://github.com/aptly-dev/aptly -Vcs-Browser: https://salsa.debian.org/go-team/packages/aptly -Vcs-Git: https://salsa.debian.org/go-team/packages/aptly.git +Standards-Version: 4.7.0 +Homepage: https://www.aptly.info +Vcs-Git: https://github.com/aptly-dev/aptly.git +Vcs-Browser: https://github.com/aptly-dev/aptly XS-Go-Import-Path: github.com/aptly-dev/aptly -Testsuite: autopkgtest-pkg-go Package: aptly Architecture: any diff --git a/debian/copyright b/debian/copyright index 53815267..cb7fed43 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,10 +1,9 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: aptly Source: http://www.aptly.info -Files-Excluded: vendor/* Files: * -Copyright: 2014 Andrey Smirnov +Copyright: 2014 Andrey Smirnov , 2023 André Roth License: Expat Comment: Some of aptly's vendored dependencies are already in Debian, and Alexandre Viau is well on his way to packaging the rest of them so that diff --git a/debian/manpages b/debian/manpages new file mode 100644 index 00000000..6bde59c3 --- /dev/null +++ b/debian/manpages @@ -0,0 +1 @@ +src/github.com/aptly-dev/aptly/man/aptly.1 diff --git a/debian/rules b/debian/rules index 1b4dddd4..40a968e5 100755 --- a/debian/rules +++ b/debian/rules @@ -8,36 +8,28 @@ export DEB_BUILD_OPTIONS=crossbuildcanrunhostbinaries export GOARCH := $(shell if [ $(DEB_TARGET_ARCH) = "i386" ]; then echo "386"; elif [ $(DEB_TARGET_ARCH) = "armhf" ]; then echo "arm"; else echo $(DEB_TARGET_ARCH); fi) %: - dh $@ --buildsystem=golang --with=golang + dh $@ --buildsystem=golang --with=golang,bash-completion override_dh_auto_clean: rm -rf build/ rm -rf obj-$(DEB_TARGET_GNU_TYPE)/ dh_auto_clean -override_dh_auto_build: - echo $(DEB_VERSION) > VERSION - go build -o build/aptly - - # when dependencies fully debianized: - # echo $(DEB_VERSION) > obj-$(DEB_TARGET_GNU_TYPE)/src/github.com/aptly-dev/aptly/VERSION - # dh_auto_build - -override_dh_auto_test: +override_dh_auto_test: # disabled override_dh_auto_install: dh_auto_install -- --no-source - mkdir -p build - test -f debian/tmp/usr/bin/aptly && mv debian/tmp/usr/bin/aptly build/ || true - mkdir -p debian/aptly/usr/share/man/man1/ - cp man/aptly.1 debian/aptly/usr/share/man/man1 - gzip debian/aptly/usr/share/man/man1/aptly.1 override_dh_strip: dh_strip --dbg-package=aptly-dbg -# only with full debian dependencies: -override_dh_golang: +override_dh_golang: # fails on non native debian build -# not needed with golang, fails with cross compiling -# override_dh_makeshlibs: +# override_dh_makeshlibs: # fails with cross compiling on non native debian build + +override_dh_dwz: # somehow dwz works only with certain newer debhelper versions + dhver=`dpkg-query -f '$${Version}' -W debhelper`; (dpkg --compare-versions "$$dhver" lt 13 || test "$$dhver" = "13.3.4" || test "$$dhver" = "13.6ubuntu1") || dh_dwz + +override_dh_auto_build: + echo $(DEB_VERSION) > VERSION + go build -o usr/bin/aptly