posaune
authorMichael Wagner <michael@wagnertech.de>
Mon, 26 Jul 2021 19:33:26 +0000 (21:33 +0200)
committerMichael Wagner <michael@wagnertech.de>
Mon, 26 Jul 2021 19:33:26 +0000 (21:33 +0200)
debian/timetracker.conf [new file with mode: 0644]
debian/timetracker.control [new file with mode: 0644]
debian/timetracker.cp [new file with mode: 0755]
debian/timetracker.postinst [new file with mode: 0755]
debian/timetracker.prepare [new file with mode: 0755]
tools/make/mconfigure
tools/make/rules

diff --git a/debian/timetracker.conf b/debian/timetracker.conf
new file mode 100644 (file)
index 0000000..9e09c8e
--- /dev/null
@@ -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 (file)
index 0000000..0aa3977
--- /dev/null
@@ -0,0 +1,11 @@
+Source: timetracker
+Section: main
+Priority: optional
+Maintainer: Michael Wagner <michael@wagnertech.de>
+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 (executable)
index 0000000..760300c
--- /dev/null
@@ -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 (executable)
index 0000000..ab465e2
--- /dev/null
@@ -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 <<END
+create user ttuser@localhost identified by 'Ttuser09';
+create database timetracker CHARACTER SET = 'utf8mb4';
+grant all on timetracker.* to ttuser@localhost;
+END
+fi
+
+# Create Config File
+pushd /usr/share/php/timetracker/WEB-INF
+       if [ ! -f config.php ]
+       then
+               echo "copy standard config file"
+               cp config.php.dist config.php
+       fi
+popd
+
+echo "Check database with http://localhost/timetracker/dbinstall.php"
+echo "Login at http://localhost/timetracker/login.php"
+echo "Initial password: admin/secret"
+echo "Further information: https://www.anuko.com/time_tracker/index.htm"
+
diff --git a/debian/timetracker.prepare b/debian/timetracker.prepare
new file mode 100755 (executable)
index 0000000..7d9ccbc
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+
+mkdir -p Downloads
+cd Downloads
+
+if [ -d timetracker ]
+then
+       cd timetracker
+       git fetch -t
+else
+       git clone https://github.com/anuko/timetracker
+       cd timetracker
+fi
+
+# determine version
+version=$(grep "APP_VERSION" initialize.php |sed 's/define("APP_VERSION", "//' |sed 's/".*//')
+echo $version
+echo "version=$version" >> ../../debian/setenv.sh
+
index 08f9d44..a8c7f6e 100755 (executable)
@@ -8,6 +8,7 @@ function echo_usage {
        echo "  -C <cross environment>"
        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
index 30648d8..1b2e042 100755 (executable)
@@ -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 <michael@wagnertech.de>  Thu, 11 Feb 2021 10:00:00 +0100" >>debian/default.changelog
+
 # Load project specification
 -include rules.post