diff options
-rw-r--r-- | metadata/accounts/groups/nut.conf | 1 | ||||
-rw-r--r-- | metadata/accounts/users/nut.conf | 6 | ||||
-rw-r--r-- | metadata/categories.conf | 1 | ||||
-rw-r--r-- | metadata/repository_mask.conf | 3 | ||||
-rw-r--r-- | packages/sys-power/nut/files/autogen.patch | 16 | ||||
-rw-r--r-- | packages/sys-power/nut/nut-2.7.4.exheres-0 | 7 | ||||
-rw-r--r-- | packages/sys-power/nut/nut-scm.exheres-0 | 7 | ||||
-rw-r--r-- | packages/sys-power/nut/nut.exlib | 82 |
8 files changed, 122 insertions, 1 deletions
diff --git a/metadata/accounts/groups/nut.conf b/metadata/accounts/groups/nut.conf new file mode 100644 index 0000000..d0b8d11 --- /dev/null +++ b/metadata/accounts/groups/nut.conf @@ -0,0 +1 @@ +preferred_gid = 84 diff --git a/metadata/accounts/users/nut.conf b/metadata/accounts/users/nut.conf new file mode 100644 index 0000000..a42f2c4 --- /dev/null +++ b/metadata/accounts/users/nut.conf @@ -0,0 +1,6 @@ +pecos = NUT daemon user +home = /var/lib/nut +shell = /sbin/nologin +primary_group = nut +extra_groups = uucp +preferred_uid = 84 diff --git a/metadata/categories.conf b/metadata/categories.conf index c940789..6d36be6 100644 --- a/metadata/categories.conf +++ b/metadata/categories.conf @@ -12,3 +12,4 @@ net-print net-vpn sys-block sys-devel +sys-power diff --git a/metadata/repository_mask.conf b/metadata/repository_mask.conf index c75c5a4..11cb760 100644 --- a/metadata/repository_mask.conf +++ b/metadata/repository_mask.conf @@ -10,9 +10,10 @@ ( net-libs/stem[~scm] + sys-power/nut[~scm] ) [[ - *date = [ 9 Jul 2018 ] + *date = [ 14 Aug 2018 ] *token = scm *description = [ Mask scm version ] ]] diff --git a/packages/sys-power/nut/files/autogen.patch b/packages/sys-power/nut/files/autogen.patch new file mode 100644 index 0000000..c973ef2 --- /dev/null +++ b/packages/sys-power/nut/files/autogen.patch @@ -0,0 +1,16 @@ +Source: written by Gluzskiy Alexandr <sss@sss.chaoslab.ru> +Reason: do not run autoreconf twice +Upstream: not required + + +diff --git a/autogen.sh b/autogen.sh +index 14e1b946..964bc358 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -31,6 +31,3 @@ then + fi + fi + +-# now we can safely call autoreconf +-echo "Calling autoreconf..." +-autoreconf -i diff --git a/packages/sys-power/nut/nut-2.7.4.exheres-0 b/packages/sys-power/nut/nut-2.7.4.exheres-0 new file mode 100644 index 0000000..7e2a55b --- /dev/null +++ b/packages/sys-power/nut/nut-2.7.4.exheres-0 @@ -0,0 +1,7 @@ +# Copyright 2018 Gluzskiy Alexandr <sss@sss.chaoslab.ru> +# Distributed under the terms of the GNU General Public License v2 + + +require nut + +PLATFORMS="~amd64 ~x86" diff --git a/packages/sys-power/nut/nut-scm.exheres-0 b/packages/sys-power/nut/nut-scm.exheres-0 new file mode 100644 index 0000000..7e2a55b --- /dev/null +++ b/packages/sys-power/nut/nut-scm.exheres-0 @@ -0,0 +1,7 @@ +# Copyright 2018 Gluzskiy Alexandr <sss@sss.chaoslab.ru> +# Distributed under the terms of the GNU General Public License v2 + + +require nut + +PLATFORMS="~amd64 ~x86" diff --git a/packages/sys-power/nut/nut.exlib b/packages/sys-power/nut/nut.exlib new file mode 100644 index 0000000..5298a9c --- /dev/null +++ b/packages/sys-power/nut/nut.exlib @@ -0,0 +1,82 @@ +# Copyright 2018 Gluzskiy Alexandr <sss@sss.chaoslab.ru> +# Distributed under the terms of the GNU General Public License v2 + +require github [ user=networkupstools tag=v${PV} force_git_clone=true ] +require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.15 ] ] +require systemd-service + +SUMMARY="Network-UPS Tools" +HOMEPAGE="http://www.networkupstools.org/" + +LICENCES="GPL-2" +SLOT="0" + + +MYOPTIONS="cgi [[ description = [ build NUT CGI program ] ]] + snmp usb ssl tcpd xml zeroconf + ssl? ( ( providers: libressl openssl ) [[ number-selected = exactly-one ]] ) +" + + +export_exlib_phases src_prepare src_install + +DEPENDENCIES=" + build+run: + cgi? ( media-libs/gd[>=2] ) + snmp? ( net/net-snmp ) + usb? ( dev-libs/libusb:0.1 ) + ssl? ( + providers:libressl? ( dev-libs/libressl:= ) + providers:openssl? ( dev-libs/openssl ) + ) + tcpd? ( sys-apps/tcp-wrappers ) + xml? ( net-misc/neon ) + zeroconf? ( net-dns/avahi ) + run: + user/nut + group/nut + build: + dev-lang/python +" + +DEFAULT_SRC_CONFIGURE_PARAMS=( + --sysconfdir=/etc/nut + --datarootdir=/usr/share/nut + --datadir=/usr/share/nut + --disable-static + --with-statepath=/var/lib/nut + --with-drvpath=/usr/$(exhost --target)/lib/nut + --with-htmlpath=/usr/share/nut/html + --with-user=nut + --with-group=nut + --with-logfacility=LOG_DAEMON + --with-dev + --with-serial + --without-powerman + --without-docs +) + +DEFAULT_SRC_CONFIGURE_OPTION_WITHS=( + cgi + snmp + ssl + "tcpd wrap" + usb + "xml neon" + "zeroconf avahi" +) + + +nut_src_prepare() { + expatch "${FILES}"/autogen.patch + edo sed -e "s/pkg-config/$(exhost --target)-pkg-config/g" -i "${WORK}"/m4/*.m4 + edo sed -e "s/AR, ar/AR, $(exhost --target)-ar/g" -i "${WORK}"/configure.ac + edo ./autogen.sh + autotools_src_prepare +} + +nut_src_install() { + default + edo mv "${IMAGE}"/lib/udev "${IMAGE}"/usr/$(exhost --target)/lib/ + edo rmdir "${IMAGE}"/lib +} |