Permalink
Browse files

Packaging

Create a release tarball that includes a runnable version of TrialInfo.

The .gitattributes control which files "git archive" will export.

deb.sh creates a deb package from a trialinfo-0.0.tar.gz tarball.
  • Loading branch information...
andreas-gruenbacher committed Apr 15, 2017
1 parent f2455ce commit e0e10da9aac2d8fa6cd9ab949eb15f761d15172f
View
@@ -0,0 +1,8 @@
/* export-ignore
.gitignore export-ignore
.gitattributes export-ignore
backend !export-ignore
htdocs !export-ignore
pdf !export-ignore
create-db.sql !export-ignore
systemd !export-ignore
View
@@ -1,3 +1,5 @@
export PACKAGE = trialinfo
MAKEFLAGS = --no-print-directory
CURL = curl
@@ -17,6 +19,8 @@ MARKO_FILES = \
$(wildcard backend/views/*.marko) \
$(wildcard backend/emails/*.marko)
TAG = $(shell git describe --tags --candidates=0 ${1:-HEAD} 2>/dev/null)
all: $(MARKO_FILES:%=%.js)
download: $(DOWNLOAD_FILES)
@@ -42,6 +46,24 @@ serve: build
profile: build
cd backend && npm run profile
.PHONY: require-tag
require-tag:
@tag="$(TAG)"; \
if [ -z "$$tag" ]; then \
echo "Please create a vN.N tag" >&2; \
exit 2; \
fi; \
if ! echo "$$tag" | grep -q -e '^v[0-9]\+\.[0-9]\+$$'; then \
echo "Tag '$$tag' does not have the form vN.N" >&2; \
exit 2; \
fi
tarball: require-tag
@./tarball.sh $(TAG)
release: require-tag tarball
@./release.sh $(TAG)
# AngularJS
ANGULAR_BASE=https://ajax.googleapis.com/ajax/libs/angularjs
ANGULAR_VERSION=1.2.32
View
@@ -0,0 +1,19 @@
package = @PACKAGE@
version = @VERSION@
all:
clean:
distclean: clean
install:
find -depth \( -name debian -o -name Makefile -o -name create-db.sql \) -prune -o -print \
| cpio -pd $(DESTDIR)/var/lib/$(package)
install -D create-db.sql $(DESTDIR)/usr/share/doc/$(package)/create-db.sql
install -d $(DESTDIR)/etc/systemd/system
install systemd/trialinfo.{socket,service} $(DESTDIR)/etc/systemd/system
uninstall:
.PHONY: all install clean distclean uninstall
View
@@ -251,6 +251,18 @@ BEVOR DIE SCRIPTS VERWENDET WERDEN KÖNNEN. Eine Vorlage dafür befindet sich i
der Datei lib/Auswertung.pm.txt.
DEB-Paket bauen
===============
$ dnf install dpkg dpkg-dev debhelper devscripts
$ make release
$ ./deb.sh trialinfo-0.1.tar.gz
$ debsign ... ?
(When dpkg-buildpackage builds packages builds packages as non-root, it uses
fakeroot which makes the build takes extremely long.)
Veranstaltungsverwaltung
========================
View
@@ -0,0 +1 @@
backend/pdf-fill-form.README export-ignore
View
@@ -0,0 +1,5 @@
trialinfo (@VERSION@) unstable; urgency=medium
* Release @VERSION@
-- Andreas Gruenbacher <andreas.gruenbacher@gmail.com> @DATE@
View
@@ -0,0 +1 @@
9
View
@@ -0,0 +1,19 @@
Source: trialinfo
Section: unknown
Priority: optional
Maintainer: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.6
Homepage: https://www.trialinfo.at
#Vcs-Git: git://github.com/trialinfo/trialinfo.git
#Vcs-Browser: https://github.com/trialinfo/trialinfo
Package: trialinfo
Architecture: all
Depends: nodejs, mariadb-server, python-poppler-qt4, poppler-utils
#For proxying through Apache and for the old Perl cgi scripts:
#Depends: apache2, libjson-perl
Description: Web application for managing observed trials competitions
A web application for managing observed trials motorbike and bicycle
competitions. The documentation, and user interface are all in German;
the code is mainly in English.
View
@@ -0,0 +1,8 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: trialinfo
Source: <url://example.com>
Files: *
Copyright: 2012-2017 Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
License: AGPL-3+
GNU Affero General Public License version 3, or any later version
@@ -0,0 +1,2 @@
trialinfo
trialinfo
View
@@ -0,0 +1,41 @@
#!/bin/sh
# postinst script for trialinfo
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
useradd --system trialinfo || [ $? -eq 9 ]
systemctl stop trialinfo 2> /dev/null || :
;;
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
View
@@ -0,0 +1,39 @@
#!/bin/sh
# postinst script for trialinfo
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
;;
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
View
@@ -0,0 +1,37 @@
#!/bin/sh
# postrm script for trialinfo
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
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
View
@@ -0,0 +1,35 @@
#!/bin/sh
# preinst script for trialinfo
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst 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
View
@@ -0,0 +1,38 @@
#!/bin/sh
# prerm script for trialinfo
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm 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
View
@@ -0,0 +1,7 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
%:
dh $@
View
@@ -0,0 +1 @@
3.0 (native)
View
@@ -0,0 +1,2 @@
ergebnisse export-ignore
veranstalter export-ignore
View
@@ -0,0 +1 @@
Nennformular2017.odt export-ignore
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,26 @@
#! /bin/sh
set -e
version=${1:1}
tarball=$PACKAGE-$version.tar.gz
basename=$PACKAGE-$version
deb=${basename/-/_}_all.deb
curdir=$PWD
tmpdir=$(mktemp -d)
trap "rm -rf $tmpdir" EXIT
tar -xz -C "$tmpdir" < "$tarball"
cp -r debian "$tmpdir/$basename/"
cd "$tmpdir/$basename"
sed -i \
-e "s/@VERSION@/$version/g" \
-e "s/@DATE@/$(date -R)/g" \
"debian/changelog"
sudo dpkg-buildpackage -us -uc -d
cd ..
sudo chown -R $(whoami) .
cat "$deb" > "$curdir/$deb"
View
@@ -0,0 +1,12 @@
[Unit]
Description=TrialInfo
[Service]
ExecStart=/usr/bin/nodejs index.js
WorkingDirectory=/var/lib/trialinfo/backend
StandardOutput=journal
SyslogIdentifier=trialinfo
User=trialinfo
Group=trialinfo
Environment=NODE_ENV=production
Environment=TRIALINFO=systemd
View
@@ -0,0 +1,5 @@
[Socket]
ListenStream=80
[Install]
WantedBy=sockets.target
Oops, something went wrong.

0 comments on commit e0e10da

Please sign in to comment.