commit edc0094cd5db85122956647b4200f0ef6d24ad3d Author: Philipp Schmitt Date: Mon Feb 17 13:40:23 2014 +0100 first commit diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..d3daebf --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = wallabag + pkgdesc = Self hostable application for saving web pages + pkgver = 1.5.0 + pkgrel = 1 + url = http://www.wallabag.org/ + install = wallabag.install + arch = x86_64 + license = WTFPL + depends = php>=5.3 + depends = php-tidy + depends = pcre + depends = mariadb + optdepends = php-sqlite: For sqlite storage + optdepends = php-pgsql: For postgres storage + source = https://github.com/wallabag/wallabag/archive/1.5.0.tar.gz + source = vendor.zip::http://wllbg.org/vendor + sha256sums = d76dd80920e7474d1b017540d6639908752e4ab35a82d0dee8e149ba33b708a4 + sha256sums = bd3e843290de28f1c20fa19ed746ca221c9174cb7f0a9723618f21bddb883e12 + +pkgname = wallabag + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2baac1a --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*tar.gz +*pkg.tar.xz +src/ +pkg/ +vendor.zip diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..9ea0493 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: Philipp Schmitt (philippschmittco) + +pkgname=wallabag +pkgver=1.5.0 +pkgrel=1 +pkgdesc='Self hostable application for saving web pages' +arch=('x86_64') +url='http://www.wallabag.org/' +license=('WTFPL') +depends=('php>=5.3' 'php-tidy' 'pcre' 'mariadb') +optdepends=('php-sqlite: For sqlite storage' 'php-pgsql: For postgres storage') +install="$pkgname.install" +source=("https://github.com/wallabag/wallabag/archive/${pkgver}.tar.gz" + "vendor.zip::http://wllbg.org/vendor") +sha256sums=('d76dd80920e7474d1b017540d6639908752e4ab35a82d0dee8e149ba33b708a4' + 'bd3e843290de28f1c20fa19ed746ca221c9174cb7f0a9723618f21bddb883e12') + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + local default_config=inc/poche/config.inc.php.new + # Salt + local salt=$(< /dev/urandom tr -dc A-Za-z0-9_ | head -c100 | sha512sum | awk '{ print $1 }') + sed -i "s/\('SALT',\).*'/\1 '${salt}'/" $default_config + # Change default storage to mysql + sed -i "s/\('STORAGE',\).*'/\1 'mysql'/" $default_config + # Change default database name + sed -i "s/\('STORAGE_DB',\).*'/\1 '${pkgname}'/" $default_config + # Change default user + sed -i "s/\('STORAGE_USER',\).*'/\1 '${pkgname}'/" $default_config + # Change default password + sed -i "s/\('STORAGE_PASSWORD',\).*'/\1 '${pkgname}'/" $default_config +} + +package() { + cd "${pkgdir}" + mkdir -p usr/share/webapps + mv "${srcdir}/${pkgname}-${pkgver}" usr/share/webapps/${pkgname} + mv "${srcdir}/vendor" usr/share/webapps/${pkgname}/vendor + chown -R http:http "${pkgdir}" +} + diff --git a/wallabag.install b/wallabag.install new file mode 100644 index 0000000..a695ae0 --- /dev/null +++ b/wallabag.install @@ -0,0 +1,19 @@ +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.php.new /usr/share/webapps/wallabag/inc/poche/config.inc.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/doku.php?id=users:begin:install' +} +