summaryrefslogtreecommitdiffstats
path: root/net/avahi-app/Makefile
blob: f3d8094a7acf13f8afc3677f2966b7b279789da3 (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
# New ports collection makefile for:    avahi
# Date created:     18 November 2005
# Whom:         Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
#   $MCom: ports/net/avahi-app/Makefile,v 1.5 2007/08/16 01:41:00 marcus Exp $
#

PORTNAME=   avahi
PORTVERSION=    0.6.21
PORTREVISION?=  1
CATEGORIES?=    net dns
MASTER_SITES=   http://www.avahi.org/download/
PKGNAMESUFFIX?= -app

MAINTAINER?=    gnome@FreeBSD.org
COMMENT?=   Service discovery on a local network

LIB_DEPENDS?=   expat.6:${PORTSDIR}/textproc/expat2 \
        daemon.0:${PORTSDIR}/devel/libdaemon \
        dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib \
        gdbm.3:${PORTSDIR}/databases/gdbm

USE_GNOME?= gnomehack ltverhack glib20
USE_GNOME_SUBR= yes
USE_GMAKE=  yes
USE_AUTOTOOLS=  libtool:15
USE_LDCONFIG=   yes
USE_GETOPT_LONG=yes
AVAHI_SLAVE?=   no
CONFIGURE_ARGS?=--with-distro=freebsd \
        --with-dbus-system-address=unix:path=/var/run/dbus/system_bus_socket \
        --disable-monodoc \
        --disable-doxygen-doc \
        --disable-doxygen-dot \
        --localstatedir=/var \
        --enable-compat-howl
CONFIGURE_ENV=  CPPFLAGS="-I${LOCALBASE}/include -DHAVE_KQUEUE" \
        LDFLAGS="-L${LOCALBASE}/lib" \
        PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
        PTHREAD_LIBS="${PTHREAD_LIBS}"

.if ${AVAHI_SLAVE}=="no"
CONFLICTS=  howl-[0-9]*

MAN1=   avahi-browse.1 avahi-publish.1 avahi-resolve.1 avahi-set-host-name.1
MAN5=   avahi-daemon.conf.5 avahi.service.5 avahi.hosts.5
MAN8=   avahi-daemon.8 avahi-dnsconfd.8 avahi-dnsconfd.action.8

MLINKS= avahi-browse.1 avahi-browse-domains.1 \
    avahi-publish.1 avahi-publish-address.1 \
    avahi-publish.1 avahi-publish-service.1 \
    avahi-resolve.1 avahi-resolve-address.1 \
    avahi-resolve.1 avahi-resolve-host-name.1
.endif

USE_RC_SUBR=yes

.include <bsd.port.pre.mk>

.if ${AVAHI_SLAVE}=="autoipd"
CONFIGURE_ARGS+=--enable-autoipd
.else
CONFIGURE_ARGS+=--disable-autoipd
.endif
.if ${AVAHI_SLAVE}=="gtk"
CONFIGURE_ARGS+=--enable-gtk
.else
CONFIGURE_ARGS+=--disable-gtk
.endif
.if ${AVAHI_SLAVE}=="libdns"
CONFIGURE_ARGS+=--enable-compat-libdns_sd
.else
CONFIGURE_ARGS+=--disable-compat-libdns_sd
.endif
.if ${AVAHI_SLAVE}=="python"
CONFIGURE_ARGS+=--enable-python
.else
CONFIGURE_ARGS+=--disable-python
.endif
.if ${AVAHI_SLAVE}=="qt3"
CONFIGURE_ARGS+=--enable-qt3
.else
CONFIGURE_ARGS+=--disable-qt3
.endif
.if ${AVAHI_SLAVE}=="qt4"
CONFIGURE_ARGS+=--enable-qt4
.else
CONFIGURE_ARGS+=--disable-qt4
.endif
.if ${AVAHI_SLAVE}=="sharp"
CONFIGURE_ARGS+=--enable-mono
.else
CONFIGURE_ARGS+=--disable-mono
.endif

post-patch: avahi-post-patch

avahi-post-patch:
    @${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|' \
        ${WRKSRC}/man/*.*
    @${RM} -f ${WRKSRC}/man/*.bak
    @${REINPLACE_CMD} -e 's|-ldl||g ; s|netdev|network|g' \
        ${WRKSRC}/configure \
        ${WRKSRC}/avahi-client/Makefile.in \
        ${WRKSRC}/avahi-daemon/Makefile.in
    @${REINPLACE_CMD} -e 's|%%RC_SUBR%%|${RC_SUBR}| ; \
            s|%%GNOME_SUBR%%|${GNOME_SUBR}|' \
        ${WRKSRC}/initscript/freebsd/avahi-dnsconfd.sh.in \
        ${WRKSRC}/initscript/freebsd/avahi-daemon.sh.in

post-build: avahi-post-build

avahi-post-build:
.for f in ${AVAHI_PKGCONFIG}
    @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} \
        ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${f}
.endfor

post-install: avahi-post-install

avahi-post-install:
.if ${AVAHI_SLAVE}!="no"
.for f in ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8} ${MAN9}
    ${INSTALL_DATA} ${WRKSRC}/man/${f} ${PREFIX}/man/man${f:E}/${f}
.endfor
.endif
.for f in ${AVAHI_PKGCONFIG}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/libdata/pkgconfig
.endfor
.if !defined(PACKAGE_BUILDING) && (${AVAHI_SLAVE}=="no" || ${AVAHI_SLAVE}=="autoipd")
    @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.endif

.include <bsd.port.post.mk>