From 6ee370ee359940f86e17a91934dbe0280114eca7 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 13 Aug 2017 16:15:18 +0200 Subject: new v0.1 based package --- debian/changelog | 7 +++++++ debian/control | 2 +- debian/copyright | 2 +- debian/example.conf | 3 +++ .../patches/allow-dashes-in-repository-names.patch | 13 ------------- debian/patches/series | 1 - debian/rules | 21 ++++++--------------- debian/vanity.conf | 3 --- debian/vanity.dirs | 1 + debian/vanity.examples | 1 + debian/vanity.install | 2 -- debian/vanity.service | 16 ---------------- debian/vanity@.service | 17 +++++++++++++++++ 13 files changed, 37 insertions(+), 52 deletions(-) create mode 100644 debian/example.conf delete mode 100644 debian/patches/allow-dashes-in-repository-names.patch delete mode 100644 debian/patches/series delete mode 100644 debian/vanity.conf create mode 100644 debian/vanity.dirs create mode 100644 debian/vanity.examples delete mode 100644 debian/vanity.install delete mode 100644 debian/vanity.service create mode 100644 debian/vanity@.service diff --git a/debian/changelog b/debian/changelog index bd91542..526a0b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +vanity (0.1.3-1) unstable; urgency=medium + + * new upstream release + * systemd unit is now a template + + -- Christian Pointner Sun, 13 Aug 2017 16:11:11 +0200 + vanity (0.1.1-5) unstable; urgency=medium * fixed default config diff --git a/debian/control b/debian/control index a7a9ddf..3bf0d2c 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Maintainer: Christian Pointner Section: utils Priority: optional Standards-Version: 3.9.2 -Build-Depends: debhelper (>= 9), dh-systemd, golang-go (>=2:1.5) +Build-Depends: debhelper (>= 9), golang-go (>=2:1.5), dh-golang Package: vanity Architecture: any diff --git a/debian/copyright b/debian/copyright index c9aca29..4d3bef3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -35,7 +35,7 @@ License: BSD-2-clause SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: debian/* -Copyright: 2016, Christian Pointner +Copyright: 2016-2017, Christian Pointner License: GPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/debian/example.conf b/debian/example.conf new file mode 100644 index 0000000..bf9ab8e --- /dev/null +++ b/debian/example.conf @@ -0,0 +1,3 @@ +VANITY_ADDR=127.0.0.1:9192 +VANITY_ROOT=https://example.com +VANITY_REPO_ROOT=https://git.example.com diff --git a/debian/patches/allow-dashes-in-repository-names.patch b/debian/patches/allow-dashes-in-repository-names.patch deleted file mode 100644 index 9fe5994..0000000 --- a/debian/patches/allow-dashes-in-repository-names.patch +++ /dev/null @@ -1,13 +0,0 @@ -This allows '-' for package names -see: https://github.com/xiam/vanity/pull/6 ---- a/main.go -+++ b/main.go -@@ -24,7 +24,7 @@ - repoRootFlag = flag.String("repo-root", "", "Git repository root URL (e.g.: https://github.com/upper).") - ) - --var packagePattern = regexp.MustCompile(`^/([a-zA-Z0-9]+)\.?(v[1-9][0-9]*)?(.*)$`) -+var packagePattern = regexp.MustCompile(`^/([-a-zA-Z0-9]+)\.?(v[1-9][0-9]*)?(.*)$`) - - var httpClient = &http.Client{Timeout: 10 * time.Second} - diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index f599fcd..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -allow-dashes-in-repository-names.patch diff --git a/debian/rules b/debian/rules index 9ab11b4..939a182 100755 --- a/debian/rules +++ b/debian/rules @@ -1,20 +1,11 @@ #!/usr/bin/make -f -%: - dh $@ --with=systemd - -override_dh_clean: - dh_clean - rm -f vanity -override_dh_auto_configure: +export DH_OPTIONS +export DH_GOPKG := github.com/xiam/vanity -override_dh_auto_build: - go build -o vanity - -override_dh_auto_install: - install -d $$(pwd)/debian/tmp/usr/bin/ - install -m 755 $$(pwd)/vanity $$(pwd)/debian/tmp/usr/bin/vanity - install -d $$(pwd)/debian/tmp/etc/ - install -m 644 $$(pwd)/debian/vanity.conf $$(pwd)/debian/tmp/etc/ +%: + dh $@ --buildsystem=golang --with=golang override_dh_installinit: + install -d $$(pwd)/debian/vanity/lib/systemd/system/ + install -m 644 $$(pwd)/debian/vanity@.service $$(pwd)/debian/vanity/lib/systemd/system/ diff --git a/debian/vanity.conf b/debian/vanity.conf deleted file mode 100644 index ae10701..0000000 --- a/debian/vanity.conf +++ /dev/null @@ -1,3 +0,0 @@ -VANITY_ADDR=127.0.0.1:9192 -VANITY_ROOT=https://spreadspace.org -VANITY_REPO_ROOT=https://git.spreadspace.org diff --git a/debian/vanity.dirs b/debian/vanity.dirs new file mode 100644 index 0000000..e0be8a2 --- /dev/null +++ b/debian/vanity.dirs @@ -0,0 +1 @@ +/etc/vanity/ diff --git a/debian/vanity.examples b/debian/vanity.examples new file mode 100644 index 0000000..66299e9 --- /dev/null +++ b/debian/vanity.examples @@ -0,0 +1 @@ +debian/example.conf diff --git a/debian/vanity.install b/debian/vanity.install deleted file mode 100644 index b90e2b1..0000000 --- a/debian/vanity.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/bin/vanity -etc/vanity.conf diff --git a/debian/vanity.service b/debian/vanity.service deleted file mode 100644 index 39eb0c9..0000000 --- a/debian/vanity.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=make go packages gettable - -[Service] -EnvironmentFile=/etc/vanity.conf -ExecStart=/usr/bin/vanity -addr=${VANITY_ADDR} -vanity-root=${VANITY_ROOT} -repo-root=${VANITY_REPO_ROOT} -User=vanity -Group=vanity -Restart=on-failure -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -ProtectHome=yes - -[Install] -WantedBy=multi-user.target diff --git a/debian/vanity@.service b/debian/vanity@.service new file mode 100644 index 0000000..cb6e2a2 --- /dev/null +++ b/debian/vanity@.service @@ -0,0 +1,17 @@ +[Unit] +Description=make go packages gettable (%I) +After=network.target + +[Service] +EnvironmentFile=/etc/vanity/%i.conf +ExecStart=/usr/bin/vanity -addr=${VANITY_ADDR} -vanity-root=${VANITY_ROOT} -repo-root=${VANITY_REPO_ROOT} +User=vanity +Group=vanity +Restart=on-failure +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +ProtectHome=yes + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3