summaryrefslogtreecommitdiff
path: root/core/heirloom-mailx/PKGBUILD
blob: 028d593a3a91f8ba6ec97d448cf90cf9fc549889 (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
# $Id: PKGBUILD 113975 2011-03-11 00:21:09Z stephane $
# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de>

pkgname=heirloom-mailx
pkgver=12.5
pkgrel=1
pkgdesc="A commandline utility for sending and receiving email"
arch=('i686' 'x86_64')
url="http://heirloom.sourceforge.net/mailx.html"
license=('custom')
groups=('base')
depends=('openssl')
optdepends=('smtp-forwarder: for sending mail')
replaces=('mailx' 'mailx-heirloom')
provides=('mailx' 'mailx-heirloom')
conflicts=('mailx' 'mailx-heirloom')
backup=(etc/mail.rc)
source=(ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}.tar.xz)
sha1sums=('1998dd6168a68400e533712ae7163c72b6a7c056')
options=('!makeflags') # Does not build with MAKEFLAGS=-jX, X>1

# source PKGBUILD && mksource
mksource() {
  export CVSROOT=:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail
  D=nail
  [ -d "${D}" ] && cvs up "${D}" || cvs co "${D}"
  
  _dirname=${pkgname}-${pkgver}
  mv $D ${_dirname}
  tar -cJv --exclude=CVS -f ${_dirname}.tar.xz ${dirname}
  rm -r ${_dirname}
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  sed -i 's|/etc/nail.rc|/etc/mail.rc|g' mailx.1

  # For Linux and BSD, this should be set.
  echo "set bsdcompat" >> nail.rc

  sed -i "s/pg/less/" cmd1.c

  echo PREFIX=/usr \
       MAILRC=/etc/mail.rc \
       SENDMAIL=/usr/sbin/sendmail \
       MAILSPOOL=/var/spool/mail \
       UCBINSTALL=/bin/install > makeflags

  make `cat makeflags` IPv6=-DHAVE_IPv6_FUNCS
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" `cat makeflags` install

  # For compatibility with the old mailx program
  ln -sf mailx "${pkgdir}"/usr/bin/mail
  ln -sf mailx.1.gz "${pkgdir}"/usr/share/man/man1/mail.1.gz

  install -D -m0644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}