iprutils: Add option to enable/disable systemd files from configure script.

Allow users to disable systemd support in iprutils for distros that
don't support it.  One can run ../configure --without-systemd to avoid
building the service files.

The default behavior is to build systemd files (--with-systemd) and they
will be installed into %{prefix}/usr/lib/systemd/system/. But path can
be overriden using --with-systemd=<path>.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This commit is contained in:
Gabriel Krisman Bertazi 2015-07-14 12:47:15 -03:00 committed by Brian King
commit 84fbaf7c3d
3 changed files with 29 additions and 4 deletions

View file

@ -43,7 +43,11 @@ dist_noinst_DATA = LICENSE
bashcompdir = ${sysconfdir}/bash_completion.d
dist_bashcomp_DATA = iprconfig-bash-completion.sh
SUBDIRS = . systemd init.d spec
SUBDIRS = . init.d spec
if SYSTEMD
SUBDIRS += systemd
endif
if SOSREPORT
sosreportdir = @pythondir@/sos/plugins

View file

@ -55,6 +55,25 @@ AC_ARG_ENABLE([sosreport],
esac], [sosreport=true])
AM_CONDITIONAL([SOSREPORT], [test "x${sosreport}" = xtrue])
# --with-systemd
systemdunitdir='${exec_prefix}/usr/lib/systemd/system/'
AC_ARG_WITH([systemd],
[--without-systemd Disable systemd service files.],
[case $withval in
yes)
systemd=true;
;;
no)
systemd=false;
;;
*)
systemd=true;
systemdunitdir="$withval"
;;
esac], [systemd=true])
AM_CONDITIONAL([SYSTEMD], [test "x${systemd}" = xtrue])
AC_SUBST(systemdunitdir, ${systemdunitdir})
## Check for python if building with sosreport.
if test "x${SOSREPORT_TRUE}" = "x"; then
AM_PATH_PYTHON([2.6])

View file

@ -11,10 +11,12 @@
%.service: %.service.in
sed -e 's,[@]sbindir[@],$(sbindir),g' < $< > $@
nodist_pkgdata_DATA = iprdump.service \
systemdunitdir = @systemdunitdir@
nodist_systemdunit_DATA = iprdump.service \
iprinit.service iprupdate.service
dist_pkgdata_DATA = iprdump.service.in \
EXTRA_DIST = iprdump.service.in \
iprinit.service.in iprupdate.service.in
clean-local:
rm iprdump.service iprinit.service iprupdate.service
-rm iprdump.service iprinit.service iprupdate.service