nut: some cleanup
[unleashed-userland.git] / components / sysutils / nut / patches / 06-nut-augeas-inst-dir.patch
blobad5e4c69ae3d09e8f46fc19f6ae4155c18f9606c
1 Allow "make install" to properly deliver the augeas lenses files, if configured.
2 Fix posted upstream so this patch should not be needed after nut-2.7.5 or so.
4 diff -Naur nut-2.7.4/configure.ac nut-2.7.4-auginst/configure.ac
5 --- nut-2.7.4/configure.ac 2016-05-02 19:07:03.924039136 +0200
6 +++ nut-2.7.4-auginst/configure.ac 2016-05-03 10:14:10.192735403 +0200
7 @@ -67,6 +67,10 @@
8 driverexecdir='${exec_prefix}/bin'
9 htmldir='${prefix}/html'
10 pkgconfigdir='${libdir}/pkgconfig'
11 +auglensdir='/usr/share/augeas/lenses'
12 +if test ! -d "${auglensdir}"; then
13 + auglensdir=''
14 +fi
15 hotplugdir='/etc/hotplug'
16 if test ! -d "${hotplugdir}"; then
17 hotplugdir=''
18 @@ -1154,6 +1158,34 @@
20 AM_CONDITIONAL(HAVE_SYSTEMD, test "$systemdsystemunitdir" != "")
22 +AC_MSG_CHECKING(whether to install Augeas configuration-management lenses)
23 +AC_ARG_WITH(augeas-lenses-dir,
24 + AS_HELP_STRING([--with-augeas-lenses-dir=PATH], [where to install Augeas configuration-management lenses (/usr/share/augeas/lenses)]),
26 + case "${withval}" in
27 + yes)
28 + if test -z "${auglensdir}"; then
29 + AC_MSG_RESULT(no)
30 + AC_MSG_ERROR(["augeas lenses directory requested but not found"])
31 + fi
32 + ;;
33 + auto)
34 + ;;
35 + no)
36 + auglensdir=""
37 + ;;
38 + *)
39 + auglensdir="${withval}"
40 + ;;
41 + esac
42 +], [])
43 +if test -n "${auglensdir}"; then
44 + AC_MSG_RESULT(using ${auglensdir})
45 +else
46 + AC_MSG_RESULT(no)
47 +fi
48 +AM_CONDITIONAL(WITH_AUGLENS, test -n "${auglensdir}")
50 AC_MSG_CHECKING(whether to install hotplug rules)
51 AC_ARG_WITH(hotplug-dir,
52 AS_HELP_STRING([--with-hotplug-dir=PATH], [where to install hotplug rules (/etc/hotplug)]),
53 @@ -1343,6 +1375,7 @@
54 AC_SUBST(pkgconfigdir)
55 AC_SUBST(systemdsystemunitdir)
56 AC_SUBST(systemdsystemshutdowndir)
57 +AC_SUBST(auglensdir)
58 AC_SUBST(hotplugdir)
59 AC_SUBST(udevdir)
61 diff -Naur nut-2.7.4/Makefile.am nut-2.7.4-auginst/Makefile.am
62 --- nut-2.7.4/Makefile.am 2016-03-09 14:24:11.000000000 +0100
63 +++ nut-2.7.4-auginst/Makefile.am 2016-05-03 10:17:53.804392904 +0200
64 @@ -14,14 +14,15 @@
65 # ----------------------------------------------------------------------
66 # flags to pass to ./configure when calling "make distcheck" and "make
67 # distcheck-light". Try to check as many features as possible! Also
68 -# need to give hotplug-dir and udev-dir, so that staged install does
69 -# not fail.
70 +# need to give augeas-lenses-dir, hotplug-dir and udev-dir, so that
71 +# staged install does not fail.
73 DISTCHECK_FLAGS = --with-all --with-ssl --with-doc=auto
74 DISTCHECK_LIGHT_FLAGS = --with-all=auto --with-ssl=auto --with-doc=auto
76 DISTCHECK_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS} \
77 --with-systemdsystemunitdir='$${prefix}/lib/systemd/system' \
78 + --with-augeas-lenses-dir='$${prefix}/usr/share/augeas/lenses' \
79 --with-hotplug-dir='$${prefix}/etc/hotplug' \
80 --with-udev-dir='$${prefix}/etc/udev' \
81 --with-devd-dir='$${prefix}/etc/devd'
82 diff -Naur nut-2.7.4/scripts/augeas/Makefile.am nut-2.7.4-auginst/scripts/augeas/Makefile.am
83 --- nut-2.7.4/scripts/augeas/Makefile.am 2016-05-03 10:22:23.738243382 +0200
84 +++ nut-2.7.4-auginst/scripts/augeas/Makefile.am 2016-03-09 14:24:11.000000000 +0100
85 @@ -14,3 +14,12 @@
86 echo "Skipping Augeas ups.conf lens regeneration."; \
87 echo "----------------------------------------------------------------------"; \
90 +if WITH_AUGLENS
91 +# Now "make install" should cover delivery of Augeas lenses...
92 +# The "auglensdir" value should be set up by configure
93 +# The *.aug files are generated by rule above or by autogen.sh and/or configure
94 + auglens_DATA = \
95 + nuthostsconf.aug nutupsconf.aug nutupsdusers.aug nutupsschedconf.aug \
96 + nutnutconf.aug nutupsdconf.aug nutupsmonconf.aug nutupssetconf.aug
97 +endif