Merge from vendor branch TNF:
[pkgsrc.git] / security / stunnel / Makefile
1 # $NetBSD: Makefile,v 1.69 2010/01/20 14:46:17 wiz Exp $
2
3 DISTNAME=               stunnel-4.33
4 CATEGORIES=             security
5 MASTER_SITES=           ftp://stunnel.mirt.net/stunnel/ \
6                         http://www.stunnel.org/download/stunnel/src/
7
8 MAINTAINER=             shaun@inerd.com
9 HOMEPAGE=               http://www.stunnel.org/
10 COMMENT=                Universal SSL tunnel
11 LICENSE=                gnu-gpl-v2
12
13 PKG_DESTDIR_SUPPORT=    user-destdir
14
15 BUILD_DEFS+=            VARBASE
16 USE_LIBTOOL=            yes
17 GNU_CONFIGURE=          yes
18 CONFIGURE_ARGS+=        --localstatedir=${VARBASE}
19 CONFIGURE_ARGS+=        --sysconfdir=${PKG_SYSCONFDIR}
20 CONFIGURE_ARGS+=        --with-cert-dir=${SSLCERTS:Q}
21 CONFIGURE_ARGS+=        --with-pem-dir=${SSLCERTS:Q}
22 CONFIGURE_ARGS+=        --with-ssl=${SSLBASE:Q}
23
24 STUNNEL_USER?=          stunnel
25 STUNNEL_GROUP?=         stunnel
26 PKG_HOME?=              ${VARBASE}/chroot/stunnel
27 PKG_USERS=              ${STUNNEL_USER}:${STUNNEL_GROUP}::Stunnel:${PKG_HOME}
28 PKG_GROUPS=             ${STUNNEL_GROUP}
29 USER_GROUP=             ${STUNNEL_USER} ${STUNNEL_GROUP}
30
31 PKG_SYSCONFSUBDIR=      stunnel
32 PKG_SYSCONFDIR_PERMS=   ${USER_GROUP} 0700
33
34 OWN_DIRS_PERMS=         ${PKG_HOME} ${USER_GROUP} 0700
35 CONF_FILES_PERMS+=      ${PREFIX}/share/examples/stunnel/stunnel.conf-sample \
36                             ${PKG_SYSCONFDIR}/stunnel.conf ${USER_GROUP} 0644
37
38 RCD_SCRIPTS=            stunnel
39
40 REPLACE_PERL+=          src/stunnel3.in
41 USE_TOOLS+=             perl:run
42
43 SUBST_CLASSES+=         chroot
44 SUBST_MESSAGE.chroot=   Fix chroot path
45 SUBST_STAGE.chroot=     pre-configure
46 SUBST_FILES.chroot=     tools/stunnel.conf-sample.in
47 SUBST_SED.chroot+=      -e 's|@prefix@/var/lib|@localstatedir@/chroot|'
48
49 SUBST_CLASSES+=         stunnel
50 SUBST_MESSAGE.stunnel=  Fix user and group
51 SUBST_STAGE.stunnel=    post-configure
52 SUBST_FILES.stunnel=    tools/stunnel.conf-sample
53 SUBST_SED.stunnel=      -e 's|setuid = nobody|setuid = ${STUNNEL_USER}|'
54 SUBST_SED.stunnel+=     -e 's|setgid = nogroup|setgid = ${STUNNEL_GROUP}|'
55
56 .include "options.mk"
57
58 .include "../../security/openssl/buildlink3.mk"
59 .include "../../mk/bsd.pkg.mk"