aboutsummaryrefslogtreecommitdiffstats
path: root/net/netatalk3/Makefile
blob: f6d0610ed4c2001ebe87a75f35c00c1b5ce074cf (plain) (blame)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Created by: stb
# $FreeBSD$

PORTNAME=   netatalk
PORTVERSION=    3.1.1
PORTEPOCH=  1
CATEGORIES= net
MASTER_SITES=   SF
#MASTER_SITE_SUBDIR=${PORTNAME}/${PORTNAME}/3.1
PKGNAMESUFFIX=  3

MAINTAINER= marcus@FreeBSD.org
COMMENT=    File server for Mac OS X

LICENSE=    GPLv2

LIB_DEPENDS=    libgcrypt.so:${PORTSDIR}/security/libgcrypt \
            libevent-2.0.so:${PORTSDIR}/devel/libevent2

USE_AUTOTOOLS=  libtool
USE_BDB=    5+
USE_BZIP2=  yes
USES=       iconv gmake pkgconfig perl5
GNU_CONFIGURE=  yes
USE_LDCONFIG=   yes
USE_RC_SUBR=    netatalk

CONFIGURE_ARGS+=    --enable-tcp-wrappers \
            --with-pkgconfdir=${PREFIX}/etc \
            --with-libgcrypt-dir=${LOCALBASE} \
            --with-uams-path=${PREFIX}/libexec/netatalk-uams \
            --with-bdb=${LOCALBASE} \
            ${ICONV_CONFIGURE_BASE} \
            --localstatedir=/var \
            --disable-bundled-libevent \
            --with-libevent-header=${LOCALBASE}/include \
            --with-libevent-lib=${LOCALBASE}/lib/event2

OPTIONS_DEFINE=PAM KRB5 LDAP SENDFILE KERBEROS DTRACE DBUS MYSQL ACL
OPTIONS_DEFAULT=KERBEROS DBUS
OPTIONS_RADIO=ZEROCONF
OPTIONS_RADIO_ZEROCONF=AVAHI MDNSRESPONDER
OPTIONS_DEFAULT+=AVAHI

NOZEROCONF_DESC=Disable Zeroconf(Bonjour) support
KRB5_DESC=  Enable Kerberos V UAM
DTRACE_DESC=    Enable DTrace support
MYSQL_DESC= Enable MySQL CNID backend support
SENDFILE_DESC=  Enable Sendfile support
ACL_DESC=   Enable ACL support

.include <bsd.port.options.mk>

CONFLICTS=  bigloo-2.* cap-6.0.* tct-1.* netatalk-[12]* yudit-[0-9]*

.if ${PORT_OPTIONS:MKRB5}
CONFIGURE_ARGS+=    --enable-krbV-uam
PLIST_SUB+=     NETATALKKRB5=""
.else
PLIST_SUB+=     NETATALKKRB5="@comment "
.endif

.if ${PORT_OPTIONS:MDTRACE}
CONFIGURE_ARGS+=    --with-dtrace
.else
CONFIGURE_ARGS+=    --without-dtrace
.endif

.if ${PORT_OPTIONS:MKERBEROS}
CONFIGURE_ARGS+=    --with-kerberos
.else
CONFIGURE_ARGS+=    --without-kerberos
.endif

.if ${PORT_OPTIONS:MPAM}
CONFIGURE_ARGS+=    --with-pam
PLIST_SUB+=     NETATALKPAM=""
.else
CONFIGURE_ARGS+=    --without-pam
PLIST_SUB+=     NETATALKPAM="@comment "
.endif

.if ${PORT_OPTIONS:MNOZEROCONF}
CONFIGURE_ARGS+=    --disable-zeroconf
SUB_LIST+=      ZEROCONF=""
.endif

.if ${PORT_OPTIONS:MAVAHI}
CONFIGURE_ARGS+=    --enable-zeroconf=${LOCALBASE}
CFLAGS+=        -I${LOCALBASE}/include -L${LOCALBASE}/lib
LIB_DEPENDS+=       libavahi-client.so:${PORTSDIR}/net/avahi-app
SUB_LIST+=      ZEROCONF="avahi_daemon"
.endif

.if ${PORT_OPTIONS:MMDNSRESPONDER}
CONFIGURE_ARGS+=    --enable-zeroconf=${LOCALBASE}
CFLAGS+=        -I${LOCALBASE}/include -L${LOCALBASE}/lib
LIB_DEPENDS+=       libdns_sd.so:${PORTSDIR}/net/mDNSResponder
SUB_LIST+=      ZEROCONF="mdnsd"
.endif

.if ${PORT_OPTIONS:MLDAP}
CONFIGURE_ARGS+=    --with-ldap=${LOCALBASE}
CFLAGS+=        -I${LOCALBASE}/include -L${LOCALBASE}/lib
USE_OPENLDAP=       yes
.else
CONFIGURE_ARGS+=    --without-ldap
.endif

.if ${PORT_OPTIONS:MSENDFILE}
CONFIGURE_ARGS+=    --enable-sendfile
.else
CONFIGURE_ARGS+=    --disable-sendfile
.endif

.if ${PORT_OPTIONS:MDBUS} || exists(${LOCALBASE}/libdata/pkgconfig/dbus-glib-1.pc)
LIB_DEPENDS+=       libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib
RUN_DEPENDS+=       ${LOCALBASE}/libdata/pkgconfig/dbus-python.pc:${PORTSDIR}/devel/py-dbus
PLIST_SUB+=     DBUS=""
.else
PLIST_SUB+=     DBUS="@comment "
.endif

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=  yes
.else
CONFIGURE_ARGS+=--with-mysql-config=/nonexistent
.endif

.if ${PORT_OPTIONS:MACL}
LIB_DEPENDS+=   libsunacl.so:${PORTSDIR}/sysutils/libsunacl
CONFIGURE_ARGS+=--with-acls
.else
CONFIGURE_ARGS+=--without-acls
.endif

.if ${OSVERSION} < 800031
PLIST_SUB+= ATFUNCS="@comment "
.else
PLIST_SUB+= ATFUNCS=""
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|%%DB_NAME%%|${BDB_INCLUDE_DIR:T}| ; \
            s|%%DB_LIB%%|-l${BDB_LIB_NAME}|g ; \
        s|%%LOCALBASE%%|${LOCALBASE}|g' \
        ${WRKSRC}/configure

post-install:
    ${INSTALL_SCRIPT} ${WRKSRC}/contrib/macusers/macusers \
        ${STAGEDIR}${PREFIX}/bin/macusers
    [ -f ${STAGEDIR}${PREFIX}/etc/afp.conf ] || \
        ${INSTALL_DATA} -c ${STAGEDIR}${PREFIX}/etc/afp.conf.dist ${STAGEDIR}${PREFIX}/etc/afp.conf
    [ -f ${STAGEDIR}${PREFIX}/etc/extmap.conf ] || \
        ${INSTALL_DATA} -c ${STAGEDIR}${PREFIX}/etc/extmap.conf.dist ${STAGEDIR}${PREFIX}/etc/extmap.conf
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>