summaryrefslogtreecommitdiff
path: root/extra/squirrelmail/PKGBUILD
blob: dcdb822f59f711c686c93641cee15fda910d224e (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
# $Id: PKGBUILD 71649 2010-03-07 23:43:31Z paul $
# Maintainer: Paul Mattal <paul@archlinux.org>
# Contributor: Manolis Tzanidakis <manolis@archlinux.org>

pkgname=squirrelmail
pkgver=1.4.20
pkgrel=1
pkgdesc="Webmail for Nuts!"
arch=(i686 x86_64)
license=('GPL')
url="http://www.squirrelmail.org"
depends=('php' 'perl' 'imap-server')
makedepends=('findutils')
backup=(srv/http/squirrelmail/.htaccess srv/http/squirrelmail/config/config.php)
install=$pkgname.install
source=(http://superb-sea2.dl.sf.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('60ffedc61b295650c7695c2b74209294')

build() {
  # install
  mkdir -p $startdir/pkg/srv/http/squirrelmail || return 1
  cd $startdir/pkg/srv/http/squirrelmail || return 1
  cp -a $startdir/src/squirrelmail-$pkgver/* . || return 1

  # remove CVS dirs
  find $startdir/pkg -type d -name CVS -exec rm -rf {} \; || return 1

  # customize config (data and attachments in /var/lib/squirrelmail)
  cd config || return 1
  cp -p config_default.php config.php || return 1
  sed -i 's|^$attachment_dir = $data_dir;|$attachment_dir = "/var/lib/squirrelmail/attachments";|' config.php || return 1
  sed -i 's|^$data_dir = "/var/local/squirrelmail/data";|$data_dir = "/var/lib/squirrelmail/data";|' config.php || return 1

  # create data and attachments directories, set ownership/permissions
  # ideally we would set attachments differently to root:-1 with 0730, but
  # I don't know how to get chgrp to take "-1" properly; perhaps someday
  # I'll figure out how to make this work
  mkdir -p $startdir/pkg/var/lib/squirrelmail/{data,attachments} || return 1
  chown -R http:http $startdir/pkg/var/lib/squirrelmail/data \
    || return 1
  chown -R http:http $startdir/pkg/var/lib/squirrelmail/attachments \
    || return 1
  chmod 0700 $startdir/pkg/var/lib/squirrelmail/data || return 1
  chmod 0300 $startdir/pkg/var/lib/squirrelmail/attachments || return 1

  # restrict access to squirrelmail by default
  echo "deny from all" >$startdir/pkg/srv/http/squirrelmail/.htaccess \
    || return 1
}
# vim: ts=2 sw=2 et ft=sh