summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Fulz2021-07-06 18:39:39 +0200
committerMatthias Fulz2021-07-06 18:39:39 +0200
commitc9aa77be5f892a9a4ea480292a5095072b674268 (patch)
tree17f82c4efe360052dfb1dafe3565f46a87bf2e51
downloadaur-c9aa77be5f892a9a4ea480292a5095072b674268.tar.gz
kimai2 stable version
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD96
-rw-r--r--kimai2-nginx.conf50
-rw-r--r--kimai2.ini7
-rw-r--r--kimai2.install18
5 files changed, 203 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..a0c13b2c315b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = kimai2
+ pkgdesc = Kimai the free open source timetracker
+ pkgver = 1.14.3
+ pkgrel = 1
+ url = http://www.kimai.org/
+ arch = any
+ license = GPL
+ makedepends = git
+ makedepends = composer
+ makedepends = php
+ depends = php
+ depends = mariadb
+ depends = php-gd
+ depends = php-intl
+ depends = php-xsl
+ depends = php-imap
+ depends = sudo
+ depends = unzip
+ backup = etc/webapps/kimai2/.env
+ backup = etc/webapps/kimai2/config/packages/local.yaml
+ backup = etc/nginx/sites-available/kimai2-nginx.conf
+ source = https://github.com/kevinpapst/kimai2/archive/refs/tags/1.14.3.tar.gz
+ source = kimai2.install
+ source = kimai2.ini
+ source = kimai2-nginx.conf
+ sha512sums = 9673423c70b5b768092c4958dc17b44a8917f3bca64c2256d6755bd8e575f7d362d3e14738a69166718aa830c1c5389c72510b937f4fa4bb112989db866168ca
+ sha512sums = a920190216528a84511c20bff125620910c1e7294445ed6f1a57a94869860ad0400651ea0fac4dc4cfc83b59e35170c9962fa03fb65f863cd9752957b7c6d5a7
+ sha512sums = d263b4e310ce7e18a3f53b0b976dff190d70da020506c766df11f210f327dc052db59abc36f44dfada6c963653e7aafd643f33a4eab2ca33f3a032c75137a03a
+ sha512sums = 98bed9e055c9d7265c6fd59514bc33edefe3a6fbe0298f9ed0f00c514f66d5eea19058850d827656d722edf5eccb07f18451791ef7bd017e13efcd102d72fb9a
+
+pkgname = kimai2
+ install = kimai2.install
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..5a88cb0fd617
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,96 @@
+
+# Maintainer: Matthias Fulz <mfulz at olznet dot de>
+
+pkgname=kimai2
+pkgver=1.14.3
+pkgrel=1
+pkgdesc="Kimai the free open source timetracker"
+url="http://www.kimai.org/"
+_phpIni="${pkgname}.ini"
+arch=('any')
+license=('GPL')
+depends=('php' 'mariadb' 'php-gd' 'php-intl' 'php-xsl' 'php-imap' 'sudo' 'unzip')
+makedepends=('git' 'composer' 'php')
+source=(
+ "https://github.com/kevinpapst/$pkgname/archive/refs/tags/$pkgver.tar.gz"
+ "kimai2.install"
+ "${_phpIni}"
+ "kimai2-nginx.conf"
+ )
+sha512sums=('9673423c70b5b768092c4958dc17b44a8917f3bca64c2256d6755bd8e575f7d362d3e14738a69166718aa830c1c5389c72510b937f4fa4bb112989db866168ca'
+ 'a920190216528a84511c20bff125620910c1e7294445ed6f1a57a94869860ad0400651ea0fac4dc4cfc83b59e35170c9962fa03fb65f863cd9752957b7c6d5a7'
+ 'd263b4e310ce7e18a3f53b0b976dff190d70da020506c766df11f210f327dc052db59abc36f44dfada6c963653e7aafd643f33a4eab2ca33f3a032c75137a03a'
+ '98bed9e055c9d7265c6fd59514bc33edefe3a6fbe0298f9ed0f00c514f66d5eea19058850d827656d722edf5eccb07f18451791ef7bd017e13efcd102d72fb9a')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # php for composer and deps
+ mkdir -p "${HOME}/.composer/cache"
+ (cat /etc/php/php.ini ; echo ; cat ${srcdir}/${_phpIni} ; echo ; echo "open_basedir=\${open_basedir}:$(pwd):/usr/share/webapps/kimai2:/etc/webapps/kimai2:/tmp:/var/lib/kimai2:/usr/bin/composer:${HOME}/.composer:/proc/version") > make-php.ini
+
+ export PHP_INI_SCAN_DIR="$(pwd)"
+ composer install --no-dev --optimize-autoloader
+}
+
+_binDir=usr/share/webapps/${pkgname}
+_confDir=etc/webapps/${pkgname}
+_libDir=var/lib/${pkgname}
+_nginxDir=etc/nginx/sites-available
+
+backup=(
+ "${_confDir}/.env"
+ "${_confDir}/config/packages/local.yaml"
+ "${_nginxDir}/${pkgname}-nginx.conf"
+ )
+
+package() {
+ install=${pkgname}.install
+
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ (cat /etc/php/php.ini ; echo ; cat ${srcdir}/${_phpIni} ; echo ; echo "open_basedir=\${open_basedir}:$(pwd):/usr/share/webapps/kimai2:/etc/webapps/kimai2:/tmp:/var/lib/kimai2:/usr/bin/composer:/srv/http/.composer:/proc/version") > make-php.ini
+
+ install -d -o root -g root -m 755 ${pkgdir}/${_binDir}
+ install -d -o root -g root -m 755 ${pkgdir}/etc/php/conf.d
+ install -d -o http -g http -m 750 ${pkgdir}/${_confDir}
+ install -d -o http -g http -m 750 ${pkgdir}/${_libDir}
+
+ # BIN
+ cp -r ${srcdir}/${pkgname}-${pkgver}/. ${pkgdir}/${_binDir}/
+
+ # CONF
+ mv ${pkgdir}/${_binDir}/config ${pkgdir}/${_confDir}/config
+ touch ${pkgdir}/${_confDir}/config/packages/local.yaml
+ chown -R http:http ${pkgdir}/${_confDir}/config
+ chmod 640 ${pkgdir}/${_confDir}/config/packages/local.yaml
+
+ # NGINX
+ install -d -o root -g root -m 755 ${pkgdir}/${_nginxDir}
+ cp ${srcdir}/${pkgname}-nginx.conf ${pkgdir}/${_nginxDir}/
+
+ mv ${pkgdir}/${_binDir}/.env ${pkgdir}/${_confDir}/.env
+ chown http:http ${pkgdir}/${_confDir}/.env
+ chmod 640 ${pkgdir}/${_confDir}/.env
+
+ ln -sf /${_confDir}/config ${pkgdir}/${_binDir}/config
+ ln -sf /${_confDir}/.env ${pkgdir}/${_binDir}/.env
+ ln -sf /usr/share/webapps/kimai2/src ${pkgdir}/${_confDir}/src
+
+ # LIB
+ mv ${pkgdir}/${_binDir}/var/* ${pkgdir}/${_libDir}/
+ rm -r ${pkgdir}/${_binDir}/var
+ ln -sf /${_libDir} ${pkgdir}/${_binDir}/var
+
+ # PERMISSIONS
+ chown -R http: ${pkgdir}/${_libDir}/*
+ chown -h http: ${pkgdir}/${_binDir}/var
+ chown -h http: ${pkgdir}/${_binDir}/.env
+ chown -h http: ${pkgdir}/${_binDir}/config
+ chown -R http: ${pkgdir}/${_binDir}/public
+ chown -R http: ${pkgdir}/${_binDir}/vendor
+ chown -R http: ${pkgdir}/${_binDir}/composer.lock
+ chown -R http: ${pkgdir}/${_binDir}/symfony.lock
+
+ # PHP
+ cp ${srcdir}/${_phpIni} ${pkgdir}/etc/php/conf.d/
+}
diff --git a/kimai2-nginx.conf b/kimai2-nginx.conf
new file mode 100644
index 000000000000..06656def82cf
--- /dev/null
+++ b/kimai2-nginx.conf
@@ -0,0 +1,50 @@
+server {
+ listen 88.198.5.112:443 ssl;
+ server_name kimai2.dom;
+ ssl_certificate /etc/letsencrypt/live/dom/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/dom/privkey.pem;
+ ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+ ssl_session_cache shared:SSL:10m;
+ ssl_prefer_server_ciphers on;
+ server_tokens off;
+ client_max_body_size 0;
+ root /usr/share/webapps/kimai2/public;
+ index index.php;
+
+ access_log /var/log/nginx/kimai2.access.log;
+ error_log /var/log/nginx/kimai2.error.log;
+
+ location ~ /\.ht {
+ deny all;
+ }
+
+ location / {
+ try_files $uri /index.php$is_args$args;
+ }
+
+ location ~ ^/index\.php(/|$) {
+ fastcgi_pass unix:/run/php-fpm/php-fpm-kimai2.sock;
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ include fastcgi_params;
+ # You can use the document root directly:
+ # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+
+ # But this is not working in every situation. When you are using symlinks to link the document
+ # root to the current version of your application, you should pass the real
+ # application path instead of the path to the symlink to PHP FPM.
+ # Otherwise, PHP's OPcache may not properly detect changes to your PHP files
+ # (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 for more information).
+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
+ fastcgi_param DOCUMENT_ROOT $realpath_root;
+
+ fastcgi_param PHP_VALUE memory_limit=512M;
+ fastcgi_param PHP_VALUE open_basedir="/usr/share/webapps/kimai2:/etc/webapps/kimai2:/tmp:/var/lib/kimai2";
+
+ internal;
+ }
+
+ location ~ \.php$ {
+ return 404;
+ }
+}
diff --git a/kimai2.ini b/kimai2.ini
new file mode 100644
index 000000000000..f13a25d84a13
--- /dev/null
+++ b/kimai2.ini
@@ -0,0 +1,7 @@
+extension=gd
+extension=intl
+extension=imap
+extension=iconv
+extension=pdo_mysql
+extension=xsl
+extension=zip
diff --git a/kimai2.install b/kimai2.install
new file mode 100644
index 000000000000..2de64e9d8394
--- /dev/null
+++ b/kimai2.install
@@ -0,0 +1,18 @@
+function _kimai2_install() {
+ echo -e "##### run the following commands to finalize the update ####"
+ echo -e 'cd /usr/share/webapps/kimai2'
+ echo -e 'sudo -u http bash'
+ echo -e 'export PHP_INI_SCAN_DIR=$(pwd)'
+ echo -e 'composer update'
+ echo -e 'bin/console cache:clear'
+ echo -e 'exit'
+ echo -e "############################################################"
+}
+
+post_install() {
+ _kimai2_install
+}
+
+post_upgrade() {
+ _kimai2_install
+}