From 9ac133751c4453ed03bb0261770f034b522ca6bd Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Mon, 26 Jul 2021 21:33:26 +0200 Subject: [PATCH] posaune --- debian/timetracker.conf | 3 +++ debian/timetracker.control | 11 +++++++++++ debian/timetracker.cp | 12 ++++++++++++ debian/timetracker.postinst | 36 ++++++++++++++++++++++++++++++++++++ debian/timetracker.prepare | 20 ++++++++++++++++++++ tools/make/mconfigure | 22 +++++++++++++++++++--- tools/make/rules | 11 +++++++++-- 7 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 debian/timetracker.conf create mode 100644 debian/timetracker.control create mode 100755 debian/timetracker.cp create mode 100755 debian/timetracker.postinst create mode 100755 debian/timetracker.prepare diff --git a/debian/timetracker.conf b/debian/timetracker.conf new file mode 100644 index 0000000..9e09c8e --- /dev/null +++ b/debian/timetracker.conf @@ -0,0 +1,3 @@ +# Configuration for timetracker +Alias /timetracker/ /usr/share/php/timetracker/ + diff --git a/debian/timetracker.control b/debian/timetracker.control new file mode 100644 index 0000000..0aa3977 --- /dev/null +++ b/debian/timetracker.control @@ -0,0 +1,11 @@ +Source: timetracker +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git + +Package: timetracker +Architecture: all +Depends: php5-mysql|php-mysql, php5|php-mbstring +Description: Anuko Time Tracker + diff --git a/debian/timetracker.cp b/debian/timetracker.cp new file mode 100755 index 0000000..760300c --- /dev/null +++ b/debian/timetracker.cp @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +mkdir -p $1/usr/share/php/timetracker +rsync -a --delete --exclude='.git' Downloads/timetracker/ $1/usr/share/php/timetracker/ + +mkdir -p $1/etc/apache2/sites-available +cp debian/timetracker.conf $1/etc/apache2/sites-available/ + +mkdir -p $1/usr/share/doc/timetracker +cp Downloads/timetracker/license.txt $1/usr/share/doc/timetracker/copyright + diff --git a/debian/timetracker.postinst b/debian/timetracker.postinst new file mode 100755 index 0000000..ab465e2 --- /dev/null +++ b/debian/timetracker.postinst @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +a2ensite timetracker.conf +#systemd restart apache2 +/etc/init.d/apache2 restart + +chmod 777 /usr/share/php/timetracker/WEB-INF/templates_c + +# check, whether sysal user exists +if ! mysql -uttuser -pTtuser09 timetracker -e";" +then + echo "Installation of ttuser user ..." + echo "Password of mysql root:" + read pw + mysql -uroot -p$pw <> ../../debian/setenv.sh + diff --git a/tools/make/mconfigure b/tools/make/mconfigure index 08f9d44..a8c7f6e 100755 --- a/tools/make/mconfigure +++ b/tools/make/mconfigure @@ -8,6 +8,7 @@ function echo_usage { echo " -C " echo " -d : compile" echo " -p : pack default: do all" + echo " -v : set version" echo " -o : support old Debian 7 format" } @@ -127,7 +128,7 @@ fi configure=0 compile=0 pack=0 -while getopts "a:cC:dpo" opt; do +while getopts "a:cC:dpov:" opt; do case $opt in a) ARCH=$OPTARG ;; @@ -141,6 +142,8 @@ while getopts "a:cC:dpo" opt; do ;; o) oldpack="-Zgzip" ;; + v) optversion=$OPTARG + ;; \?) echo "Invalid option: -$OPTARG" echo_usage exit 1 @@ -215,7 +218,12 @@ then echo "oldpack=\"$oldpack\"" >> debian/setenv.sh set_build - check_version + if [ -z "$optversion" ] + then + check_version + else + version=$optversion + fi echo "version=$version" >> debian/setenv.sh echo "build=$build" >> debian/setenv.sh @@ -327,11 +335,19 @@ then if grep "^Architecture: *all" debian/$paket.control >/dev/null then echo "arch = all" >> debian/rules.pre - echo "BINARY_INDEP = copy ../${paket}_$version-${build}_all.deb" >> debian/rules.pre + echo 'BINARY_INDEP = copy ../$(paket)_$(version)-$(build)_all.deb' >> debian/rules.pre else echo 'arch = ${DEB_HOST_ARCH}' >> debian/rules.pre echo "BINARY_ARCH = copy ../${paket}_$version-${build}_"'$(arch).deb' >> debian/rules.pre fi + if ! [ -f $paket.changelog ] + then + echo "changelog_source = debian/default.changelog" >> debian/rules.pre + if [ -f debian/default.changelog ] + then + rm debian/default.changelog + fi + fi elif [ -f debian/$paket.cp ] then echo "PACK=zip" >> debian/rules.pre diff --git a/tools/make/rules b/tools/make/rules index 30648d8..1b2e042 100755 --- a/tools/make/rules +++ b/tools/make/rules @@ -7,7 +7,9 @@ NOP = @echo "No operation for target $@" DEB = fakeroot dpkg-deb --build $(oldpack) debian/tmp INSERT_BUILD = /usr/share/mbuild/insert_build.sh RSYNC_OPT = -av --exclude="build" --exclude="debian/tmp" --exclude="Packages" --exclude="*Aktuell" --exclude=".*" + std_inst_tgt = debian/tmp/usr/share/doc/$(paket)/copyright debian/tmp/usr/share/doc/$(paket)/README.debian +changelog_source = $(paket).changelog include debian/rules.pre @@ -70,8 +72,8 @@ debian/tmp/DEBIAN/control: debian/control debian/changelog debian/control: debian/$(paket).control sed "s/_DEB_HOST_ARCH/${DEB_HOST_ARCH}/" debian/$(paket).control > debian/control -debian/changelog: debian/$(paket).changelog debian/rules.pre - sed "s/%BUILD%/$(build)/" debian/$(paket).changelog > debian/changelog +debian/changelog: $(changelog_source) debian/rules.pre + sed "s/%BUILD%/$(build)/" $(changelog_source) > debian/changelog debian/tmp/usr/share/doc/$(paket)/changelog: debian/changelog mkdir -p debian/tmp/usr/share/doc/$(paket) @@ -105,6 +107,11 @@ debian/README.debian: debian/copyright: cp /usr/share/mbuild/copyright debian/copyright +debian/default.changelog: + @echo "$(paket) ($(version)-$(build)) unstable; urgency=medium" >debian/default.changelog + @echo " * generated" >>debian/default.changelog + @echo " -- Michael Wagner Thu, 11 Feb 2021 10:00:00 +0100" >>debian/default.changelog + # Load project specification -include rules.post -- 2.20.1