From 4fa420699b7daad01aa108db78564677787356bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= Date: Tue, 15 Oct 2024 12:32:05 +0200 Subject: [PATCH] Adjust packaging for 1.6.0~alpha1 --- debian/NEWS | 13 ++++++++++++ debian/README.source | 9 --------- debian/aptly-api.conf | 3 --- debian/aptly-api.postinst | 42 +++++++++++++-------------------------- debian/aptly-api.postrm | 17 ---------------- debian/control | 1 - debian/copyright | 1 - debian/rules | 15 ++++++-------- debian/tests/control | 4 ---- 9 files changed, 33 insertions(+), 72 deletions(-) delete mode 100644 debian/README.source delete mode 100644 debian/aptly-api.conf mode change 100644 => 100755 debian/aptly-api.postrm diff --git a/debian/NEWS b/debian/NEWS index 7b1eb1d4..c51ca1e3 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,16 @@ +aptly (1.6.0+ds1~alpha1-1) unstable; urgency=medium + + - aptly-api: configuration file is now /etc/aptly.conf, and `rootDir` + defaults to `~/.aptly` + + - aptly-api: default port is 8080, as declared in + `/etc/default/aptly-api` + + - aptly: swagger support is disabled, but will be re-enabled after the + corresponding golang packages make it to unstable + + -- Sebastien Delafond Tue, 15 Oct 2024 11:41:33 +0200 + aptly (1.3.0+ds1-2.2) unstable; urgency=medium This version tries to fix the database backwards compatibility, diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index cea43b81..00000000 --- a/debian/README.source +++ /dev/null @@ -1,9 +0,0 @@ -aptly for Debian ----------------- - -For now, we bundle the Go libraries that aptly depends on, within the -aptly tarball itself. As time goes, those will be packaged on their -own. - - -- Sebastien Delafond , Tue, 29 Apr 2014 15:56:02 +0200 - diff --git a/debian/aptly-api.conf b/debian/aptly-api.conf deleted file mode 100644 index b154da05..00000000 --- a/debian/aptly-api.conf +++ /dev/null @@ -1,3 +0,0 @@ -{ - "rootDir": "/var/lib/aptly-api" -} diff --git a/debian/aptly-api.postinst b/debian/aptly-api.postinst index e9131fb3..198beec2 100755 --- a/debian/aptly-api.postinst +++ b/debian/aptly-api.postinst @@ -1,43 +1,29 @@ #!/bin/sh -# postinst script for aptly-api -# -# 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|reconfigure) - # create an aptly-api group and user if ! getent passwd aptly-api > /dev/null; then - adduser --system --home /var/lib/aptly-api --no-create-home aptly-api - addgroup --system aptly-api - adduser aptly-api aptly-api + useradd --system --user-group --create-home --home-dir /var/lib/aptly-api aptly-api fi - # setup /var/lib/aptly-api - if [ ! -d /var/lib/aptly-api ]; then - mkdir -p /var/lib/aptly-api - fi - chown aptly-api:aptly-api /var/lib/aptly-api + # set config file permissions not world readable as it may contain secrets + chown root:aptly-api /etc/aptly.conf + chmod 640 /etc/aptly.conf - # set config file permissions - # it may contain secrets so it is not world readable - chown root:aptly-api /etc/aptly-api.conf - chmod 640 /etc/aptly-api.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) diff --git a/debian/aptly-api.postrm b/debian/aptly-api.postrm old mode 100644 new mode 100755 index d22a7064..3092cecd --- a/debian/aptly-api.postrm +++ b/debian/aptly-api.postrm @@ -1,24 +1,7 @@ #!/bin/sh -# postrm script for aptly-api -# -# see: dh_installdeb(1) set -e -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) # Only remove /var/lib/aptly-api on purge diff --git a/debian/control b/debian/control index bd9961e7..24f81aac 100644 --- a/debian/control +++ b/debian/control @@ -109,7 +109,6 @@ Description: Swiss army knife for Debian repository management - main package Package: aptly-api Architecture: all Depends: ${misc:Depends}, aptly, adduser -Built-Using: ${misc:Built-Using} Description: Swiss army knife for Debian repository management - API It offers several features making it easy to manage Debian package repositories: diff --git a/debian/copyright b/debian/copyright index 657b432b..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: debian/* Files: * Copyright: 2014 Andrey Smirnov diff --git a/debian/rules b/debian/rules index 9fe53910..747a56b1 100755 --- a/debian/rules +++ b/debian/rules @@ -1,19 +1,16 @@ #!/usr/bin/make -f -# -*- makefile -*- - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 include /usr/share/dpkg/pkg-info.mk +%: + dh $@ --buildsystem=golang --with=golang,bash-completion + override_dh_auto_test: - # tests are failing for now and the pacakge vendors many libraries + # run during autopkgtests override_dh_auto_install: dh_auto_install -- --no-source override_dh_auto_build: - dh_auto_build -- -ldflags "-X main.Version=$(DEB_VERSION)" - -%: - dh $@ --buildsystem=golang --with=golang,bash-completion + echo $(DEB_VERSION) > obj-$(DEB_TARGET_GNU_TYPE)/src/github.com/aptly-dev/aptly/VERSION + dh_auto_build diff --git a/debian/tests/control b/debian/tests/control index 65f0d64a..0ae1d291 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,8 +1,4 @@ # This file is an addition to the autodep8 tests. -# -# See autodep8(1): -# > If `debian/tests/control.autodep8` exists, autodep8 -# > will prepend the contents of that file to its own output. Test-Command: HOME=/tmp aptly repo create autopkgtest Restrictions: allow-stderr