summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 321a8edff4a711256e9a30065efab6328cac9490 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Maintainer: J. King <jking@jkingweb.ca>
pkgname="arsse-git"
pkgver=0.9.1.r46.g2ccfb1f
pkgrel=1
epoch=
pkgdesc="Multi-protocol RSS/Atom newsfeed synchronization server, bugfix-testing version"
arch=("any")
url="https://thearsse.com/"
license=("MIT")
provides=("arsse")
conflicts=("arsse")
depends=("php" "php-intl" "php-sqlite")
makedepends=("composer")
checkdepends=()
optdepends=("nginx: HTTP server"
            "apache: HTTP server"
            "percona-server: Alternate database"
            "postgresql: Alternate database"
            "php-pgsql: PostgreSQL database support")
backup=("etc/webapps/arsse/config.php"
        "etc/php/php-fpm.d/arsse.conf"
        "etc/webapps/arsse/nginx/example.conf"
        "etc/webapps/arsse/nginx/arsse.conf"
        "etc/webapps/arsse/nginx/arsse-loc.conf"
        "etc/webapps/arsse/nginx/arsse-fcgi.conf"
        "etc/webapps/arsse/apache/example.conf"
        "etc/webapps/arsse/apache/arsse.conf"
        "etc/webapps/arsse/apache/arsse-loc.conf")
source=("git+https://code.mensbeam.com/MensBeam/arsse/")
md5sums=("SKIP")

pkgver() {
  cd "arsse"
  git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "$srcdir/arsse"
    composer install
    ./robo manual
    composer install --no-dev -o --no-scripts
    php arsse.php conf save-defaults config.defaults.php
    rm -r vendor/bin
}

package() {
    # define runtime dependencies
    depends=("php" "php-intl" "php-sqlite" "php-fpm")
    # create most directories necessary for the final package
    cd "$pkgdir"
    mkdir -p "usr/share/webapps/arsse" "usr/share/doc/arsse" "usr/share/licenses/arsse" "usr/lib/systemd/system" "usr/lib/sysusers.d" "usr/lib/tmpfiles.d" "etc/php/php-fpm.d/" "etc/webapps/arsse" "etc/webapps/arsse/nginx"
    #copy requisite files
    cd "$srcdir/arsse"
    cp -r lib locale sql vendor www CHANGELOG UPGRADING README.md arsse.php "$pkgdir/usr/share/webapps/arsse"
    cp -r manual/* "$pkgdir/usr/share/doc/arsse"
    cp LICENSE AUTHORS "$pkgdir/usr/share/licenses/arsse"
    cp dist/systemd/* "$pkgdir/usr/lib/systemd/system"
    cp dist/sysuser.conf "$pkgdir/usr/lib/sysusers.d/arsse.conf"
    cp dist/tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/arsse.conf"
    cp dist/php-fpm.conf "$pkgdir/etc/php/php-fpm.d/arsse.conf"
    cp -r dist/nginx dist/apache config.defaults.php "$pkgdir/etc/webapps/arsse"
    cd "$pkgdir"
    # copy files requiring special permissions
    cd "$srcdir/arsse"
    install -Dm755 dist/arsse "$pkgdir/usr/bin/arsse"
    install -Dm640 dist/arch/config.php "$pkgdir/etc/webapps/arsse"
    # patch generic configuration files to use Arch-specific paths and identifiers
    sed -i -se 's/\/\(etc\|usr\/share\)\/arsse\//\/\1\/webapps\/arsse\//' "$pkgdir/etc/webapps/arsse/nginx/"* "$pkgdir/etc/webapps/arsse/apache/"* "$pkgdir/usr/lib/tmpfiles.d/arsse.conf" "$pkgdir/usr/lib/systemd/system/"* "$pkgdir/usr/bin/"*
    sed -i -se 's/\/var\/run\/php\//\/run\/php-fpm\//' "$pkgdir/etc/webapps/arsse/nginx/"* "$pkgdir/etc/webapps/arsse/apache/"* "$pkgdir/etc/php/php-fpm.d/arsse.conf"
    sed -i -se 's/www-data/http/' "$pkgdir/etc/php/php-fpm.d/arsse.conf"
    sed -i -e 's/^WorkingDirectory=.*$/WorkingDirectory=\/usr\/share\/webapps\/arsse/' -e 's/^ConfigurationDirectory=.*$/ConfigurationDirectory=webapps\/arsse/' "$pkgdir/usr/lib/systemd/system/arsse-fetch.service"
}