### this file is sourced not run
PKGVER=2.11.0beta2
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=opendkim-$PKGVER.tar.gz
MD5SUM=0be899116b3246fc8a1ed42671ba005b
SRC_URL=https://github.com/trusteddomainproject/OpenDKIM/archive/rel-opendkim-2-11-0-Beta2.tar.gz
BUNDLE=

SLACKREQ='openssl libbsd' # libmilter build-time only since we link it statically
SLACKDESC="opendkim: opendkim $PKGVER (DKIM service and library)
opendkim: 
opendkim: OpenDKIM is a community effort to develop and maintain a C library 
opendkim: for producing DKIM-aware applications and an open source milter for 
opendkim: providing DKIM service. DKIM is Domain Keys Identified Mail 
opendkim: authentication system.
opendkim: 
opendkim: http://www.opendkim.org/
opendkim: https://github.com/trusteddomainproject/OpenDKIM
opendkim: 
opendkim: 
"
SLACKINSTALL='
! grep -q opendkim ./etc/passwd && adduser -D opendkim
' # needed for operation by init-script

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/*dkim* &&

	# link statically 
	rm -f /usr/$LIBDIR/libmilter.so* &&
	
	# only look for milter in lib64
	sed -i -e 's|for d in lib lib64 lib/libmilter|for d in lib64|' configure.ac &&
	
	autoreconf -fi &&
	CONFFLAGS="$CONFFLAGS --disable-static" &&
	pkg_build_autoconf &&
	pkg_build_slackdesc &&

	# install init script
	install -m644 contrib/init/generic/opendkim /etc/init.d/99-opendkim &&
	sed -i -e 's|PATH=.*|PATH=/usr/bin:/usr/sbin:/bin:/sbin|' /etc/init.d/99-opendkim &&

	# sample config
	mv /usr/share/doc/opendkim/opendkim.conf.sample /etc &&
	true
}


