[arch-commits] Commit in flyspray/trunk (5 files)

David Runge dvzrv at archlinux.org
Sat Sep 7 10:41:31 UTC 2019


    Date: Saturday, September 7, 2019 @ 10:41:30
  Author: dvzrv
Revision: 508373

upgpkg: flyspray 1.0rc9-1

Upgrading to 1.0rc9. Updating maintainer. Adding php-gd to depends. Adding graphviz, mariadb, php-fpm, php-pgsql, postgresql and uwsgi to optdepends. Adding dummy configuration (also to backup array). Removing forced redirect, if setup/ directory is present (this should be made unavailable by the webserver, not moved to some bizarre location).
Using composer to install vendored dependencies. Using upstream .htaccess, instead of DIY dummy. Adding sysusers.d and tmpfiles.d integration, so flyspray needs to be run as its own user.
Adding uwsgi snippet, so flyspray can directly be used from uwsgi. Adding .install file to describe changes and how to handle the setup/ directory.

Added:
  flyspray/trunk/flyspray.install
  flyspray/trunk/flyspray.sysusers
  flyspray/trunk/flyspray.tmpfiles
  flyspray/trunk/flyspray.uwsgi
Modified:
  flyspray/trunk/PKGBUILD

-------------------+
 PKGBUILD          |  226 ++++++++++++++++++++++++++++++++++++++++++++++++----
 flyspray.install  |   14 +++
 flyspray.sysusers |    1 
 flyspray.tmpfiles |    5 +
 flyspray.uwsgi    |   33 +++++++
 5 files changed, 264 insertions(+), 15 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-09-07 10:30:02 UTC (rev 508372)
+++ PKGBUILD	2019-09-07 10:41:30 UTC (rev 508373)
@@ -1,26 +1,222 @@
-# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+# Maintainer: David Runge <dave at sleepmap.de>
+# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
 # Contributor: Sergej Pupykin <pupykin.s+arch at gmail.com>
 
 pkgname=flyspray
-pkgver=1.0rc7
+pkgver=1.0rc9
 pkgrel=1
 pkgdesc='Lightweight, web-based bug tracking system written in PHP'
-url='https://www.flyspray.org/'
+url="https://www.flyspray.org/"
 arch=('any')
 license=('LGPL2.1')
-depends=('php')
-backup=('etc/webapps/flyspray/.htaccess')
-options=('!strip')
-source=(${pkgname}-${pkgver}.tar.gz::https://github.com/Flyspray/flyspray/archive/v${pkgver/rc/-rc}.tar.gz)
-sha256sums=('b04c4ff059f9a0449279758d196d7843bc99fad2365c930ed9d06e6b55eee9e2')
+depends=('php' 'php-gd')
+makedepends=('composer' 'unzip')
+optdepends=('graphviz: plot task dependency graphs'
+            'mariadb: use local MariaDB database'
+            'php-fpm: run with FastCGI process manager'
+            'php-pgsql: use PostgreSQL database'
+            'postgresql: use local PostgreSQL database'
+            'uwsgi: run in application container')
+backup=("etc/webapps/${pkgname}/.htaccess"
+        "etc/webapps/${pkgname}/${pkgname}.conf.php")
+install="${pkgname}.install"
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/v${pkgver/rc/-rc}.tar.gz"
+        "${pkgname}.sysusers"
+        "${pkgname}.tmpfiles"
+        "${pkgname}.uwsgi")
+sha512sums=('30b297c6c993936db2e10eeea75a049b8bf42a9bd4090bbba2465de946eb04a5cde9d4b8ec88065c12f2f2dce99b9bf3d0fcdf30334fd1b77030813b8393c070'
+            'ee23df991c6a42bfb139caabad861a3f945ea18d81061fdb90ace8430d4225e7db322802de4fdf36aa8191cbedab3cafd025c76f08806b7fcdb88f6eb185519e'
+            '65d333b98a93cc320300bacc8d142f7150e31f4a65da96f09ab0c88e6556a120a5cab8d2c871840753eb4eec6a281d0731b1ab5524834f1281f2d073ba4983f0'
+            '1f2817cd0cf3ef1a642fed7b1814e2e773b2ad3b2fd9e5df305ab5d6f6dbc8bfa38e6220380c288f252d015c810dc8c83046555e9e1a54a9b7cb805a75dbe4f2')
 
+prepare() {
+  mv -v "${pkgname}-${pkgver/rc/-rc}" "${pkgname}-${pkgver}"
+  touch "${pkgname}.conf.php"
+  cd "${pkgname}-${pkgver}"
+  # removing forced redirect, if setup/index.php is accessible.
+  # access to it should be denied via the webserver settings
+  sed -e '45,82d' -i header.php
+}
+
+build() {
+  cd "${pkgname}-${pkgver}"
+  php -d 'extension=gd' /usr/bin/composer install --no-dev
+}
+
 package() {
-  _instdir="${pkgdir}"/usr/share/webapps/flyspray
-  mkdir -p "${_instdir}" "${pkgdir}"/etc/webapps/flyspray
-  cd "${_instdir}"
-  cp -ra "${srcdir}"/flyspray-${pkgver/rc/-rc}/* .
-  echo "deny from all" > "${pkgdir}"/etc/webapps/flyspray/.htaccess
-  ln -s /etc/webapps/flyspray/.htaccess .htaccess
+  cd "${pkgname}-${pkgver}"
+  # sysusers.d integration
+  install -vDm 644 ../${pkgname}.sysusers \
+    "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+  # tmpfiles.d integration
+  install -vDm 644 ../${pkgname}.tmpfiles \
+    "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
+  # uwsgi integration
+  install -vDm 644 ../${pkgname}.uwsgi \
+    "${pkgdir}/etc/uwsgi/${pkgname}.ini"
+  # docs
+  install -vDm 644 {docs/*.txt,README.md} \
+    -t "${pkgdir}/usr/share/doc/${pkgname}"
+  # webapp
+  install -vDm 644 *.{ico,php,png,txt,xml} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}"
+  install -vDm 644 fonts/index.html \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/fonts/"
+  install -vDm 644 includes/{.htaccess,*.php} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/includes/"
+  install -vDm 644 js/*.js\
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/"
+  install -vDm 644 js/callbacks/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/callbacks/"
+  install -vDm 644 js/ckeditor/*.{css,js,md} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/"
+  install -vDm 644 js/ckeditor/adapters/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/adapters/"
+  install -vDm 644 js/ckeditor/lang/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/lang/"
+  cp -ar js/ckeditor/plugins "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/"
+  install -vDm 644 js/ckeditor/samples/*.{css,html,js,php} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/samples/"
+  install -vDm 644 js/ckeditor/samples/assets/*.{css,jpg,php} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/samples/assets"
+  install -vDm 644 js/ckeditor/samples/assets/inlineall/*.png \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/samples/assets/inlineall"
+  install -vDm 644 js/ckeditor/samples/assets/outputxhtml/*.css \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/samples/assets/outputxhtml"
+  install -vDm 644 js/ckeditor/samples/assets/uilanguages/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/samples/assets/uilanguages"
+  cp -ar js/ckeditor/samples/plugins \
+    "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/samples/"
+  install -vDm 644 js/ckeditor/skins/moono/images/hidpi/*.png \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/skins/moono/images/hidpi"
+  install -vDm 644 js/ckeditor/skins/moono/images/*.png \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/skins/moono/images/"
+  install -vDm 644 js/ckeditor/skins/moono/*.{css,md,png} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/ckeditor/skins/moono/"
+  install -vDm 644 js/jit/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/jit"
+  install -vDm 644 js/jscalendar/*.{css,gif,js,php} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/jscalendar"
+  install -vDm 644 js/jscalendar/lang/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/jscalendar/lang"
+  install -vDm 644 js/jscalendar/skins/aqua/*.{css,gif} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/jscalendar/skins/aqua"
+  install -vDm 644 js/lightbox/css/*.css \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/lightbox/css"
+  install -vDm 644 js/lightbox/images/*.gif \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/lightbox/images"
+  install -vDm 644 js/lightbox/js/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/lightbox/js"
+  install -vDm 644 js/prototype/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/prototype"
+  install -vDm 644 js/script.aculo.us/*.js \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/js/script.aculo.us/"
+  install -vDm 644 lang/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/lang/"
+  install -vDm 644 plugins/.htaccess \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/"
+  install -vDm 644 plugins/dokuwiki/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki"
+  install -vDm 644 plugins/dokuwiki/conf/{.htaccess,*.{conf,php}} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/conf"
+  install -vDm 644 plugins/dokuwiki/img/*.{gif,png} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/img"
+  install -vDm 644 plugins/dokuwiki/inc/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/inc"
+  install -vDm 644 plugins/dokuwiki/inc/geshi/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/inc/geshi"
+  install -vDm 644 plugins/dokuwiki/inc/parser/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/inc/parser"
+  install -vDm 644 plugins/dokuwiki/lib/exe/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/exe"
+  install -vDm 644 plugins/dokuwiki/lib/images/fileicons/*.{gif,php,png} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/images/fileicons"
+  install -vDm 644 plugins/dokuwiki/lib/images/interwiki/*.gif \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/images/interwiki"
+  install -vDm 644 plugins/dokuwiki/lib/images/smileys/*.gif \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/images/smileys"
+  install -vDm 644 plugins/dokuwiki/lib/plugins/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/plugins"
+  install -vDm 644 plugins/dokuwiki/lib/plugins/changelinks/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/plugins/changelinks"
+  install -vDm 644 plugins/dokuwiki/lib/plugins/fslink/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/plugins/fslink"
+  install -vDm 644 plugins/dokuwiki/lib/plugins/newline/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins/dokuwiki/lib/plugins/newline"
+  install -vDm 644 scripts/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/scripts"
+  install -vDm 644 setup/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/setup"
+  install -vDm 755 setup/*.pl \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/setup"
+  install -vDm 644 setup/images/*.png \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/setup/images"
+  install -vDm 644 setup/lang/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/setup/lang"
+  install -vDm 644 setup/styles/*.css \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/setup/styles"
+  install -vDm 644 setup/templates/*.tpl \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/setup/templates"
+  for _upgrade in setup/upgrade/*; do
+    install -vDm 644 "setup/upgrade/$(basename $_upgrade)/"*.{info,php,xml} \
+      -t "${pkgdir}/usr/share/webapps/${pkgname}/setup/upgrade/$(basename $_upgrade)/"
+  done
+  install -vDm 644 tests/*.php \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/tests"
+  install -vDm 644 themes/.htaccess \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes"
+  install -vDm 644 themes/CleanFS/*.{css,html,md,png} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS"
+  install -vDm 644 themes/CleanFS/*.{css,html,md,png} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS"
+  install -vDm 644 themes/CleanFS/fonts/*.{eot,otf,svg,ttf,woff,woff2} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/fonts"
+  install -vDm 644 themes/CleanFS/fonts/octicons/*.{css,eot,less,svg,ttf,woff,scss,txt} \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/fonts/octicons"
+  install -vDm 644 themes/CleanFS/img/*.gif \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/img"
+  for _imgs in themes/CleanFS/img/*; do
+    if [ -d $_imgs ]; then
+      install -vDm 644 "themes/CleanFS/img/$(basename $_imgs)"/*.png \
+        -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/img/$(basename $_imgs)"
+    fi
+  done
+  install -vDm 644 themes/CleanFS/mime/*.png \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/mime"
+  install -vDm 644 themes/CleanFS/mime/application/*.png \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/mime/application"
+  install -vDm 644 themes/CleanFS/mime/text/*.png \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/mime/text"
+  install -vDm 644 themes/CleanFS/templates/*.tpl \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}/themes/CleanFS/templates"
+  # vendor
+  cp -ar vendor "${pkgdir}/usr/share/webapps/${pkgname}/"
+  # state
+  install -vdm 750 "${pkgdir}/var/lib/${pkgname}/attachments/"
+  install -vDm 644 attachments/{.htaccess,index.html} \
+    -t "${pkgdir}/var/lib/${pkgname}/attachments/"
+  ln -sv "/var/lib/${pkgname}/attachments" \
+    "${pkgdir}/usr/share/webapps/${pkgname}/attachments"
+  install -vdm 750 "${pkgdir}/var/lib/${pkgname}/avatars/"
+  install -vDm 644 avatars/index.html \
+    -t "${pkgdir}/var/lib/${pkgname}/avatars/"
+  ln -sv "/var/lib/${pkgname}/avatars" \
+    "${pkgdir}/usr/share/webapps/${pkgname}/avatars"
+  # cache
+  install -vdm 750 "${pkgdir}/var/cache/${pkgname}"
+  install -vDm 644 cache/index.html \
+    -t "${pkgdir}/var/cache/${pkgname}/"
+  ln -sv "/var/cache/${pkgname}" \
+    "${pkgdir}/usr/share/webapps/${pkgname}/cache"
+  # config
+  install -vDm 644 htaccess.dist "${pkgdir}/etc/webapps/${pkgname}/.htaccess"
+  ln -sv /etc/webapps/${pkgname}/.htaccess \
+    "${pkgdir}/usr/share/webapps/${pkgname}/.htaccess"
+  install -vDm 660 "../${pkgname}.conf.php" \
+    -t "${pkgdir}/etc/webapps/${pkgname}"
+  ln -sv /etc/webapps/${pkgname}/${pkgname}.conf.php \
+    "${pkgdir}/usr/share/webapps/${pkgname}/${pkgname}.conf.php"
+  # remove unneeded python scripts from vendor libraries
+  find "${pkgdir}/usr/share/webapps/${pkgname}/vendor" -type f -iname "*.py" -delete
 }
-
 # vim: ts=2 sw=2 et:

Added: flyspray.install
===================================================================
--- flyspray.install	                        (rev 0)
+++ flyspray.install	2019-09-07 10:41:30 UTC (rev 508373)
@@ -0,0 +1,14 @@
+post_install() {
+  echo "Make sure disallow access to /usr/share/webapps/flyspray/setup/ after installation is complete."
+}
+
+post_upgrade() {
+  local new_package_version="$1"
+  local old_package_version="$2"
+  if [ $(vercmp "${old_package_version}" "1.0rc9") -le 0 ]; then
+cat <<EOF
+The webapp now needs to be run as its own user/group: flyspray/flyspray.
+EOF
+  fi
+  echo "Make sure to run setup/upgrade.php for a database schema upgrade."
+}

Added: flyspray.sysusers
===================================================================
--- flyspray.sysusers	                        (rev 0)
+++ flyspray.sysusers	2019-09-07 10:41:30 UTC (rev 508373)
@@ -0,0 +1 @@
+u flyspray - "Flyspray user" -

Added: flyspray.tmpfiles
===================================================================
--- flyspray.tmpfiles	                        (rev 0)
+++ flyspray.tmpfiles	2019-09-07 10:41:30 UTC (rev 508373)
@@ -0,0 +1,5 @@
+z /etc/webapps/flyspray/*.php 0660 root flyspray
+d %C/flyspray/ 0750 flyspray flyspray
+d %S/flyspray/attachments 0750 flyspray flyspray
+d %S/flyspray/avatars 0750 flyspray flyspray
+d %t/flyspray 755 flyspray flyspray

Added: flyspray.uwsgi
===================================================================
--- flyspray.uwsgi	                        (rev 0)
+++ flyspray.uwsgi	2019-09-07 10:41:30 UTC (rev 508373)
@@ -0,0 +1,33 @@
+[uwsgi]
+procname-master = flyspray
+plugins = php
+master = true
+socket = /run/%n/%n.sock
+stats = /run/%n/%n-stats.sock
+uid = flyspray
+gid = flyspray
+processes = 10
+cheaper = 2
+cheaper-step = 1
+idle = 600
+die-on-idle = true
+touch-reload = %p
+
+php-allowed-ext = .php
+php-docroot = /usr/share/webapps/flyspray
+php-index = index.php
+php-set = date.timezone=Europe/Berlin
+php-set = open_basedir=/tmp/:/usr/share/webapps/flyspray:/var/cache/flyspray:/var/lib/flyspray:/etc/webapps/flyspray
+php-set = session.save_path=/tmp
+php-set = session.gc_maxlifetime  21600
+php-set = session.gc_divisor  500
+php-set = session.gc_probability  1
+php-set = post_max_size=64M
+php-set = upload_max_filesize=64M
+php-set = always_populate_raw_post_data=-1
+
+php-set = extension=curl
+php-set = extension=gd
+php-set = extension=exif
+php-set = extension=mysqli
+php-set = extension=pgsql


More information about the arch-commits mailing list