diff options
author | Owen Trigueros | 2019-05-15 21:19:53 +0200 |
---|---|---|
committer | Owen Trigueros | 2019-05-15 21:19:53 +0200 |
commit | 225318c66fb2e054a09aa81dc29e376ea241ae7e (patch) | |
tree | 0da69be45eedeb72d28ea1bc085578575777a9a1 /PKGBUILD | |
parent | c6c6bcee01f7048f0972b18e80f366a7992c14c9 (diff) | |
download | aur-225318c66fb2e054a09aa81dc29e376ea241ae7e.tar.gz |
Add backup(), replace cp w/ install, remove references to $pkgdir, mv config to /etc/
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 58 |
1 files changed, 38 insertions, 20 deletions
@@ -2,7 +2,7 @@ pkgname=turtl-server-git pkgver=r209.f37f183 -pkgrel=1 +pkgrel=2 pkgdesc="The secure, collaborative notebook's server" arch=('any') url="https://turtlapp.com/" @@ -11,14 +11,14 @@ depends=('nodejs' 'postgresql') makedepends=('git' 'npm') install=$pkgname.install source=("$pkgname::git+https://github.com/turtl/server.git" - "turtl.conf" "turtl-server-git.install" - "turtl.service") + "turtl.service" + "turtl.sysusers") md5sums=('SKIP' - '7436fec3178f4204a0bda9519dcc8f08' - 'd91669b7799dea106b8e7f0e5d14e9a7' - '222f09bb6a654caa705e14a82ad8db8a') + '2277c97e9f9ea821b35f5f4215e5ff9b' + 'ef593935d035ae7df448dbb18aaed70f' + 'c6727740e7165fa825bc011ec5f50f78') pkgver() { cd "$pkgname" @@ -31,20 +31,38 @@ build() { } package() { - mkdir -p "$pkgdir"/var/www/turtl/server - mkdir -p "$pkgdir"/var/www/turtl/server/plugins + cd "$srcdir"/"$pkgname" + backup=('etc/webapps/turtl/config.yaml') - install -Dm644 turtl.service "$pkgdir"/usr/lib/systemd/system/turtl.service - install -Dm644 turtl.conf "$pkgdir"/usr/lib/sysusers.d/turtl.conf + # install service file and systemd-sysusers config + install -Dm644 "$srcdir"/turtl.service "$pkgdir"/usr/lib/systemd/system/turtl.service + install -Dm644 "$srcdir"/turtl.sysusers "$pkgdir"/usr/lib/sysusers.d/turtl.conf - cd "$srcdir"/"$pkgname" - cp -r controllers $pkgdir/var/www/turtl/server - cp -r helpers "$pkgdir"/var/www/turtl/server - cp -r models "$pkgdir"/var/www/turtl/server - cp -r node_modules "$pkgdir"/var/www/turtl/server - cp -r scripts "$pkgdir"/var/www/turtl/server - cp -r tools "$pkgdir"/var/www/turtl/server - - install -Dm644 config/config.yaml.default "$pkgdir"/var/www/turtl/server/config/config.yaml - install -Dm644 server.js "$pkgdir"/var/www/turtl/server/server.js + # install server files + find controllers/ -type f -exec install -Dm644 {} "$pkgdir"/usr/share/webapps/turtl/{} \; + find helpers/ -type f -exec install -Dm644 {} "$pkgdir"/usr/share/webapps/turtl/{} \; + find models/ -type f -exec install -Dm644 {} "$pkgdir"/usr/share/webapps/turtl/{} \; + find scripts/ -type f -exec install -Dm644 {} "$pkgdir"/usr/share/webapps/turtl/{} \; + find tools/ -type f -exec install -Dm644 {} "$pkgdir"/usr/share/webapps/turtl/{} \; + find node_modules/ -type f -exec install -Dm644 {} "$pkgdir"/usr/share/webapps/turtl/{} \; + install -Dm644 server.js "$pkgdir"/usr/share/webapps/turtl/server.js + install -d "$pkgdir"/usr/share/webapps/turtl/plugins + install -d "$pkgdir"/var/lib/turtl/public/uploads + ln -s /var/lib/turtl/public "$pkgdir"/usr/share/webapps/turtl/public + + # install config file + install -Dm644 config/config.yaml.default "$pkgdir"/etc/webapps/turtl/config.yaml + mkdir -p "$pkgdir"/usr/share/webapps/turtl/config + ln -s /etc/webapps/turtl/config.yaml "$pkgdir"/usr/share/webapps/turtl/config/config.yaml + + # remove references to $pkgdir and $srcdir + find "$pkgdir" -name package.json -print0 | xargs -0 sed -i '/_where/d' + + # change 'loglevel' to 'info' + sed -i "s/loglevel: 'debug'/loglevel: 'info'/" \ + "$pkgdir"/etc/webapps/turtl/config.yaml + + # change data dir + sed -i "s/\/var\/www\/turtl\/server/usr\/share\/webapps\/turtl/g" \ + "$pkgdir"/etc/webapps/turtl/config.yaml } |