summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a7dad6ecf38a5160b4aa4d0dbbe1c98818e59740 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Maintainer: Cedric Girard <cgirard [dot] archlinux [at] valinor [dot] fr>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=roundcubemail-git
pkgver=1.6beta.r609.g7a3e91a9d
pkgrel=1
pkgdesc="A PHP web-based mail client"
arch=('any')
url="https://roundcube.net/"
license=('GPL')
depends=('php' 'php-gd')
makedepends=('systemd' 'composer' 'php-gd' 'git' 'unzip' 'java-runtime' 'nodejs-less-plugin-clean-css' 'uglify-js' 'nodejs-csso-cli')
provides=('roundcubemail')
conflicts=('roundcubemail')
backup=('etc/webapps/roundcubemail/.htaccess'
        'etc/webapps/roundcubemail/apache.conf')
source=("git+https://github.com/roundcube/roundcubemail.git"
        "apache.conf")
sha256sums=('SKIP'
            'c90981405527ebaf153a407af6b8178b41d078bd4472d63b837b3b4cd5ae36b0')

pkgver() {
  cd "roundcubemail"
  git describe --long --tags | sed 's/-\(alpha\|beta\|rc\)/\1/g;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$srcdir"/roundcubemail
  sed -i \
    -e "s|RCUBE_INSTALL_PATH . 'temp.*|'/var/cache/roundcubemail';|" \
    -e "s|RCUBE_INSTALL_PATH . 'logs.*|'/var/log/roundcubemail';|" \
    config/defaults.inc.php \
    program/lib/Roundcube/rcube_config.php

  sed -i 's!"dest": "program/js/tinymce"!"dest": "program/js/tinymce/langs"!' jsdeps.json

}

build(){
  cd "$srcdir"/roundcubemail
  php -d extension=gd.so /usr/bin/composer install --no-dev --ignore-platform-req=ext-gd --ignore-platform-req=ext-iconv
  bin/install-jsdeps.sh
  bin/jsshrink.sh

  cd skins/elastic
  lessc --clean-css="--s1 --advanced" styles/styles.less > styles/styles.min.css
  lessc --clean-css="--s1 --advanced" styles/print.less > styles/print.min.css
  lessc --clean-css="--s1 --advanced" styles/embed.less > styles/embed.min.css

  cd ../..

  bin/updatecss.sh
  bin/cssshrink.sh

  rm -rf tests/ .tx/ .github/

}


package() {
  mkdir -p "$pkgdir"/etc/webapps/roundcubemail
  mkdir -p "$pkgdir"/usr/share/webapps
  cd "$pkgdir"/usr/share/webapps
  cp -ra "$srcdir"/roundcubemail roundcubemail
  cd roundcubemail

  mv .htaccess "$pkgdir"/etc/webapps/roundcubemail/
  ln -s /etc/webapps/roundcubemail/.htaccess .htaccess

  mv config "$pkgdir"/etc/webapps/roundcubemail/
  ln -s /etc/webapps/roundcubemail/config config

  install -Dm0644 "$srcdir"/apache.conf "$pkgdir"/etc/webapps/roundcubemail/apache.conf
  chown http:http "$pkgdir"/etc/webapps/roundcubemail/config/config.inc.php.sample
  chmod 0640 "$pkgdir"/etc/webapps/roundcubemail/config/config.inc.php.sample

  install -dm0750 -o http -g http "$pkgdir"/var/cache/roundcubemail
  install -dm0750 -o http -g http "$pkgdir"/var/log/roundcubemail

  rm -rf temp logs
  find "$pkgdir" -name .git -exec rm -rf {} \; || true

#  sed -i "s|"$srcdir"/roundcubemail/vendor/pear-pear.php.net/Console_CommandLine/data|/usr/share/webapps/roundcubemail/vendor/pear-pear.php.net|g" \
#    vendor/pear-pear.php.net/Console_CommandLine/Console/CommandLine/XmlParser.php

#  sed -i "s|"$srcdir"/roundcubemail|/usr/share/webapps/roundcubemail|g" \
#    vendor/pear-pear.php.net/Crypt_GPG/bin/crypt-gpg-pinentry \
#    vendor/pear-pear.php.net/Crypt_GPG/Crypt/GPG/Engine.php \
#    vendor/pear-pear.php.net/Crypt_GPG/Crypt/GPG/PinEntry.php
}