diff --git a/debian/aptly-api.conf b/debian/aptly-api.conf new file mode 100644 index 00000000..b154da05 --- /dev/null +++ b/debian/aptly-api.conf @@ -0,0 +1,3 @@ +{ + "rootDir": "/var/lib/aptly-api" +} diff --git a/debian/aptly-api.default b/debian/aptly-api.default new file mode 100644 index 00000000..a407ec52 --- /dev/null +++ b/debian/aptly-api.default @@ -0,0 +1,2 @@ +# Default settings for aptly-api +LISTEN_ADDRESS='localhost:8080' diff --git a/debian/aptly-api.install b/debian/aptly-api.install new file mode 100644 index 00000000..e1d67361 --- /dev/null +++ b/debian/aptly-api.install @@ -0,0 +1 @@ +debian/aptly-api.conf etc diff --git a/debian/aptly-api.postinst b/debian/aptly-api.postinst new file mode 100755 index 00000000..9d263609 --- /dev/null +++ b/debian/aptly-api.postinst @@ -0,0 +1,57 @@ +#!/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 + + +case "$1" in + configure|reconfigure) + + # create an aptly-api group and user + if ! grep -q aptly-api /etc/passwd; then + adduser --system --home /var/lib/aptly-api --no-create-home aptly-api + addgroup --system aptly-api + adduser 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 + # it may contain secrets so it is not world readable + chown root:aptly-api /etc/aptly-api.conf + chmod 640 /etc/aptly-api.conf + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + 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# + +exit 0 diff --git a/debian/aptly-api.postrm b/debian/aptly-api.postrm new file mode 100644 index 00000000..d22a7064 --- /dev/null +++ b/debian/aptly-api.postrm @@ -0,0 +1,41 @@ +#!/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 + if [ "${1}" = "purge" ] ; then + rm -rf /var/lib/aptly-api + fi + ;; + + *) + echo "postrm 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-api.service b/debian/aptly-api.service new file mode 100644 index 00000000..7a67ed2a --- /dev/null +++ b/debian/aptly-api.service @@ -0,0 +1,16 @@ +[Unit] +Description=Aptly API +After=network.target +Documentation=man:aptly(1) + +[Service] +User=aptly-api +Group=aptly-api +WorkingDirectory=/var/lib/aptly-api +EnvironmentFile=/etc/default/aptly-api +ExecStart=/usr/bin/aptly api serve \ + -config=/etc/aptly-api.conf \ + -listen=${LISTEN_ADDRESS} + +[Install] +WantedBy=multi-user.target diff --git a/debian/aptly.install b/debian/aptly.install new file mode 100644 index 00000000..f738a823 --- /dev/null +++ b/debian/aptly.install @@ -0,0 +1 @@ +usr/bin/aptly 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 828f51d3..a0b95a2c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +aptly (1.3.0-3) UNRELEASED; urgency=medium + + * Create aptly-api package. (Closes: #902032) + + -- Alexandre Viau Fri, 22 Jun 2018 13:51:50 -0400 + aptly (1.3.0-2) unstable; urgency=medium * Team upload, many thanks to Alexandre Viau for this work 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 84d772fd..1fff10b4 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,8 @@ Source: aptly Section: utils Priority: optional Maintainer: Sebastien Delafond -Build-Depends: debhelper (>= 9.0.0), +Uploaders: Alexandre Viau +Build-Depends: debhelper (>= 11), dh-golang, golang-any, golang-go.tools, @@ -19,7 +20,7 @@ Architecture: any Depends: bzip2, xz-utils, gnupg, gpgv, ${shlibs:Depends}, ${misc:Depends} Suggests: graphviz Built-Using: ${misc:Built-Using} -Description: Swiss army knife for Debian repository management +Description: Swiss army knife for Debian repository management - main package It offers several features making it easy to manage Debian package repositories: . @@ -31,3 +32,24 @@ Description: Swiss army knife for Debian repository management - controlled update of one or more packages in snapshot from upstream mirror, tracking dependencies - merge two or more snapshots into one + . + This is the main package, it contains the aptly command-line utility. + +Package: aptly-api +Architecture: any +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: + . + - make mirrors of remote Debian/Ubuntu repositories, limiting by + components/architectures + - take snapshots of mirrors at any point in time, fixing state of + repository at some moment of time + - publish snapshot as Debian repository, ready to be consumed by apt + - controlled update of one or more packages in snapshot from upstream + mirror, tracking dependencies + - merge two or more snapshots into one + . + This package contains the aptly-api service.