summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d0e07dfca68cf54535c80bce94b34125ff1d918c (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
# $Id: PKGBUILD 140402 2011-10-12 20:25:08Z eric $
# Maintainer: Paul Mattal <paul@archlinux.org>
# Contributor: Manolis Tzanidakis <manolis@archlinux.org>

pkgname=squirrelmail
pkgver=1.4.22
pkgrel=2
pkgdesc="Webmail for Nuts!"
arch=('any')
license=('GPL')
url="http://www.squirrelmail.org"
depends=('php' 'perl' 'imap-server')
backup=(srv/http/squirrelmail/.htaccess srv/http/squirrelmail/config/config.php)
install=$pkgname.install
source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-webmail-$pkgver.tar.bz2)
sha1sums=('46819275be27e9119e9a2fd976d441cee261ea55')

package() {
  # install
  mkdir -p "$pkgdir"/srv/http/squirrelmail
  cd "$pkgdir"/srv/http/squirrelmail
  cp -a "$srcdir"/squirrelmail-webmail-$pkgver/* .

  # remove CVS dirs
  find "$pkgdir" -type d -name CVS -exec rm -rf {} \;

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

  # 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 "$pkgdir"/var/lib/squirrelmail/{data,attachments}
  chown -R http:http "$pkgdir"/var/lib/squirrelmail/data
   
  chown -R http:http "$pkgdir"/var/lib/squirrelmail/attachments
   
  chmod 0700 "$pkgdir"/var/lib/squirrelmail/data
  chmod 0300 "$pkgdir"/var/lib/squirrelmail/attachments

  # restrict access to squirrelmail by default
  echo "deny from all" >"$pkgdir"/srv/http/squirrelmail/.htaccess
}

# vim: ts=2 sw=2 et ft=sh