Move "data" and "var" directories to /var/lib/wallabag/
This commit is contained in:
parent
61fd0bd1e7
commit
4dc334c2fe
3 changed files with 30 additions and 11 deletions
2
.SRCINFO
2
.SRCINFO
|
@ -16,6 +16,8 @@ pkgbase = wallabag
|
|||
options = !strip
|
||||
backup = etc/webapps/wallabag/parameters.yml
|
||||
backup = usr/share/webapps/wallabag/parameters.yml
|
||||
backup = var/lib/wallabag/data/db/wallabag.sqlite
|
||||
backup = usr/share/webapps/wallabag/data/db/wallabag.sqlite
|
||||
source = wallabag.tar.xz::http://wllbg.org/latest-v2-package
|
||||
sha256sums = f3acfde5a945bcd0a65f2549fc2f577bc6fc633ba901df27e7dc88c07feb2406
|
||||
|
||||
|
|
12
PKGBUILD
12
PKGBUILD
|
@ -23,7 +23,9 @@ options=(!strip)
|
|||
source=("${pkgname}.tar.xz::http://wllbg.org/latest-v2-package")
|
||||
sha256sums=('f3acfde5a945bcd0a65f2549fc2f577bc6fc633ba901df27e7dc88c07feb2406')
|
||||
backup=("etc/webapps/${pkgname}/parameters.yml"
|
||||
"usr/share/webapps/${pkgname}/parameters.yml")
|
||||
"usr/share/webapps/${pkgname}/parameters.yml"
|
||||
"var/lib/${pkgname}/data/db/wallabag.sqlite"
|
||||
"usr/share/webapps/${pkgname}/data/db/wallabag.sqlite")
|
||||
|
||||
package() {
|
||||
cd "${pkgdir}"
|
||||
|
@ -37,5 +39,11 @@ package() {
|
|||
chown -R http:http ${pkgdir}/etc/webapps/${pkgname}
|
||||
ln -s /etc/webapps/${pkgname}/parameters.yml "${WALLABAG_CONF_DIR}"/
|
||||
|
||||
chown -R http:http "${pkgdir}/usr/share/webapps/wallabag"
|
||||
_VAR_DIR="${pkgdir}/var/lib/${pkgname}/"
|
||||
install -d "$_VAR_DIR"
|
||||
mv "${pkgdir}/usr/share/webapps/${pkgname}/"{data,var} "$_VAR_DIR"
|
||||
ln -s "/var/lib/${pkgname}/"{data,var} "${pkgdir}/usr/share/webapps/${pkgname}/"
|
||||
chown -R http:http "$_VAR_DIR"
|
||||
|
||||
chown -R http:http "${pkgdir}/usr/share/webapps/${pkgname}"
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
post_install() {
|
||||
echo ""
|
||||
echo "==> Installed in : /usr/share/webapps/wallabag"
|
||||
echo ""
|
||||
echo "==> Config is at /etc/webapps/wallabag/config/parameters.yml"
|
||||
echo ""
|
||||
echo ""
|
||||
echo "==> Installed in : /usr/share/webapps/wallabag"
|
||||
echo ""
|
||||
echo "==> Config is at /etc/webapps/wallabag/config/parameters.yml"
|
||||
echo ""
|
||||
echo -n "Change the configuration to fit to your current setup, and then "
|
||||
echo "init wallabag by launching:"
|
||||
echo "php /usr/share/webapps/wallabag/bin/console wallabag:install --env=prod"
|
||||
|
@ -15,15 +15,24 @@ post_install() {
|
|||
|
||||
|
||||
pre_upgrade() {
|
||||
# save old untracked config and make it tracked
|
||||
if [[ -f /usr/share/webapps/wallabag/app/config/parameters.yml && \
|
||||
# save old untracked config and make it tracked
|
||||
if [[ -f /usr/share/webapps/wallabag/app/config/parameters.yml && \
|
||||
! -h /usr/share/webapps/wallabag/app/config/parameters.yml ]];
|
||||
then install -Dm644 \
|
||||
/usr/share/webapps/wallabag/app/config/parameters.yml \
|
||||
-t /etc/webapps/wallabag/
|
||||
fi
|
||||
fi
|
||||
# also move `data` and `var` to /var/lib/wallabag/
|
||||
if [[ -d /usr/share/webapps/wallabag/data && \
|
||||
! -h /usr/share/webapps/wallabag/data && \
|
||||
-d /usr/share/webapps/wallabag/var && \
|
||||
! -h /usr/share/webapps/wallabag/var ]]; then
|
||||
install -d /var/lib/wallabag/
|
||||
chown http:http /var/lib/wallabag/
|
||||
mv /usr/share/webapps/wallabag/{data,var} /var/lib/wallabag/
|
||||
fi
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
rm -rf /usr/share/webapps/wallabag/var/cache/*
|
||||
rm -rf /var/lib/wallabag/var/cache/*
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue