summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8981154ba0336d0ccdacfa0acb9f5d90ae76a72e (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
# Maintainer: Gavin Troy <gavtroy@fastmail.fm>
# Based on heirloom-mailx PKGBUILD

pkgname=s-nail-git
pkgver=14.8.6_x12_g778f90c
pkgrel=1
pkgdesc="Commandline utility for sending and receiving email"
arch=('i686' 'x86_64')
url="https://www.sdaoden.eu/code.html#s-nail"
license=('custom:BSD')
depends=('krb5' 'libidn' 'openssl')
makedepends=('git')
optdepends=('smtp-forwarder: alternatives for sending mail')
provides=('mailx' 'heirloom-mailx')
conflicts=('mailx' 'heirloom-mailx')
backup=('etc/mail.rc')
source=("git+https://git.sdaoden.eu/scm/s-nail.git")
sha1sums=('SKIP')

pkgver() {
	cd s-nail
	# pacman treats "_" like a ".", so use "_x" to seperate the git tag.
	# otherwise pacman may think XX.Y_git to XX.Y.Z_git is a downgrade
	gitver=$(git describe --tags | cut -c 2-)
	gitver=${gitver//-/_}; echo ${gitver/_/_x}
}

build() {
	cd s-nail
	CFLAGS+=" $CPPFLAGS"

	if check_option "debug" "y"; then
		config_target="CONFIG=DEVEL"
	fi

	make PREFIX=/usr \
	     SYSCONFDIR=/etc \
	     SYSCONFRC=mail.rc \
	     LIBEXECDIR=/usr/lib \
	     MAILSPOOL=/var/spool/mail \
	     WANT_AUTOCC=0 \
	     ${config_target:-} \
	     config

	make -f mk.mk _update-version

	make build
}

package() {
	cd s-nail
	make DESTDIR="${pkgdir}" chown=/usr/bin/true packager-install

	ln -sf s-nail "${pkgdir}"/usr/bin/mail
	ln -sf s-nail "${pkgdir}"/usr/bin/mailx
	ln -sf s-nail.1.gz "${pkgdir}"/usr/share/man/man1/mail.1.gz
	ln -sf s-nail.1.gz "${pkgdir}"/usr/share/man/man1/mailx.1.gz

	install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/COPYING
}