--- /dev/null
+Source: projects
+Section: main
+Priority: optional
+Maintainer: Michael Wagner <michael@wagnertech.de>
+Build-Depends: git, mbuild
+
+Package: verleihnix
+Architecture: all
+Description: Verleih Management
+ .
+ Verleih Management
+
--- /dev/null
+#!/bin/bash
+set -e
+
+mkdir -p $1/usr/share/php/verleihnix
+cp -a verleihnix/* $1/usr/share/php/verleihnix
+
+mkdir -p $1/etc/apache2/sites-available/
+cp verleihnix/etc/verleihnix.conf $1/etc/apache2/sites-available/
+
--- /dev/null
+#!/bin/bash
+set -e
+
+# check MariaDB or MySQL
+maria=$(mysql -V |grep MariaDB) || true
+
+# check, whether mkrimi user exists
+if ! mysql -umkrimi -pmkrimi mkrimi -e";"
+then
+ echo "Installation of mkrimi user ..."
+ # unix_socket authentification for MariaDB 10
+ if [ -n "$maria" ]
+ then
+ mysql <<END
+create user mkrimi@localhost identified by 'mkrimi';
+create database mkrimi;
+grant all on mkrimi.* to mkrimi@localhost;
+END
+ else
+ echo "Password of mysql root:"
+ read pw
+ mysql -uroot -p$pw <<END1
+create user mkrimi@localhost identified by 'mkrimi';
+create database mkrimi;
+grant all on mkrimi.* to mkrimi@localhost;
+END1
+ fi
+fi
+
+# check schema
+if ! mysql -umkrimi -pmkrimi mkrimi -e"select * from medium;" >/dev/null 2>&1
+then
+ echo "Installation of mkrimi schema ..."
+ mysql -umkrimi -pmkrimi mkrimi </usr/share/php/verleihnix/Verleihnix/impl/data/build/sql/schema.sql
+fi
+
+# Apache configuration
+sctl=$(which systemctl) || sctl=$(which sysd2sysv) || (echo "install sysd2sysv"; exit 1)
+
+a2ensite verleihnix
+$sctl reload apache2
+
if ($user == "") putenv("USER=gui");
// includes
-$path = preg_replace("/mKrimi.*/", "mKrimi", __FILE__);
+$path = preg_replace("/verleihnix.*/", "verleihnix", __FILE__);
set_include_path($path . PATH_SEPARATOR . get_include_path());
require_once 'util/Logger.php';
require_once 'util/Config.php';