upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / flyspray / trunk / PKGBUILD
blob0a1c8227f3d0426a8aa3468f683a646ac63938d9
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
3 # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
5 pkgname=flyspray
6 pkgver=1.0rc10
7 pkgrel=2
8 pkgdesc='Lightweight, web-based bug tracking system written in PHP'
9 url="https://www.flyspray.org/"
10 arch=('any')
11 license=('LGPL2.1')
12 depends=('php' 'php-gd')
13 makedepends=('composer' 'unzip')
14 optdepends=('graphviz: plot task dependency graphs'
15             'mariadb: use local MariaDB database'
16             'php-fpm: run with FastCGI process manager'
17             'php-pgsql: use PostgreSQL database'
18             'postgresql: use local PostgreSQL database'
19             'uwsgi-plugin-php: run in application container')
20 backup=("etc/webapps/${pkgname}/.htaccess"
21         "etc/webapps/${pkgname}/${pkgname}.conf.php")
22 install="${pkgname}.install"
23 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/v${pkgver/rc/-rc}.tar.gz"
24         "${pkgname}.sysusers"
25         "${pkgname}.tmpfiles"
26         "${pkgname}.uwsgi")
27 sha512sums=('b6d4d786a013141940a9c9f6047a85f39d7a56978a5882c53f101457f6fca2635e1a3727f2c95c7ddbb44527c12a408873640e6cbb832d09eef27183fb4d10e3'
28             'ee23df991c6a42bfb139caabad861a3f945ea18d81061fdb90ace8430d4225e7db322802de4fdf36aa8191cbedab3cafd025c76f08806b7fcdb88f6eb185519e'
29             '65d333b98a93cc320300bacc8d142f7150e31f4a65da96f09ab0c88e6556a120a5cab8d2c871840753eb4eec6a281d0731b1ab5524834f1281f2d073ba4983f0'
30             'a236f32e46b1ef9574fde8201c18f09edcd72ad2a53fc5c88f1b8da7540ac55a936da69e3af096b1c73155882cdfe3343dd2f0242de9b6b7ca6713752a1a3343')
31 b2sums=('ede853846d898c41c42d7bdec720ede685fd4ed285c5ab014425f7e1d0b2fb2b3122ac598b653acac0e92e7dfa7dd87b4fd9cdd0e42e313653ae336983453f27'
32         '93ab7184cceaa6148dcf4161fe6a680cae105859697373021b9f027d85bbad0f0c7ee02b7800305df26858c1b39e70dd4dadf2f539f6659215d159ac6a3151c5'
33         'f2c6b9137747aca24875d113251011b1759402372d25de3771ce5d11461fdc530ca000c3490f8b76d567302c8abf3ba95d5a0f831d34164225a99516745f38f3'
34         '075ca6cc87246491d5981414ff3e0cd84ce466034fc8afe025fc9d272f295a13d6e19496c8abe3c8db8fbd9a9c1b579c78230f06797527722bae7817255f4e47')
36 prepare() {
37   mv -v "${pkgname}-${pkgver/rc/-rc}" "${pkgname}-${pkgver}"
38   touch "${pkgname}.conf.php"
39   cd "${pkgname}-${pkgver}"
40   # removing forced redirect, if setup/index.php is accessible.
41   # access to it should be denied via the webserver settings
42   sed -e '45,82d' -i header.php
45 build() {
46   cd "${pkgname}-${pkgver}"
47   php -d 'extension=gd' /usr/bin/composer install --no-dev
50 package() {
51   cd "${pkgname}-${pkgver}"
52   # sysusers.d integration
53   install -vDm 644 ../${pkgname}.sysusers \
54     "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
55   # tmpfiles.d integration
56   install -vDm 644 ../${pkgname}.tmpfiles \
57     "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
58   # uwsgi integration
59   install -vDm 644 ../${pkgname}.uwsgi \
60     "${pkgdir}/etc/uwsgi/${pkgname}.ini"
61   # docs
62   install -vDm 644 {docs/*.txt,README.md} \
63     -t "${pkgdir}/usr/share/doc/${pkgname}"
64   rm -rv docs
65   install -vdm 755 "${pkgdir}/usr/share/webapps/${pkgname}/"
66   # state
67   install -vdm 750 "${pkgdir}/var/lib/${pkgname}/attachments/"
68   install -vDm 644 attachments/{.htaccess,index.html} \
69     -t "${pkgdir}/var/lib/${pkgname}/attachments/"
70   rm -rv attachments
71   ln -sv "/var/lib/${pkgname}/attachments" \
72     "${pkgdir}/usr/share/webapps/${pkgname}/attachments"
73   install -vdm 750 "${pkgdir}/var/lib/${pkgname}/avatars/"
74   install -vDm 644 avatars/index.html \
75     -t "${pkgdir}/var/lib/${pkgname}/avatars/"
76   rm -rv avatars
77   ln -sv "/var/lib/${pkgname}/avatars" \
78     "${pkgdir}/usr/share/webapps/${pkgname}/avatars"
79   # cache
80   install -vdm 750 "${pkgdir}/var/cache/${pkgname}"
81   install -vDm 644 cache/index.html \
82     -t "${pkgdir}/var/cache/${pkgname}/"
83   rm -rv cache
84   ln -sv "/var/cache/${pkgname}" \
85     "${pkgdir}/usr/share/webapps/${pkgname}/cache"
86   # config
87   install -vDm 644 htaccess.dist "${pkgdir}/etc/webapps/${pkgname}/.htaccess"
88   rm -v htaccess.dist
89   ln -sv /etc/webapps/${pkgname}/.htaccess \
90     "${pkgdir}/usr/share/webapps/${pkgname}/.htaccess"
91   install -vDm 660 "../${pkgname}.conf.php" \
92     -t "${pkgdir}/etc/webapps/${pkgname}"
93   ln -sv /etc/webapps/${pkgname}/${pkgname}.conf.php \
94     "${pkgdir}/usr/share/webapps/${pkgname}/${pkgname}.conf.php"
96   # install webapp
97   find . -type f -exec install -vDm 644 {} "${pkgdir}/usr/share/webapps/${pkgname}/"{} \;
98   # remove unneeded files
99   find "${pkgdir}/usr/share/webapps/${pkgname}" -type f \
100     \( \
101     -iname "*.py" -or \
102     -iname "*.gitignore" -or \
103     -iname "*.travis.yml" -or \
104     -iname "*composer.lock" -or \
105     -iname "*composer.json" \
106     \) \
107     -delete
109 # vim: ts=2 sw=2 et: