upgpkg: freshrss 1.15.3-2

relocate datadir
This commit is contained in:
Cedric Girard 2019-12-01 14:45:34 +01:00
parent 06ff6041f8
commit 2fcaacdb24
Signed by: X-dark
GPG key ID: E7D0E125DB9519E4
3 changed files with 33 additions and 4 deletions

View file

@ -1,7 +1,7 @@
pkgbase = freshrss pkgbase = freshrss
pkgdesc = A free, self-hostable aggregator… pkgdesc = A free, self-hostable aggregator…
pkgver = 1.15.3 pkgver = 1.15.3
pkgrel = 1 pkgrel = 2
url = http://freshrss.org/ url = http://freshrss.org/
install = freshrss.install install = freshrss.install
arch = any arch = any

View file

@ -2,7 +2,7 @@
pkgname=freshrss pkgname=freshrss
pkgver=1.15.3 pkgver=1.15.3
pkgrel=1 pkgrel=2
pkgdesc='A free, self-hostable aggregator…' pkgdesc='A free, self-hostable aggregator…'
arch=('any') arch=('any')
url='http://freshrss.org/' url='http://freshrss.org/'
@ -18,10 +18,28 @@ install="$pkgname.install"
source=("https://github.com/FreshRSS/FreshRSS/archive/$pkgver.tar.gz") source=("https://github.com/FreshRSS/FreshRSS/archive/$pkgver.tar.gz")
sha256sums=('c6d1b392ed85ef8eab132634ff1199fad1a274df5892e29c0793cabc6668eb55') sha256sums=('c6d1b392ed85ef8eab132634ff1199fad1a274df5892e29c0793cabc6668eb55')
prepare(){
cd "${srcdir}/FreshRSS-$pkgver"
sed -i "s!FRESHRSS_PATH . '/data'!'/var/lib/webapps/freshrss/data'!" constants.php
}
package() { package() {
cd "${srcdir}/FreshRSS-$pkgver" cd "${srcdir}/FreshRSS-$pkgver"
install -d "$pkgdir/usr/share/webapps/freshrss" install -d "$pkgdir/usr/share/webapps/freshrss"
cp -r . "$pkgdir/usr/share/webapps/freshrss/" cp -r . "$pkgdir/usr/share/webapps/freshrss/"
#do some cleanup
find "$pkgdir/usr/share/webapps/freshrss" -name '.git*' -exec rm -rf {} \; || true
rm -rf "$pkgdir/usr/share/webapps/freshrss/Docker"
rm -rf "$pkgdir/usr/share/webapps/freshrss/tests"
#new location for datadir
install -dm 700 "$pkgdir/var/lib/webapps/freshrss"
mv "$pkgdir/usr/share/webapps/freshrss/data" "$pkgdir/var/lib/webapps/freshrss/data"
} }
# vim:set ts=2 sw=2 et: # vim:set ts=2 sw=2 et:

View file

@ -1,9 +1,20 @@
post_install() { post_install() {
# Make data writable by webserver chown -R http:http /var/lib/webapps/freshrss
chown -R http:http /usr/share/webapps/freshrss/data
echo 'You can now configure your (PHP compatible) web server to run FreshRSS' echo 'You can now configure your (PHP compatible) web server to run FreshRSS'
} }
pre_upgrade() {
# Move data dir to new location if needed
if [ ! -L /usr/share/webapps/freshrss/data ] ; then
# dir not yet symlinked
install -dm 700 /var/lib/webapps/freshrss
mv /usr/share/webapps/freshrss/data /var/lib/webapps/freshrss/data
chown -R http:http /var/lib/webapps/freshrss
echo 'Datadir has been automatically moved to /var/lib/webapps/freshrss/data'
fi
}
post_upgrade() { post_upgrade() {
post_install post_install
} }