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 old mode 100644 new mode 100755 index e2543af1..2f857aed --- a/debian/aptly-api.preinst +++ b/debian/aptly-api.preinst @@ -1,24 +1,9 @@ #!/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) @@ -30,9 +15,6 @@ case "$1" in ;; 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/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..437700f3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,6 @@ 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 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..768a0f97 100755 --- a/debian/rules +++ b/debian/rules @@ -8,36 +8,25 @@ 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: + # 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: # not needed with golang, fails with cross compiling # override_dh_makeshlibs: + +override_dh_auto_build: + echo $(DEB_VERSION) > VERSION + go build -o build/aptly