summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2b3ff1cd904fee00c25e63867f42ca8bbfe5b5d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: hashworks<mail@hashworks.net>
pkgname=filebin
pkgver=3.4.3
pkgrel=1
pkgdesc="A pastebin service written in PHP"
arch=('any')
url="https://wiki.server-speed.net/projects/filebin"
license=('AGPL')
makedepends=('nodejs' 'git')
depends=('php'
         'pygmentize'
         'python-ansi2html'
         'php-gd'
         'imagemagick'
)
backup=('etc/webapps/filebin/config-local.php'
        'etc/webapps/filebin/contact-info.php'
        'etc/webapps/filebin/database.php'
        'etc/webapps/filebin/memcached.php'
)
install=filebin.install
options=('!strip' 'emptydirs')
source=("git+https://github.com/Bluewind/filebin.git"
        'filebin-nginx.conf'
)
sha256sums=('SKIP'
            '5500d423d798478bf4f7bb0a147fe8a42b00e843513dd70665ec81f304a6c729')

build () {
  cd ${srcdir}/filebin
  git checkout ${pkgver}
  git submodule update --init --recursive
  scripts/optimize_js.sh
}

package() {
  mkdir -p ${pkgdir}/usr/share/webapps
  mkdir -p ${pkgdir}/etc/webapps/filebin
  cp -ra ${srcdir}/filebin/ ${pkgdir}/usr/share/webapps/filebin/
  cp filebin-nginx.conf ${pkgdir}/usr/share/webapps/filebin
  cd ${pkgdir}/usr/share/webapps/filebin
  cp application/config/example/{config-local,database,memcached}.php ${pkgdir}/etc/webapps/filebin
  rm application/config/memcached.php
  ln -s /etc/webapps/filebin/{config-local,database,memcached}.php application/config
  cp data/local/examples/contact-info.php ${pkgdir}/etc/webapps/filebin
  ln -s /etc/webapps/filebin/contact-info.php data/local

  # removing unnecessary data for a production environment
  rm -rf .git
  rm -rf application/third_party/{test-more-php,mockery}
  rm -rf application/tests
  find . -name \*.gitignore -type f -delete 
}