1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00
Arsse/dist/arch/PKGBUILD
2021-05-19 18:59:20 -04:00

52 lines
2.5 KiB
Bash

pkgname="arsse"
pkgver=0.9.1
pkgrel=1
epoch=
pkgdesc="RSS/Atom newsfeed synchronization server"
arch=("any")
url="https://thearsse.com/"
license=("MIT")
depends=()
makedepends=()
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")
install=
changelog=
source=("arsse-0.9.1.tar.gz")
md5sums=("SKIP")
package() {
# define runtime dependencies
depends=("php" "php-intl" "php-sqlite" "php-fpm")
# create most directories necessary forn 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"
# adjust permissions, just in case
chmod -R u=rwX,g=rX,o=rX *
# create a symbolic link for the configuration file
ln -sT "/etc/webapps/arsse/config.php" "usr/share/webapps/arsse/config.php"
# copy files requiring special permissions
cd "$srcdir/arsse"
install -Dm755 dist/arsse "$pkgdir/usr/bin"
install -Dm640 dist/arch/config.php "$pkgdir/etc/webapps/arsse"
# patch generic configuration files to use Arch-specific paths and identifiers
sed -ise '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 -ise '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 -ise 's/www-data/http/' "$pkgdir/etc/php/php-fpm.d/arsse.conf"
}