From 9f9854c729961d52fe2286e4eeaa31afe44a707e Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 1 Aug 2019 14:21:29 +0200 Subject: [PATCH] Initial debian packaging --- debian/cacert-boardvoting.dirs | 1 + debian/cacert-boardvoting.docs | 1 + debian/cacert-boardvoting.examples | 1 + debian/cacert-boardvoting.install | 1 + debian/cacert-boardvoting.postinst | 31 ++++++++++++++++++++++++++++++ debian/cacert-boardvoting.service | 12 ++++++++++++ debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 21 ++++++++++++++++++++ debian/copyright | 8 ++++++++ debian/gbp.conf | 5 +++++ debian/rules | 16 +++++++++++++++ debian/source/format | 1 + 13 files changed, 104 insertions(+) create mode 100644 debian/cacert-boardvoting.dirs create mode 100644 debian/cacert-boardvoting.docs create mode 100644 debian/cacert-boardvoting.examples create mode 100644 debian/cacert-boardvoting.install create mode 100644 debian/cacert-boardvoting.postinst create mode 100644 debian/cacert-boardvoting.service create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/gbp.conf create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/debian/cacert-boardvoting.dirs b/debian/cacert-boardvoting.dirs new file mode 100644 index 0000000..c8a4f7e --- /dev/null +++ b/debian/cacert-boardvoting.dirs @@ -0,0 +1 @@ +/srv/cacert-boardvoting diff --git a/debian/cacert-boardvoting.docs b/debian/cacert-boardvoting.docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/cacert-boardvoting.docs @@ -0,0 +1 @@ +README.md diff --git a/debian/cacert-boardvoting.examples b/debian/cacert-boardvoting.examples new file mode 100644 index 0000000..3cd870e --- /dev/null +++ b/debian/cacert-boardvoting.examples @@ -0,0 +1 @@ +config.yaml.example diff --git a/debian/cacert-boardvoting.install b/debian/cacert-boardvoting.install new file mode 100644 index 0000000..ce81627 --- /dev/null +++ b/debian/cacert-boardvoting.install @@ -0,0 +1 @@ +cacert-boardvoting /srv/cacert-boardvoting diff --git a/debian/cacert-boardvoting.postinst b/debian/cacert-boardvoting.postinst new file mode 100644 index 0000000..8d9c5fb --- /dev/null +++ b/debian/cacert-boardvoting.postinst @@ -0,0 +1,31 @@ +#!/bin/sh +# +# postinst script for cacert-boardvoting +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + configure) + adduser --system --quiet --home /srv/cacert-boardvoting cacert-boardvoting + DATADIR=/srv/cacert-boardvoting/data + if [ -d "${DATADIR}" ]; then + chown -R cacert-boardvoting "${DATADIR}" + else + install -d --owner cacert-boardvoting --mode 0700 "${DATADIR}" + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/cacert-boardvoting.service b/debian/cacert-boardvoting.service new file mode 100644 index 0000000..ad92db0 --- /dev/null +++ b/debian/cacert-boardvoting.service @@ -0,0 +1,12 @@ +[Unit] +Description=CAcert board voting software +Documentation=file:/usr/share/doc/cacert-boardvoting/README.md.gz +After=network.target +ConditionPathExists=/srv/cacert-boardvoting/config.yaml + +[Service] +ExecStart=/srv/cacert-boardvoting/cacert-boardvoting -config /srv/cacert-boardvoting/config.yaml +User=cacert-boardvoting + +[Install] +WantedBy=multi-user.target diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..63786d1 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +cacert-boardvoting (0.5.0-1) UNRELEASED; urgency=medium + + * Initial debian package + + -- Jan Dittberner Wed, 31 Jul 2019 17:54:34 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..458c034 --- /dev/null +++ b/debian/control @@ -0,0 +1,21 @@ +Source: cacert-boardvoting +Section: misc +Priority: optional +Maintainer: Jan Dittberner +Build-Depends: ca-certificates, + debhelper (>= 10), + git, + golang-go (>= 2:1.11~1~), + libsqlite3-0 +Standards-Version: 4.3.0 +Homepage: https://git.cacert.org/gitweb/?p=cacert-boardvoting.git +Vcs-Browser: https://git.cacert.org/gitweb/?p=cacert-boardvoting.git +Vcs-Git: git://git.cacert.org/cacert-boardvoting.git -b debian + +Package: cacert-boardvoting +Architecture: amd64 +Depends: adduser, libsqlite3-0, ${misc:Depends}, ${shlibs:Depends} +Recommends: sqlite3 +Description: CAcert board voting software + software that provides a web based tool for voting on motions to CAcert + commitee members and allows viewing of votes to other CAcert members. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..beeb507 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,8 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: CAcert board voting software +Upstream-Contact: Jan Dittberner +Source: https://git.cacert.org/gitweb/?p=cacert-boardvoting.git + +Files: * +Copyright: 2017-2019 Jan Dittberner +License: Apache-2.0 diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..9d89d92 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,5 @@ +[DEFAULT] +upstream-branch = master +debian-branch = debian +upstream-tag = %(version)s +pristine-tar = False diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..4351fc6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +%: + dh $@ + +DEB_BUILD_MAINT_OPTIONS = hardening=+all +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + +DEB_VERSION=$(shell dpkg-parsechangelog -S Version) + +override_dh_auto_build: + GOCACHE=$(CURDIR)/tmp/.cache \ + GOPATH=$(CURDIR)/tmp/gocode \ + go get -u -v github.com/shulhan/go-bindata/cmd/go-bindata ; \ + PATH=$(CURDIR)/tmp/gocode/bin:$(PATH) make GOCACHE=$(CURDIR)/tmp/.cache GOPATH=$(CURDIR)/tmp/gocode VERSION=$(DEB_VERSION) diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)