echo $(VERSION) > $(distdir)/.dist-version
MOSTLYCLEANFILES = $(DX_CLEANFILES)
+
+# systemd and launchd files are not installed in the prefix, don't
+# request them for distcheck
+DISTCHECK_CONFIGURE_FLAGS = \
+ --with-systemdsystemunitdir=no \
+ --with-launchddaemonsdir=no
fi
# OS X launchd support
-lldp_ARG_WITH([launchd-daemons-path], [Directory for launchd configuration file (OSX)], [/Library/LaunchDaemons])
+lldp_ARG_WITH([launchddaemonsdir], [Directory for launchd configuration file (OSX)],
+ [/Library/LaunchDaemons])
+AC_SUBST([launchddaemonsdir], [$with_launchddaemonsdir])
+AM_CONDITIONAL(HAVE_LAUNCHDDAEMONSDIR,
+ [test -n "$with_launchddaemonsdir" -a "x$with_launchddaemonsdir" != xno ])
# Systemd
lldp_ARG_WITH([systemdsystemunitdir], [Directory for systemd service files],
- [$($PKG_CONFIG --variable=systemdsystemunitdir systemd || echo no)])
+ [$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMDSYSTEMUNITDIR,
+ [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
# Privsep settings
lldp_ARG_WITH([privsep-user], [Which user to use for privilege separation], [_lldpd])
include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/class/autotools.mk
-DEB_CONFIGURE_EXTRA_FLAGS = --with-snmp --with-xml
+DEB_CONFIGURE_EXTRA_FLAGS = --with-snmp --with-xml --with-systemdsystemunitdir=/lib/systemd/system
AC_SUBST(AS_TR_CPP([$1]), [$withval])],[
AC_DEFINE_UNQUOTED(AS_TR_CPP([$1]), ["$3"], [$2])
AC_SUBST(AS_TR_CPP([$1]), [$3])
+ eval with_[]m4_translit([$1], [-+.], [___]))="$3"
])])
dnl lldp_ARG_ENABLE(name, help1, default)
touch $@
# Install launchd plist
-install-data-local:
- [ x"@LAUNCHD_DAEMONS_PATH@" = x"no" ] || install -m 0755 -d $(DESTDIR)@LAUNCHD_DAEMONS_PATH@
- [ x"@LAUNCHD_DAEMONS_PATH@" = x"no" ] || install -m 0644 im.bernat.lldpd.plist $(DESTDIR)@LAUNCHD_DAEMONS_PATH@
-uninstall-local:
- [ x"@LAUNCHD_DAEMONS_PATH@" = x"no" ] || rm -f $(DESTDIR)@LAUNCHD_DAEMONS_PATH@/im.bernat.lldpd.plist
-clean-local:
- rm -rf $(ARCHS)
- rm -rf $(PKG_DIR)
- rm -f stamp-*
- rm -rf pkg.1
- rm -f ../$(PKG_NAME)
+if HAVE_LAUNCHDDAEMONSDIR
+launchddaemons_DATA = im.bernat.lldpd.plist
+endif
.PHONY: pkg requirements
endif
## systemd service file
-install-data-local:
- [ x"@SYSTEMDSYSTEMUNITDIR@" = x"no" ] || install -m 0755 -d $(DESTDIR)@SYSTEMDSYSTEMUNITDIR@
- [ x"@SYSTEMDSYSTEMUNITDIR@" = x"no" ] || install -m 0644 -d lldpd.service $(DESTDIR)@SYSTEMDSYSTEMUNITDIR@
-uninstall-local:
- [ x"@LAUNCHD_DAEMONS_PATH@" = x"no" ] || rm -f $(DESTDIR)@SYSTEMDSYSTEMUNITDIR@/lldpd.service
+if HAVE_SYSTEMDSYSTEMUNITDIR
+systemdsystemunit_DATA = lldpd.service
+endif