From ba3359722cbf8aa7b0ed39e1f81d1d74ec88fecd Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 30 May 2009 20:39:07 +0200 Subject: optimize ipkg package management - generate ipkg control file from PKG_* variables - automatically install init scripts from ./files/*.init set #PKG pkgname to set the binary package - rename FWINIT -> INIT - move postinst and conffiles meta data to ./files - update the packages to the latest upstream version - remove some unready or unused package (strongswan,..) more cleanups needed after allmodconfig --- package/nut/Makefile | 34 +++++++++++++++++++++------------- package/nut/files/nut.conffiles | 2 ++ package/nut/files/nut.postinst | 4 ++++ package/nut/files/upsd.init | 4 +++- package/nut/ipkg/nut.conffiles | 2 -- package/nut/ipkg/nut.control | 4 ---- package/nut/ipkg/nut.postinst | 4 ---- 7 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 package/nut/files/nut.conffiles create mode 100644 package/nut/files/nut.postinst delete mode 100644 package/nut/ipkg/nut.conffiles delete mode 100644 package/nut/ipkg/nut.control delete mode 100644 package/nut/ipkg/nut.postinst (limited to 'package/nut') diff --git a/package/nut/Makefile b/package/nut/Makefile index 158ee47b9..2bf1c12f8 100644 --- a/package/nut/Makefile +++ b/package/nut/Makefile @@ -6,14 +6,29 @@ include ${TOPDIR}/rules.mk PKG_NAME:= nut -PKG_VERSION:= 2.0.5 +PKG_VERSION:= 2.4.1 PKG_RELEASE:= 1 -PKG_MD5SUM:= b08fde86191154bbcfda860f95a5dca2 -MASTER_SITES:= http://www.networkupstools.org/source/2.0/ +PKG_MD5SUM:= 609ebaf2123fc7171d25a6c742dd7d66 +PKG_DESCR:= Network UPS Tools +PKG_SECTION:= sys +PKG_URL:= http://www.networkupstools.org +PKG_SITES:= http://www.networkupstools.org/source/2.4/ include ${TOPDIR}/mk/package.mk -$(eval $(call PKG_template,NUT,nut,${PKG_VERSION}-${PKG_RELEASE})) +ifneq (${ADK_PACKAGE_NUT_SNMP},) +PKG_DEPENDS+= libnetsnmp +endif + +ifneq (${ADK_PACKAGE_NUT_USB},) +PKG_DEPENDS+= libusb +endif + +ifneq (${ADK_PACKAGE_NUT_SSL},) +PKG_DEPENDS+= libopenssl +endif + +$(eval $(call PKG_template,NUT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) define DRIVER_template @@ -71,13 +86,13 @@ CONFIGURE_STYLE:= gnu CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \ --without-cgi \ --with-drivers=${INSTALL_DRIVERS} \ + --with-group=root \ --with-user=root -IPKG_DEPEND_tmp:= + ifneq (${ADK_PACKAGE_NUT_SSL},) CONFIGURE_ARGS+= --with-ssl CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}" MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto" -IPKG_DEPEND_tmp+= libopenssl endif BUILD_STYLE:= auto ALL_TARGET:= all @@ -86,20 +101,14 @@ INSTALL_TARGET:= install ifneq (${ADK_PACKAGE_NUT_USB},) ALL_TARGET+= usb INSTALL_TARGET+= install-usb -IPKG_DEPEND_tmp+= libusb endif ifneq (${ADK_PACKAGE_NUT_SNMP},) ALL_TARGET+= snmp INSTALL_TARGET+= install-snmp -IPKG_DEPEND_tmp+= libnetsnmp endif -IPKG_DEPEND=$(shell echo ${IPKG_DEPEND_tmp} | tr ' ' ',') post-install: ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin - ${INSTALL_DIR} ${IDIR_NUT}/etc/init.d - ${INSTALL_BIN} ./files/upsd.init \ - ${IDIR_NUT}/etc/init.d/upsd ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \ ${IDIR_NUT}/usr/sbin/ ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \ @@ -107,7 +116,6 @@ post-install: ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \ ${IDIR_NUT}/usr/bin/ ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/ - echo "Depends: ${IPKG_DEPEND}" >> ${IDIR_NUT}/CONTROL/control ifneq (${ADK_PACKAGE_NUT_VARDESC},) ${INSTALL_DIR} ${IDIR_NUT}/usr/share ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \ diff --git a/package/nut/files/nut.conffiles b/package/nut/files/nut.conffiles new file mode 100644 index 000000000..df6dd3071 --- /dev/null +++ b/package/nut/files/nut.conffiles @@ -0,0 +1,2 @@ +/etc/ups.conf +/etc/upsd.conf diff --git a/package/nut/files/nut.postinst b/package/nut/files/nut.postinst new file mode 100644 index 000000000..cd5faf1af --- /dev/null +++ b/package/nut/files/nut.postinst @@ -0,0 +1,4 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf upsd upsd NO + diff --git a/package/nut/files/upsd.init b/package/nut/files/upsd.init index e3afadbba..a65d1ad81 100644 --- a/package/nut/files/upsd.init +++ b/package/nut/files/upsd.init @@ -1,5 +1,7 @@ #!/bin/sh -#FWINIT 60 +#PKG nut +#INIT 60 + . /etc/rc.conf case $1 in diff --git a/package/nut/ipkg/nut.conffiles b/package/nut/ipkg/nut.conffiles deleted file mode 100644 index df6dd3071..000000000 --- a/package/nut/ipkg/nut.conffiles +++ /dev/null @@ -1,2 +0,0 @@ -/etc/ups.conf -/etc/upsd.conf diff --git a/package/nut/ipkg/nut.control b/package/nut/ipkg/nut.control deleted file mode 100644 index a896bfd60..000000000 --- a/package/nut/ipkg/nut.control +++ /dev/null @@ -1,4 +0,0 @@ -Package: nut -Priority: optional -Section: sys -Description: Network UPS Tools diff --git a/package/nut/ipkg/nut.postinst b/package/nut/ipkg/nut.postinst deleted file mode 100644 index cd5faf1af..000000000 --- a/package/nut/ipkg/nut.postinst +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. $IPKG_INSTROOT/etc/functions.sh -add_rcconf upsd upsd NO - -- cgit v1.2.3