first commit

This commit is contained in:
Philipp Schmitt 2014-02-17 13:40:23 +01:00
commit edc0094cd5
4 changed files with 86 additions and 0 deletions

21
.SRCINFO Normal file
View file

@ -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

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
*tar.gz
*pkg.tar.xz
src/
pkg/
vendor.zip

41
PKGBUILD Normal file
View file

@ -0,0 +1,41 @@
# Maintainer: Philipp Schmitt (philipp<at>schmitt<dot>co)
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}"
}

19
wallabag.install Normal file
View file

@ -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'
}