diff --git a/.SRCINFO b/.SRCINFO index 0b6cb3d..ce574f8 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,25 +1,25 @@ # Generated by mksrcinfo v8 -# Fri May 6 05:56:19 UTC 2016 +# Sat May 7 10:29:37 UTC 2016 pkgbase = wallabag pkgdesc = Self hostable application for saving web pages pkgver = 2.0.3 - pkgrel = 2 + pkgrel = 3 url = http://www.wallabag.org/ install = wallabag.install arch = any license = MIT depends = php>=5.3.3 + depends = php-gd depends = php-tidy depends = pcre - depends = php-gd - optdepends = mariadb: For MySQL storage - optdepends = php-sqlite: For sqlite storage + optdepends = php-mysql: For MySQL storage optdepends = php-pgsql: For postgres storage + optdepends = php-sqlite: For sqlite storage options = !strip - source = https://github.com/wallabag/wallabag/archive/2.0.3.tar.gz - source = vendor.zip::http://wllbg.org/vendor - sha256sums = 2252e0218917bc71db03db60a7b6940b4b8bdc8602732a458e906147e3c99a73 - sha256sums = bd3e843290de28f1c20fa19ed746ca221c9174cb7f0a9723618f21bddb883e12 + backup = etc/webapps/wallabag/parameters.yml + backup = usr/share/webapps/wallabag/parameters.yml + source = wallabag.tar.xz::http://wllbg.org/latest-v2-package + sha256sums = 6c69e2fd1dbebbd4311e4d385928dcad60cb80b16247d1e18181eb66a91e8bd7 pkgname = wallabag diff --git a/PKGBUILD b/PKGBUILD index 02c62bb..7d7e108 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,24 +2,40 @@ pkgname=wallabag pkgver=2.0.3 -pkgrel=2 +pkgrel=3 pkgdesc='Self hostable application for saving web pages' arch=('any') url='http://www.wallabag.org/' license=('MIT') -depends=('php>=5.3.3' 'php-tidy' 'pcre' 'php-gd') -optdepends=('mariadb: For MySQL storage' 'php-sqlite: For sqlite storage' 'php-pgsql: For postgres storage') +depends=( + 'php>=5.3.3' + 'php-gd' + 'php-tidy' + 'pcre' +) +optdepends=( + 'php-mysql: For MySQL storage' + 'php-pgsql: For postgres storage' + 'php-sqlite: For sqlite storage' +) install="$pkgname.install" options=(!strip) -source=("https://github.com/wallabag/wallabag/archive/${pkgver}.tar.gz" "vendor.zip::http://wllbg.org/vendor") -sha256sums=('2252e0218917bc71db03db60a7b6940b4b8bdc8602732a458e906147e3c99a73' - 'bd3e843290de28f1c20fa19ed746ca221c9174cb7f0a9723618f21bddb883e12') +source=("${pkgname}.tar.xz::http://wllbg.org/latest-v2-package") +sha256sums=('6c69e2fd1dbebbd4311e4d385928dcad60cb80b16247d1e18181eb66a91e8bd7') +backup=("etc/webapps/${pkgname}/parameters.yml" + "usr/share/webapps/${pkgname}/parameters.yml") package() { cd "${pkgdir}" mkdir -p usr/share/webapps - mv "${srcdir}/${pkgname}-${pkgver}" usr/share/webapps/${pkgname} - mv "${srcdir}/vendor" usr/share/webapps/${pkgname}/vendor + mv "${srcdir}/release-${pkgver}" usr/share/webapps/${pkgname} + + WALLABAG_CONF_DIR="${pkgdir}/usr/share/webapps/${pkgname}/app/config" + + install -d "${pkgdir}/etc/webapps/${pkgname}/" + mv "${WALLABAG_CONF_DIR}"/parameters.yml ${pkgdir}/etc/webapps/${pkgname}/ + 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" } - diff --git a/wallabag.install b/wallabag.install index f347dc5..55b211b 100644 --- a/wallabag.install +++ b/wallabag.install @@ -1,27 +1,29 @@ -post_install() { - echo 'To get started you need to: - - Enable tidy.so and allow_url_fopen in /etc/php/php.ini - - Create a new mariadb user and a database: - $ mysql -u root -p - > create database wallabag; - > GRANT ALL ON wallabag.* TO wallabag@localhost IDENTIFIED BY '"'mypassword'"'; - - Initialize the database: - $ mysql -u root -p wallabag < /usr/share/webapps/wallabag/install/mysql.sql - - Create a config file: - # cp /usr/share/webapps/wallabag/inc/poche/config.inc{.default,}.php - - Adjust your prefered STORAGE_SERVER (mysql, sqlite, postgres) - - Set the database credentials: STORAGE_SERVER, STORAGE_DB, STORAGE_USER, STORAGE_PASSWORD - - *Optional*: Adjust the SALT value in config.inc.php (it was autogenerated during install) - - Remove /usr/share/webapps/wallabag/install - More info: - http://doc.wallabag.org/en/Administrator/download_and_install.html' +post_install() { + 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" + echo "" + echo -n "To setup your webserver and enable the needed php extensions, " + echo "plase read: http://doc.wallabag.org/en/master/user/installation.html" +} + + +pre_upgrade() { + # 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 } post_upgrade() { - echo 'After each upgrade you have to manually: - - Remove the installation folder (/usr/share/webapps/wallabag/install) - - Empty the cache folder (/usr/share/webapps/wallabag/cache) - - $ sudo -u http rm -rf /usr/share/webapps/wallabag/{install,cache/*}' + rm -rf /usr/share/webapps/wallabag/var/cache/* }