summaryrefslogtreecommitdiff
path: root/packages/sys-power/nut
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sys-power/nut')
-rw-r--r--packages/sys-power/nut/files/autogen.patch16
-rw-r--r--packages/sys-power/nut/nut-2.7.4.exheres-07
-rw-r--r--packages/sys-power/nut/nut-scm.exheres-07
-rw-r--r--packages/sys-power/nut/nut.exlib82
4 files changed, 112 insertions, 0 deletions
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
+}