aboutsummaryrefslogtreecommitdiff
path: root/net/avahi-app/Makefile
blob: 9914a245e9231f7879a8feaf65267c9565125745 (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
PORTNAME=	avahi
PORTVERSION=	0.8
PORTREVISION?=	2	# don't delete, reset to 0, check slave ports
CATEGORIES?=	net dns
MASTER_SITES=	http://www.avahi.org/download/
PKGNAMESUFFIX?=	-app

MAINTAINER?=	desktop@FreeBSD.org
COMMENT?=	Service discovery on a local network
WWW=		https://www.avahi.org/

LICENSE=	LGPL21+
LICENSE_FILE=	${WRKSRC}/LICENSE

AVAHI_SLAVE?=	no

.if ${AVAHI_SLAVE} != header
LIB_DEPENDS?=	libexpat.so:textproc/expat2 \
		libdaemon.so:devel/libdaemon \
		libdbus-glib-1.so:devel/dbus-glib \
		libdbus-1.so:devel/dbus \
		libgdbm.so:databases/gdbm \
		libevent.so:devel/libevent

USERS?=		${PORTNAME}
GROUPS?=	${USERS}

USES+=		alias cpe gettext gmake gnome libtool pathfix pkgconfig
USE_GNOME+=	glib20 intltool introspection:build
USE_GNOME_SUBR=	yes
USE_LDCONFIG=	yes
GNU_CONFIGURE=	yes
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
CONFIGURE_ARGS?=--with-distro=freebsd \
		--with-dbus-system-socket=unix:path=/var/run/dbus/system_bus_socket \
		--enable-introspection=yes \
		--disable-static \
		--disable-monodoc \
		--disable-doxygen-doc \
		--disable-doxygen-dot \
		--disable-qt3 \
		--disable-qt4 \
		--localstatedir=/var \
		--enable-compat-howl
CPPFLAGS+=	-I${LOCALBASE}/include -DHAVE_KQUEUE
LDFLAGS+=	-L${LOCALBASE}/lib -lintl
INSTALL_TARGET=	install-strip

.if ${AVAHI_SLAVE} == no
CONFLICTS=	howl

DAEMON_CONFIG_FILES=	hosts avahi-daemon.conf
.endif
.endif # !avahi-header

.include <bsd.port.options.mk>

.if ${AVAHI_SLAVE} != header
.if ${AVAHI_SLAVE} == autoipd
CONFIGURE_ARGS+=--enable-autoipd
.else
CONFIGURE_ARGS+=--disable-autoipd
.endif
.if ${AVAHI_SLAVE} == gtk
# We disable man pages, because bssh.1 is not generated (no xmltoman port)
CONFIGURE_ARGS+=--enable-gtk \
		--disable-manpages
.else
CONFIGURE_ARGS+=--disable-gtk
.endif
.if ${AVAHI_SLAVE} == gtk3
CONFIGURE_ARGS+=--enable-gtk3
.else
CONFIGURE_ARGS+=--disable-gtk3
.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} == qt5
CONFIGURE_ARGS+=--enable-qt5 \
		--disable-expat \
		--disable-gdbm
.else
CONFIGURE_ARGS+=--disable-qt5
.endif
.if ${AVAHI_SLAVE} == sharp
CONFIGURE_ARGS+=--enable-mono
.else
CONFIGURE_ARGS+=--disable-mono
.endif
CONFIGURE_ARGS+=--disable-stack-protector

post-patch: avahi-post-patch

avahi-post-patch:
	@${REINPLACE_CMD} -e 's|avahi_runtime_dir="/run"|avahi_runtime_dir="/var/run"|' \
		${WRKSRC}/configure
	@${RM} ${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|have_inotify=yes|have_inotify=no|' \
		${WRKSRC}/configure
	@${REINPLACE_CMD} -e '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} ${MAKE_CMD} \
		${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${f}
.endfor

pre-su-install: avahi-pre-su-install

avahi-pre-su-install:
.if ${AVAHI_SLAVE}=="no"
	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/avahi
	@${TOUCH} -f ${STAGEDIR}${PREFIX}/lib/avahi/.keep
.endif

post-install: avahi-post-install

avahi-post-install:
.if defined(MANPAGES) && ${AVAHI_SLAVE} != gtk
.for f in ${MANPAGES}
	${INSTALL_DATA} ${WRKSRC}/man/${f} ${STAGEDIR}${PREFIX}/share/man/man${f:E}/${f}
.endfor
.endif
.for f in ${AVAHI_PKGCONFIG}
	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${PREFIX}/libdata/pkgconfig
.endfor
.for f in ${DAEMON_CONFIG_FILES}
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/avahi
	${INSTALL_DATA} ${WRKSRC}/avahi-daemon/${f} \
		${STAGEDIR}${PREFIX}/etc/avahi/${f}.sample
.endfor
.if ${AVAHI_SLAVE}==no
	${MKDIR} ${STAGEDIR}${PREFIX}/share/dbus-1/system-services
	${INSTALL_DATA} ${WRKSRC}/avahi-daemon/org.freedesktop.Avahi.service \
		${STAGEDIR}${PREFIX}/share/dbus-1/system-services
.endif
.endif # ! avahi-header

.include <bsd.port.mk>