From 5d51d74f79f216a6cbada7b57df7a06acab247e7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 18 Aug 2016 12:08:51 +0200 Subject: [PATCH 001/207] Added packaging metadata used by OBS as of 2016-08-18 (except debian.series) Signed-off-by: Jim Klimov --- obs/debian.Makefile.am | 9 + obs/debian.Makefile.in | 381 ++++ obs/debian.NEWS | 6 + obs/debian.changelog | 1931 +++++++++++++++++ obs/debian.compat | 1 + obs/debian.control | 297 +++ obs/debian.copyright | 69 + obs/debian.description.subst | 1 + obs/debian.gbp.conf | 8 + obs/debian.hotplug | 24 + obs/debian.libnutclient-dev.install | 3 + obs/debian.libnutclient-dev.manpages | 34 + obs/debian.libnutclient0.install | 1 + obs/debian.libnutclient0.lintian-overrides | 1 + obs/debian.libnutscan-dev.install | 6 + obs/debian.libnutscan1.install | 2 + obs/debian.libups-nut-perl.install | 1 + obs/debian.libupsclient-dev.install | 4 + obs/debian.libupsclient-dev.manpages | 2 + obs/debian.libupsclient4.install | 1 + obs/debian.nut-cgi.README.Debian | 39 + obs/debian.nut-cgi.docs | 1 + obs/debian.nut-cgi.install | 6 + obs/debian.nut-cgi.manpages | 6 + obs/debian.nut-cgi.postinst | 55 + obs/debian.nut-cgi.postrm | 47 + obs/debian.nut-client.init | 180 ++ obs/debian.nut-client.install | 20 + obs/debian.nut-client.links | 1 + obs/debian.nut-client.lintian-overrides | 2 + obs/debian.nut-client.maintscript | 1 + obs/debian.nut-client.manpages | 9 + obs/debian.nut-client.postinst | 79 + obs/debian.nut-client.preinst | 23 + obs/debian.nut-client.tmpfiles | 1 + ...ebian.nut-doc.doc-base.nut-developer-guide | 13 + obs/debian.nut-doc.doc-base.nut-faq | 12 + ...debian.nut-doc.doc-base.nut-packager-guide | 15 + obs/debian.nut-doc.doc-base.nut-user-manual | 15 + obs/debian.nut-doc.install | 1 + obs/debian.nut-ipmi.install | 2 + obs/debian.nut-ipmi.manpages | 1 + obs/debian.nut-monitor.install | 7 + obs/debian.nut-monitor.menu | 4 + obs/debian.nut-monitor.xpm | 326 +++ obs/debian.nut-powerman-pdu.install | 1 + obs/debian.nut-powerman-pdu.manpages | 1 + obs/debian.nut-server.dirs | 1 + obs/debian.nut-server.init | 179 ++ obs/debian.nut-server.install | 59 + obs/debian.nut-server.manpages | 53 + obs/debian.nut-server.postinst | 91 + obs/debian.nut-server.postrm | 50 + obs/debian.nut-server.preinst | 12 + obs/debian.nut-server.prerm | 42 + obs/debian.nut-server.tmpfiles | 1 + obs/debian.nut-snmp.docs | 1 + obs/debian.nut-snmp.install | 3 + obs/debian.nut-snmp.manpages | 1 + obs/debian.nut-xml.install | 1 + obs/debian.nut-xml.manpages | 1 + obs/debian.nut.README.Debian | 162 ++ obs/debian.nut.TODO.Debian | 9 + obs/debian.nut.docs | 18 + obs/debian.python-nut.install | 1 + obs/debian.rules | 140 ++ obs/debian.series | 2 + obs/debian.watch | 2 + obs/nut.changes | 0 obs/nut.dsc | 34 + obs/nut.spec | 380 ++++ 71 files changed, 4893 insertions(+) create mode 100644 obs/debian.Makefile.am create mode 100644 obs/debian.Makefile.in create mode 100644 obs/debian.NEWS create mode 100644 obs/debian.changelog create mode 100644 obs/debian.compat create mode 100644 obs/debian.control create mode 100644 obs/debian.copyright create mode 100644 obs/debian.description.subst create mode 100644 obs/debian.gbp.conf create mode 100644 obs/debian.hotplug create mode 100644 obs/debian.libnutclient-dev.install create mode 100644 obs/debian.libnutclient-dev.manpages create mode 100644 obs/debian.libnutclient0.install create mode 100644 obs/debian.libnutclient0.lintian-overrides create mode 100644 obs/debian.libnutscan-dev.install create mode 100644 obs/debian.libnutscan1.install create mode 100644 obs/debian.libups-nut-perl.install create mode 100644 obs/debian.libupsclient-dev.install create mode 100644 obs/debian.libupsclient-dev.manpages create mode 100644 obs/debian.libupsclient4.install create mode 100644 obs/debian.nut-cgi.README.Debian create mode 100644 obs/debian.nut-cgi.docs create mode 100644 obs/debian.nut-cgi.install create mode 100644 obs/debian.nut-cgi.manpages create mode 100644 obs/debian.nut-cgi.postinst create mode 100644 obs/debian.nut-cgi.postrm create mode 100644 obs/debian.nut-client.init create mode 100644 obs/debian.nut-client.install create mode 100644 obs/debian.nut-client.links create mode 100644 obs/debian.nut-client.lintian-overrides create mode 100644 obs/debian.nut-client.maintscript create mode 100644 obs/debian.nut-client.manpages create mode 100644 obs/debian.nut-client.postinst create mode 100644 obs/debian.nut-client.preinst create mode 100644 obs/debian.nut-client.tmpfiles create mode 100644 obs/debian.nut-doc.doc-base.nut-developer-guide create mode 100644 obs/debian.nut-doc.doc-base.nut-faq create mode 100644 obs/debian.nut-doc.doc-base.nut-packager-guide create mode 100644 obs/debian.nut-doc.doc-base.nut-user-manual create mode 100644 obs/debian.nut-doc.install create mode 100644 obs/debian.nut-ipmi.install create mode 100644 obs/debian.nut-ipmi.manpages create mode 100644 obs/debian.nut-monitor.install create mode 100644 obs/debian.nut-monitor.menu create mode 100644 obs/debian.nut-monitor.xpm create mode 100644 obs/debian.nut-powerman-pdu.install create mode 100644 obs/debian.nut-powerman-pdu.manpages create mode 100644 obs/debian.nut-server.dirs create mode 100644 obs/debian.nut-server.init create mode 100644 obs/debian.nut-server.install create mode 100644 obs/debian.nut-server.manpages create mode 100644 obs/debian.nut-server.postinst create mode 100644 obs/debian.nut-server.postrm create mode 100644 obs/debian.nut-server.preinst create mode 100644 obs/debian.nut-server.prerm create mode 100644 obs/debian.nut-server.tmpfiles create mode 100644 obs/debian.nut-snmp.docs create mode 100644 obs/debian.nut-snmp.install create mode 100644 obs/debian.nut-snmp.manpages create mode 100644 obs/debian.nut-xml.install create mode 100644 obs/debian.nut-xml.manpages create mode 100644 obs/debian.nut.README.Debian create mode 100644 obs/debian.nut.TODO.Debian create mode 100644 obs/debian.nut.docs create mode 100644 obs/debian.python-nut.install create mode 100644 obs/debian.rules create mode 100644 obs/debian.series create mode 100644 obs/debian.watch create mode 100644 obs/nut.changes create mode 100644 obs/nut.dsc create mode 100644 obs/nut.spec diff --git a/obs/debian.Makefile.am b/obs/debian.Makefile.am new file mode 100644 index 0000000000..68fdb08494 --- /dev/null +++ b/obs/debian.Makefile.am @@ -0,0 +1,9 @@ +EXTRA_DIST = changelog control copyright description.subst hotplug \ + nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \ + nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \ + nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \ + nut-server.init nut-client.init nut-client.links \ + nut.postinst nut.postrm nut.preinst nut.prerm nut.README.Debian \ + nut.templates nut.TODO.Debian rules watch \ + po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \ + po/pt.po po/pt_BR.po po/templates.pot po/vi.po diff --git a/obs/debian.Makefile.in b/obs/debian.Makefile.in new file mode 100644 index 0000000000..aca99247d6 --- /dev/null +++ b/obs/debian.Makefile.in @@ -0,0 +1,381 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = packaging/debian +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/nut_arg_with.m4 \ + $(top_srcdir)/m4/nut_check_hiddev.m4 \ + $(top_srcdir)/m4/nut_check_ipv6.m4 \ + $(top_srcdir)/m4/nut_check_libgd.m4 \ + $(top_srcdir)/m4/nut_check_libhal.m4 \ + $(top_srcdir)/m4/nut_check_libneon.m4 \ + $(top_srcdir)/m4/nut_check_libnetsnmp.m4 \ + $(top_srcdir)/m4/nut_check_libssl.m4 \ + $(top_srcdir)/m4/nut_check_libusb.m4 \ + $(top_srcdir)/m4/nut_report_feature.m4 \ + $(top_srcdir)/m4/nut_type_socklen_t.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFPATH = @CONFPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@ +DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@ +DRIVER_MAN_LIST = @DRIVER_MAN_LIST@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@ +HAL_FDI_PATH = @HAL_FDI_PATH@ +HAL_USER = @HAL_USER@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBGD_CFLAGS = @LIBGD_CFLAGS@ +LIBGD_LDFLAGS = @LIBGD_LDFLAGS@ +LIBHAL_CFLAGS = @LIBHAL_CFLAGS@ +LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@ +LIBNEON_CFLAGS = @LIBNEON_CFLAGS@ +LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@ +LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@ +LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSSL_CFLAGS = @LIBSSL_CFLAGS@ +LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@ +LIBTOOL = @LIBTOOL@ +LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ +LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@ +LINUX_HIDDEV = @LINUX_HIDDEV@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NETLIBS = @NETLIBS@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RUN_AS_GROUP = @RUN_AS_GROUP@ +RUN_AS_USER = @RUN_AS_USER@ +SED = @SED@ +SERLIBS = @SERLIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STATEPATH = @STATEPATH@ +STRIP = @STRIP@ +SUN_LIBUSB = @SUN_LIBUSB@ +VERSION = @VERSION@ +WORDS_BIGENDIAN = @WORDS_BIGENDIAN@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +cgiexecdir = @cgiexecdir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverexecdir = @driverexecdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +hotplugdir = @hotplugdir@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +udevdir = @udevdir@ +EXTRA_DIST = changelog control copyright description.subst hotplug \ + nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \ + nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \ + nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \ + nut.init nut.links nut.postinst nut.postrm nut.preinst nut.prerm \ + nut.README.Debian nut.templates nut.TODO.Debian \ + rules watch po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \ + po/pt.po po/pt_BR.po po/templates.pot po/vi.po + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu packaging/debian/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu packaging/debian/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/obs/debian.NEWS b/obs/debian.NEWS new file mode 100644 index 0000000000..e42605c871 --- /dev/null +++ b/obs/debian.NEWS @@ -0,0 +1,6 @@ +nut (2.6.5-1) experimental; urgency=low + + mge-shut driver has been replaced by a new implementation (newmge-shut). + In case of issue with this new version, users can revert to oldmge-shut. + + -- Laurent Bigonville Mon, 13 Aug 2012 00:32:18 +0200 diff --git a/obs/debian.changelog b/obs/debian.changelog new file mode 100644 index 0000000000..e071d2e0e2 --- /dev/null +++ b/obs/debian.changelog @@ -0,0 +1,1931 @@ +nut (2.7.4-13) UNRELEASED; urgency=high + + * Base on daisychain+DMF branch from vyskocilm fork @ github + removed patches + * 0024-snmp-ups-Eaton-3ph-UPS-improvements.patch + * 0025-Fix-nut-scanner-compilation-in-some-environments.patch + * 0026-snmp-ups-support-Raritan-Dominion-PX2-PDU.patch + can't be merged, upstream change + * 0028-nut-scanner-additional-search-path.patch + * 0029-netvision-mib-uses-0-as-dfl.patch + daisy chain is upstream + * 0030-daisychain.patch + * 0031-daisychain-complement.patch + * 0032-snmp-ups-fix-some-regression-due-to-daisychain.patch + * 0033-snmp-ups-fix-memory-leaks.patch + part of daisychain+DMF branch + * 0035-daisychain+DMF.patch + * 0036-post-carlos-dmf-fixes.patch + + -- Michal Vyskocil Tue, 16 Aug 2016 11:29:12 +0200 + +nut (2.7.4-12) UNRELEASED; urgency=high + + * Add 0036-post-carlos-dmf-fixes.patch + this fixes bug introduced by Carlos after DMF support was validated + Pushed upstream (DMF branch) as + https://github.com/networkupstools/nut/pull/304 + + -- Michal Vyskocil Mon, 15 Aug 2016 15:25:11 +0200 + +nut (2.7.4-11) UNRELEASED; urgency=high + + * Add 0035-daisychain+DMF.patch + this is combination of daisychain+DMF vyskocilm branch on gh + some + polishing to apply cleanly + + -- Michal Vyskocil Fri, 12 Aug 2016 15:15:18 +0200 + +nut (2.7.4-10) UNRELEASED; urgency=high + + * Add 0034-fix_xmlv4_segfault.patch + + -- Arnaud Quette Tue, 28 Jun 2016 14:17:57 +0200 + +nut (2.7.4-9) UNRELEASED; urgency=high + + * Add 0033-snmp-ups-fix-memory-leaks.patch + + -- Arnaud Quette Thu, 09 Jun 2016 10:36:07 +0200 + +nut (2.7.4-8) UNRELEASED; urgency=high + + * Add 0032-snmp-ups-fix-some-regression-due-to-daisychain.patch + + -- Arnaud Quette Tue, 07 Jun 2016 16:59:19 +0200 + +nut (2.7.4-7) UNRELEASED; urgency=high + + * Add the complementary patch 0031-daisychain-complement.patch + + -- Arnaud Quette Tue, 31 May 2016 16:23:23 +0200 + +nut (2.7.4-6) UNRELEASED; urgency=high + + * Add again patch 0030-daisychain.patch + + -- Arnaud Quette Fri, 27 May 2016 15:46:43 +0200 + +nut (2.7.4-5) UNRELEASED; urgency=high + + * Add patch 0029-netvision-mib-uses-0-as-dfl.patch and + 0030-daisychain.patch + + -- Arnaud Quette Thu, 19 May 2016 13:36:45 +0200 + +nut (2.7.4-4) UNRELEASED; urgency=high + + * Add patch 0028-nut-scanner-additional-search-path.patch + + -- Arnaud Quette Mon, 11 Apr 2016 09:34:15 +0200 + +nut (2.7.4-3) UNRELEASED; urgency=high + + * Add patch 0027-snmp-ups-support-APC-PDU.patch + + -- Tomas Halman Wed, 06 Apr 2016 16:21:47 +0200 + +nut (2.7.4-2) UNRELEASED; urgency=high + + * Add patch 0026-snmp-ups-support-Raritan-Dominion-PX2-PDU.patch + + -- Arnaud Quette Wed, 06 Apr 2016 16:21:47 +0200 + +nut (2.7.4-1) UNRELEASED; urgency=high + + * updated to 2.7.4 + dropped following no longer needed patches: + 0009-systemd.patch + 0010-libnutscanner-2pass-crash.patch + 0012-nutclient-socket-read.patch + 0013-Fix-dummy-ups-for-external-value-changes.patch + 0016-Eaton-ePDU.patch + 0017-Eaton-ePDU-groups.patch + 0018-Eaton-3phase-alarms.patch + 0019-stale-comm-recovery.patch + 0020-stale-comm-detection.patch + 0022-3ph_temp_hum_internal_th.patch + 0023-3ph-outputsource.patch + * Add patch 0024-snmp-ups-Eaton-3ph-UPS-improvements.patch + + -- Arnaud Quette Thu, 10 Mar 2016 11:11:28 +0100 + +nut (2.7.3-23) UNRELEASED; urgency=high + + * Patch SNMP for Eaton 3ph output source status + + -- Arnaud Quette Mon, 08 Feb 2016 11:56:24 +0100 + +nut (2.7.3-22) UNRELEASED; urgency=high + + * Patch SNMP for Eaton 3ph temperature and humidity (internal and external) + + -- Arnaud Quette Wed, 03 Feb 2016 16:21:10 +0100 + +nut (2.7.3-21) UNRELEASED; urgency=high + + * Patch XML scan to actually limit to 3 attempt, and not loop infinitly + + -- Arnaud Quette Tue, 02 Feb 2016 13:01:12 +0100 + +nut (2.7.3-20) UNRELEASED; urgency=high + + * Patch snmp-ups to improve stale communication detection + + -- Arnaud Quette Thu, 14 Jan 2016 15:48:13 +0100 + +nut (2.7.3-19) UNRELEASED; urgency=high + + * Patch snmp-ups to improve stale communication recovery + + -- Arnaud Quette Thu, 07 Jan 2016 13:34:15 +0100 + +nut (2.7.3-18) UNRELEASED; urgency=high + + * Fix typo in nut-driver@.service + + -- Michal Hrusecky Thu, 1 Oct 2015 13:28:07 +0200 + +nut (2.7.3-17) UNRELEASED; urgency=high + + * Add 0018-Eaton-3phase-alarms.patch for 3phase UPS alarms + + -- Arnaud Quette Mon, 28 Sep 2015 16:27:48 +0200 + +nut (2.7.3-16) UNRELEASED; urgency=high + + * Add 0017-Eaton-ePDU-groups.patch for ePDU outlet groups management + and others SNMP improvements + + -- Arnaud Quette Fri, 11 Sep 2015 15:48:36 +0200 + +nut (2.7.3-15) UNRELEASED; urgency=high + + * Complete 0016-Eaton-ePDU.patch for ePDU alarms and SNMP improvements + + -- Arnaud Quette Fri, 11 Sep 2015 15:48:36 +0200 + +nut (2.7.3-14) UNRELEASED; urgency=high + + * added 0016-Eaton-ePDU.patch for ePDU alarms and SNMP improvements + + -- Arnaud Quette Mon, 07 Sep 2015 14:55:11 +0200 + +nut (2.7.3-13) UNRELEASED; urgency=high + + * added 0015-Use-target-for-drivers-in-systemd.patch to implement more + granular systemd support + + -- Michal Hrusecky Fri, 21 Aug 2015 12:15:07 +0200 + +nut (2.7.3-12) UNRELEASED; urgency=high + + * putting 0013-Fix-dummy-ups-for-external-value-changes.patch back + for remote settings through upsrw (for GreenDataNet) + * including 0014-upsrdvctl-nowait.patch. Provides an option to start + The nowait flag allow to tell upsdrvctl to not wait at all for the + driver(s) to execute the request command. The default behavior, when + this variable is omitted, is to wait 'maxstartdelay' seconds + + -- Tomas Halman Mon, 11 Aug 2015 9:20:00 +0100 + +nut (2.7.3-11) UNRELEASED; urgency=high + + * removed 0013-Fix-dummy-ups-for-external-value-changes.patch + probably causes nut unstability + + -- Tomas Halman Mon, 11 Aug 2015 9:20:00 +0100 + +nut (2.7.3-10) UNRELEASED; urgency=high + + * 0013-Fix-dummy-ups-for-external-value-changes.patch: fix dummy-ups + for remote settings through upsrw (for GreenDataNet) + + -- Arnaud Quette Mon, 10 Aug 2015 09:41:28 +0200 + +nut (2.7.3-9) UNRELEASED; urgency=high + + * 0012-nutclient-socket-read.patch fix socket reading + + -- Tomas Halman Mon, 3 Aug 2015 13:12:00 +0100 + +nut (2.7.3-8) UNRELEASED; urgency=low + + * Drop bogus headers from libupsclient-dev + + -- Michal Hrusecky Tue, 30 Jun 2015 8:13:08 +0100 + +nut (2.7.3-7) UNRELEASED; urgency=low + + * 0011-libnutscanner-scan-one-ip-xml-http.patch + + -- Michal Vyskocil Tue, 23 Jun 2015 10:13:08 +0100 + +nut (2.7.3-6) UNRELEASED; urgency=low + + * fix nutscan library crash on second call + + -- Tomas Halman Thu, 18 Jun 2015 8:54:38 +0100 + +nut (2.7.3-5) UNRELEASED; urgency=low + + * add mising dependency between libraries + + -- Michal Hrusecky Wed, 17 Jun 2015 8:54:38 +0100 + +nut (2.7.3-4) UNRELEASED; urgency=low + + * add mising header file for scanner + + -- Michal Hrusecky Mon, 15 Jun 2015 10:54:38 +0100 + +nut (2.7.3-3) UNRELEASED; urgency=low + + * drop static libraries + * add nut-scanner + + -- Michal Hrusecky Fri, 12 Jun 2015 16:54:38 +0100 + +nut (2.7.3-2) UNRELEASED; urgency=low + + * add 0009-systemd.patch + + -- Michal Hrusecky Wed, 13 May 2015 16:54:38 +0100 + +nut (2.7.3-1) UNRELEASED; urgency=low + + * to ease the maintenance switched to OBS format + * updated to 2.7.3 + dropped following no longer needed patches: + 0007-killpower-path.patch + 0009-nut-epdu-input.patch + + -- Michal Hrusecky Wed, 5 May 2015 16:54:38 +0100 + +nut (2.7.2-3) UNRELEASED; urgency=low + + * added 0009-nut-epdu-input.patch + + -- Arnaud Quette Wed, 4 Feb 2015 16:54:38 +0100 + +nut (2.7.2-2) UNRELEASED; urgency=low + + * debian/control: add new packages libnutclient0 and libnutclient-dev + * debian/rules: adapted for the new packages + * debian/libnutclient0.install, debian/libnutclient0.symbols, + debian/libnutclient-dev.install, debian/libnutclient-dev.manpages: + created for the new packages + + -- Arnaud Quette Mon, 20 Oct 2014 20:41:47 +0200 + +nut (2.7.2-1) unstable; urgency=low + + * New upstream release + - Fix the undefined references (Closes: #731156) + - debian/patches/0004-fix-systemd-service.patch: Refreshed + - Drop d/p/0005-Provide-retry-options-for-upsdrvctl-and-drivers.patch: + Merged upstream + - debian/nut-server.install: Upstream is now installing upsdrvctl /sbin + - Rename package libupsclient3 to libupsclient4, soname got bumped again + * debian/rules, debian/control, d/p/0004-fix-systemd-service.patch: Use a + symlink instead of an Alias= to mask the SysV initscript + * debian/control: Bump Standards-Version to 3.9.5 (no further changes) + * debian/tests/control: Add lsb-release and netcat to the dependencies + (Closes: #733189) + * debian/control, debian/rules: Call dh-autoreconf and pass LDFLAGS to + minimize runtime dependencies + * debian/patches/0008-drop-w3c-icons.patch: Remove the link to external W3C + icons to prevent privacy breach (privacy-breach-w3c-valid-html) + * debian/nut-server.install, debian/nut-server.manpages: Install new + nutdrv_atcl_usb driver + + -- Laurent Bigonville Tue, 22 Apr 2014 22:46:12 +0200 + +nut (2.7.1-1) unstable; urgency=low + + * New upstream release (Closes: #730183) + - Refresh debian/patches/0004-fix-systemd-service.patch + - Rename libupsclient1 to libupsclient3 following the soname bump, rename + libupsclient1-dev to libupsclient-dev, the package is not co-installable + anyway + * debian/rules, debian/control: Enable SSL support using libnss3 + * d/p/0005-Provide-retry-options-for-upsdrvctl-and-drivers.patch, + d/p/0006-ups-conf-maxretry.patch: By default, retry to start the drivers + up-to three times, this should mitigate races with slow devices + (Closes: #694717) + * debian/nut-server.install, debian/nut-server.manpages: Install new drivers + * Move bash-completion file to /usr/share/bash-completion/ + * debian/patches/0007-killpower-path.patch: Revert POWERDOWNFLAG back to + /etc/killpower + * debian/nut-client.lintian-overrides: Add override for + systemd-no-service-for-init-script ups-monitor + * debian/rules: Drop static ordering for the initscripts and pass + --restart-after-upgrade option to dh_installinit and dh_systemd_start to + minimize the downtime of the daemons + + -- Laurent Bigonville Sun, 24 Nov 2013 20:57:51 +0100 + +nut (2.6.5-4) unstable; urgency=low + + * debian/control: Do not build nut-ipmi on hurd-i386 as freeipmi is not + available on that platform. + + -- Laurent Bigonville Thu, 11 Jul 2013 12:29:58 +0200 + +nut (2.6.5-3) unstable; urgency=low + + [ Laurent Bigonville ] + * debian/control: + - Move libupsclient1 package to libs Section + - Add libgd-dev to the Build-Depends, keep the other alternatives to ease + the backports + - Bump Standards-Version to 3.9.4 (no further changes) + - Add autotools-dev to the build-dependencies so config.{guess,sub} are + getting updated during build + - Use canonical URL for the VCS-* fields + - Add build-dependency against dh-systemd and bump minimal cdbs version so + systemd helpers are called during build. + * Added dep-8-tests to improve QA (from Ubuntu, closes: #708130) + * debian/nut-monitor.menu, nut-monitor.xpm: Add Debian menu entry (Closes: + #708813) + * debian/rules: Drop manual creation of .service files symlink, this should + be handled by dh_systemd now + * debian/patches/0004-fix-systemd-service.patch: Also add Wants/Before for + systemd-udev-settle.service in the nut-driver.service as it got renamed + after udev merge + * debian/patches/0004-fix-systemd-service.patch: Fix path for upsdrvctl in + scripts/systemd/nutshutdown.in + + [ Ivo De Decker ] + * debian/nut-client.preinst: also revert /etc/nut/nut.conf mangling done + by postinst during upgrade from lenny to squeeze (Really closes: #677054) + Thanks to Andreas Beckmann for the review. + + -- Laurent Bigonville Thu, 11 Jul 2013 00:50:06 +0200 + +nut (2.6.5-2) experimental; urgency=low + + [ Laurent Bigonville ] + * debian/control: Move the nut-monitor Suggests from nut-server to + nut-client + * Restore proper SELinux context for runtime created /var/run/nut directory + * debian/control: Fix typo in package description + * debian/watch: Update watch file URL (Thanks to Bart Martens) + * debian/rules: Alias systemd nut-monitor service file to nut-client to + prevent it from running twice + * d/p/0004-fix-systemd-service.patch: Fix systemd service file for Debian + * Install tmpfiles conf files to create /run/nut directory during boot + + [ Sébastien Villemot ] + * debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older + versions of the postinst (Closes: #677054) + + [ Ivo De Decker ] + * Only fix permissions of configfiles on first install. + * Only remove /etc/init.d/nut from previous versions of nut in nut-server + postinst if there are no local changes. + * Also remove /etc/init.d/nut in nut-client postinst. Thanks to + Laurent Bigonville for the hint. + + -- Laurent Bigonville Thu, 31 Jan 2013 21:51:31 +0100 + +nut (2.6.5-1) experimental; urgency=low + + [ Arnaud Quette ] + * debian/control, debian/nut-ipmi.{install,manpages}: create IPMI + support package + * debian/nut-server.install: only install USB udev rules + + [ Laurent Bigonville ] + * New upstream release + - Drop debian/patches/0001-fix-upsmon-regression.patch, applied upstream + * Follow multi-arch policy + * Install systemd .service files (Closes: #679450) + * debian/nut-server.install: Drop newmge-shut, renamed upstream to mge-shut + and install the old implementation (oldmge-shut) instead + * debian/control: Drop ancient Conflicts/Provides/Replaces + * Install all development files under /usr + + -- Laurent Bigonville Mon, 13 Aug 2012 01:59:18 +0200 + +nut (2.6.4-2) unstable; urgency=low + + * debian/rules: Stop the nut-client before nut-server on systems using static + boot ordering (Closes: #679451) + * debian/nut-server.postinst: Remove /etc/init.d/nut on upgrade + (Closes: #677822) + * Rename nut-server.lintian-overrides to nut-client.lintian-overrides and + adjust overrides now that ups-monitor is shipped in nut-client package + (Closes: #677947) + * Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched + regression (Taken from upstream) (Closes: #679513) + * Move nut metapackage to Section: metapackages + * Also create nut user when installing nut-client package and do not delete + it on purge anymore (Closes: #682000) + * Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration + happends before squeeze release and this was against policy to have a + maintainer script modifying a conffile in the first place (Closes: #684392) + * Add dependency against adduser and lsb-base on nut-client package + * Be sure that client is stopped before the server also when using + dependencies based boot + * Fix package descriptions (Closes: #678068) + * Also install /bin/upssched-cmd in nut-client package as this script is + referenced in default upssched.conf config file + * debian/watch: Update watch file + * Be sure that all maintainer scripts are returning 0 at their end + + -- Laurent Bigonville Sun, 12 Aug 2012 20:38:52 +0200 + +nut (2.6.4-1) unstable; urgency=high + + * New upstream release (Closes: #671444) + * acknowledges NMU (Closes: #613643) + * debian/nut-client.init: fix action "start" and use of log_*_*msg + LSB log functions (Closes: #675619) + * debian/nut-server.preinst: remove obsolete file(s) left in + /etc/udev/rules.d and related processing: udev files are now located + in /lib/udev/rules, and there is no reason to modify the dedicated + USB UPS rules (52-nut-usbups.rules) (Closes: #660072) + + -- Arnaud Quette Wed, 06 Jun 2012 21:03:50 +0200 + +nut (2.6.3-2) unstable; urgency=low + + * debian/nut-server.init: rewrite to match upsd / drivers startup scope + * debian/nut-client.init: created to match upsmon startup scope + (Closes: #634858) + * debian/nut.TODO.Debian, debian/Makefile.am: updated to reflect the above + * debian/rules: install nut-client.init, and update to reflect the above + * debian/control, debian/Makefile.am: updated to reflect the above + * debian/control: + - add Breaks on nut-server (<< 2.6.3-1~) + - bump Standards-Version to 3.9.3 + * debian/nut-client.links: renamed from debian/nut-server.links, since + ups-monitor is now provided by nut-client initscript + * debian/nut.README.Debian: renamed from nut-server.README.Debian, + to provide it with both client and server packages + * debian/nut-server.install: add missing drivers (clone-outlet, + liebert-esp2 and microdowell) + * debian/nut-server.manpages: add missing manual pages (apcsmart-old, + ivtscd, liebert-esp2 and microdowell) + + -- Arnaud Quette Tue, 24 Jan 2012 13:14:59 +0100 + +nut (2.6.3-1) unstable; urgency=low + + * New upstream release (Closes: #635186, #598741, #633756, #638221) + * debian/nut-server.{install,manpages}: add richcomm_usb + * debian/nut-server.install, debian/rules: install Avahi service file + * debian/rules, nut-client.install: install Augeas lenses + * debian/nut-server.README.Debian: clarify udev explanation (Closes: #529664) + * debian/patches/0001-fix_spelling_and_typo.patch, + debian/patches/0003-libupsclient-version.patch: removed since these are now + fixed upstream + * debian/patches/series: updated + + -- Arnaud Quette Tue, 24 Jan 2012 13:14:59 +0100 + +nut (2.6.2-1) unstable; urgency=low + + * New upstream release (Closes: #594989) + * debian/control: + - remove legacy Build-Depends for nut-hal-drivers on libdbus and libglib + - Build-Depends-Indep on docbook-xsl for offline document + generation (Closes: #635347) + * debian/nut-server.install: add apcsmart-old + * debian/nut-server.init: + - add udev as Required-Start/Stop (Closes: #642412) + - remove legacy support for /etc/default/nut (Closes: #638021) + * debian/patches/0003-libupsclient-version.patch: added to fix the missing + libupsclient version info bump + * debian/libupsclient1-dev.links: update link name + * debian/libupsclient1.symbols: add with upscli_tryconnect + * debian/nut.TODO.Debian: update and complete the TODO list + + -- Arnaud Quette Thu, 29 Sep 2011 18:39:16 +0200 + +nut (2.6.1-2) unstable; urgency=low + + * debian/nut.README.Debian: Adjust udev rules naming for permissions override + (Closes: #529664) + * Re-add and refresh debian/patches/0001-fix_spelling_and_typo.patch: + Some typos and spelling errors remain. + * Split nut package into nut-client and nut-server, keep nut package as + metapackage + * Generate PDF and html doc and install it in nut-doc package + * debian/rules: + - List non-installed files + - Includes python-module.mk + - Add flags to build documentation and install it + * debian/control: + - Add python-nut package and add python build-dependency + - Set nut-powerman-pdu priority to extras + - Add nut-monitor package + - Add nut-doc package and add required C/R/P + - Add libups-nut-perl package + * debian/nut-server.prerm: Remove /var/run/nut during removal + + -- Laurent Bigonville Sun, 17 Jul 2011 19:03:18 +0200 + +nut (2.6.1-1) unstable; urgency=low + + * New upstream release (Closes: #595953, #614842, #595773) + * debian/patches/*.patch: removed since these are now fixed upstream + [Laurent Bigonville] + * Drop HAL package and build-dependencies (Closes: #613197) + * debian/control: + - Bump Standards-Version to 3.9.2 (no further changes) + - Drop autotools build-dependencies (not needed anymore) + - Drop non-existing build-dependencies + * debian/rules: + - Correctly pass flags to configure + + -- Arnaud Quette Wed, 01 Jun 2011 22:34:28 +0200 + +nut (2.6.0-2) unstable; urgency=low + + * debian/nut-snmp.docs: Distribute snmp.txt doc file (Closes: #548295) + * d/p/0001-fix_spelling_and_typo.patch: Update and refresh + * debian/nut.lintian-overrides: Fix typo + * debian/patch/0002-fix_libupsclient_pc.patch: Fix libupsclient.pc (Closes: + #624255) + * debian/rules: + - Switch to cdbs + - Remove not existing configure options (Closes: #611813) + - Drop Phony rules (Closes: #613699) + * debian/control: + - Add cdbs build-dependency + + -- Laurent Bigonville Sun, 08 May 2011 21:23:46 +0200 + +nut (2.6.0-1) unstable; urgency=low + + * New upstream release (Closes: #575176, #588648, #609597, #687985) + * debian/patches/*.patch: removed since these are now fixed upstream + * debian/patches/0001-fix_spelling_and_typo.patch, + debian/patches/series: reworked to match the new upstream release + * debian/nut.install, debian/nut.manpages: remove obsolete reference to + megatec and megatec_usb, now respectively replaced by blazer_ser and + blazer_usb + * debian/nut.docs: limit distributed documentation + + -- Arnaud Quette Wed, 16 Feb 2011 22:55:26 +0100 + +nut (2.4.3-3) UNRELEASED; urgency=low + + * debian/control: + - Wrap build-dependencies + - Change nut-cgi Recommends to apache2 | httpd-cgi + * debian/nut.postinst: Only trigger USB subsystem, should Closes: #574769 + * debian/patches/0002-fix_udev_action.patch: Use SUBSYSTEM instead of BUS + + -- Laurent Bigonville Tue, 11 Jan 2011 22:24:07 +0100 + +nut (2.4.3-2) unstable; urgency=medium + + * debian/control: + - Bump Standards-Version to 3.9.1 + - Update Vcs-* fields to new GIT repository + - Add myself as Uploaders + * Switch to dpkg-source 3.0 (quilt) format (Closes: #573601) + * debian/patches/0001-low_speed_usb_ups.patch: Use patch system for changes + that were applied directly in the source + * Add debian/gbp.conf file + * debian/watch: Bump version to 3 + * Add debian/patches/0002-fix_udev_action.patch: Also set permission for + "change" udev ACTION (Closes: #557178) + * debian/nut.postrm: Do not try to remove nut user is deluser is not + installed anymore + * debian/nut.manpages: Install manpage nut.conf.5 (Closes: #528222) + * debian/copyright: Fix copyright-with-old-dh-make-debian-copyright + * Remove nut-snmp.lintian-overrides, not needed anymore + * debian/patches/0003-fix_spelling_and_typo.patch: Fix some spelling errors + * Add debian/libupsclient1.symbols file + * Add debian/nut.links: Re-add /etc/init.d/ups-monitor that was lost for + some reasons (Closes: #592351) + * debian/nut.lintian-overrides: Add override for + init.d-script-does-not-provide-itself /etc/init.d/ups-monitor + * Drop libupsclient1.post{inst,rm}: ldconfig call is added automatically by + debhelper + * debian/libupsclient1-dev.install: Do not ship /lib/libupsclient.la anymore + * debian/rules: Remove dpatch logic as we are using package source version + '3.0 (quilt)' + * debian/compat: Bump debhelper compatibility to 8 + + -- Laurent Bigonville Fri, 24 Dec 2010 11:46:22 +0100 + +nut (2.4.3-1.1) unstable; urgency=low + + * Non-maintainer upload. + * drivers/libhid.c: Apply r2407 from upstream to fix bug with some + low speed UPS devices. (Closes: #583371) + + -- Tim Retout Fri, 15 Oct 2010 19:31:39 +0100 + +nut (2.4.3-1) unstable; urgency=low + + * New upstream release (Closes: #544390, #528222, #539747, #526811, + #562064) + * debian/nut.install, debian/nut.manpages: + - remove cyberpower driver and manpage + - add bestfortress, clone and ivtscd drivers and manpages + * debian/rules: + - change udev dir to /lib/udev (Closes: #522327) + - replace deprecated calls to 'dh_clean -k' by dh_prep (Closes: #536599) + * debian/rules, debian/nut.install, debian/nut.install, + debian/nut.README.Debian: install configuration files, without the + sample suffix (Closes: #528641) + * debian/nut.links: restored (Closes: #522506) + * debian/nut.init: + - source nut.conf instead of default/nut for POWEROFF_WAIT(Closes: + #538173) + - fix status checking (Closes: #538785) + - improve detection of non configured system and beautify related + output (Closes: #563112) + - use 'invoke-rc.d' instead of calling the reboot script directly + - add $remote_fs to Required-Start and Required-Stop + * debian/nut.postrm: remove udev files and simplify cleanup (Closes: + #541629) + * debian/control: + - remove Luca Filipozzi from the Uploaders list (Closes: #568987) + - update Standards-Version to 3.8.4 + - remove the debconf dependency + - bump debhelper version to (>= 7) in Build-Depends, for dh_prep + - add Breaks on nut-hal-drivers to ensure we have correct udev version + * Remove debconf support since it was related to really old nut + version (Closes: #518056): + - remove nut-cgi.config, nut.config, nut-cgi.templates, nut.templates, + and po/ directory + - update nut-cgi.postinst + * debian/nut.dirs: remove /var/run/nut to conform to Debian Policy + * debian/nut.postint: + - create /var/run/nut if needed + - improve security checks + * debian/nut.README.Debian: add a security note for ups.conf + * debian/watch: URL update + + -- Arnaud Quette Wed, 24 Feb 2010 22:58:53 +0100 + +nut (2.4.1-3.2) unstable; urgency=low + + * Non-maintainer upload. + * nut.postinst: fix post-processing of nut.conf to avoid overriding + user settings (Closes: #531220) + + -- Stefano Zacchiroli Thu, 26 Nov 2009 09:30:45 +0100 + +nut (2.4.1-3.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix length of extended descriptions of packages + in debian/control + * Fix pending l10n issues. Debconf translations: + - Galician (marce villarino). Closes: #524263 + - Spanish (Noel David Torres Taño). Closes: #525125 + - Vietnamese (Clytie Siddall). Closes: #548170 + + -- Christian Perrier Tue, 20 Oct 2009 21:45:21 +0200 + +nut (2.4.1-3) unstable; urgency=low + + * Debconf templates and debian/control reviewed by the debian-l10n- + english team as part of the Smith review project. Closes: #520591 + * [Debconf translation updates] + - Japanese. Closes: #521350, #518602 + - Czech. Closes: #521662 + - German. Closes: #518005 + - Basque. Closes: #522390 + - French. Closes: #522677 + - Finnish. Closes: #522837 + - Swedish. Closes: #522973 + - Italian. Closes: #522987 + - Russian. Closes: #523122 + - Portuguese. Closes: #523600 + + -- Christian Perrier Sat, 21 Mar 2009 08:08:59 +0100 + +nut (2.4.1-2) unstable; urgency=low + + * debian/control: + - add Build-Depends libwrap0-dev to enable TCP wrappers support, + - remove again dpatch from Build-Depends, + - move back debconf to Depends since we don't use it anymore in the preinst, + - add udev to nut-hal-drivers Depends so that it can use udevadm. + * debian/rules: + - pre merge the needed changes for Ubuntu (udev path and version), + - deactivate again dpatch rules + - move the nut-cgi HTML files off /var/www to /usr/share/nut/www + - set dh_installdocs to ignore Makefile + - remove dh_installexamples + * debian/patches/*: removed since it doesn't address the issue + * debian/nut-snmp.lintian-overrides: added to address NetSNMP overlinking + * debian/nut.install: + - add an precise list of the configuration files (Closes: #254355), + - use a wildcard to specify the udev rules installation path + * debian/nut-hal-drivers.install: use a wildcard to specify the udev rules + installation path (either /etc or /lib) + * debian/nut-cgi.install: add an precise list of the configuration files + * debian/nut.preinst: + - remove previous udev rule if unchanged, otherwise move to new filename (ie + with a dash), + - don't call adduser or addgroup *at all*, since these operations should be + handled in the postinst, + - migrate /etc/default/nut content to /etc/nut/nut.conf (part #1) + * debian/nut-cgi.preinst: removed since its content is addressed by postinst. + * debian/nut-hal-drivers.preinst: + - remove previous udev rule if unchanged, otherwise move to new filename (ie + with a dash), + * debian/nut-hal-drivers.postinst: + - reinstate since it was lost in the 2.2.2-10 merge, + - use the safe way to install udev rules (udevadm trigger --action=change). + * debian/nut.postinst: + - use the safe way to install udev rules, as for nut-hal-drivers.postinst + (udevadm trigger --action=change) + - rework the user/group creation, and a commented add to the dialout group, + - migrate /etc/default/nut content to /etc/nut/nut.conf (part #2) + * debian/nut-cgi.postinst: rework the user/group creation, and a commented add + to the dialout group. + * debian/nut.postinst: reactivate the nut user removal upon purge + * debian/nut.init: + - use nut.conf instead of /etc/default/nut to start the right component(s) + - enforce the configuration checking + - add basic support for the status option (as required per LSB) + * debian/nut.default: removed since its content has been incorporated into + nut.conf + * debian/{nut-cgi,nut}.examples: removed since the sample configuration files + are now installed. + * debian/nut.README.Debian: reworked with a lot of update and completion. + * debian/nut-cgi.README.Debian: reworked with a lot of update and completion. + + -- Arnaud Quette Fri, 20 Feb 2009 10:09:52 +0100 + +nut (2.4.1-1) unstable; urgency=low + + * New upstream release + * Acknowledge the use of debhelpers (Closes: #506583) + * debian/copyright: authors and licensing (GPL2+ and GPL3+) completion + * debian/control: + - add a Pre-Depends on debconf for nut and nut-cgi, and remove the according + Depends + - add ${misc:Depends} to all Depends + - add libpowerman0-dev to the Build-Depends + - add a new nut-powerman-pdu package + - add a Recommends on bash-completion for nut + - remove Shaul Karl from the Uploaders as per his request + * debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: added for + the nut-powerman-pdu package + * debian/nut.install: + - also list the bash_completion entry + - list update due to upstream changes + * debian/nut.manpages: list update due to upstream changes + * debian/rules: + - comment the patching rules + - install the nut.bash_completion script + * debian/patches/*: removed the previous patches since fixed upstream + * debian/patches/01_snmp_ups_no_lcrypto.dpatch: add a patch to fix snmp-ups + overlinking with lcrypto (lintian possible-gpl-code-linked-with-openssl) + * debian/po/es.po: added Spanish debconf template translation (Closes: + 512494) + * debian/po/ja.po: added Japanese debconf template translation (Closes: + 512865) + * debian/watch: updated for the new 2.4 tree + * debian/nut.prerm: replace the direct call to the init script by invoke-rc.d + + -- Arnaud Quette Tue, 17 Feb 2009 14:15:24 +0100 + +nut (2.2.2-10) unstable; urgency=low + + * Merge from Ubuntu (Morten Kjeldgaard): + * debian/compat: changed to 6 + * debian/control: + - bump Build-Depends on debhelper to (>= 6.0.7~) since we are now using + dh_lintian. + - add hal to Build-Depends since configure attempts to locate /usr/lib/hal + in order to define callouts path and device information path + * debian/rules: --prefix is back to /usr, --exec-prefix=/ and --libdir=/lib + instead, which has the desired effect of moving the libraries to /lib. + The many shell commands in debian/rules, for moving files from the + install directory to the package directories have all been replaced by + dh_* calls and matching .* files. + * debian/{libupsclient1-dev.install, libupsclient1-dev.manpages, + libupsclient1.install, nut-cgi.install, nut-cgi.manpages, + nut-hal-drivers.install, nut-snmp.install, nut-snmp.manpages, + nut-xml.install, nut-xml.manpages, nut.install, nut.lintian-overrides, + nut.manpages}: added debhelper files. + * debian/nut.dirs: modified debhelper files + * debian/libupsclient1-dev.links: added to provide a link from + /usr/lib/libupsclient.so -> /lib/libupsclient.so.1.0.0 + This is a transitional measure, to salvage packages that have not yet + been updated to the new library location. Can be removed sometime in the + future. + * debian/patches/03-configure.in.dpatch: patch to configure.in adding + AC_CONFIG_MACRO_DIR([m4]) + + -- Arnaud Quette Thu, 27 Nov 2008 21:43:59 +0100 + +nut (2.2.2-9) unstable; urgency=low + + * debian/rules: also move libupsclient.so to /lib, otherwise the link is + broken (Closes: #505101) + * debian/nut-cgi.postinst: test if /etc/nut exists before chmod'ing (Closes: + #502757) + * debian/nut.TODO.Debian: some update and completion + + -- Arnaud Quette Wed, 15 Oct 2008 17:20:29 +0200 + +nut (2.2.2-8) unstable; urgency=high + + * debian/nut.links: restored since it's now handled by insserv (Closes: + #500190) + * debian/changelog: fix a typo error + * debian/rules: move libupsclient.so.1 from /usr/lib to /lib (Closes: + #491591) + * debian/nut-cgi.README.Debian: fix the permissions on /etc/nut (Closes: + #492277) + * debian/control: add Vcs-Browser and Vcs-Svn fields + + -- Arnaud Quette Tue, 30 Sep 2008 21:37:59 +0200 + +nut (2.2.2-7) unstable; urgency=high + + * debian/nut.links: removed to satisfy insserv (Closes: #492734) + * debian/po/it.po: add Italian debconf template translation (Closes: + #495781) + * debian/nut.preinst: force the nut user to be part of the extra group nut + (Closes: #493159) + + -- Arnaud Quette Mon, 15 Sep 2008 17:18:28 +0200 + +nut (2.2.2-6) unstable; urgency=low + + * tag this bug as closed by the 2.2.2 release (Closes: #490048) + * debian/nut.README.Debian: + - fix the serial udev advice (Closes: #490182) + - mention the UPS compatibility list (Closes: #447187) + * debian/po/de.po: update German debconf template translation (Closes: + #490128) + * debian/changelog: fix a typo on 2.2.2-2 release urgency + + -- Arnaud Quette Fri, 11 Jul 2008 11:30:55 +0200 + +nut (2.2.2-5) unstable; urgency=low + + * debian/po/eu.po: add Basque debconf template translation (Closes: + #489580) + * debian/control: + - add a Build-Depends on autoconfi, automake, libtool for the below patch + - bump Depends on udev to 0.124-1 to complete the fix of #489831 + * debian/rules: call autoreconf after patches application + * debian/patches/02_g_timeout_add_seconds_patch.dpatch: fix compilation + issue in the nut-hal-drivers code, when using a Glib older than 2.14 + (Closes: #489742) + * debian/nut.postint: replace the call to udevtrigger by udevadm trigger + (Closes: #489831) + + -- Arnaud Quette Mon, 07 Jul 2008 11:04:52 +0200 + +nut (2.2.2-4) unstabl e; urgency=low + + * debian/rules: fix a Lintian warning + (debian-rules-calls-debhelper-in-odd-order) + * debian/po/fi.po: add Finnish debconf template translation (Closes: + #489123) + * debian/po/ru.po: add Russian debconf template translation (Closes: + #489285) + * debian/po/vi.po: update Vietnamese debconf template translation (Closes: + #489393) + * debian/nut.templates: remove nut/change_system_user since it is not used + anymore (Closes: #486783) + + -- Arnaud Quette Sat, 05 Jul 2008 22:56:35 +0200 + +nut (2.2.2-3) unstable; urgency=low + + * debian/rules: reactivate dpatch support + * debian/control: add dpatch back to Build-Depends + * debian/patches/00list: fix the matching of the NUT HAL .fdi file (Closes: + #471828) + * debian/po/fr.po: update French debconf template translation (Closes: + #486740) + * debian.po/de.po: update the German debconf template translation (Closes: + #487187) + * debian/po/sv.po: add Swedish debconf template translation (Closes: #488217) + * debian.po/cs.po: update the Czech debconf template translation (Closes: + #488355) + * debian/po/pt.po: update the Portuguese debconf template translation (Closes: + #488403) + * debian/po/sv.po: add Galician debconf template translation (Closes: #488380) + * debian/nut.config: fix a typo in comment + + -- Arnaud Quette Fri, 27 Jun 2008 16:18:29 +0200 + +nut (2.2.2-2) unstable; urgency=low + + * debian/rules: fix HAL files installation paths (Closes: #486362) + * debian/control: + - fix conflicts (Closes: #486704, #486705) + - update Standards-Version to 3.8.0 + + -- Arnaud Quette Fri, 20 Jun 2008 21:29:31 +0200 + +nut (2.2.2-1) unstable; urgency=low + + * New upstream release (Closes: #471828, #462468, #334105, #463150) + * acknowledges NMUs (Closes: #469855) + * debian/control: + - add the new nut-xml package and its libneon dependency + - add the new libupsclient1 and libupsclient1-dev packages, with the latter + replacing nut-dev (Closes: #419684) + - remove dpatch dependency + * debian/rules: update according to upstream changes + - replace --with-lib by --with-dev + - update HAL integration + - update for the nut-xml package + - distribute the shared version of libupsclient + - comment dpatch calls + * debian/nut.postinst, debian/nut-hal-drivers.postinst: use udevtrigger to + refresh the devices permissions (Closes: #469601, #475262) + * debian/changelog: fix a typo + * debian/nut.templates: fix the short and long descriptions + * debian/libupsclient1.postinst, debian/libupsclient1.postrm: added to + handle the calls to ldconfig + * debian/nut.init: fix the call to /etc/init.d/reboot by adding the missing + "stop" parameter (Closes: 482022) + * debian/*.template: minor rework of the Debconf templates (Closes: 444151) + + -- Arnaud Quette Wed, 04 Jun 2008 13:35:41 +0200 + +nut (2.2.1-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Skip udev restart logic within chroots, closes: #469855. + + -- Joe Nahmias Sun, 09 Mar 2008 13:12:12 -0400 + +nut (2.2.1-2) unstable; urgency=low + + * debian/po/de.po: update the German po-debconf translation (Closes: + #464466) + * nut-hal-drivers.preinst: created to add to HAL user to the NUT group + (Closes: #460392) + * debian/nut-hal-drivers.postinst: created to complete the above by + restarting udev after the rules file installation + * debian/changelog: Fix some Lintian reports (syntax and spelling errors) + * debian/nut.README.Debian: completed a bit more for #334105 + + -- Arnaud Quette Fri, 8 Feb 2008 13:48:23 +0100 + +nut (2.2.1-1) unstable; urgency=low + + * New upstream release (Closes: #439986) + * acknowledges NMUs (Closes: #447961, #445000) + * debian/watch: update the URL to point the 2.2 tree + * debian/rules: + - force --udev-dir to remove udev from Build-Depends while + keeping the feature (complete #447961 fix) + - limit the above fix to linux systems not to break build on + bsd and hurd these architectures (Closes: #460732) + - fix lintian debian-rules-ignores-make-clean-error and do some more + cleanup + - remove the empty directories /usr/{include,lib} from the nut package + * debian/nut.postinst: call invoke-rc.d instead of the udev init script + (Closes: #442331) + * debian/control: + - remove udev from Build-Depends + - update Standards-Version to 3.7.3 + - remove Homepage from description and add it as a tag + - add libsnmp-dev as an alternate Build-Depends to libsnmp9-dev + * debian/po/nl.po: update the Dutch po-debconf translation (Closes: #447720) + * debian/po/fr.po: update the French po-debconf translation (Closes: #442102) + * debian/patches/*: removed since these have been applied upstream + * debian/patches/00list: emptied but kept for future use + + -- Arnaud Quette Wed, 23 Jan 2008 17:13:13 +0100 + +nut (2.2.0-2.1) unstable; urgency=low + + * Non-maintainer upload with Arnaud's permission. + * debian/nut.postinst: restart udev only if it is running already + (Closes: #447961). + * debian/nut.preinst: ignore db_get errors for nut/remove_debian_conf, + thanks to Alexander Gerasiov for the patch (Closes: #445000). + * Fixed typo in the date of the 2.2.0-2 changelog entry (Augl -> Aug). + + -- Sebastian Harl Tue, 8 Jan 2008 13:50:11 +0100 + +nut (2.2.0-2) unstable; urgency=low + + * debian/control: list udev as Build-Depends to allow the udev rules + inclusion (Closes: #437811) + * debian/nut.default: fix a typo error on UPSMON options comment (Closes: + #439407) + * debian/po/: + - add Brazilian Portuguese debconf templates translation (Closes: + #439793) + - update Portuguese debconf templates translation (Closes: 440369) + - update French debconf templates translation (Closes: 440524) + * debian/Makefile.am: update with the missing files + * debian/patches/03_libupsclient-config.dpatch: patch for the missing FLAGS + (Closes: #439985) + + -- Arnaud Quette Wed, 29 Aug 2007 16:14:11 +0200 + +nut (2.2.0-1) unstable; urgency=low + + * New upstream release (Closes: #432909, #420016, #426033) + * debian/control: + - merge the nut-usb package into nut, and update the various needed + fields (Depends, Provides, Conflicts, Suggests and Description) + - requires at least libhal-dev 0.5.8 + - complete the nut-hal-drivers Description (Homepage) + - update to policy 3.7.2 + - add po-debconf to Build-Depends + * debian/rules: + - general rewrite since the upstream now use automake + - force the evaluation of DEB_HOST_ARCH_OS for dh_gencontrol + - force udev to empty on non Linux system, for dh_gencontrol + - remove the DH_COMPAT export + - update the nut-usb specifics, not needed anymore + - nut-hal-drivers also needs the udev rules + - call debconf-updatepo to clean debconf translations + * debian/compat: creation + * debian/nut-usb.*: remove these files, and put the content in the + matching nut.* files + * debian/nut.preinst: remove the old udev rule file (025_nut...) which + was manually installed, and now addressed upstream and called 52_nut. + * debian/nut.postinst: restart udev to apply the USB rules to the + already plugged devices + * debian/nut-hal-drivers.preinst: created to add the HAL user to + the nut group + * debian/po/nl.po: added Dutch po-debconf translation (Closes: #414756) + * debian/po/pt.po: added Portuguese po-debconf translation (Closes: #415189) + * debian/patches/01_udev_rules_subsystem_usb.dpatch: update the patch + * debian/patches/02_libupsclient.dpatch: patch for the missing FLAGS + * debian/nut.templates: rewrite and simplification + * debian/nut.config: rewrite and simplification + * debian/rules: call dh_installinit with the priority set to 50 to (Closes: + #385694) + * debian/nut.default, debian/nut.init: allow to specify options for upsd and + upsmon (Closes: #420020, #434503) + + -- Arnaud Quette Tue, 17 Jul 2007 09:14:11 +0200 + +nut (2.0.5-3) unstable; urgency=low + + * debian/patches/01_udev_rules_subsystem_usb.dpatch: rework that + patch to be more generic + + -- Arnaud Quette Fri, 02 Feb 2007 15:38:59 +0100 + +nut (2.0.5-2) unstable; urgency=low + + * debian/patches/*: add a patch to fix the udev rule SUBSYSTEM from + usb_device to usb (thanks to Joey Hess) (Closes: #409080) + * debian/control: + - replace the udev substvar by udev + - nut Conflicts with nut-{usb,snmps} <= 2.0.4 and nut-{usb,snmp} + Depends upon 2.0.5 (Closes: #407882) + * debian/rules: dh_gencontrol no more calls -V for udev + + -- Arnaud Quette Thu, 01 Feb 2007 14:50:49 +0100 + +nut (2.0.5-1) unstable; urgency=low + + * New upstream release (Closes: #406045, #380304, #399741) + * debian/rules: + - replaces CHANGES by ChangeLog + - replace the dummycons installation by dummy-ups + - integrate the --with-htmlpath option + * debian/nut-cgi.docs: created to install data/html/README + * debian/nut.init: LSB compliance update + * debian/control: add lsb-base (>= 3.0-6) to Depends for LSB compliance + + -- Arnaud Quette Tue, 16 Jan 2007 10:42:36 +0100 + +nut (2.0.4-3) unstable; urgency=high + + * acknowledges NMUs (Closes: #396704, #389350) + * debian/nut-usb.postinst: remove the symlinking of the udev file since it's + not useful anymore (Closes: #400215) + * native udev rules are now used (Closes: #359802, #380304) + * debian/po/de.po: add German po-debconf template translation (Closes: + #400285) + * debian/nut.config: change the medium priorities to high (Closes: #388945) + * debian/nut.init: improve drivers startup report + + -- Arnaud Quette Wed, 20 Dec 2006 11:07:30 +0100 + +nut (2.0.4-2.3) unstable; urgency=high + + * Non-maintainer upload. + * Some polish on top of the previous NMU. + * Remove the hotplug alternative; we no longer support it, so it's no + longer acceptable in place of udev. Correspondingly, rename the + substvar to ${udev}. (Closes: #396704) + * Drop debian/nut-usbups.rules and use upstream's rules instead. Modify + debian/rules correspondigly, patch from Arnaud Quette. + + -- Steinar H. Gunderson Fri, 17 Nov 2006 01:12:54 +0100 + +nut (2.0.4-2.2) unstable; urgency=high + + * Non-maintainer upload. + * In the udev script, replace the RUN actions by MODE and GROUP actions, as + per suggestion from the maintainer; should fix permission issues. + (Closes: #396704) + + -- Steinar H. Gunderson Thu, 16 Nov 2006 15:38:43 +0100 + +nut (2.0.4-2.1) unstable; urgency=low + + * NMU + * not removing nut user on purge (Closes: #389350) + + -- Florian M. Weps Thu, 12 Oct 2006 11:19:37 +0200 + +nut (2.0.4-2) unstable; urgency=low + + * debian/rules: replace $PWD by CURDIR to satisfy buildd + * debian/nut.default, debian/nut.init: make the bug 358696 workaround + optional as it might be dangerous under some circumstances (closes: + #358696) + + -- Arnaud Quette Tue, 01 Aug 2006 08:50:26 +0200 + +nut (2.0.4-1) unstable; urgency=low + + * New upstream release + - driver do not use /var anymore when called for shutdown/poweroff + (closes: #332846) + - fixes the newhidups crash upon device reconnexion (closes: #354305, + #359769) + * debian/nut.preinst: syntax enhancement to avoid issue when the nut user + already exists (closes: #378970) + * debian/nut-cgi.postinst: fix wrong permissions (closes: #378818) + * debian/po/cs.po: update Czech translation of nut debconf messages (closes: + #366738) + * debian/nut.default, debian/nut.init: "poweroff" workaround to deal with + BIOS default of "On/Off state: Last state" and system halting itself + before the UPS cuts power (closes: #358696) + * debian/nut-usbups.rules: fix the broken udev rules (closes: #359801) + + -- Arnaud Quette Thu, 27 Jul 2006 15:20:46 +0200 + +nut (2.0.3-4) unstable; urgency=low + + * debian/nut-usb.postinst: generate the /etc/udev/rules/ file + * debian/rules: + - install the right udev rule file (not the upstream one) + - install the debian/hotplug file as libhidups, as it's compatible + with hotplug and udev styles + + -- Arnaud Quette Mon, 13 Mar 2006 08:52:25 +0100 + +nut (2.0.3-3) unstable; urgency=low + + * debian/rules: + - fix a wrong symlink for the udev rule files (closes: #354262) + - add a temporary workaround to clean drivers/tripplite_usb + + -- Arnaud Quette Mon, 27 Feb 2006 15:35:32 +0100 + +nut (2.0.3-2) unstable; urgency=low + + * debian/nut.init: fix the creation of the PID directory, as /var is now volative. + This bug has been identified in Ubuntu (Launchpad #6679) + * debian/nut-cgi.postrm: suppress the deletion of the nut user as it's not + needed (closes: #319395) + * debian/nut-cgi.preinst: suppress that file as we do not need to check and create + the nut user and group for nut-cgi + * debian/nut-cgi.postinst: enhanced to ensure the /etc/nut directory and nut-cgi + configuration files are readable by others + * debian/nut-cgi.README.Debian: improve the documentation about configuration + files permissions + + -- Arnaud Quette Fri, 24 Feb 2006 10:05:25 +0100 + +nut (2.0.3-1) unstable; urgency=low + + * New upstream release + - include the improved USB driver (closes: #300115) + - fix mge-utalk regression (closes: #315431) + - fix USB device claiming and logging (closes: #322901) + * debian/nut-cgi.config: complete the typo fixes from 2.0.2-1 and remove exit + calls (closes: #308215) + * debian/nut.config: remove exit calls + * debian/hotplug: add this file to manage hotplug and udev style permissions settings + * debian/nut-usbups.rules: embed a modified version of the upstream file + * debian/control: + - make hotplug | udev Depends conditionnal, from rules + - remove libusb-0.1-4 Depends as it is already listed with shlibs:Depends + * debian/rules: + - generate debian/control Depends for hotplug | udev + - also install udev files (closes: #338738, #332939) + - call the clean rule before distclean + * debian/nut.README.Debian: + - update the Installation §2 to reflect udev changes on serial port permissions. + Users need to manually add the nut group to the dialout group (closes: #325878, + #334105) + - some other minor update + + -- Arnaud Quette Tue, 21 Feb 2006 13:57:35 +0100 + +nut (2.0.2-2) unstable; urgency=low + + * debian/nut-cgi.postinst: load confmodule + * debian/nut-hidups/*: remove this unneeded directory + * debian/control: + - Update build dependency from libsnmp5-dev to libsnmp9-dev (closes: + #326410) + - Changes nut-usb wrong dependency from libusb-dev to libusb-0.1-4 (closes: + #320315) + - add debconf (>= 0.5.00) and adduser to nut/nut-cgi Depends + * debian/copyright: update the FSF address and the Authors + * debian/po/vi.po: add the Vietnamese translation for debconf, from Clytie + Siddall ((closes: #316327) + + -- Arnaud Quette Fri, 07 Oct 2005 23:35:55 +0200 + +nut (2.0.2-1) unstable; urgency=low + + * New upstream release: + - build respect LDFLAGS (closes: #265439) + - fix etapro brokeness (closes: #305730) + - fix shutdown/restart problems with mge-shut (closes: #302190) + - fix mge-utalk support for older units (closes: #315431) + * debian/po/fr.po: update the French debconf templates, thanks to Michel + Grentzinger (closes: #306541) + * debian/rules: + - install hotplug files for the newhidups USB driver + - suppress the snmp-ups.8 manpage workaround + * debian/nut-usb.prerm: created to remove hotplug files + * debian/control: + - add hotplug Depends for nut-usb + - upgrade Debian Policy to 3.6.2 + * debian/patches/*: remove all patch and empty 00list as all has + been fixed upstream + * debian/nut-cgi.config: integrate the typo fixes that was blocking + upgrade from woody to sarge + * debian/nut-cgi.preinst: remove an unneeded blank line + * acknowledge NMU from Craig Small (closes: #302189) + + -- Arnaud Quette Mon, 27 Jun 2005 11:29:52 +0200 + +nut (2.0.1-3) unstable; urgency=low + + * debian/patches/01_cleanSourceFromlibupsclient.dpatch: removed as it + has been fixed upstream in 2.0.1 + * debian/patches/00list: re enabled for the below patch + * debian/patches/01_upsstatsCgiNoHostCrash.dpatch: added while waiting + for the upstream fix (closes: #302902) + * debian/nut-cgi.templates: added nut-cgi/major_template_changes + * debian/nut-cgi.config: use nut-cgi/major_template_changes (closes: + #301184) + * debian/nut-cgi.README.Debian: reworked, and mention upgrade and + installation. + * debian/nut.README.Debian: mention the missing UPGRADING file, and complete + the upsmon.conf lines with the mandatory POWERDOWNFLAG and SHUTDOWNCMD + (closes: #302182) + * debian/nut.templates: add nut/2_0_upstream_changes to deal with the new + changes + * debian/nut.config: use the above nut/2_0_upstream_changes (closes: + #301060) + + -- Arnaud Quette Fri, 15 Apr 2005 13:52:32 +0100 + +nut (2.0.1-2.1) unstable; urgency=low + + * Non-maintainer upload + * NUT nows powersdown Closes: #302189 + + -- Craig Small Thu, 7 Apr 2005 11:47:58 +1000 + +nut (2.0.1-2) unstable; urgency=low + + * debian/control: add missing Build-Depends for dpatch, thanks to Kurt + Roeckx (closes: #298218) + + -- Arnaud Quette Mon, 07 Mar 2005 16:29:32 +0100 + +nut (2.0.1-1) unstable; urgency=low + + * New upstream release (closes: #247671, #283539) + * debian/watch: update URL to match the current 2.0 stable tree + * debian/rules: + - change install-misc target to install-lib following the upstream rule + name change + - error reporting enhancements, thanks to Karl Shaul (inserted a set -e at + the start of every for loop ; from Debian Policy §4.5). + - workaround to include dummycons test driver and its manpage in nut-dev + while waiting for an upstream rule + - workaround to remove snmp-ups manpage from the nut package, to avoid a + file conflict with nut-snmp, while waiting for an upstream rule + - remove the workaround from 1.4.2-2 to suppress libupsclient.a and + newhidups upon make clean + - comment the "conf files workaround" as it's no more needed + * debian/control: + - add nut-dev to nut Suggests + - complete nut-dev to include dummycons testing driver + - add libusb (>= 0.1.8) nut-usb Depends to benefit of the kernel driver + unbind feature (needed for USB models other than MGE UPSs) + - suppress libgd1 from Build-Depends to fix a DebCheck warning, as it + is listed in Section oldlibs + * debian/nut.README.Debian: add a section "(3) /etc/nut/upsd.conf" + and add references to sample config files and UPGRADING information + (closes: #269485) + * debian/nut.TODO.Debian: add this file to track planned and unfinished + tasks + * debian/nut-cgi.README.Debian: improve a bit the text + * debian/nut.init: test powerdown flag (upsmon -K) and use the new + upsdrvctl exit codes (thanks to Karl Shaul) + * debian/po/cs.po: add Czech translation of debconf templates (patch from + Miroslav Kure) (closes: #283225) + * debian/patches: add basic infrastructure for dpatch + + -- Arnaud Quette Fri, 04 Mar 2005 11:40:13 +0100 + +nut (1.4.3-2) unstable; urgency=low + + * debian/control: add nut-dev package with NUT lib and headers (closes: + #263937) + * debian/rules: change install-misc for the above nut-dev. + * debian/control: invert apache and httpd in nut-cgi Recommends to solve a + lintian warning + + -- Arnaud Quette Sun, 08 Aug 2004 16:07:04 +0200 + +nut (1.4.3-1) unstable; urgency=low + + * New upstream release + * debian/control: change Homepage URL to "www" instead of "random" and + remove trailing slash / dot (closes: #254084) + * debian/control: add apache to nut-cgi Recommends to have a non-virtual + package alternative + + -- Arnaud Quette Thu, 29 Jul 2004 22:58:03 +0200 + +nut (1.4.2-3) unstable; urgency=low + + * debian/control: add libusb-dev version in Build-Depends (closes: #248952) + * debian/copyright: update upstream URL and copyright owners (closes: + #242422) + * debian/po/ca.po: add Catalan translation of debconf templates (patch from + Aleix Badia i Bosch) (closes: #248741) + * debian/nut-cgi.README.Debian: added to describe nut-cgi configuration + (thanks to Marius Gedminas) (closes: #249825) + * debian/nut.README.Debian: minor change + + -- Arnaud Quette Fri, 28 May 2004 13:10:01 +0200 + +nut (1.4.2-2) unstable; urgency=low + + * debian/control: add libusb-dev to Build-Depends (closes: #240586) + * debian/rules: workaround to clean libupsclient.a and newhidups (complete + the above) + + -- Arnaud Quette Sun, 28 Mar 2004 18:30:01 +0100 + +nut (1.4.2-1) unstable; urgency=low + + * New upstream release + * Fixes mge-shut settings and shutdown problems (closes: #232402, #234037) + * debian/nut.init: fixes powerdown rule to prevent from forced UPS shutoff + upon normal shutdown, and add a warning when POWERDOWN flags isn't + defined, thanks to Loic Le Loarer (closes: #236092) + * debian/control: update nut-usb Description to reflect the add of newhidups + and energizerups drivers. + * debian/rules: update nut-usb build and install rules to match the new ones + + -- Arnaud Quette Thu, 25 Mar 2004 16:30:01 +0100 + +nut (1.4.1-release-2) unstable; urgency=low + + * recall previously malformed closed bug (closes: #227965, #227964) + * debian/control: Build-Depends to allow libgd*-noxpm (closes: #231153) + * debian/control: update Homepage address + * debian/watch: update target address + + -- Arnaud Quette Thu, 05 Feb 2004 19:19:56 +0100 + +nut (1.4.1-release-1) unstable; urgency=low + + * New upstream release + * debian/po/*: add gettext support for debconf templates (patch from Michel + Grentzinger) (Close: #227965) + * debian/po/fr.po: add French translation of debconf templates (patch from + Michel Grentzinger) (Close: #227964) + + -- Arnaud Quette Sun, 18 Jan 2004 21:19:56 +0100 + +nut (1.4.1-pre3-5) unstable; urgency=low + + * debian/nut.postrm: fix inverted test with -z (fix a purge error) + * debian/nut.postrm: same as above + * debian/nut.postrm: suppress check_and_delete_group() as it is not useful + * debian/nut-cgi.postrm: same as above + * debian/nut.postinst: test if /etc/nut exists before chmod'ing (fix an + install error) + + -- Arnaud Quette Sat, 15 Nov 2003 22:10:23 +0100 + +nut (1.4.1-pre3-4) unstable; urgency=low + + * debian/nut.preinst: wider check for user/group creation (closes: #217980) + * debian/nut.postrm: rework purge rule for user/group deletion (2nd part of + the above fix) + * debian/nut-cgi.postrm: rework purge rule for user/group deletion (2nd part of + the above fix) + * debian/nut-cgi.preinst: wider check for user/group creation (same as + above) + * debian/rules: suppress {nut,nut-cgi}/etc/nut/*.sample that were wrongly + installed (linked to #172217) + * debian/nut.examples: created to complete above fix + * debian/nut-cgi.examples: created to complete above fix + * debian/nut.postrm: suppress /etc/nut/*.sample file (to correct above + problem) + * debian/nut-cgi.postrm: suppress /etc/nut/*.sample file (same as above) + * Maintainer upload (forgotten previously), closes: #200182, #203061 + + -- Arnaud Quette Sat, 15 Nov 2003 10:10:23 +0100 + +nut (1.4.1-pre3-3) unstable; urgency=low + + * clients/Makefile.in: install parseconf.h to fix compilation error with wmnut + * man/Makefile.in: fix a broken upstream rule (hidups manpages installed two + times) that prevent from installing nut-usb package. This will be fixed in + the next upstream + + -- Arnaud Quette Mon, 10 Nov 2003 17:10:23 +0100 + +nut (1.4.1-pre3-2) unstable; urgency=low + + * man/Makefile.in: fix a broken upstream rule (powernet and snmp-ups + manpages installed two times) that prevent from installing nut-snmp package + + -- Arnaud Quette Mon, 10 Nov 2003 12:59:23 +0100 + +nut (1.4.1-pre3-1) unstable; urgency=low + + * New upstream release + * clients/Makefile.in: suppress the one line patch to install parseconf.o + (from 1.4.1-pre2-1). This is now cleanly addressed by the upstream source + by installing libupsclient.a (closes: #216496) + * debian/rules: change dh_shlibdeps's exclude from upsfetch.o to libupsclient.a + * debian/nut.preinst: fix install rule to catch all cases of nut user and group + needed creation. Previously, post purge install case was not (closes: #217980) + * debian/rules: suppress the work-around for nut-usb package following + the upstream correction (from 1.4.1-pre1-2) + * debian/control: Final package take over ; switch Luca Filipozzi as + co maintainer, and Arnaud Quette as new maintainer. + * debian/watch: point the authoritative download server (penguin.harrison) + and stable releases ("nut/release/1.4/" directory ; it won't work for + final 1.4.1, but for 1.4.2) + * debian/nut.postrm: rework purge rule to suppress a warning + + -- Arnaud Quette Sat, 8 Nov 2003 12:15:23 +0100 + +nut (1.4.1-pre2-1) unstable; urgency=low + + * New upstream release + * debian/control: created package nut-usb for finer deps management + * debian/rules: added rules for nut-usb package, and a work-around + for install directories creation while waiting for upstream correction. + * drivers/Makefile.in: suppressed hidups from PROGS, thanks to the above + * debian/control: repeat Homepage for every sub-package + * debian/control: completed nut Suggests + * debian/control: changed Arnaud Quette address to the good Debian one + * debian/rules: suppress the work-around for nut-snmp package following + the upstream correction(from 1.4.1-pre1-1) + * debian/nut-cgi.preinst: always test if nut user exist as nut-cgi + can be installed without nut, so not having nut user created (closes: + Bug#213730) + * debian/nut-cgi.postinst: chown root:nut to address a potential security + issue (see 1.2.1-2) + * clients/Makefile.in: one line patch to install parseconf.o. This solve + a problem with wmnut package (can't build anymore due to unresolved + symbols). This point will be more cleanly address in next upstream + + -- Arnaud Quette Sat, 18 Oct 2003 09:05:01 +0200 + +nut (1.4.1-pre1-2) unstable; urgency=low + + * debian/control: rewrotte descriptions to follow Debian Policy. A + further enhancement will be to use debian/nut.substvars (thanks + to Shaul Karl) (closes: Bug#209569) + * drivers/Makefile.in: added back hidups to PROGS (closes: Bug#208248) + * debian/control: added libgd2-* to Build-Depends to allow more choices + * debian/control: added Shaul Karl as co-maintainer + * debian/control: changed Arnaud Quette address to Debian's one + + -- Arnaud Quette Sun, 14 Sep 2003 12:11:45 +0200 + +nut (1.4.1-pre1-1) unstable; urgency=low + + * New upstream release (closes: Bug#203856) + * recall ignored 1.4.0-2 changes (closes: Bug#204193, Bug#199895) + * debian/nut.preinst: already solved bug in 1.4.0-3 (closes:Bug#206229) + * debian/control: created package nut-snmp (closes: Bug#195645) + * debian/rules: added rules for nut-snmp package, and a work-around + for install directories creation while waiting for upstream correction. + * debian/control: change Build-Depends to "libgd-xpm-dev | libgd-dev" to + allow easy woody backport (thanks to Martin Maney) + * debian/nut.prerm: wait for upsd stop before calling the remove tempo + + -- Arnaud Quette Sat, 23 Aug 2003 13:55:32 +0200 + +nut (1.4.0-3) unstable; urgency=low + + * debian/nut.prerm: fix a post removal warning by adding a tempo + (1 sec) before removing /var/run/nut + * debian/nut.preinst: reworked install rule (thanks Shaul) (closes:Bug#204153) + + -- Arnaud Quette Fri, 8 Aug 2003 23:14:26 +0200 + +nut (1.4.0-2) unstable; urgency=low + + * debian/watch: update URL to point NUT 1.4 (thanks to Shaul Karl) + * debian/nut.dirs: add /var/run/nut (thanks Shaul) (closes: Bug#204193) + * debian/nut-cgi.preinst: created for allowing separate installation + (without nut) (closes: Bug#199895) + * debian/rules: remove the "--with-group=nut" call to configure as it + is obsolete (thanks Shaul) + * debian/control: add Arnaud Quette as co-maintainer + + -- Arnaud Quette Thu, 7 Aug 2003 20:14:26 +0200 + +nut (1.4.0-1) unstable; urgency=low + + * New upstream release (closes: Bug#203061) + * debian/nut.init: change Init-script ordering (start_stop_server) to + address data stale warning (closes: Bug#200182) + + -- Arnaud Quette Fri, 1 Aug 2003 18:42:22 +0200 + +nut (1.2.2-1) unstable; urgency=low + + * New upstream release + * debian/rules: gidNumber of group 'nobody' is 65534 not 65535 + (thanks Shaul) (closes: Bug#180532) + + -- Luca Filipozzi Fri, 18 Apr 2003 20:12:17 -0700 + +nut (1.2.1-2) unstable; urgency=low + + * debian/nut.README.Debian: s/smartapc/apcsmart/ (closes: Bug#177713) + * debian/nut.postinst: chown root:nut instead of chown nut:nut for files + in /etc/nut/* and for the dirs /etc/nut, /var/run/nut, /var/lib/nut; + this addresses a potential security issue as described in the comments + contained in /etc/nut/upsmon.conf (closes: Bug#180059) + * debian/nut.init: sysadmins might modify POWERDOWNFLAG in + /etc/nut/upsmon.conf without realizing that it is hard coded in the + /etc/init.d/nut init script; fix the init script to parse the + configuration file for the value of POWERDOWNFLAG (closes: Bug#179686) + * debian/nut.init: print a message prior to shutdown (closes: Bug#180242) + + -- Luca Filipozzi Sat, 8 Feb 2003 18:12:11 -0800 + +nut (1.2.1-1) unstable; urgency=low + + * New upstream release + * debian/control: nut provides/conflicts ups-monitor (closes: Bug#170655) + * debian/nut.postinst and debian/nut-cgi.postinst: + test -f file before chown/chmod (closes: Bug#170553) + * debian/nut.postinst: fix permissions on /var/lib/nut (closes: Bug#173318) + * debian/nut.preinst: change how the 'nut' user/group are detected and + created (closes: Bug#173321) + * between 1.1.11-1 incorrectly installed conffiles into /etc/nut + with the extension .sample; fortunately, this release of the package + did not migrate to testing and since 1.1.11-2 the .sample extension + has not been used (closes: Bug#172217) + * debian/nut.preinst: change the way the nut user/group are detected + before adduser is called (closes: Bug#170653) + * debian/nut.README.Debian: fixed minor doc error (Closes: Bug#173673) + + -- Luca Filipozzi Wed, 11 Dec 2002 19:39:02 -0800 + +nut (1.2.0-1) unstable; urgency=low + + * New upstream release + * debian/nut-cgi.postinst: fix permissions on /etc/nut/hosts.conf and + /etc/nut/upsset.conf so that they are world readable (Closes: Bug#167332) + * debian/nut.init: added sleep 5 to allow for an orderly restart (thanks + to Shaul Karl for pointing this out) + + -- Luca Filipozzi Tue, 19 Nov 2002 09:44:25 -0800 + +nut (1.1.12-1) unstable; urgency=high + + * New upstream release (urgency high due to SECURITY FIX) + * SECURITY FIX: a file permission problem potentially exposes + non-system usernames/passwords in /etc/nut/upsd.users that can be used + to DoS a machine running nut by contacting the nut daemon and instructing + it to power off the machine; fixed. + * debian/nut.postinst: change permissions of /etc/nut/upsd.users and + other conffiles to 640 (Closes: Bug#165445) + * debian/nut.config: use db_fset to reset the boolean question that prompts + users to accept whether to continue with the installation of this version + of nut should they answer no (Closes: Bug#165376) + * debian/control: make nut-cgi Replace nut so that conflicting files + can be installed (Closes: Bug#165049) + * drivers/Makefile.in: restored original version that doesn't build + hidups, snmp-ups or powernet; hidups doesn't build on m68k; snmp-ups + and powernet require libsnmp5-dev but libsnmp5-dev requires OpenSSL; + unfortunately, upstream's license doesn't have the OpenSSL exclusion + clause... work is proceeding on porting to gnutls + * drivers/Makefile.in + debian/rules: figured out a mechanism to build + hidups on those architectures that have /usr/include/linux/hiddev.h + * debian/control: build-depend on libgd-xpm-dev (really closes Bug#164832) + + -- Luca Filipozzi Sat, 19 Oct 2002 16:47:35 -0700 + +nut (1.1.11-2) unstable; urgency=low + + * changed build dependencies to avoid depending on a pure-virtual package + without providing a default (thanks Junichi Uekawa) (Closes: Bug#164832) + * debian/rules calls $(MAKE) install-misc so that the header and the .o file + are released with the nut package (too small for a nut-dev package?) + + -- Luca Filipozzi Tue, 15 Oct 2002 08:50:18 -0700 + +nut (1.1.11-1) unstable; urgency=low + + * New upstream release + (Closes: Bug#151047, Bug#155943, Bug#153174, Bug#160178, Bug#164024) + * the "Hey Dorothy, you aren't in Kansas anymore" release + * warning: significant changes since nut 0.45.5; specifically: + - upsd listens on a different port (was 3305; now 3493 (IANA-assigned)) + - configuration file formats have changed + - ups driver internals haved changed: 'common main.c' + upsdrvctl + - some ups drivers that were not ported to the new common model have + been dropped by the upstream author (submit a patch to rectify) + - the init script is significantly simpler + - the daemons will NOT restart on upgrade from from 0.45.5 or earlier + - there is an /etc/default/nut file that defines whether the daemons + will be started + - removed nut-doc package... far too small to merit being on its own + + -- Luca Filipozzi Mon, 14 Oct 2002 13:33:58 -0700 + +nut (0.45.5-rel-3) unstable; urgency=low + + * "unlink .sock file before starting up; this was keeping the drivers down + after a system crash where the .sock files remained" -- upstream + (Closes: Bug#149150, Bug#139859) + + -- Luca Filipozzi Fri, 7 Jun 2002 22:34:53 -0700 + +nut (0.45.5-rel-2) unstable; urgency=low + + * debian/control: nut and nut-cgi suggest rather than recommend + the documentation package, nut-doc (Closes: Bug#144763) + * debian/nut-cgi.dirs: change absolute paths to relative (Closes: Bug#144746) + * debian/rules: remove upsdrvctl.8 from package (Closes: Bug#143099) + + -- Luca Filipozzi Sun, 2 Jun 2002 21:39:14 -0700 + +nut (0.45.5-rel-1) unstable; urgency=low + + * New upstream release + * debian/rules: moved model daemons to /lib/nut to reduce chance of + namespace conflicts (Closes: Bug#141209) + * debian/rules: moved sample configuration files to + /usr/share/doc/nut/examples (Closes: Bug#140472) + # debian/postinst: change mode and ownership of files in /etc/nut/ on + configure to allow ready by nut/nut (Closes: Bug#142116) + + -- Luca Filipozzi Sun, 14 Apr 2002 13:37:13 -0700 + +nut (0.45.4-rel-3) unstable; urgency=low + + * added runtime dependency on adduser (Closes: Bug#137887) + + -- Luca Filipozzi Sat, 16 Mar 2002 21:41:53 -0800 + +nut (0.45.4-rel-2) unstable; urgency=low + + * Changed debian/rules to call install-misc which installs the development + files upsfetch.[oh]. There are too few development files to merit a + nut-dev package. + + -- Luca Filipozzi Sun, 24 Feb 2002 15:47:56 -0800 + +nut (0.45.4-rel-1) unstable; urgency=low + + * New upstream release + + -- Luca Filipozzi Sun, 24 Feb 2002 11:56:46 -0800 + +nut (0.45.4-pre5-1) unstable; urgency=low + + * New upstream release (Closes: Bug#131673) + + -- Luca Filipozzi Sun, 17 Feb 2002 17:31:32 -0800 + +nut (0.45.1-release-2) unstable; urgency=low + + * applied POWERDOWNFLAG upstream-patch (Closes: Bug#111979) + * applied apcsmart calibration user-patch (Closes: Bug#111978) + * modified models/main.c so that it does a forceshutdown *before* + attempting to chdir into /var/lib/nut (Closes: Bug#112540) + + -- Luca Filipozzi Tue, 23 Oct 2001 16:22:57 -0700 + +nut (0.45.1-release-1) unstable; urgency=low + + * New upstream release + * Fixed conffile problem with nut-cgi package (Closes: #108687) + + -- Luca Filipozzi Sat, 18 Aug 2001 11:58:57 -0700 + +nut (0.45.1-pre4-1) unstable; urgency=low + + * New upstream release (Closes: #101105) + + -- Luca Filipozzi Sun, 5 Aug 2001 13:59:12 -0700 + +nut (0.44.3-pre6-3) unstable; urgency=low + + * Init script now poweroffs the UPS' correctly. (Closes: #96790) + * Changed section of nut-doc to 'doc' (Closes: #94842) + * Not upgrading to new upstream source (0.45.0) until it is released. + * Not upgrading to upstream source (0.44.3) since (0.45.0) is coming soon. + + -- Luca Filipozzi Sun, 3 Jun 2001 16:05:01 -0700 + +nut (0.44.3-pre6-2) unstable; urgency=low + + * init script follows policy (Closes: #90346) + + -- Luca Filipozzi Mon, 19 Mar 2001 15:21:44 -0800 + +nut (0.44.3-pre6-1) unstable; urgency=low + + * New upstream release + * modified configure.in so that it doesn't produce an error when it tests + for the existance of group "nut" (Closes: #88126) + + -- Luca Filipozzi Sun, 11 Mar 2001 11:48:54 -0800 + +nut (0.44.3-pre4-1) unstable; urgency=low + + * New upstream release + * create pidfile modifications reworked to use upstream's writepid() function + * modified init script to support these changes... note that users MUST + follow the convention for the UPS directives in the sample upsd.conf; + a warning has been placed in said file + + -- Luca Filipozzi Sun, 25 Feb 2001 19:19:29 -0800 + +nut (0.44.2-6) unstable; urgency=low + + * modified prerm and postinst so that the daemon(s) is restarted only in the + postinst rather than stopped in prerm and started later in postinst thereby + stopping the daemon(s) shortest possible time (Closes: #83614) + * modified all the daemon(s)' source code so that they create pidfiles + * modified the init script so that it uses the pidfiles + + -- Luca Filipozzi Sun, 11 Feb 2001 18:23:44 -0800 + +nut (0.44.2-5) unstable; urgency=low + + * removed "function" keyword from init script (Closes: #83569) + * modified the pre and post scripts so that #DEBHELPER# is at the bottom + * modified debian/rules so that nut-doc is created (Closes: #85059) + * added support for MGE UPS (thanks to Ryan Murray) (Closes: #83743) + + -- Luca Filipozzi Sat, 10 Feb 2001 20:09:35 -0800 + +nut (0.44.2-4) unstable; urgency=low + + * control file changed such that arch=any for nut-doc (Closes: #83323) + + -- Luca Filipozzi Tue, 23 Jan 2001 17:49:25 -0800 + +nut (0.44.2-3) unstable; urgency=low + + * Added a build conflict against libgd-gif1-dev because it provides + libgd-dev but does not have PNG support. (Closes: #82607) + * Fixed a path problem in debian/rules that had manpages installing + in /share/man/man8 instead of /usr/share/man/man8. + + -- Luca Filipozzi Wed, 17 Jan 2001 19:11:56 -0800 + +nut (0.44.2-2) unstable; urgency=low + + * Modified README.Debian to address bad doc path (Closes: #82460) + * Slight improvements to README.Debian, as well. + + -- Luca Filipozzi Mon, 15 Jan 2001 21:11:39 -0800 + +nut (0.44.2-1) unstable; urgency=low + + * New upstream release + + -- Luca Filipozzi Tue, 9 Jan 2001 08:33:56 -0800 + +nut (0.44.1-4) unstable; urgency=low + + * fixed path problem with cgi files; they *are* in /usr/lib/cgi-bin/nut now + + -- Luca Filipozzi Wed, 22 Nov 2000 08:47:54 -0800 + +nut (0.44.1-3) unstable; urgency=low + + * the following changes suggested by Patrik Rak (Closes: #77144, #77195) + * added better preinst(install) checks for group membership + * modified upstream upsd.conf to use correct paths in the UPS directives + * modified upstream upsd.conf to have better ACCESS directive examples + * modified upstream upsmon.conf to have better MONITOR directive examples + * modified upstream upsmon.conf to use a different POWERDOWNFLAG location + (location must be on the root filesystem... otherwise powerdownflag is + not found!) + * modified init script to parse upsmon.conf for the POWERDOWNFLAG location + * modified init script's poweroff section so that all args are recognized + * improved the documentation, primarily README.Debian + * installation scripts modified so that the dependency on adduser >= 3.14 + can be removed; this allows for the creation of potato packages + * the nut user is no longer part of the dialout group; users will have to + manually change the permissions on the serial port devices; + a nut group is created at the same time as the nut user; users should use + the nut group for the serial port permissions: chown root.nut /dev/ttyS0 + (suggested by Shaul Karl and Patrik Rak) + * the cgi scripts are moved to /usr/lib/cgi-bin/nut/* + (suggested by Shaul Karl) + * init script changed significantly to address argument passing problems + (reported by Shaul Karl) + + -- Luca Filipozzi Thu, 16 Nov 2000 11:42:42 -0800 + +nut (0.44.1-2) unstable; urgency=low + + * removed else clause on detection of existing "nut" user (Closes: #76721) + "install" creates the user nut; "remove" doesn't remove it, "purge" does; + a re-"install" would find an existing "nut" user and exit on error; fixed + * fixed a possible bashism (Closes: #72711) + + -- Luca Filipozzi Fri, 10 Nov 2000 10:06:05 -0800 + +nut (0.44.1-1) unstable; urgency=low + + * New upstream release + * serious repurcussion to existing users of nut... the configuration files + have changed somewhat... a critical debconf warning informs the user of + this fact + * binaries are to remains in /sbin (Closes: #69525) + * init script no longer relies on /usr being mounted (Closes: #70033) + * + + -- Luca Filipozzi Fri, 10 Nov 2000 10:05:55 -0800 + +nut (0.44.0-4) unstable; urgency=low + + * Moved man pages from section 1 to section 8. (Closes: #68819) + * nut-doc suggest rather than recommends nut and nut-cgi. (Closes: #69400) + + -- Luca Filipozzi Fri, 18 Aug 2000 23:15:18 -0700 + +nut (0.44.0-3) unstable; urgency=low + + * Minor fixes to packaging scripts (Closes: #67649). + * Created new doc package: nut-doc. + + -- Luca Filipozzi Mon, 24 Jul 2000 10:18:19 -0700 + +nut (0.44.0-2) unstable; urgency=low + + * Minor fixes to init script and to list of undocumented binaries. + + -- Luca Filipozzi Sat, 22 Jul 2000 19:11:42 -0700 + +nut (0.44.0-1) unstable; urgency=low + + * New upstream release + + -- Luca Filipozzi Thu, 20 Jul 2000 09:26:04 -0700 + +nut (0.43.2-2) unstable; urgency=low + + * fixes: Bug#67316: nut: default permissions could reveal passwords + Files in /etc/nut are now 600 by default. + * fixes: Bug#67314: nut: uses old FHS directory /var/state + Now uses /var/lib as per FHS guidelines. + * fixes: Bug#66988: nut_0.43.2-1(unstable): Missing build dependencies + Added debhelper to the build dependencies. + + -- Luca Filipozzi Tue, 18 Jul 2000 14:55:03 -0700 + +nut (0.43.2-1) unstable; urgency=low + + * Initial Release. + * Modification to upstream source: configure.in, common/common.c, + and models/upscommon.c changed to support different configuration + options... --with-user and --with-group which accept a username + and a groupname (rather than a uid/gid as before). + * Modification to upstream source: /var/state/nut is used instead + of /var/state/ups in conf/upsd.conf. + + -- Luca Filipozzi Wed, 3 May 2000 20:50:30 -0700 + +Local variables: +mode: debian-changelog +End: diff --git a/obs/debian.compat b/obs/debian.compat new file mode 100644 index 0000000000..45a4fb75db --- /dev/null +++ b/obs/debian.compat @@ -0,0 +1 @@ +8 diff --git a/obs/debian.control b/obs/debian.control new file mode 100644 index 0000000000..5454404e5c --- /dev/null +++ b/obs/debian.control @@ -0,0 +1,297 @@ +Source: nut +Section: admin +Priority: optional +Maintainer: Arnaud Quette +Uploaders: Laurent Bigonville +Build-Depends: debhelper (>= 8.1.3), + cdbs (>= 0.4.122~), + autotools-dev, + dh-autoreconf, + dh-systemd (>= 1.14), + libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, + libsnmp-dev | libsnmp9-dev, + libusb-dev (>= 0.1.8), + libneon27-gnutls-dev | libneon27-dev, + libpowerman0-dev (>= 2.3.3), + libwrap0-dev (>= 7.6), + python (>= 2.6.6-3~), + libfreeipmi-dev (>= 0.8.5) [!hurd-i386], + libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], + libnss3-dev, libtool, libltdl-dev, + liblua5.1-0-dev, + lua5.1 +Build-Depends-Indep: asciidoc (>= 8.6.3), + docbook-xsl, + dblatex (>= 0.2.5), + libxml2-utils +Standards-Version: 3.9.5 +Homepage: http://www.networkupstools.org/ +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary +Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git +X-Python-Version: >= 2.5 +XS-Testsuite: autopkgtest + +Package: nut +Architecture: all +Section: metapackages +Depends: ${misc:Depends}, nut-server, nut-client +Description: network UPS tools - metapackage + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package is a metapackage that installs both nut-server and nut-client, + in most cases it is sufficient for a basic UPS monitoring system. + +Package: nut-server +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-client (= ${binary:Version}) +Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml +Conflicts: nut-hal-drivers +Replaces: nut (<< 2.6.1-2~) +Breaks: nut (<< 2.6.1-2~) +Description: network UPS tools - core system + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides NUT's core system, and the serial and USB UPS + drivers. + +Package: nut-client +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) +Provides: ups-monitor +Conflicts: ups-monitor +Recommends: bash-completion +Suggests: nut-monitor +Replaces: ups-monitor, nut (<< 2.6.1-2~), nut-server (<< 2.6.3-1~) +Breaks: nut (<< 2.6.1-2~), nut-server (<< 2.6.3-1~) +Description: network UPS tools - clients + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides NUT's clients that allows the user to control + and monitor the UPS. + +Package: nut-cgi +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser +Recommends: apache2 | httpd-cgi +Suggests: nut +Description: network UPS tools - web interface + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides an HTTP interface for Network UPS Tools which makes + it possible to monitor the core NUT system with a web browser. + +Package: nut-snmp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1) +Description: network UPS tools - SNMP driver + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides snmp-ups, the SNMP multi-MIB driver for UPS, which + supports various MIBs including IETF, MGE, and APC. It adds an SNMP + Manager interface to the core NUT system. + +Package: nut-ipmi +Architecture: linux-any kfreebsd-any +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1) +Description: network UPS tools - IPMI driver + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package currently provides nut-ipmipsu, a driver which allows + to monitor IPMI power supply units (PSU) found in servers of + popular brands, such as Dell, HP, IBM. It adds an IPMI interface + to the core NUT system. + +Package: nut-xml +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.2.2) +Description: network UPS tools - XML/HTTP driver + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides netxml-ups, which supports UPS models from + Eaton or MGE that use an XML/HTTP-based Network Management Card or + Proxy. + +Package: nut-powerman-pdu +Architecture: any +Priority: extra +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.4.0), powerman (>= 2.3.3) +Description: network UPS tools - PowerMan PDU driver + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides powerman-pdu, which allows NUT clients to communicate + with the PowerMan daemon to support PDUs. + +Package: nut-doc +Architecture: all +Section: doc +Depends: ${misc:Depends} +Suggests: doc-base +Description: network UPS tools - documentation + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package contains FAQ, user, developer and packager documentation. + +Package: libupsclient4 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: network UPS tools - client library + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the shared client library. + +Package: libupsclient-dev +Section: libdevel +Architecture: any +Depends: libupsclient4 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Conflicts: libupsclient1-dev +Replaces: libupsclient1-dev +Description: network UPS tools - development files + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the development files. + +Package: libnutscan1 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: network UPS tools - scanner library + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the shared client library. + +Package: libnutscan-dev +Section: libdevel +Architecture: any +Depends: libnutscan1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: network UPS tools - development files + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the development files. + +Package: libnutclient0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: network UPS tools - new client library + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the new shared client library. + +Package: libnutclient-dev +Section: libdevel +Architecture: any +Depends: libnutclient0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: network UPS tools - development files + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the development files for the new client library. + +Package: python-nut +Section: python +Architecture: all +Depends: ${python:Depends}, ${misc:Depends} +Description: network UPS tools - Python bindings for NUT server + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides Python bindings to connect to NUT server. + +Package: nut-monitor +Architecture: all +Depends: ${python:Depends}, + ${misc:Depends}, + python-gobject, + python-gtk2, + python-glade2, + python-nut +Description: network UPS tools - GUI application to monitor UPS status + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides nut-monitor, a GUI application to monitor UPS status. + +Package: libups-nut-perl +Section: perl +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends} +Description: network UPS tools - Perl bindings for NUT server + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides Perl bindings to connect to NUT server. diff --git a/obs/debian.copyright b/obs/debian.copyright new file mode 100644 index 0000000000..01fea182b6 --- /dev/null +++ b/obs/debian.copyright @@ -0,0 +1,69 @@ +This package was debianized by Luca Filipozzi on +Wed Jun 28 19:48:05 PDT 2000 + +It was downloaded from http://www.networkupstools.org/ + +Upstream Authors: + + Russell Kroll + Arnaud Quette + Arjen de Korte + Charles Lepple + Kjell Claesson + David Goncalves + and the NUT Team + +Copyright: + + Copyright (C) 2000-2008 Russell Kroll, Arnaud Quette and the NUT Team + +Licenses: + + Most files are licensed under the GNU General Public License (GPL) version 2, + or (at your option) any later version. + + The files in the scripts/python/ directory are released under GNU General + Public License (GPL) version 3, or (at your option) any later version. + + GPL-2 + ----- + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + On Debian systems, the full text of the GNU General Public License v2 + may be found in /usr/share/common-licenses/GPL-2. + + GPL-3 + ----- + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + On Debian systems, the full text of the GNU General Public License v3 + may be found in /usr/share/common-licenses/GPL-3. + + +The Debian packaging is Copyright (C) 2008, Arnaud Quette +and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. diff --git a/obs/debian.description.subst b/obs/debian.description.subst new file mode 100644 index 0000000000..1ba1c3d148 --- /dev/null +++ b/obs/debian.description.subst @@ -0,0 +1 @@ +description=nut is a client/server uninterruptible power supply (UPS) monitoring system${Newline}${Space}that permits the sharing of one (or more) UPS between several machines. The${Newline}${Space}'server' monitors the UPS and notifies the 'clients' when the UPS is on${Newline}${Space}battery or has a low battery. diff --git a/obs/debian.gbp.conf b/obs/debian.gbp.conf new file mode 100644 index 0000000000..6837223f66 --- /dev/null +++ b/obs/debian.gbp.conf @@ -0,0 +1,8 @@ +[DEFAULT] +debian-branch = debian +upstream-branch = upstream +pristine-tar = True + +[git-buildpackage] +tarball-dir = ../tarballs/ +export-dir = ../build-area/ diff --git a/obs/debian.hotplug b/obs/debian.hotplug new file mode 100644 index 0000000000..36069fe5ee --- /dev/null +++ b/obs/debian.hotplug @@ -0,0 +1,24 @@ +#!/bin/bash +# taken from libgphoto2 + +GROUP=nut + +# for previous udev versions +if [ "$ACTION" = "add" ] && [ -f "$DEVICE" ] +then + # check if $GROUP really exists + if getent group $GROUP > /dev/null; then + chmod 660 "$DEVICE" + chown root:$GROUP "$DEVICE" + fi +fi + +# for recent udev versions +if [ "$ACTION" = "add" ] && [ -r "$DEVNAME" ] +then + # check if $GROUP really exists + if getent group $GROUP > /dev/null; then + chmod 660 "$DEVNAME" + chown root:$GROUP "$DEVNAME" + fi +fi diff --git a/obs/debian.libnutclient-dev.install b/obs/debian.libnutclient-dev.install new file mode 100644 index 0000000000..6f780df0ac --- /dev/null +++ b/obs/debian.libnutclient-dev.install @@ -0,0 +1,3 @@ +usr/lib/*/libnutclient.so +usr/lib/*/pkgconfig/libnutclient.pc +usr/include/nutclient.h diff --git a/obs/debian.libnutclient-dev.manpages b/obs/debian.libnutclient-dev.manpages new file mode 100644 index 0000000000..7ac2971ea8 --- /dev/null +++ b/obs/debian.libnutclient-dev.manpages @@ -0,0 +1,34 @@ +debian/tmp/usr/share/man/man3/libnutclient.3 +debian/tmp/usr/share/man/man3/libnutclient_commands.3 +debian/tmp/usr/share/man/man3/libnutclient_devices.3 +debian/tmp/usr/share/man/man3/libnutclient_general.3 +debian/tmp/usr/share/man/man3/libnutclient_misc.3 +debian/tmp/usr/share/man/man3/libnutclient_tcp.3 +debian/tmp/usr/share/man/man3/libnutclient_variables.3 +debian/tmp/usr/share/man/man3/nutclient_authenticate.3 +debian/tmp/usr/share/man/man3/nutclient_destroy.3 +debian/tmp/usr/share/man/man3/nutclient_device_forced_shutdown.3 +debian/tmp/usr/share/man/man3/nutclient_device_login.3 +debian/tmp/usr/share/man/man3/nutclient_device_master.3 +debian/tmp/usr/share/man/man3/nutclient_execute_device_command.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_command_description.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_commands.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_description.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_num_logins.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_rw_variables.3 +debian/tmp/usr/share/man/man3/nutclient_get_devices.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_variable_description.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_variables.3 +debian/tmp/usr/share/man/man3/nutclient_get_device_variable_values.3 +debian/tmp/usr/share/man/man3/nutclient_has_device.3 +debian/tmp/usr/share/man/man3/nutclient_has_device_command.3 +debian/tmp/usr/share/man/man3/nutclient_has_device_variable.3 +debian/tmp/usr/share/man/man3/nutclient_logout.3 +debian/tmp/usr/share/man/man3/nutclient_set_device_variable_value.3 +debian/tmp/usr/share/man/man3/nutclient_set_device_variable_values.3 +debian/tmp/usr/share/man/man3/nutclient_tcp_create_client.3 +debian/tmp/usr/share/man/man3/nutclient_tcp_disconnect.3 +debian/tmp/usr/share/man/man3/nutclient_tcp_get_timeout.3 +debian/tmp/usr/share/man/man3/nutclient_tcp_is_connected.3 +debian/tmp/usr/share/man/man3/nutclient_tcp_reconnect.3 +debian/tmp/usr/share/man/man3/nutclient_tcp_set_timeout.3 diff --git a/obs/debian.libnutclient0.install b/obs/debian.libnutclient0.install new file mode 100644 index 0000000000..e5a792e829 --- /dev/null +++ b/obs/debian.libnutclient0.install @@ -0,0 +1 @@ +lib/*/libnutclient.so.* diff --git a/obs/debian.libnutclient0.lintian-overrides b/obs/debian.libnutclient0.lintian-overrides new file mode 100644 index 0000000000..6f2da5475a --- /dev/null +++ b/obs/debian.libnutclient0.lintian-overrides @@ -0,0 +1 @@ +libnutclient0: no-symbols-control-file shlib-missing-in-symbols-control-file diff --git a/obs/debian.libnutscan-dev.install b/obs/debian.libnutscan-dev.install new file mode 100644 index 0000000000..7ec9050380 --- /dev/null +++ b/obs/debian.libnutscan-dev.install @@ -0,0 +1,6 @@ +usr/lib/*/libnutscan.so +usr/lib/*/pkgconfig/libnutscan.pc +usr/include/nut-scan.h +usr/include/nutscan-ip.h +usr/include/nutscan-device.h +usr/include/nutscan-init.h diff --git a/obs/debian.libnutscan1.install b/obs/debian.libnutscan1.install new file mode 100644 index 0000000000..55d88d748b --- /dev/null +++ b/obs/debian.libnutscan1.install @@ -0,0 +1,2 @@ +lib/*/libnutscan.so.* +usr/share/nut/dmfnutscan/* diff --git a/obs/debian.libups-nut-perl.install b/obs/debian.libups-nut-perl.install new file mode 100644 index 0000000000..355c6fe0a5 --- /dev/null +++ b/obs/debian.libups-nut-perl.install @@ -0,0 +1 @@ +scripts/perl/Nut.pm /usr/share/perl5/UPS/ diff --git a/obs/debian.libupsclient-dev.install b/obs/debian.libupsclient-dev.install new file mode 100644 index 0000000000..e72f788135 --- /dev/null +++ b/obs/debian.libupsclient-dev.install @@ -0,0 +1,4 @@ +usr/lib/*/libupsclient.so +usr/lib/*/pkgconfig/libupsclient.pc +usr/include/parseconf.h +usr/include/upsclient.h diff --git a/obs/debian.libupsclient-dev.manpages b/obs/debian.libupsclient-dev.manpages new file mode 100644 index 0000000000..141a1b1c7a --- /dev/null +++ b/obs/debian.libupsclient-dev.manpages @@ -0,0 +1,2 @@ +debian/tmp/usr/share/man/man3/nutscan*.3 +debian/tmp/usr/share/man/man3/upscli*.3 diff --git a/obs/debian.libupsclient4.install b/obs/debian.libupsclient4.install new file mode 100644 index 0000000000..132d81a96d --- /dev/null +++ b/obs/debian.libupsclient4.install @@ -0,0 +1 @@ +lib/*/libupsclient.so.* diff --git a/obs/debian.nut-cgi.README.Debian b/obs/debian.nut-cgi.README.Debian new file mode 100644 index 0000000000..03277173ca --- /dev/null +++ b/obs/debian.nut-cgi.README.Debian @@ -0,0 +1,39 @@ +Network UPS Tools - CGI Interface - Quick Start for Debian +---------------------------------------------------------- + +(I) Installation +================= + +1) Sample configuration files are provided in /etc/nut/ +Rename without the ".sample" suffix the files hosts.conf, upsstats.html, +upsstats-single.html and optionaly upsset.conf. +Then edit these to match your configuration. + +2) Ensure these configuration files are readable by others + + chmod 755 /etc/nut + chmod 644 /etc/nut/upsset.conf + chmod 644 /etc/nut/hosts.conf + chmod 644 /etc/nut/upsstats.html + chmod 644 /etc/nut/upsstats-single.html + +3) You will then be able to access NUT CGI through a Web browser. +The URL, which depends on your httpd configuration, is: + + http://localhost/cgi-bin/nut/upsstats.cgi + +4) NUT also provides a set of HTML files to wrap the CGIs. +To use it, create a new virtual host with your preferred webserver, and point the +Document Root to: /usr/share/nut/www/ + + You can also add an alias to an existing site, if it is supported: + Alias /nut/ "/usr/share/nut/www/" + + Also ensure that the files in this directory have the suitable permissions. + +For more information on nut-cgi configuration, have a look at the following +manual pages: +- upsstats.html (5) +- hosts.conf (5) +- upsset.conf (5) + diff --git a/obs/debian.nut-cgi.docs b/obs/debian.nut-cgi.docs new file mode 100644 index 0000000000..80796c9b00 --- /dev/null +++ b/obs/debian.nut-cgi.docs @@ -0,0 +1 @@ +data/html/README diff --git a/obs/debian.nut-cgi.install b/obs/debian.nut-cgi.install new file mode 100644 index 0000000000..3dc88ccc3d --- /dev/null +++ b/obs/debian.nut-cgi.install @@ -0,0 +1,6 @@ +debian/tmp/etc/nut/hosts.conf +debian/tmp/etc/nut/upsset.conf +debian/tmp/etc/nut/upsstats.html +debian/tmp/etc/nut/upsstats-single.html +debian/tmp/usr/lib/cgi-bin/ +debian/tmp/usr/share/nut/www diff --git a/obs/debian.nut-cgi.manpages b/obs/debian.nut-cgi.manpages new file mode 100644 index 0000000000..36a14498f2 --- /dev/null +++ b/obs/debian.nut-cgi.manpages @@ -0,0 +1,6 @@ +debian/tmp/usr/share/man/man5/hosts.conf.5 +debian/tmp/usr/share/man/man5/upsset.conf.5 +debian/tmp/usr/share/man/man5/upsstats.html.5 +debian/tmp/usr/share/man/man8/upsimage.cgi.8 +debian/tmp/usr/share/man/man8/upsset.cgi.8 +debian/tmp/usr/share/man/man8/upsstats.cgi.8 diff --git a/obs/debian.nut-cgi.postinst b/obs/debian.nut-cgi.postinst new file mode 100644 index 0000000000..e082532566 --- /dev/null +++ b/obs/debian.nut-cgi.postinst @@ -0,0 +1,55 @@ +#!/bin/sh -e + +case "$1" in + + configure) + + # make sure the nut user exists and has correct memberships + if ! getent group nut >/dev/null; then + addgroup --quiet --system nut + fi + if ! getent passwd nut >/dev/null; then + adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut + elif ! groups nut | grep -qw nut; then + adduser nut nut + fi +# for Ubuntu, while waiting for a proper debconf +# if ! groups nut | grep -qw dialout; then +# adduser nut dialout +# fi + + # Ensure /etc/nut is readable/crossable for others + if [ -d /etc/nut/ ] ; then + chmod 755 /etc/nut + fi + + # Ensure nut-cgi configuration files are readable by others + for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do + if [ -f /etc/nut/$file ] ; then + chmod 644 /etc/nut/$file + fi + done + ;; + + abort-upgrade) + # do nothing + ;; + + abort-remove) + # do nothing + ;; + + abort-deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-cgi.postrm b/obs/debian.nut-cgi.postrm new file mode 100644 index 0000000000..91be66ddc6 --- /dev/null +++ b/obs/debian.nut-cgi.postrm @@ -0,0 +1,47 @@ +#!/bin/sh -e + +case "$1" in + + remove) + # remove sample file if those were previously (wrongly) installed + for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do + if [ -f /etc/nut/${file}.sample ] ; then + rm -f /etc/nut/${file}.sample + fi + done + ;; + + purge) + # do nothing + ;; + + upgrade) + # do nothing + ;; + + failed-upgrade) + # do nothing + ;; + + abort-install) + # do nothing + ;; + + abort-upgrade) + # do nothing + ;; + + disappear) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-client.init b/obs/debian.nut-client.init new file mode 100644 index 0000000000..15a9f75f37 --- /dev/null +++ b/obs/debian.nut-client.init @@ -0,0 +1,180 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: nut-client upsmon ups-monitor +# Required-Start: $local_fs $syslog $network $remote_fs +# Required-Stop: $local_fs $syslog $network $remote_fs +# Should-Start: nut-server +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Network UPS Tools monitor initscript +# Description: This script take care of starting and stopping the +# Network UPS Tools monitoring component (upsmon). +### END INIT INFO + +# Author: Arnaud Quette + +PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin + +NAME=nut-client +DESC="NUT - power device monitor and shutdown controller" +CONFIG=/etc/nut/nut.conf +pid_dir=/var/run/nut +upsmon_pid=${pid_dir}/upsmon.pid +upsmon=/sbin/upsmon +log=">/dev/null 2>/dev/null" + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# set upsmon specific options. use "man upsmon" for more info +# this parameter is now located in nut.conf, and not in /etc/default/nut anymore +# FIXME: retrieved from 'nut' script during update +UPSMON_OPTIONS="" + +# Exit if the package is not installed +[ -x "$upsmon" ] || exit 0 + +# Include NUT nut.conf +[ -r $CONFIG ] && . $CONFIG + +# FIXME: put all common bits, between nut-client and nut-server, +# into a common nut-function + +# Explicitly require the configuration to be done in /etc/nut/nut.conf +if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then + log_action_msg "$NAME disabled, please adjust the configuration to your needs" + log_action_msg "Then set MODE to a suitable value in $CONFIG to enable it" + # exit success to avoid breaking the install process! + exit 0 +fi + +# Check if /var/run/nut exists and has the correct perms +check_var_directory() { + [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ + && chown root:nut ${pid_dir} \ + && chmod 770 ${pid_dir} \ + && [ -x /sbin/restorecon ] && /sbin/restorecon ${pid_dir} +} + +# check if the right components are running +check_status() { + case "$MODE" in + standalone|netserver|netclient) + status_of_proc -p $upsmon_pid $upsmon upsmon + ;; + none|*) + ;; + esac +} + +start_stop_client () { + case "$MODE" in + standalone|netserver|netclient) + # FIXME: for standalone|netserver, ensure 'nut-server status' returns ? + case "$1" in + start) + start-stop-daemon -S -q -p $upsmon_pid -x $upsmon \ + -- $UPSMON_OPTIONS >/dev/null 2>&1 && return 0 || return 1 + ;; + stop) + start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 \ + && return 0 || return 1 + ;; + esac + ;; + none|*) + return 1 + ;; + esac +} + +case "$1" in + + start) + log_daemon_msg "Starting $DESC" "$NAME" + check_var_directory + start_stop_client start + log_end_msg $? + ;; + + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + start_stop_client stop + log_end_msg $? + ;; + + reload) + log_daemon_msg "Reloading $DESC" "$NAME" + $upsmon -c reload >/dev/null 2>&1 + log_end_msg $? + ;; + + restart|force-reload) + # FIXME: lack consistency, due to initscript split. + # This only addresses partial reload. + # Full reload requires to: + # - stop nut-client + # - restart (Ie stop+start) nut-server + # - start nut-client + log_daemon_msg "Restarting $DESC" "$NAME" + start_stop_client stop || true + # should then 'start_stop_server stop', Ie /etc/init.d/nut-server stop + #sleep 5 + check_var_directory + # should first 'start_stop_server start', Ie /etc/init.d/nut-server start + start_stop_client start + log_end_msg $? + ;; + + status) + #log_daemon_msg "Checking status of $DESC" + echo "Checking status of $DESC" + check_status + exit $? + ;; + + poweroff) + case "$MODE" in + standalone|netserver) + # Sanity check + flag=`sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf` + if [ -z "$flag" ] ; then + log_action_msg "##########################################################" + log_action_msg "## POWERDOWNFLAG is not defined in /etc/nut/upsmon.conf ##" + log_action_msg "## ##" + log_action_msg "## Please read the Manual page upsmon.conf(5) ##" + log_action_msg "##########################################################" + exit 1 + fi + + # Defer to nut-server to actually poweroff the UPS, if needed + # (the need is tested here though!) + if $upsmon -K >/dev/null 2>&1 ; then + log_daemon_msg "UPS poweroff required..." + log_end_msg 0 + if [ -x /etc/init.d/nut-server ] ; then + exec /etc/init.d/nut-server poweroff + else + log_action_msg "Failure: /etc/init.d/nut-server script missing" + fi + else + log_action_msg "Power down flag is not set (UPS poweroff not needed)" + fi + ;; + none|netclient|*) + # nothing to do + log_action_msg "'$MODE' configuration does not require UPS poweroff" + ;; + esac + ;; + + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|reload|restart|force-reload|status|poweroff}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/obs/debian.nut-client.install b/obs/debian.nut-client.install new file mode 100644 index 0000000000..b899f84d60 --- /dev/null +++ b/obs/debian.nut-client.install @@ -0,0 +1,20 @@ +debian/tmp/bin/upslog +debian/tmp/bin/upsc +debian/tmp/bin/upsrw +debian/tmp/bin/upscmd +debian/tmp/sbin/upsmon +debian/tmp/sbin/upssched +debian/tmp/bin/upssched-cmd +debian/tmp/etc/nut/nut.conf +debian/tmp/etc/nut/upsmon.conf +debian/tmp/etc/nut/upssched.conf +debian/tmp/usr/share/augeas/lenses/dist/nuthostsconf.aug +debian/tmp/usr/share/augeas/lenses/dist/nutnutconf.aug +debian/tmp/usr/share/augeas/lenses/dist/nutupsconf.aug +debian/tmp/usr/share/augeas/lenses/dist/nutupsdconf.aug +debian/tmp/usr/share/augeas/lenses/dist/nutupsdusers.aug +debian/tmp/usr/share/augeas/lenses/dist/nutupsmonconf.aug +debian/tmp/usr/share/augeas/lenses/dist/nutupsschedconf.aug +debian/tmp/usr/share/augeas/lenses/dist/nutupssetconf.aug +debian/tmp/usr/share/augeas/lenses/dist/tests/test_nut.aug +debian/tmp/usr/share/bash-completion/completions/nut diff --git a/obs/debian.nut-client.links b/obs/debian.nut-client.links new file mode 100644 index 0000000000..c8d27c5584 --- /dev/null +++ b/obs/debian.nut-client.links @@ -0,0 +1 @@ +etc/init.d/nut-client etc/init.d/ups-monitor diff --git a/obs/debian.nut-client.lintian-overrides b/obs/debian.nut-client.lintian-overrides new file mode 100644 index 0000000000..4830620aef --- /dev/null +++ b/obs/debian.nut-client.lintian-overrides @@ -0,0 +1,2 @@ +nut-client: script-in-etc-init.d-not-registered-via-update-rc.d +nut-client: systemd-no-service-for-init-script ups-monitor diff --git a/obs/debian.nut-client.maintscript b/obs/debian.nut-client.maintscript new file mode 100644 index 0000000000..692b715bc3 --- /dev/null +++ b/obs/debian.nut-client.maintscript @@ -0,0 +1 @@ +rm_conffile /etc/bash_completion.d/nut 2.7.1-1~ diff --git a/obs/debian.nut-client.manpages b/obs/debian.nut-client.manpages new file mode 100644 index 0000000000..115e821706 --- /dev/null +++ b/obs/debian.nut-client.manpages @@ -0,0 +1,9 @@ +debian/tmp/usr/share/man/man8/upsc.8 +debian/tmp/usr/share/man/man8/upscmd.8 +debian/tmp/usr/share/man/man8/upsmon.8 +debian/tmp/usr/share/man/man8/upsrw.8 +debian/tmp/usr/share/man/man8/upssched.8 +debian/tmp/usr/share/man/man5/nut.conf.5 +debian/tmp/usr/share/man/man5/upsmon.conf.5 +debian/tmp/usr/share/man/man5/upssched.conf.5 +debian/tmp/usr/share/man/man8/upslog.8 diff --git a/obs/debian.nut-client.postinst b/obs/debian.nut-client.postinst new file mode 100644 index 0000000000..4b0485045a --- /dev/null +++ b/obs/debian.nut-client.postinst @@ -0,0 +1,79 @@ +#!/bin/sh -e + +case "$1" in + + configure) + + # make sure the nut user exists and has correct memberships + if ! getent group nut >/dev/null; then + addgroup --quiet --system nut + fi + if ! getent passwd nut >/dev/null; then + adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut + elif ! groups nut | grep -qw nut; then + adduser nut nut + fi +# for Ubuntu, while waiting for a proper debconf +# if ! groups nut | grep -qw dialout; then +# adduser nut dialout +# fi + + # make sure that conffiles are secured and have the correct ownerships + # on first install + if [ -z "$2" ] ; then + if [ -d /etc/nut/ ] ; then + chown root:nut /etc/nut/ + fi + for file in nut.conf upsmon.conf upssched.conf ; do + if [ -f /etc/nut/$file ] ; then + chown root:nut /etc/nut/$file + chmod 640 /etc/nut/$file + fi + done + fi + + # make sure that /var/run/nut exists and has the correct ownerships + if [ ! -d /var/run/nut ] ; then + mkdir -p /var/run/nut + fi + if [ -d /var/run/nut ] ; then + chown root:nut /var/run/nut + chmod 770 /var/run/nut + if which restorecon >/dev/null 2>&1; then + restorecon /var/run/nut + fi + fi + + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then + rm -f /etc/init.d/nut + else + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old + fi + update-rc.d nut remove >/dev/null + fi + ;; + + abort-upgrade) + # do nothing + ;; + + abort-remove) + # do nothing + ;; + + abort-deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-client.preinst b/obs/debian.nut-client.preinst new file mode 100644 index 0000000000..fa1bd014ee --- /dev/null +++ b/obs/debian.nut-client.preinst @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +# Revert /etc/nut/nut.conf mangling done by older versions of the postinst +# See #677054 +# changed configfile created by a fresh install in lenny, upgraded to squeeze +if [ "$1" = "install" -o "$1" = "upgrade" ] \ + && dpkg --compare-versions "$2" lt "2.6.4-2" \ + && [ -f /etc/nut/nut.conf ] \ + && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = 331cca39153f451c2968f4b734c1cf3f ]; then + sed -i '29,$ d' /etc/nut/nut.conf +fi + +# changed configfile created by a fresh install in squeeze +if [ "$1" = "install" -o "$1" = "upgrade" ] \ + && dpkg --compare-versions "$2" lt "2.6.4-2" \ + && [ -f /etc/nut/nut.conf ] \ + && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = f9b571ae65952e3a761fac2202633478 ]; then + sed -i 's/^MODE=none$/MODE = none/' /etc/nut/nut.conf +fi + +#DEBHELPER# diff --git a/obs/debian.nut-client.tmpfiles b/obs/debian.nut-client.tmpfiles new file mode 100644 index 0000000000..bf195cf142 --- /dev/null +++ b/obs/debian.nut-client.tmpfiles @@ -0,0 +1 @@ +d /run/nut 0770 root nut - - diff --git a/obs/debian.nut-doc.doc-base.nut-developer-guide b/obs/debian.nut-doc.doc-base.nut-developer-guide new file mode 100644 index 0000000000..ed3ad0d8b7 --- /dev/null +++ b/obs/debian.nut-doc.doc-base.nut-developer-guide @@ -0,0 +1,13 @@ +Document: nut-developer-guide +Title: Network UPS Tools Developer Guide +Author: Russell Kroll, Arnaud Quette, Charles Lepple and Peter Selinger +Abstract: This document intend to describe how NUT is designed, + and the way to develop new device drivers and client applications. +Section: Programming + +Format: PDF +Files: /usr/share/doc/nut-doc/pdf/developer-guide.pdf + +Format: HTML +Index: /usr/share/doc/nut-doc/html/developer-guide/index.html +Files: /usr/share/doc/nut-doc/html/developer-guide/*.html diff --git a/obs/debian.nut-doc.doc-base.nut-faq b/obs/debian.nut-doc.doc-base.nut-faq new file mode 100644 index 0000000000..098042f7c8 --- /dev/null +++ b/obs/debian.nut-doc.doc-base.nut-faq @@ -0,0 +1,12 @@ +Document: nut-faq +Title: NUT Frequently asked questions +Author: Arnaud Quette +Abstract: Frequently asked questions for Network UPS Tools (NUT) +Section: Help/FAQ + +Format: PDF +Files: /usr/share/doc/nut-doc/pdf/FAQ.pdf + +Format: HTML +Index: /usr/share/doc/nut-doc/html/FAQ.html +Files: /usr/share/doc/nut-doc/html/FAQ.html diff --git a/obs/debian.nut-doc.doc-base.nut-packager-guide b/obs/debian.nut-doc.doc-base.nut-packager-guide new file mode 100644 index 0000000000..61d6b46665 --- /dev/null +++ b/obs/debian.nut-doc.doc-base.nut-packager-guide @@ -0,0 +1,15 @@ +Document: nut-packager-guide +Title: NUT Packager and Integrators Guide +Author: Arnaud Quette +Abstract: Packaging is a final aim for software. + It eases and completes the software integration into an OS, + and allows users to have an easy software installation and support out of the box. + This document describes best practice for packaging NUT. +Section: Debian + +Format: PDF +Files: /usr/share/doc/nut-doc/pdf/packager-guide.pdf + +Format: HTML +Index: /usr/share/doc/nut-doc/html/packager-guide/index.html +Files: /usr/share/doc/nut-doc/html/packager-guide/*.html diff --git a/obs/debian.nut-doc.doc-base.nut-user-manual b/obs/debian.nut-doc.doc-base.nut-user-manual new file mode 100644 index 0000000000..76db720fa1 --- /dev/null +++ b/obs/debian.nut-doc.doc-base.nut-user-manual @@ -0,0 +1,15 @@ +Document: nut-user-manual +Title: Network UPS Tools User Manual +Author: Russell Kroll, Arnaud Quette and Arjen de Korte +Abstract: This document intend to describe how to install software support + for your Power Devices (UPS, PDU, …), and how to use the NUT project. + It is not intended to explain what are, nor distinguish the different technologies that exist. + For such information, have a look at the General Power Devices Information. +Section: System/Administration + +Format: PDF +Files: /usr/share/doc/nut-doc/pdf/user-manual.pdf + +Format: HTML +Index: /usr/share/doc/nut-doc/html/user-manual/index.html +Files: /usr/share/doc/nut-doc/html/user-manual/*.html diff --git a/obs/debian.nut-doc.install b/obs/debian.nut-doc.install new file mode 100644 index 0000000000..e3f78faf8e --- /dev/null +++ b/obs/debian.nut-doc.install @@ -0,0 +1 @@ +debian/tmp/usr/share/doc/nut-doc/ diff --git a/obs/debian.nut-ipmi.install b/obs/debian.nut-ipmi.install new file mode 100644 index 0000000000..2d9854d88d --- /dev/null +++ b/obs/debian.nut-ipmi.install @@ -0,0 +1,2 @@ +debian/tmp/lib/nut/nut-ipmipsu +debian/tmp/*/udev/rules.d/52-nut-ipmipsu.rules diff --git a/obs/debian.nut-ipmi.manpages b/obs/debian.nut-ipmi.manpages new file mode 100644 index 0000000000..5da576ff9c --- /dev/null +++ b/obs/debian.nut-ipmi.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man8/nut-ipmipsu.8 diff --git a/obs/debian.nut-monitor.install b/obs/debian.nut-monitor.install new file mode 100644 index 0000000000..6cbef89947 --- /dev/null +++ b/obs/debian.nut-monitor.install @@ -0,0 +1,7 @@ +scripts/python/app/NUT-Monitor usr/bin/ +scripts/python/app/nut-monitor.desktop usr/share/applications/ +scripts/python/app/gui-*.glade usr/share/nut-monitor/ +scripts/python/app/locale/ usr/share/ +scripts/python/app/nut-monitor.png usr/share/pixmaps/ +scripts/python/app/pixmaps usr/share/nut-monitor/ +debian/nut-monitor.xpm usr/share/pixmaps/ diff --git a/obs/debian.nut-monitor.menu b/obs/debian.nut-monitor.menu new file mode 100644 index 0000000000..2b849cba47 --- /dev/null +++ b/obs/debian.nut-monitor.menu @@ -0,0 +1,4 @@ +?package(nut-monitor): needs="X11" section="Applications/System/Monitoring"\ + title="NUT Monitor" command="/usr/bin/NUT-Monitor"\ + icon="/usr/share/pixmaps/nut-monitor.xpm"\ + longtitle="Network UPS Tools GUI client" diff --git a/obs/debian.nut-monitor.xpm b/obs/debian.nut-monitor.xpm new file mode 100644 index 0000000000..6bfa642f89 --- /dev/null +++ b/obs/debian.nut-monitor.xpm @@ -0,0 +1,326 @@ +/* XPM */ +static char * nut_monitor_xpm[] = { +"32 32 291 2", +" c None", +". c #C7A509", +"+ c #D0B123", +"@ c #CEAF21", +"# c #CBAB15", +"$ c #C5A305", +"% c #C4A100", +"& c #CAAB1A", +"* c #E0C74E", +"= c #E0C949", +"- c #ECDA6F", +"; c #FCF6C6", +"> c #FDF7B5", +", c #E8D663", +"' c #CEAF0E", +") c #CAA915", +"! c #DFC858", +"~ c #D1B42E", +"{ c #C29E00", +"] c #D6BB34", +"^ c #FBEE92", +"/ c #FFF792", +"( c #FEF07A", +"_ c #F9E857", +": c #F6E558", +"< c #F5E55D", +"[ c #EED500", +"} c #D7B800", +"| c #CCAB00", +"1 c #CAA80A", +"2 c #EFDA59", +"3 c #EFDC69", +"4 c #F0E289", +"5 c #DBC350", +"6 c #C8A714", +"7 c #BE9700", +"8 c #FFFEAA", +"9 c #FCE955", +"0 c #FCED74", +"a c #FCF194", +"b c #FDF4AD", +"c c #F5E565", +"d c #EFD91D", +"e c #E6CA00", +"f c #D2B000", +"g c #D0B226", +"h c #EAD65F", +"i c #EDD852", +"j c #E9D037", +"k c #E6CC2E", +"l c #ECD856", +"m c #CDAF23", +"n c #BD9500", +"o c #FFFFD2", +"p c #FCED72", +"q c #FCEE7A", +"r c #FDF087", +"s c #FDF195", +"t c #FDF4AB", +"u c #FEF8C2", +"v c #FEF9C0", +"w c #FEF5AA", +"x c #FBEE8A", +"y c #F4E269", +"z c #F4E058", +"A c #F0DA49", +"B c #EDD851", +"C c #EBD96F", +"D c #CCAD23", +"E c #BC9400", +"F c #FFFFD9", +"G c #FDF5B0", +"H c #FDFAD9", +"I c #FDF9D4", +"J c #FEF9D8", +"K c #FEFBE3", +"L c #FFFDEA", +"M c #FFFCE4", +"N c #FEFAD4", +"O c #FBF3B8", +"P c #F5E99B", +"Q c #EBDA75", +"R c #E0CA52", +"S c #D8C03D", +"T c #D6BE48", +"U c #CCAC21", +"V c #FFFFD6", +"W c #FDF3A5", +"X c #FDF9D0", +"Y c #FCF4B9", +"Z c #F9F2AB", +"` c #F5E561", +" . c #F1DE3B", +".. c #EFD91C", +"+. c #E8CF1B", +"@. c #E0C61C", +"#. c #DBC01E", +"$. c #D9BD21", +"%. c #D6BA26", +"&. c #D5B729", +"*. c #D7BD43", +"=. c #FFFFD4", +"-. c #FCF3A2", +";. c #FDF9CE", +">. c #FBF4B9", +",. c #FAF2AA", +"'. c #F5E86D", +"). c #F3E14B", +"!. c #F0DC2D", +"~. c #EAD329", +"{. c #E1C927", +"]. c #DCC224", +"^. c #D9BD23", +"/. c #D5B921", +"(. c #D2B522", +"_. c #D3BA3E", +":. c #CBAC22", +"<. c #A68E1A", +"[. c #FFFCD8", +"}. c #FCF2A0", +"|. c #FEF8C9", +"1. c #FCF4B1", +"2. c #FAF1A2", +"3. c #F5E666", +"4. c #F2E045", +"5. c #F0DB28", +"6. c #E8D123", +"7. c #E1C720", +"8. c #DCC01D", +"9. c #D9BC1A", +"0. c #D7B916", +"a. c #D3B41A", +"b. c #C8B140", +"c. c #B6A34A", +"d. c #777B7D", +"e. c #EFF0ED", +"f. c #DCDECF", +"g. c #F0EEDC", +"h. c #F2ECC0", +"i. c #F4EDA6", +"j. c #F2E568", +"k. c #F2DF3E", +"l. c #F4DD12", +"m. c #EBD118", +"n. c #DDC420", +"o. c #D1BA27", +"p. c #C0AD37", +"q. c #A5994E", +"r. c #898464", +"s. c #7F8077", +"t. c #8F9396", +"u. c #72746E", +"v. c #D8DAD4", +"w. c #E7E8E5", +"x. c #E0E2E1", +"y. c #DBDDDE", +"z. c #CACDD3", +"A. c #C2C6CD", +"B. c #B7BBC8", +"C. c #A9AFB8", +"D. c #9CA0A7", +"E. c #8E9396", +"F. c #848888", +"G. c #7E7F7B", +"H. c #76786F", +"I. c #7B7C77", +"J. c #8C8E8A", +"K. c #676965", +"L. c #EFF1EE", +"M. c #D6D9D4", +"N. c #E4E5E3", +"O. c #DFE0DC", +"P. c #D9DCD7", +"Q. c #CCCEC8", +"R. c #C4C7BF", +"S. c #BABDB5", +"T. c #ADAFA7", +"U. c #9FA199", +"V. c #91938B", +"W. c #84877F", +"X. c #7B7D76", +"Y. c #71736E", +"Z. c #787975", +"`. c #858783", +" + c #5F615C", +".+ c #EFF0EE", +"++ c #D5D8D3", +"@+ c #E3E5E1", +"#+ c #DCDDDA", +"$+ c #D6D9D5", +"%+ c #C9CCC7", +"&+ c #C2C5BE", +"*+ c #B8BBB4", +"=+ c #ABAEA6", +"-+ c #9C9F97", +";+ c #8E9089", +">+ c #81847D", +",+ c #787A74", +"'+ c #6E716B", +")+ c #757772", +"!+ c #7E807C", +"~+ c #555752", +"{+ c #D5D7D3", +"]+ c #E0E2DE", +"^+ c #DADBD8", +"/+ c #D4D6D1", +"(+ c #C8CAC5", +"_+ c #C1C4BD", +":+ c #B6B9B3", +"<+ c #A9ACA4", +"[+ c #999C95", +"}+ c #8A8D85", +"|+ c #7F827B", +"1+ c #767771", +"2+ c #6D6F6A", +"3+ c #757773", +"4+ c #777975", +"5+ c #4B4E49", +"6+ c #F0F2EE", +"7+ c #D3D6D1", +"8+ c #DEE0DE", +"9+ c #D8D9D6", +"0+ c #D1D3CF", +"a+ c #C6C8C3", +"b+ c #BFC2BB", +"c+ c #B5B8B1", +"d+ c #A6A9A2", +"e+ c #989B93", +"f+ c #767773", +"g+ c #70726F", +"h+ c #434540", +"i+ c #D2D5D0", +"j+ c #DCDDDB", +"k+ c #D4D6D2", +"l+ c #CED0CB", +"m+ c #C5C7C2", +"n+ c #BEC1BA", +"o+ c #B4B7B0", +"p+ c #A7AAA2", +"q+ c #767874", +"r+ c #6A6C68", +"s+ c #424440", +"t+ c #EFF1ED", +"u+ c #D1D4CF", +"v+ c #DADCD8", +"w+ c #D3D5D0", +"x+ c #CCCFC9", +"y+ c #C4C7C1", +"z+ c #6A6B68", +"A+ c #41433F", +"B+ c #EDEFEC", +"C+ c #D2D5CF", +"D+ c #D9DAD7", +"E+ c #D2D4CF", +"F+ c #CBCEC8", +"G+ c #D7D9D5", +"H+ c #D1D3CE", +"I+ c #CBCDC8", +"J+ c #8A8C85", +"K+ c #7D8079", +"L+ c #696B65", +"M+ c #7F807C", +"N+ c #6A6C69", +"O+ c #81827E", +"P+ c #DEE0DD", +"Q+ c #F1F2EF", +"R+ c #DEE0DC", +"S+ c #CFD2CC", +"T+ c #C3C6C0", +"U+ c #BBBEB7", +"V+ c #ADB0A9", +"W+ c #A2A59D", +"X+ c #979A92", +"Y+ c #8F928A", +"Z+ c #92948F", +"`+ c #9D9E99", +" @ c #A9AAA6", +".@ c #868784", +"+@ c #4B4D49", +"@@ c #5E605B", +"#@ c #959794", +"$@ c #AEAFAC", +"%@ c #B6B8B5", +"&@ c #BABCB8", +"*@ c #BDBEBB", +"=@ c #B4B6B2", +"-@ c #AAABA7", +";@ c #9E9F9B", +">@ c #888986", +",@ c #686A66", +"'@ c #454743", +" ", +" ", +" ", +" ", +" ", +" ", +" . + @ # $ ", +" % & * = - ; > , ' ) ! ~ { ", +" ] ^ / ( _ : < [ } | 1 2 3 4 5 6 ", +" 7 8 9 0 a b c d e f g h i j k l m ", +" n o p q r s t u v w x y z A B C D ", +" E F G H I J K L M N O P Q R S T U ", +" E V W X Y Z ` ...+.@.#.$.%.&.*.U ", +" E =.-.;.>.,.'.).!.~.{.].^./.(._.:. ", +" <.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c. ", +" d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t. ", +" u.e.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J. ", +" K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. ", +" +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+ ", +" ~+.+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+ ", +" 5+6+7+8+9+0+a+b+c+d+e+}+|+1+2+f+g+ ", +" h+6+i+j+k+l+m+n+o+p+e+}+|+1+2+q+r+ ", +" s+t+u+v+w+x+y+n+o+p+e+}+|+1+2+q+z+ ", +" A+B+C+D+E+F+y+n+o+p+e+}+|+1+2+4+z+ ", +" s+6+7+G+H+I+y+n+c+p+e+J+K+u.L+M+N+ ", +" O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@ ", +" A+@@#@$@%@&@*@=@-@;@>@,@'@ ", +" ", +" ", +" ", +" ", +" "}; diff --git a/obs/debian.nut-powerman-pdu.install b/obs/debian.nut-powerman-pdu.install new file mode 100644 index 0000000000..f0acaa4eaf --- /dev/null +++ b/obs/debian.nut-powerman-pdu.install @@ -0,0 +1 @@ +debian/tmp/lib/nut/powerman-pdu diff --git a/obs/debian.nut-powerman-pdu.manpages b/obs/debian.nut-powerman-pdu.manpages new file mode 100644 index 0000000000..43bbc81a04 --- /dev/null +++ b/obs/debian.nut-powerman-pdu.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man8/powerman-pdu.8 diff --git a/obs/debian.nut-server.dirs b/obs/debian.nut-server.dirs new file mode 100644 index 0000000000..a80531140f --- /dev/null +++ b/obs/debian.nut-server.dirs @@ -0,0 +1 @@ +/var/lib/nut diff --git a/obs/debian.nut-server.init b/obs/debian.nut-server.init new file mode 100644 index 0000000000..c539bd5ebe --- /dev/null +++ b/obs/debian.nut-server.init @@ -0,0 +1,179 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: nut-server upsd +# Required-Start: $local_fs $syslog $network $remote_fs udev +# Required-Stop: $local_fs $syslog $network $remote_fs udev +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Network UPS Tools initscript +# Description: This script take care of starting and stopping the +# Network UPS Tools components. When needed, it also +# handle the UPS hardware shutdown. +### END INIT INFO + +# Author: Arnaud Quette + +PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin + +NAME=nut-server +DESC="NUT - power devices information server and drivers" +CONFIG=/etc/nut/nut.conf +pid_dir=/var/run/nut +upsd_pid=${pid_dir}/upsd.pid +upsd=/sbin/upsd +upsdrvctl=/sbin/upsdrvctl +log=">/dev/null 2>/dev/null" + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# set upsd specific options. use "man upsd" for more info +# this parameter is now located in nut.conf, and not in /etc/default/nut anymore +# FIXME: retrieved from 'nut' script during update +UPSD_OPTIONS="" + +# Exit if the package is not installed +[ -x "$upsd" ] || exit 0 + +# Include NUT nut.conf +[ -r $CONFIG ] && . $CONFIG + +# Explicitly require the configuration to be done in /etc/nut/nut.conf +# redundant with nut-client +if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then + log_action_msg "$NAME disabled, please adjust the configuration to your needs" + log_action_msg "Then set MODE to a suitable value in $CONFIG to enable it" + # exit success to avoid breaking the install process! + exit 0 +fi + +# Check if /var/run/nut exists and has the correct perms +check_var_directory() { + [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ + && chown root:nut ${pid_dir} \ + && chmod 770 ${pid_dir} \ + && [ -x /sbin/restorecon ] && /sbin/restorecon ${pid_dir} +} + +# check if the right components are running +check_status() { + case "$MODE" in + standalone|netserver) + status_of_proc -p $upsd_pid $upsd upsd + # FIXME: need driver(s) status too! + ;; + none|netclient|*) + # defered to nut-client + #status_of_proc -p $upsmon_pid $upsmon upsmon + ;; + esac +} + +start_stop_server () { + case "$MODE" in + standalone|netserver) + case "$1" in + start) + # First, start driver(s) + ! $upsdrvctl start >/dev/null 2>&1 && \ + log_progress_msg " (driver(s) failed)." || log_progress_msg " driver(s)." + # Then, data server (upsd) + start-stop-daemon -S -p $upsd_pid -x $upsd \ + -- $UPSD_OPTIONS >/dev/null 2>&1 && + log_progress_msg "upsd" || log_progress_msg "(upsd failed)" + ;; + stop) + # FIXME: should stop nut-client first! + # Reverse order for stop + start-stop-daemon -K -o -p $upsd_pid -n upsd && #>/dev/null 2>&1 && + log_progress_msg "upsd" || log_progress_msg "(upsd failed)" + ! /sbin/upsdrvctl stop >/dev/null 2>&1 && \ + log_progress_msg "(driver(s) failed)" || log_progress_msg "driver(s)" + ;; + esac + ;; + none|netclient|*) + # now handled by nut-client + return 1 + ;; + esac +} + +case "$1" in + + start) + log_daemon_msg "Starting $DESC" + check_var_directory + start_stop_server start #&& log_progress_msg "upsd" + #start_stop_client start && log_progress_msg "upsmon" + log_end_msg 0 + ;; + + stop) + log_daemon_msg "Stopping $DESC" + start_stop_server stop #&& log_progress_msg "upsd" + #start_stop_client stop && log_progress_msg "upsmon" + log_end_msg 0 + ;; + + reload) + $upsd -c reload >/dev/null 2>&1 + #$upsmon -c reload >/dev/null 2>&1 + ;; + + restart|force-reload) + log_daemon_msg "Restarting $DESC" + #start_stop_client stop + start_stop_server stop + sleep 5 + check_var_directory + start_stop_server start #&& log_progress_msg "upsd" + #start_stop_client start && log_progress_msg "upsmon" + log_end_msg 0 + ;; + + status) + #log_daemon_msg "Checking status of $DESC" + echo "Checking status of $DESC" + check_status + exit $? + ;; + + poweroff) + wait_delay=`sed -ne 's#^ *POWEROFF_WAIT= *\(.*\)$#\1#p' /etc/nut/nut.conf` + # UPS poweroff action is actually done here. + # But nut-monitor (Ie nut-client) does the check and call nut-server if needed! + # This action MUST NOT be called directly, and thus is not exposed in 'Usage' + case "$MODE" in + standalone|netserver) + log_daemon_msg "Shutting down the UPS ..." + if $upsdrvctl shutdown ; then + # FIXME (needed?): sleep 5 + log_progress_msg "Waiting for UPS to cut the power" + log_end_msg 0 + else + log_progress_msg "Shutdown failed." + log_progress_msg "Waiting for UPS batteries to run down" + log_end_msg 0 + fi + if [ -n "$wait_delay" ] ; then + log_daemon_msg " (will reboot after $wait_delay) ..." + sleep "$wait_delay" + invoke-rc.d reboot stop + fi + ;; + none|netclient|*) + # nothing to do + ;; + esac + ;; + + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|reload|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/obs/debian.nut-server.install b/obs/debian.nut-server.install new file mode 100644 index 0000000000..4c0f50e069 --- /dev/null +++ b/obs/debian.nut-server.install @@ -0,0 +1,59 @@ +debian/tmp/bin/nut-scanner +debian/tmp/sbin/upsd +debian/tmp/sbin/upsdrvctl +debian/tmp/usr/share/nut/cmdvartab +debian/tmp/usr/share/nut/driver.list +debian/tmp/*/udev/rules.d/[0-9][0-9]-*.rules +debian/tmp/etc/avahi/services/nut.service +debian/tmp/etc/nut/ups.conf +debian/tmp/etc/nut/upsd.conf +debian/tmp/etc/nut/upsd.users +debian/tmp/lib/nut/genericups +debian/tmp/lib/nut/mge-shut +debian/tmp/lib/nut/rhino +debian/tmp/lib/nut/bestups +debian/tmp/lib/nut/bestfortress +debian/tmp/lib/nut/usbhid-ups +debian/tmp/lib/nut/apcsmart +debian/tmp/lib/nut/apcsmart-old +debian/tmp/lib/nut/belkin +debian/tmp/lib/nut/blazer_ser +debian/tmp/lib/nut/blazer_usb +debian/tmp/lib/nut/clone +debian/tmp/lib/nut/clone-outlet +debian/tmp/lib/nut/ivtscd +debian/tmp/lib/nut/metasys +debian/tmp/lib/nut/etapro +debian/tmp/lib/nut/tripplite_usb +debian/tmp/lib/nut/bcmxcp +debian/tmp/lib/nut/bestuferrups +debian/tmp/lib/nut/gamatronic +debian/tmp/lib/nut/oldmge-shut +debian/tmp/lib/nut/safenet +debian/tmp/lib/nut/isbmex +debian/tmp/lib/nut/masterguard +debian/tmp/lib/nut/belkinunv +debian/tmp/lib/nut/tripplite +debian/tmp/lib/nut/upscode2 +debian/tmp/lib/nut/solis +debian/tmp/lib/nut/oneac +debian/tmp/lib/nut/mge-utalk +debian/tmp/lib/nut/powerpanel +debian/tmp/lib/nut/bestfcom +debian/tmp/lib/nut/liebert +debian/tmp/lib/nut/powercom +debian/tmp/lib/nut/bcmxcp_usb +debian/tmp/lib/nut/victronups +debian/tmp/lib/nut/tripplitesu +debian/tmp/lib/nut/optiups +debian/tmp/lib/nut/everups +debian/tmp/lib/nut/dummy-ups +debian/tmp/lib/nut/richcomm_usb +debian/tmp/lib/nut/liebert-esp2 +debian/tmp/lib/nut/microdowell +debian/tmp/lib/nut/al175 +debian/tmp/lib/nut/apcupsd-ups +debian/tmp/lib/nut/nutdrv_atcl_usb +debian/tmp/lib/nut/nutdrv_qx +debian/tmp/lib/nut/riello_ser +debian/tmp/lib/nut/riello_usb diff --git a/obs/debian.nut-server.manpages b/obs/debian.nut-server.manpages new file mode 100644 index 0000000000..d5cf07ed18 --- /dev/null +++ b/obs/debian.nut-server.manpages @@ -0,0 +1,53 @@ +debian/tmp/usr/share/man/man5/ups.conf.5 +debian/tmp/usr/share/man/man5/upsd.conf.5 +debian/tmp/usr/share/man/man5/upsd.users.5 +debian/tmp/usr/share/man/man8/apcsmart.8 +debian/tmp/usr/share/man/man8/apcsmart-old.8 +debian/tmp/usr/share/man/man8/bcmxcp.8 +debian/tmp/usr/share/man/man8/bcmxcp_usb.8 +debian/tmp/usr/share/man/man8/belkin.8 +debian/tmp/usr/share/man/man8/belkinunv.8 +debian/tmp/usr/share/man/man8/bestfcom.8 +debian/tmp/usr/share/man/man8/bestuferrups.8 +debian/tmp/usr/share/man/man8/bestups.8 +debian/tmp/usr/share/man/man8/bestfortress.8 +debian/tmp/usr/share/man/man8/clone.8 +debian/tmp/usr/share/man/man8/dummy-ups.8 +debian/tmp/usr/share/man/man8/etapro.8 +debian/tmp/usr/share/man/man8/everups.8 +debian/tmp/usr/share/man/man8/gamatronic.8 +debian/tmp/usr/share/man/man8/genericups.8 +debian/tmp/usr/share/man/man8/isbmex.8 +debian/tmp/usr/share/man/man8/ivtscd.8 +debian/tmp/usr/share/man/man8/liebert.8 +debian/tmp/usr/share/man/man8/liebert-esp2.8 +debian/tmp/usr/share/man/man8/masterguard.8 +debian/tmp/usr/share/man/man8/metasys.8 +debian/tmp/usr/share/man/man8/mge-shut.8 +debian/tmp/usr/share/man/man8/mge-utalk.8 +debian/tmp/usr/share/man/man8/microdowell.8 +debian/tmp/usr/share/man/man8/nutupsdrv.8 +debian/tmp/usr/share/man/man8/oneac.8 +debian/tmp/usr/share/man/man8/optiups.8 +debian/tmp/usr/share/man/man8/powercom.8 +debian/tmp/usr/share/man/man8/powerpanel.8 +debian/tmp/usr/share/man/man8/rhino.8 +debian/tmp/usr/share/man/man8/richcomm_usb.8 +debian/tmp/usr/share/man/man8/safenet.8 +debian/tmp/usr/share/man/man8/solis.8 +debian/tmp/usr/share/man/man8/tripplite.8 +debian/tmp/usr/share/man/man8/tripplitesu.8 +debian/tmp/usr/share/man/man8/tripplite_usb.8 +debian/tmp/usr/share/man/man8/upscode2.8 +debian/tmp/usr/share/man/man8/upsd.8 +debian/tmp/usr/share/man/man8/upsdrvctl.8 +debian/tmp/usr/share/man/man8/usbhid-ups.8 +debian/tmp/usr/share/man/man8/victronups.8 +debian/tmp/usr/share/man/man8/al175.8 +debian/tmp/usr/share/man/man8/apcupsd-ups.8 +debian/tmp/usr/share/man/man8/blazer_ser.8 +debian/tmp/usr/share/man/man8/blazer_usb.8 +debian/tmp/usr/share/man/man8/nutdrv_atcl_usb.8 +debian/tmp/usr/share/man/man8/nutdrv_qx.8 +debian/tmp/usr/share/man/man8/riello_ser.8 +debian/tmp/usr/share/man/man8/riello_usb.8 diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst new file mode 100644 index 0000000000..33221262fe --- /dev/null +++ b/obs/debian.nut-server.postinst @@ -0,0 +1,91 @@ +#!/bin/sh -e + +case "$1" in + + configure) + + # make sure the nut user exists and has correct memberships + if ! getent group nut >/dev/null; then + addgroup --quiet --system nut + fi + if ! getent passwd nut >/dev/null; then + adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut + elif ! groups nut | grep -qw nut; then + adduser nut nut + fi +# for Ubuntu, while waiting for a proper debconf +# if ! groups nut | grep -qw dialout; then +# adduser nut dialout +# fi + + # make sure that conffiles are secured and have the correct ownerships + # on first install + if [ -z "$2" ] ; then + if [ -d /etc/nut/ ] ; then + chown root:nut /etc/nut/ + fi + for file in ups.conf upsd.conf upsd.users ; do + if [ -f /etc/nut/$file ] ; then + chown root:nut /etc/nut/$file + chmod 640 /etc/nut/$file + fi + done + fi + + # make sure that /var/run/nut exists and has the correct ownerships + if [ ! -d /var/run/nut ] ; then + mkdir -p /var/run/nut + fi + if [ -d /var/run/nut ] ; then + chown root:nut /var/run/nut + chmod 770 /var/run/nut + if which restorecon >/dev/null 2>&1; then + restorecon /var/run/nut + fi + fi + + # make sure that /var/lib/nut has the correct permissions and ownerships + if [ -d /var/lib/nut ] ; then + chown root:nut /var/lib/nut + chmod 770 /var/lib/nut + fi + + # ask udev to check for new udev rules + [ -x /etc/init.d/udev ] && pidof udevd > /dev/null \ + && udevadm trigger --subsystem-match=usb --action=change + + # 557178 udevadm trigger --subsystem-match=usb + + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then + rm -f /etc/init.d/nut + else + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old + fi + update-rc.d nut remove >/dev/null + fi + ;; + + abort-upgrade) + # do nothing + ;; + + abort-remove) + # do nothing + ;; + + abort-deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-server.postrm b/obs/debian.nut-server.postrm new file mode 100644 index 0000000000..b95b26f6f5 --- /dev/null +++ b/obs/debian.nut-server.postrm @@ -0,0 +1,50 @@ +#!/bin/sh -e + +case "$1" in + + remove) + # remove sample file if those were previously (wrongly) installed + for file in ups.conf upsd.conf upsmon.conf upsd.users upssched.conf ; do + rm -f /etc/nut/${file}.sample + done + ;; + + purge) + # remove udev rules files + rm -f /etc/udev/rules.d/025_nut-usbups.rules + rm -f /etc/udev/rules.d/52_nut-usbups.rules + rm -f /etc/udev/rules.d/52-nut-usbups.rules + # handle a dpkg bug + [ -d /etc/nut ] && rmdir --ignore-fail-on-non-empty /etc/nut >/dev/null 2>&1 + ;; + + upgrade) + # do nothing + ;; + + failed-upgrade) + # do nothing + ;; + + abort-install) + # do nothing + ;; + + abort-upgrade) + # do nothing + ;; + + disappear) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-server.preinst b/obs/debian.nut-server.preinst new file mode 100644 index 0000000000..f3e949fd35 --- /dev/null +++ b/obs/debian.nut-server.preinst @@ -0,0 +1,12 @@ +#!/bin/sh -e + +if [ "$1" = upgrade ]; then + # remove the obsolete udev file(s) + [ -f /etc/udev/rules.d/025_nut-usbups.rules ] && rm -f /etc/udev/rules.d/025_nut-usbups.rules + [ -f /etc/udev/rules.d/52_nut-usbups.rules ] && rm -f /etc/udev/rules.d/52_nut-usbups.rules + [ -f /etc/udev/rules.d/52-nut-usbups.rules ] && rm -f /etc/udev/rules.d/52-nut-usbups.rules +fi + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-server.prerm b/obs/debian.nut-server.prerm new file mode 100644 index 0000000000..6292ef83c7 --- /dev/null +++ b/obs/debian.nut-server.prerm @@ -0,0 +1,42 @@ +#!/bin/sh -e + +# the DEBHELPER token is purposely not used +# because we don't want the daemon to be +# stopped during an upgrade + +case "$1" in + + remove) + # nut-usb specifics + [ -f /etc/hotplug/usb/libhid.usermap ] && rm -f /etc/hotplug/usb/libhid.usermap + [ -f /etc/hotplug/usb/libhidups ] && rm -f /etc/hotplug/usb/libhidups + + [ -L /usr/doc/nut ] && rm -f /usr/doc/nut + # do stop the daemon on remove + invoke-rc.d nut stop && sleep 1 + [ -d /var/run/nut ] && rm -rf /var/run/nut/ + ;; + + upgrade) + [ -L /usr/doc/nut ] && rm -f /usr/doc/nut + # do not stop the daemon on upgrade + ;; + + failed-upgrade) + # do nothing + ;; + + deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-server.tmpfiles b/obs/debian.nut-server.tmpfiles new file mode 100644 index 0000000000..bf195cf142 --- /dev/null +++ b/obs/debian.nut-server.tmpfiles @@ -0,0 +1 @@ +d /run/nut 0770 root nut - - diff --git a/obs/debian.nut-snmp.docs b/obs/debian.nut-snmp.docs new file mode 100644 index 0000000000..9611f52b41 --- /dev/null +++ b/obs/debian.nut-snmp.docs @@ -0,0 +1 @@ +docs/snmp.txt diff --git a/obs/debian.nut-snmp.install b/obs/debian.nut-snmp.install new file mode 100644 index 0000000000..3c04aff520 --- /dev/null +++ b/obs/debian.nut-snmp.install @@ -0,0 +1,3 @@ +debian/tmp/lib/nut/snmp-ups +debian/tmp/lib/nut/snmp-ups-dmf +usr/share/nut/dmfsnmp diff --git a/obs/debian.nut-snmp.manpages b/obs/debian.nut-snmp.manpages new file mode 100644 index 0000000000..3c9644ed7c --- /dev/null +++ b/obs/debian.nut-snmp.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man8/snmp-ups.8 diff --git a/obs/debian.nut-xml.install b/obs/debian.nut-xml.install new file mode 100644 index 0000000000..9c6d56dd6e --- /dev/null +++ b/obs/debian.nut-xml.install @@ -0,0 +1 @@ +debian/tmp/lib/nut/netxml-ups diff --git a/obs/debian.nut-xml.manpages b/obs/debian.nut-xml.manpages new file mode 100644 index 0000000000..91a537eadd --- /dev/null +++ b/obs/debian.nut-xml.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man8/netxml-ups.8 diff --git a/obs/debian.nut.README.Debian b/obs/debian.nut.README.Debian new file mode 100644 index 0000000000..882e2afd65 --- /dev/null +++ b/obs/debian.nut.README.Debian @@ -0,0 +1,162 @@ +Network UPS Tools - Quick Start for Debian +------------------------------------------ + +Anyway, here are the quick start instructions for using nut: + +These Quick Start instructions are useful for a UPS connected to a single +machine. For a UPS connected to multiple machines, additional steps must be +taken, as outlined at the end of this file, including the notice regarding +SECURITY CONSIDERATIONS. + +(I) Upgrading +============= + +In case of upgrading, follow instructions given in: +/usr/share/doc/nut/UPGRADING + +Note that service(s) (driver(s), upsd, upsmon) are not restarted upon +upgrade, to avoid service disruption. You have to manually do it. + +(II) Installation +================= + +Configuration files are located in /etc/nut/ +In order to tune NUT configuration according to your needs, follow the below +information, along with the one provided inside these files. + +(1) /etc/nut/nut.conf (see 'man 5 nut.conf' for more information) + Edit /etc/nut/nut.conf and modify the "MODE" variable according to your + configuration. + + You can also fine tune the daemons options through UPSD_OPTIONS and + UPSMON_OPTIONS. + +The steps 2 to 5 are only required if you use a "standalone" or "netserver" +MODE. If you are running in "netclient" MODE, jump directly to section 6. + +(2) /etc/nut/ups.conf (see 'man 5 ups.conf' for more information) + + Edit /etc/nut/ups.conf and add something like: + [myups] + driver = usbhid-ups + port = auto + Use the appropriate driver for your UPS and select the correct port. + To select the driver, take a look at the UPS compatibility list: + /usr/share/nut/driver.list + + If you have more than one UPS, add as many entries as needed. + + If you wish to test manually whether your configuration of ups.conf is + correct, you may invoke upsdrvctl by hand (as root): + /sbin/upsdrvctl start [myups] + /sbin/upsdrvctl stop [myups] + + Ensure that the permissions of ups.conf do not permit the world to + read it. It should already be thus, but the following command + accomplishes this: + chown root:nut /etc/nut/ups.conf + chmod 640 /etc/nut/ups.conf + +(3) device port permissions + The nut user need to be able to access the device port both for reading and + writing. + + For serial devices, there are two possibilities: + + a) You can add the nut user to the dialout group. + The following command accomplishes this: + addgroup nut dialout + + This is not done by default for security reason on Debian, but is applied + on Ubuntu. + + b) Another solution, for system supporting udev, is to create a file, + For example /etc/udev/rules.d/92-nut-serialups.rules. It will + be used after /lib/udev/rules.d/91-permissions.rules, and + contains something like: + + KERNEL=="ttyS1", GROUP="nut" + + where 'ttyS1' has to be replaced by the exact name of your serial port. + + For USB devices, permissions are automatically set by the + /lib/udev/rules.d/52-nut-usbups.rules udev rules file. + +(4) /etc/nut/upsd.conf (see 'man 5 upsd.conf' for more information) + the default /etc/nut/upsd.conf is fine for a "standalone" configuration. + If you are in "netserver" MODE, you will have to modify the LISTEN option + to something suitable. + + Ensure that the permissions of upsd.conf do not permit the world to + read it. It should already be thus, but the following command + accomplishes this: + chown root:nut /etc/nut/upsd.conf + chmod 640 /etc/nut/upsd.conf + +(5) /etc/nut/upsd.users (see 'man 5 upsd.users' for more information) + Edit /etc/nut/upsd.users and add something like the following, + without the comments, in order to define a user: + [monmaster] + password = blah + upsmon master + Please use *different* usernames and passwords than you use on your + system; see the note regarding SECURITY CONSIDERATIONS at the end + of this file. + + Ensure that the permissions of upsd.users do not permit the world to + read it. It should already be thus, but the following command + accomplishes this: + chown root:nut /etc/nut/upsd.users + chmod 640 /etc/nut/upsd.users + +(6) /etc/nut/upsmon.conf (see 'man 5 upsmon.conf' for more information) + Edit /etc/nut/upsmon.conf and add something like the following: + MONITOR myups@localhost 1 monmaster blah master + POWERDOWNFLAG /etc/killpower + SHUTDOWNCMD "/sbin/shutdown -h +0" + + Ensure that the permissions of upsmon.conf do not permit the world to + read it. It should already be thus, but the following commands + accomplishes this: + chown root:nut /etc/nut/upsmon.conf + chmod 640 /etc/nut/upsmon.conf + +(7) /etc/default/nut + This file is not used anymore. + nut.conf provides all the needed features to replace this file. + +(8) start the daemon + If you use a "standalone" or "netserver" MODE, invoke: + - '/etc/init.d/nut-server start' to start upsd and appropriate driver(s), + - '/etc/init.d/nut-client start' to start upsmon. + + If you are running in "netclient" MODE, invoke: + - '/etc/init.d/nut-client start' to start upsmon. + + Check /var/log/syslog to ensure that daemon(s) started up correctly. + + +Additional Notes for Sharing a UPS +---------------------------------- +If you have multiple machines connected to the same UPS, you will need to +(a) modify the access control lists in upsd.conf on the server; +(b) add additional users to upsd.users on the server; and +(c) configure upsmon.conf on the clients. + +Please note that upsmon on a client machine and upsd on a server machine need +to communicate via your network. This means that you need to ensure that all +the networking equipment (hub, switch, router, etc.) between the client and the +server is powered by the UPS. Otherwise, when the power goes down, the network +connection between the client machine will be broken and the client will not +be told to shut down. + +SECURITY CONSIDERATIONS +----------------------- +Finally, please be aware of the following SECURITY CONSIDERATIONS: the TCP +communications between the client daemon, upsmon, and the server daemon, upsd, +send the username and passwords defined in upsd.users and used in upsmon.conf +over the wire UNENCRYPTED. This means that somebody could sniff the username +and password. A version that encrypts the connection using SSL should be +available someday. + +Please see the documentation in /usr/share/doc/nut/docs for more information. diff --git a/obs/debian.nut.TODO.Debian b/obs/debian.nut.TODO.Debian new file mode 100644 index 0000000000..b8fe9dd56b --- /dev/null +++ b/obs/debian.nut.TODO.Debian @@ -0,0 +1,9 @@ +- how to distribute the nut-scanner and its library? Ie, a single package, + or using the nut-{xml,snmp,...} packages. + this requires libusb (0.1), Net SNMP, FreeIPMi, Avahi, libupsclient and Neon! +- consider an SSL/TLS set of packages (ie nut-ssl, ...) + or help the port to NSS +- install the device-recorder.sh script (with libupsclient-dev or a more + generic nut-dev that depends?) +- address the /var/www issue with upstream +- audit and solve the lintian reports... diff --git a/obs/debian.nut.docs b/obs/debian.nut.docs new file mode 100644 index 0000000000..d0026f76e3 --- /dev/null +++ b/obs/debian.nut.docs @@ -0,0 +1,18 @@ +AUTHORS +MAINTAINERS +README +UPGRADING +docs/acknowledgements.txt +docs/config-notes.txt +docs/documentation.txt +docs/download.txt +docs/FAQ.txt +docs/features.txt +docs/history.txt +docs/nut-names.txt +docs/outlets.txt +docs/packager-guide.txt +docs/scheduling.txt +docs/security.txt +docs/support.txt +docs/user-manual.txt diff --git a/obs/debian.python-nut.install b/obs/debian.python-nut.install new file mode 100644 index 0000000000..fa24bc5bd3 --- /dev/null +++ b/obs/debian.python-nut.install @@ -0,0 +1 @@ +scripts/python/module/PyNUT.py usr/share/pyshared/ diff --git a/obs/debian.rules b/obs/debian.rules new file mode 100644 index 0000000000..b203467949 --- /dev/null +++ b/obs/debian.rules @@ -0,0 +1,140 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/class/python-module.mk + +include /usr/share/cdbs/1/rules/autoreconf.mk +# We cannot call autoreconf -f -i as it updates INSTALL which is used for doc +# generation +DEB_DH_AUTORECONF_ARGS = --as-needed + +DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) + +# List any files which are not installed +include /usr/share/cdbs/1/rules/utils.mk +common-binary-post-install-arch:: list-missing + +DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,-O1 -Wl,--as-needed +include /usr/share/dpkg/buildflags.mk + +DEB_CONFIGURE_PREFIX := +DEB_CONFIGURE_SYSCONFDIR := /etc/nut +DEB_CONFIGURE_INCLUDEDIR := /usr/include +DEB_CONFIGURE_MANDIR := /usr/share/man +DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ + --with-ssl --with-openssl --with-libltdl=yes \ + --with-cgi=auto --with-powerman=auto \ + --with-serial --with-usb --with-snmp --with-neon --with-ipmi \ + --with-dmf=yes \ + --with-dev \ + --disable-static \ + --with-statepath=/var/run/nut \ + --with-altpidpath=/var/run/nut \ + --with-drvpath=/lib/nut \ + --with-cgipath=/usr/lib/cgi-bin/nut \ + --with-htmlpath=/usr/share/nut/www \ + --with-pidpath=/var/run/nut \ + --datadir=/usr/share/nut \ + --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ + --with-user=nut --with-group=nut + +ifeq (linux,$(DEB_HOST_ARCH_OS)) + DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev --with-systemdsystemunitdir=/lib/systemd/system +endif + +# only build documentation if asciidoc is installed +ifneq ($(shell which asciidoc),) +# DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=html-chunked,pdf + DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man +endif + +pre-build:: debian/compat + (cd tools; python nut-snmpinfo.py) + +common-install-arch:: + # install the bash completion script + mkdir -p $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/ + cp $(CURDIR)/scripts/misc/nut.bash_completion \ + $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/nut + + # install the avahi service file + mkdir -p $(CURDIR)/debian/tmp/etc/avahi/services + cp $(CURDIR)/scripts/avahi/nut.service \ + $(CURDIR)/debian/tmp/etc/avahi/services + + # install Augeas lenses + mkdir -p $(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/tests + cp $(CURDIR)/scripts/augeas/*.aug \ + $(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/ + cp $(CURDIR)/scripts/augeas/tests/test_nut.aug \ + $(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/tests/ + + # install the default configuration + for f in $(CURDIR)/debian/tmp/etc/nut/*; do \ + nf=`basename $${f} | sed 's/\(.*\).sample/\1/'`; \ + mv $${f} $(CURDIR)/debian/tmp/etc/nut/$${nf}; \ + done + + # Move -dev file to /usr + rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so + ln -s /lib/$(DEB_HOST_MULTIARCH)/libupsclient.so.4 \ + $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so + rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so + ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutclient.so.0 \ + $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so + rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so + ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.1 \ + $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so + + # Install systemd files only on systems where it's supported + install -m 644 -D $(CURDIR)/debian/tmp/lib/systemd/system/nut-monitor.service \ + $(CURDIR)/debian/nut-client/lib/systemd/system/nut-monitor.service + install -D $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/systemd/system-shutdown/nutshutdown \ + $(CURDIR)/debian/nut-server/lib/systemd/system-shutdown/nutshutdown + install -m 644 -D $(CURDIR)/debian/tmp/lib/systemd/system/nut-server.service \ + $(CURDIR)/debian/nut-server/lib/systemd/system/nut-server.service + install -m 644 -t $(CURDIR)/debian/nut-server/lib/systemd/system \ + $(CURDIR)/debian/tmp/lib/systemd/system/nut-driver* + + # Add a symlink to mask the LSB initscript + ln -s nut-monitor.service $(CURDIR)/debian/nut-client/lib/systemd/system/nut-client.service + + # Install tmpfiles config file to create /run/nut directory + install -m 644 -D $(CURDIR)/debian/nut-client.tmpfiles \ + $(CURDIR)/debian/nut-client/usr/lib/tmpfiles.d/nut-client.conf + install -m 644 -D $(CURDIR)/debian/nut-server.tmpfiles \ + $(CURDIR)/debian/nut-server/usr/lib/tmpfiles.d/nut-server.conf + +extradocs-install: + #install documentation + mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf + mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html + cp $(CURDIR)/docs/*.pdf $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf + cp $(CURDIR)/docs/FAQ.html $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html + + for f in $(CURDIR)/docs/*.chunked/; do \ + nf=`basename $${f} | sed 's/\(.*\)\.chunked/\1/'`; \ + cp -a $${f} $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html/$${nf}/; \ + done + +#common-install-indep:: extradocs-install +common-install-indep:: + # Make sure this exists for packaging to be consistent + mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc + +binary-install/nut-monitor:: + dh_python2 -pnut-monitor + +DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server --restart-after-upgrade +DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client --restart-after-upgrade +DEB_DH_SYSTEMD_START_ARGS_nut-server := --restart-after-upgrade +DEB_DH_SYSTEMD_START_ARGS_nut-client := --restart-after-upgrade +DEB_DH_COMPRESS_ARGS_nut-doc := -X.pdf + +ifeq (linux,$(DEB_HOST_ARCH_OS)) +# for Debian + DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 0.124-1)" +# for Ubuntu +# DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 136-1)" +endif diff --git a/obs/debian.series b/obs/debian.series new file mode 100644 index 0000000000..a75b428046 --- /dev/null +++ b/obs/debian.series @@ -0,0 +1,2 @@ +# This source tarball is taken from a dedicated Git branch head, so +# no further patches are to be applied (change the repo if needed). diff --git a/obs/debian.watch b/obs/debian.watch new file mode 100644 index 0000000000..606e46065f --- /dev/null +++ b/obs/debian.watch @@ -0,0 +1,2 @@ +version=3 +http://www.networkupstools.org/download.html .*/nut-(.*)\.tar\.(?:gz|bz2|xz) diff --git a/obs/nut.changes b/obs/nut.changes new file mode 100644 index 0000000000..e69de29bb2 diff --git a/obs/nut.dsc b/obs/nut.dsc new file mode 100644 index 0000000000..bdb3391923 --- /dev/null +++ b/obs/nut.dsc @@ -0,0 +1,34 @@ +Format: 1.0 +Source: nut +Binary: nut, nut-server, nut-client, nut-cgi, nut-snmp, nut-ipmi, nut-xml, nut-powerman-pdu, nut-doc, libupsclient4, libupsclient-dev, libnutclient0, libnutclient-dev, python-nut, nut-monitor, libups-nut-perl +Architecture: any all +Version: 2.7.4-11 +Maintainer: Arnaud Quette +Uploaders: Laurent Bigonville +Homepage: http://www.networkupstools.org/ +Standards-Version: 3.9.6 +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary +Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git +Testsuite: autopkgtest +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1 +Build-Depends-Indep: asciidoc (>= 8.6.3), docbook-xsl, dblatex (>= 0.2.5), libxml2-utils +Package-List: + libnutclient-dev deb libdevel optional arch=any + libnutclient0 deb libs optional arch=any + libnutscan-dev deb libdevel optional arch=any + libnutscan1 deb libs optional arch=any + libups-nut-perl deb perl optional arch=all + libupsclient-dev deb libdevel optional arch=any + libupsclient4 deb libs optional arch=any + nut deb metapackages optional arch=all + nut-cgi deb admin optional arch=any + nut-client deb admin optional arch=any + nut-doc deb doc optional arch=all + nut-ipmi deb admin optional arch=linux-any,kfreebsd-any + nut-monitor deb admin optional arch=all + nut-powerman-pdu deb admin extra arch=any + nut-server deb admin optional arch=any + nut-snmp deb admin optional arch=any + nut-xml deb admin optional arch=any + python-nut deb python optional arch=all +DEBTRANSFORM-TAR: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz diff --git a/obs/nut.spec b/obs/nut.spec new file mode 100644 index 0000000000..32e3d78ba6 --- /dev/null +++ b/obs/nut.spec @@ -0,0 +1,380 @@ +# +# spec file for package nut.spec +# +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 Eaton EEIC. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%define apache_serverroot %(%{_sbindir}/apxs2 -q datadir 2>/dev/null || %{_sbindir}/apxs -q PREFIX) +%define CGIPATH %{apache_serverroot}/cgi-bin +%define HTMLPATH %{apache_serverroot}/htdocs +%define MODELPATH %{_libexecdir}/ups/driver +%define STATEPATH %{_localstatedir}/lib/ups +%define CONFPATH %{_sysconfdir}/ups +%define USER upsd +%define GROUP daemon +%define LBRACE ( +%define RBRACE ) +%define QUOTE " +%define BACKSLASH \\ +# Collect all devices listed in ups-nut-device.fdi: +%define USBHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | fgrep -a -A1 USBHID-UPS | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') +%define USBNONHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | fgrep -a -A1 _USB | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') +%define systemdsystemunitdir %(pkg-config --variable=systemdsystemunitdir systemd) +%define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) + +Name: nut +Version: 2.7.4 +Release: 4 +Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring) +License: GPL-2.0+ +Group: Hardware/UPS +Url: http://www.networkupstools.org/ +#Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz + +# git clone https://github.com/vyskocilm/nut daisychain+DMF +# git archive --prefix nut-2.7.4/ -o ~/work/BIOS/ROZ-OBS/Pool\:master/nut/nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz HEAD +Source: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz +Patch2: 0002-nut-monitor-paths.patch +Patch3: 0003-install-dev-files-in-usr.patch +Patch4: 0004-fix-systemd-service.patch +Patch6: 0006-ups-conf-maxretry.patch +Patch8: 0008-drop-w3c-icons.patch +Patch11: 0011-libnutscanner-scan-one-ip-xml-http.patch +Patch14: 0014-upsrdvctl-nowait.patch +Patch15: 0015-Use-target-for-drivers-in-systemd.patch +Patch16: 0021-xml_scan_3tries.patch +# already upstream +#Patch17: 0024-snmp-ups-Eaton-3ph-UPS-improvements.patch +#Patch18: 0025-Fix-nut-scanner-compilation-in-some-environments.patch +#Patch19: 0026-snmp-ups-support-Raritan-Dominion-PX2-PDU.patch +Patch20: 0027-snmp-ups-support-APC-PDU.patch +# can't be merged, upstream change +#Patch21: 0028-nut-scanner-additional-search-path.patch +# can't be merged, upstream change +#Patch29: 0029-netvision-mib-uses-0-as-dfl.patch +# daisy chain is upstream +# Patch30: 0030-daisychain.patch +# Patch31: 0031-daisychain-complement.patch +# Patch32: 0032-snmp-ups-fix-some-regression-due-to-daisychain.patch +# Patch33: 0033-snmp-ups-fix-memory-leaks.patch +Patch34: 0034-fix_xmlv4_segfault.patch +#Patch35: 0035-daisychain+DMF.patch +#Patch36: 0036-post-carlos-dmf-fixes.patch + +Requires: %{_bindir}/fgrep +Requires: %{_bindir}/grep +Requires: %{_bindir}/pgrep +Requires: %{_bindir}/pkill +Requires: %{_bindir}/readlink +Requires: usbutils +#Requires(post): udev +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +BuildRequires: avahi-devel +# To fix end-of-line encoding: +BuildRequires: dos2unix +BuildRequires: freeipmi-devel +BuildRequires: gcc-c++ +BuildRequires: gd-devel +BuildRequires: libtool +BuildRequires: libtool-ltdl-devel +BuildRequires: libusb-devel +BuildRequires: net-snmp-devel +BuildRequires: pkg-config +BuildRequires: python +BuildRequires: lua-devel >= 5.1 + +%if 0%{?suse_version} +BuildRequires: apache2-devel +BuildRequires: dbus-1-glib-devel +BuildRequires: libcppunit-devel +BuildRequires: libneon-devel +BuildRequires: libopenssl-devel +BuildRequires: systemd-rpm-macros +BuildRequires: powerman-devel +BuildRequires: tcpd-devel +# TODO: For doc build: move out of opensuse +BuildRequires: asciidoc +BuildRequires: dblatex +BuildRequires: libxslt-tools +%endif + +%if 0%{?centos_version} +BuildRequires: cppunit-devel +BuildRequires: dbus-glib-devel +BuildRequires: httpd-devel +BuildRequires: neon-devel +BuildRequires: openssl-devel +BuildRequires: tcp_wrappers-devel +BuildRequires: libxslt +%endif + +%if 0%{?rhel_version}>=7 +BuildRequires: dbus-glib-devel +BuildRequires: httpd-devel +BuildRequires: libusb +BuildRequires: neon +BuildRequires: openssl-devel +BuildRequires: tcp_wrappers-devel +BuildRequires: libxslt +%endif + +%if %{defined opensuse_version} +# Package provides driver for USB HID UPSes, but people can live with hal addon: +Enhances: %{USBHIDDRIVERS} +# Package provides the only avalailable driver for other USB UPSes: +Supplements: %{USBNONHIDDRIVERS} +%systemd_requires +%endif + +%description +Core package of Network UPS Tools. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%package drivers-net +Summary: Network UPS Tools - Extra Networking Drivers (for Network Monitoring) +Group: Hardware/UPS +Requires: %{name} = %{version} + +%description drivers-net +Networking drivers for the Network UPS Tools. You will need them +together with nut to provide UPS networking support. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%package -n libupsclient1 +Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring) +Group: System/Libraries + +%description -n libupsclient1 +Shared library for the Network UPS Tools. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%package cgi +Summary: Network UPS Tools Web Server Support (UPS Status Pages) +Group: Hardware/UPS +Requires: %{name} = %{version} + +%description cgi +Web server support package for the Network UPS Tools. + +Predefined URL is http://localhost/nut/index.html + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%package devel +Summary: Network UPS Tools (Uninterruptible Power Supply Monitoring) +Group: Development/Libraries/C and C++ +Requires: %{name} = %{version} +Requires: openssl-devel + +%description devel +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%prep +%setup -q +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch6 -p1 +%patch8 -p1 +%patch11 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +# % patch17 -p1 +# % patch18 -p1 +# % patch19 -p1 +%patch20 -p1 +# % patch21 -p1 +# % patch29 -p1 +# % patch30 -p1 +# % patch31 -p1 +# % patch32 -p1 +# % patch33 -p1 +%patch34 -p1 +# % patch35 -p1 +# % patch36 -p1 + +%build +autoreconf -f -i +%configure --disable-static --with-pic --libexecdir=%{_prefix}/lib\ + --sysconfdir=%{CONFPATH}\ + --datadir=%{_datadir}/nut\ + --with-ssl --with-openssl\ + --with-libltdl=yes\ + --with-cgi=auto\ + --with-serial\ + --with-usb\ + --with-snmp\ + --with-neon\ + --with-dev\ + --with-ipmi \ + --with-powerman=auto\ + --with-doc=man\ + --with-htmlpath=%{HTMLPATH}\ + --with-cgipath=%{CGIPATH}\ + --with-statepath=%{STATEPATH}\ + --with-drvpath=%{MODELPATH}\ + --with-user=%{USER}\ + --with-group=%{GROUP} \ + --with-udev-dir=%{_sysconfdir}/udev \ + --enable-option-checking=fatal + +(cd tools; python nut-snmpinfo.py) + +make %{?_smp_mflags} +PORT=$(sed -n 's/#define PORT //p' config.log) +if test "$PORT" = 3493 ; then + PORT=nut +fi + +%install +make DESTDIR=%{buildroot} install %{?_smp_mflags} +mkdir -p %{buildroot}%{STATEPATH} +# SuSE rc +mkdir -p %{buildroot}%{_sbindir} +mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d +install -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/ +mkdir -p %{buildroot}%{STATEPATH} +rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample +mkdir %{buildroot}/bin +mv %{buildroot}%{_bindir}/upssched-cmd %{buildroot}/bin/upssched-cmd +# Rename web pages to not conflict with apache2-example-pages or user home page: +mkdir %{buildroot}%{HTMLPATH}/nut %{buildroot}%{CGIPATH}/nut +mv %{buildroot}%{HTMLPATH}/*.{html,png} %{buildroot}%{HTMLPATH}/nut/ +mv %{buildroot}%{CGIPATH}/*.cgi %{buildroot}%{CGIPATH}/nut +find %{buildroot} -type f -name "*.la" -delete -print +mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d +install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/ + +%pre +usr/sbin/useradd -r -g %{GROUP} -s /bin/false \ + -c "UPS daemon" -d /sbin %{USER} 2>/dev/null || : +%if %{defined opensuse_version} +%service_add_pre nut-driver.service nut-server.service nut-monitor.service +%endif + +%post +# Be sure that all files are owned by a dedicated user. +bin/chown -R %{USER}:%{GROUP} %{STATEPATH} +# Be sure that all files are owned by a dedicated user. +bin/chown %{USER}:root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users +bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users +# And finally trigger udev to set permissions according to newly installed rules files. +/sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device +%if %{defined opensuse_version} +%service_add_post nut-driver.service nut-server.service nut-monitor.service +%endif + +%preun +%if %{defined opensuse_version} +%service_del_preun nut-driver.service nut-server.service nut-monitor.service +%endif + +%postun +%if %{defined opensuse_version} +%service_del_postun nut-driver.service nut-server.service nut-monitor.service +%endif + +%post -n libupsclient1 -p /sbin/ldconfig + +%postun -n libupsclient1 -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc AUTHORS COPYING ChangeLog MAINTAINERS NEWS README UPGRADING docs/*.txt docs/cables +/bin/* +%{_sysconfdir}/bash_completion.d/* +%{_sysconfdir}/logrotate.d/* +%{_bindir}/* +%{_datadir}/nut +%{_mandir}/man5/*.* +%{_mandir}/man8/*.* +%exclude %{_mandir}/man8/netxml-ups*.* +%exclude %{_mandir}/man8/snmp-ups*.* +%dir %{_libexecdir}/ups +%{_sbindir}/* +%dir %{_sysconfdir}/udev +%dir %{_sysconfdir}/udev/rules.d +%config(noreplace) %{_sysconfdir}/udev/rules.d/*.rules +%config(noreplace) %{CONFPATH}/hosts.conf +%config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsd.conf +%config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsd.users +%config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsmon.conf +%dir %{CONFPATH} +%config(noreplace) %{CONFPATH}/nut.conf +%config(noreplace) %{CONFPATH}/ups.conf +%config(noreplace) %{CONFPATH}/upsset.conf +%config(noreplace) %{CONFPATH}/upssched.conf +%dir %{MODELPATH} +%{MODELPATH}/* +%exclude %{MODELPATH}/snmp-ups +%exclude %{MODELPATH}/netxml-ups +%attr(700,%{USER},%{GROUP}) %{STATEPATH} +%{systemdsystemunitdir}/* +%dir %{_libdir}/systemd/ +%dir %{_libdir}/systemd/system-shutdown/ +%{_libdir}/systemd/system-shutdown/nutshutdown + +%files drivers-net +%defattr(-,root,root) +%{MODELPATH}/snmp-ups +%{MODELPATH}/netxml-ups +%{_mandir}/man8/netxml-ups*.* +%{_mandir}/man8/snmp-ups*.* + +%files -n libupsclient1 +%defattr(-,root,root) +%{_libdir}/*.so.* + +%files cgi +%defattr(-,root,root) +%{CGIPATH}/nut +%{HTMLPATH}/nut +%config(noreplace) %{CONFPATH}/upsstats-single.html +%config(noreplace) %{CONFPATH}/upsstats.html + +%files devel +%defattr(-,root,root) +%{_includedir}/*.h +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc +%{_mandir}/man3/*.* + +%changelog From b89e4e0ea64084f015e0b6a4ab694e4e02b79d7c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 00:37:49 +0200 Subject: [PATCH 002/207] Seems OBS mkpac.sh wants a file named "control" in any debian-pkg directory type (obs/ too) Signed-off-by: Jim Klimov --- obs/control | 1 + 1 file changed, 1 insertion(+) create mode 120000 obs/control diff --git a/obs/control b/obs/control new file mode 120000 index 0000000000..467d6decea --- /dev/null +++ b/obs/control @@ -0,0 +1 @@ +debian.control \ No newline at end of file From b977a05de0aaa6c7f414c0b2e83a5ee19b3b307e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 00:48:21 +0200 Subject: [PATCH 003/207] Update packaging files to install DMF data files Signed-off-by: Jim Klimov --- obs/debian.nut-snmp.install | 1 + obs/debian.rules | 2 +- obs/nut.spec | 61 +++++++++++++++++++++---------------- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/obs/debian.nut-snmp.install b/obs/debian.nut-snmp.install index 3c04aff520..767eb3bb8f 100644 --- a/obs/debian.nut-snmp.install +++ b/obs/debian.nut-snmp.install @@ -1,3 +1,4 @@ debian/tmp/lib/nut/snmp-ups debian/tmp/lib/nut/snmp-ups-dmf usr/share/nut/dmfsnmp +usr/share/nut/dmfnutscan diff --git a/obs/debian.rules b/obs/debian.rules index b203467949..945921b7c0 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -26,7 +26,7 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-ssl --with-openssl --with-libltdl=yes \ --with-cgi=auto --with-powerman=auto \ --with-serial --with-usb --with-snmp --with-neon --with-ipmi \ - --with-dmf=yes \ + --with-snmp_dmf_lua=yes \ --with-dev \ --disable-static \ --with-statepath=/var/run/nut \ diff --git a/obs/nut.spec b/obs/nut.spec index 32e3d78ba6..495ab4fe3c 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -47,32 +47,32 @@ Url: http://www.networkupstools.org/ # git clone https://github.com/vyskocilm/nut daisychain+DMF # git archive --prefix nut-2.7.4/ -o ~/work/BIOS/ROZ-OBS/Pool\:master/nut/nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz HEAD Source: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz -Patch2: 0002-nut-monitor-paths.patch -Patch3: 0003-install-dev-files-in-usr.patch -Patch4: 0004-fix-systemd-service.patch -Patch6: 0006-ups-conf-maxretry.patch -Patch8: 0008-drop-w3c-icons.patch -Patch11: 0011-libnutscanner-scan-one-ip-xml-http.patch -Patch14: 0014-upsrdvctl-nowait.patch -Patch15: 0015-Use-target-for-drivers-in-systemd.patch -Patch16: 0021-xml_scan_3tries.patch -# already upstream -#Patch17: 0024-snmp-ups-Eaton-3ph-UPS-improvements.patch -#Patch18: 0025-Fix-nut-scanner-compilation-in-some-environments.patch -#Patch19: 0026-snmp-ups-support-Raritan-Dominion-PX2-PDU.patch -Patch20: 0027-snmp-ups-support-APC-PDU.patch -# can't be merged, upstream change -#Patch21: 0028-nut-scanner-additional-search-path.patch -# can't be merged, upstream change -#Patch29: 0029-netvision-mib-uses-0-as-dfl.patch -# daisy chain is upstream -# Patch30: 0030-daisychain.patch -# Patch31: 0031-daisychain-complement.patch -# Patch32: 0032-snmp-ups-fix-some-regression-due-to-daisychain.patch -# Patch33: 0033-snmp-ups-fix-memory-leaks.patch -Patch34: 0034-fix_xmlv4_segfault.patch -#Patch35: 0035-daisychain+DMF.patch -#Patch36: 0036-post-carlos-dmf-fixes.patch +#Patch2: 0002-nut-monitor-paths.patch +#Patch3: 0003-install-dev-files-in-usr.patch +#Patch4: 0004-fix-systemd-service.patch +#Patch6: 0006-ups-conf-maxretry.patch +#Patch8: 0008-drop-w3c-icons.patch +#Patch11: 0011-libnutscanner-scan-one-ip-xml-http.patch +#Patch14: 0014-upsrdvctl-nowait.patch +#Patch15: 0015-Use-target-for-drivers-in-systemd.patch +#Patch16: 0021-xml_scan_3tries.patch +### already upstream +###Patch17: 0024-snmp-ups-Eaton-3ph-UPS-improvements.patch +###Patch18: 0025-Fix-nut-scanner-compilation-in-some-environments.patch +###Patch19: 0026-snmp-ups-support-Raritan-Dominion-PX2-PDU.patch +#Patch20: 0027-snmp-ups-support-APC-PDU.patch +### can't be merged, upstream change +###Patch21: 0028-nut-scanner-additional-search-path.patch +### can't be merged, upstream change +###Patch29: 0029-netvision-mib-uses-0-as-dfl.patch +### daisy chain is upstream +### Patch30: 0030-daisychain.patch +### Patch31: 0031-daisychain-complement.patch +### Patch32: 0032-snmp-ups-fix-some-regression-due-to-daisychain.patch +### Patch33: 0033-snmp-ups-fix-memory-leaks.patch +#Patch34: 0034-fix_xmlv4_segfault.patch +###Patch35: 0035-daisychain+DMF.patch +###Patch36: 0036-post-carlos-dmf-fixes.patch Requires: %{_bindir}/fgrep Requires: %{_bindir}/grep @@ -243,6 +243,7 @@ autoreconf -f -i --with-usb\ --with-snmp\ --with-neon\ + --with-snmp_dmf_lua\ --with-dev\ --with-ipmi \ --with-powerman=auto\ @@ -324,6 +325,8 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{_sysconfdir}/logrotate.d/* %{_bindir}/* %{_datadir}/nut +%exclude %{_datadir}/nut/dmfnutscan +%exclude %{_datadir}/nut/dmfsnmp %{_mandir}/man5/*.* %{_mandir}/man8/*.* %exclude %{_mandir}/man8/netxml-ups*.* @@ -358,6 +361,12 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{MODELPATH}/netxml-ups %{_mandir}/man8/netxml-ups*.* %{_mandir}/man8/snmp-ups*.* +%dir %{_datadir}/nut/dmfnutscan +%dir %{_datadir}/nut/dmfsnmp +%{_datadir}/nut/dmfnutscan/*.dmf +%{_datadir}/nut/dmfsnmp/*.dmf +%{_datadir}/nut/dmfnutscan/*.xsd +%{_datadir}/nut/dmfsnmp/*.xsd %files -n libupsclient1 %defattr(-,root,root) From a5bc5b5de5119bd16613e5f1f8913a6652e0e07c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:03:24 +0200 Subject: [PATCH 004/207] Update OBS packaging to deliver bin/nut-scanner-reindex-dmfsnmp Signed-off-by: Jim Klimov --- obs/debian.nut-snmp.install | 1 + obs/nut.spec | 2 ++ 2 files changed, 3 insertions(+) diff --git a/obs/debian.nut-snmp.install b/obs/debian.nut-snmp.install index 767eb3bb8f..60d066444d 100644 --- a/obs/debian.nut-snmp.install +++ b/obs/debian.nut-snmp.install @@ -1,4 +1,5 @@ debian/tmp/lib/nut/snmp-ups debian/tmp/lib/nut/snmp-ups-dmf +debian/tmp/bin/nut-scanner-reindex-dmfsnmp usr/share/nut/dmfsnmp usr/share/nut/dmfnutscan diff --git a/obs/nut.spec b/obs/nut.spec index 495ab4fe3c..2fdfb80d46 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -324,6 +324,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{_sysconfdir}/bash_completion.d/* %{_sysconfdir}/logrotate.d/* %{_bindir}/* +%exclude %{bindir}/nut-scanner-reindex-dmfsnmp %{_datadir}/nut %exclude %{_datadir}/nut/dmfnutscan %exclude %{_datadir}/nut/dmfsnmp @@ -359,6 +360,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %defattr(-,root,root) %{MODELPATH}/snmp-ups %{MODELPATH}/netxml-ups +%{bindir}/nut-scanner-reindex-dmfsnmp %{_mandir}/man8/netxml-ups*.* %{_mandir}/man8/snmp-ups*.* %dir %{_datadir}/nut/dmfnutscan From 660ab27b7823da976daeac379fe1142567f8992f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:10:22 +0200 Subject: [PATCH 005/207] OBS nut.dsc : comment away DEBTRANSFORM of teh tarball Signed-off-by: Jim Klimov --- obs/nut.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.dsc b/obs/nut.dsc index bdb3391923..5869cbb257 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -31,4 +31,4 @@ Package-List: nut-snmp deb admin optional arch=any nut-xml deb admin optional arch=any python-nut deb python optional arch=all -DEBTRANSFORM-TAR: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz +# DEBTRANSFORM-TAR: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz From be2c7693ef644c388ba7a1ecf5baac022be9118a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:17:14 +0200 Subject: [PATCH 006/207] OBS nut.spec : use common tarball filename pattern Signed-off-by: Jim Klimov --- obs/nut.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 2fdfb80d46..95f19939f3 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -37,7 +37,7 @@ Name: nut Version: 2.7.4 -Release: 4 +Release: 11 Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring) License: GPL-2.0+ Group: Hardware/UPS @@ -46,7 +46,8 @@ Url: http://www.networkupstools.org/ # git clone https://github.com/vyskocilm/nut daisychain+DMF # git archive --prefix nut-2.7.4/ -o ~/work/BIOS/ROZ-OBS/Pool\:master/nut/nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz HEAD -Source: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz +Source0: %{name}-%{version}.tar.gz +#Source: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz #Patch2: 0002-nut-monitor-paths.patch #Patch3: 0003-install-dev-files-in-usr.patch #Patch4: 0004-fix-systemd-service.patch From 16e4e7229370bdeff5dd0c03c077125f76e388f4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:29:27 +0200 Subject: [PATCH 007/207] OBS : try to call autogen.sh before configuring sources Signed-off-by: Jim Klimov --- obs/debian.rules | 1 + obs/nut.spec | 46 +++++++++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 945921b7c0..4bb1d5034f 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -51,6 +51,7 @@ endif pre-build:: debian/compat (cd tools; python nut-snmpinfo.py) + sh autogen.sh common-install-arch:: # install the bash completion script diff --git a/obs/nut.spec b/obs/nut.spec index 95f19939f3..9f87e264df 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -209,31 +209,31 @@ Detailed information about supported hardware can be found in %prep %setup -q -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch6 -p1 -%patch8 -p1 -%patch11 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 -# % patch17 -p1 -# % patch18 -p1 -# % patch19 -p1 -%patch20 -p1 -# % patch21 -p1 -# % patch29 -p1 -# % patch30 -p1 -# % patch31 -p1 -# % patch32 -p1 -# % patch33 -p1 -%patch34 -p1 -# % patch35 -p1 -# % patch36 -p1 +#%patch2 -p1 +#%patch3 -p1 +#%patch4 -p1 +#%patch6 -p1 +#%patch8 -p1 +#%patch11 -p1 +#%patch14 -p1 +#%patch15 -p1 +#%patch16 -p1 +### % patch17 -p1 +### % patch18 -p1 +### % patch19 -p1 +#%patch20 -p1 +### % patch21 -p1 +### % patch29 -p1 +### % patch30 -p1 +### % patch31 -p1 +### % patch32 -p1 +### % patch33 -p1 +#%patch34 -p1 +### % patch35 -p1 +### % patch36 -p1 %build -autoreconf -f -i +sh autogen.sh %configure --disable-static --with-pic --libexecdir=%{_prefix}/lib\ --sysconfdir=%{CONFPATH}\ --datadir=%{_datadir}/nut\ From 65463e48a47ed7708d8218212a9d56eb02ecbabf Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:38:37 +0200 Subject: [PATCH 008/207] nut.spec : make asciidoc a common dependency Signed-off-by: Jim Klimov --- obs/nut.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 9f87e264df..92e11a1f62 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -108,10 +108,11 @@ BuildRequires: systemd-rpm-macros BuildRequires: powerman-devel BuildRequires: tcpd-devel # TODO: For doc build: move out of opensuse -BuildRequires: asciidoc +###BuildRequires: asciidoc BuildRequires: dblatex BuildRequires: libxslt-tools %endif +BuildRequires: asciidoc %if 0%{?centos_version} BuildRequires: cppunit-devel From 2b136c5277bdae34113a510b35fb42b8d13f31b8 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:40:14 +0200 Subject: [PATCH 009/207] OBS nut.spec : fix LUA requirement at == 5.1 (not >= 5.1) Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 92e11a1f62..d80e509a5f 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -96,7 +96,7 @@ BuildRequires: libusb-devel BuildRequires: net-snmp-devel BuildRequires: pkg-config BuildRequires: python -BuildRequires: lua-devel >= 5.1 +BuildRequires: lua-devel == 5.1 %if 0%{?suse_version} BuildRequires: apache2-devel From 2531f49b64f9706bba425c3c31a7da2d32836581 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:43:48 +0200 Subject: [PATCH 010/207] OBS nut.spec : make manpages optional Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index d80e509a5f..b1a51d3125 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -249,7 +249,7 @@ sh autogen.sh --with-dev\ --with-ipmi \ --with-powerman=auto\ - --with-doc=man\ + --with-doc=man=auto\ --with-htmlpath=%{HTMLPATH}\ --with-cgipath=%{CGIPATH}\ --with-statepath=%{STATEPATH}\ From e5390d35c399b1b22272671568fd215cf5e18560 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 01:47:49 +0200 Subject: [PATCH 011/207] Build Requires python-pycparser Signed-off-by: Jim Klimov --- obs/nut.dsc | 2 +- obs/nut.spec | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/nut.dsc b/obs/nut.dsc index 5869cbb257..59f7fc63b1 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1 +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, python-pycparser Build-Depends-Indep: asciidoc (>= 8.6.3), docbook-xsl, dblatex (>= 0.2.5), libxml2-utils Package-List: libnutclient-dev deb libdevel optional arch=any diff --git a/obs/nut.spec b/obs/nut.spec index b1a51d3125..26c5d3af72 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -96,6 +96,8 @@ BuildRequires: libusb-devel BuildRequires: net-snmp-devel BuildRequires: pkg-config BuildRequires: python +# TODO: Make sure how this is named +BuildRequires: python-pycparser BuildRequires: lua-devel == 5.1 %if 0%{?suse_version} From b059871b4ec672ead626a89576a1526c7521f2e6 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 19 Aug 2016 14:48:43 +0200 Subject: [PATCH 012/207] OBS: Try to rectify package numbering and dependencies of sub-packages for Debian Signed-off-by: Jim Klimov --- obs/debian.control | 14 +++++++------- obs/nut.dsc | 2 +- obs/nut.spec | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index 5454404e5c..6b5e6df58e 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -34,7 +34,7 @@ XS-Testsuite: autopkgtest Package: nut Architecture: all Section: metapackages -Depends: ${misc:Depends}, nut-server, nut-client +Depends: ${misc:Depends}, nut-server (= ${binary:Version}), nut-client (= ${binary:Version}) Description: network UPS tools - metapackage Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and @@ -50,7 +50,7 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-client (= ${binary:Version}) Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml Conflicts: nut-hal-drivers -Replaces: nut (<< 2.6.1-2~) +Replaces: nut (<< 2.7.4-11~) Breaks: nut (<< 2.6.1-2~) Description: network UPS tools - core system Network UPS Tools (NUT) is a client/server monitoring system that @@ -69,7 +69,7 @@ Provides: ups-monitor Conflicts: ups-monitor Recommends: bash-completion Suggests: nut-monitor -Replaces: ups-monitor, nut (<< 2.6.1-2~), nut-server (<< 2.6.3-1~) +Replaces: ups-monitor, nut (<< 2.7.4-11~), nut-server (<< 2.7.4-11~) Breaks: nut (<< 2.6.1-2~), nut-server (<< 2.6.3-1~) Description: network UPS tools - clients Network UPS Tools (NUT) is a client/server monitoring system that @@ -98,7 +98,7 @@ Description: network UPS tools - web interface Package: nut-snmp Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}) Description: network UPS tools - SNMP driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and @@ -112,7 +112,7 @@ Description: network UPS tools - SNMP driver Package: nut-ipmi Architecture: linux-any kfreebsd-any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}) Description: network UPS tools - IPMI driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and @@ -127,7 +127,7 @@ Description: network UPS tools - IPMI driver Package: nut-xml Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.2.2) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}) Description: network UPS tools - XML/HTTP driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and @@ -142,7 +142,7 @@ Description: network UPS tools - XML/HTTP driver Package: nut-powerman-pdu Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.4.0), powerman (>= 2.3.3) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}), powerman (>= 2.3.3) Description: network UPS tools - PowerMan PDU driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and diff --git a/obs/nut.dsc b/obs/nut.dsc index 59f7fc63b1..a014bdc05f 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -2,7 +2,7 @@ Format: 1.0 Source: nut Binary: nut, nut-server, nut-client, nut-cgi, nut-snmp, nut-ipmi, nut-xml, nut-powerman-pdu, nut-doc, libupsclient4, libupsclient-dev, libnutclient0, libnutclient-dev, python-nut, nut-monitor, libups-nut-perl Architecture: any all -Version: 2.7.4-11 +Version: 2.7.4-12 Maintainer: Arnaud Quette Uploaders: Laurent Bigonville Homepage: http://www.networkupstools.org/ diff --git a/obs/nut.spec b/obs/nut.spec index 26c5d3af72..e05254be1c 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -37,7 +37,7 @@ Name: nut Version: 2.7.4 -Release: 11 +Release: 12 Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring) License: GPL-2.0+ Group: Hardware/UPS From 34391922c267b7ee30974ff3512f751062ed9af0 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 14 Sep 2016 04:58:10 +0200 Subject: [PATCH 013/207] RPM/DEB : deliver the sorted symlinks in packages Signed-off-by: Jim Klimov --- obs/debian.nut-snmp.install | 2 ++ obs/nut.spec | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/obs/debian.nut-snmp.install b/obs/debian.nut-snmp.install index 60d066444d..eaacebada2 100644 --- a/obs/debian.nut-snmp.install +++ b/obs/debian.nut-snmp.install @@ -3,3 +3,5 @@ debian/tmp/lib/nut/snmp-ups-dmf debian/tmp/bin/nut-scanner-reindex-dmfsnmp usr/share/nut/dmfsnmp usr/share/nut/dmfnutscan +usr/share/nut/dmfsnmp.d +usr/share/nut/dmfnutscan.d diff --git a/obs/nut.spec b/obs/nut.spec index e05254be1c..b7ecce0c25 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -332,6 +332,8 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{_datadir}/nut %exclude %{_datadir}/nut/dmfnutscan %exclude %{_datadir}/nut/dmfsnmp +%exclude %{_datadir}/nut/dmfnutscan.d +%exclude %{_datadir}/nut/dmfsnmp.d %{_mandir}/man5/*.* %{_mandir}/man8/*.* %exclude %{_mandir}/man8/netxml-ups*.* @@ -373,6 +375,10 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{_datadir}/nut/dmfsnmp/*.dmf %{_datadir}/nut/dmfnutscan/*.xsd %{_datadir}/nut/dmfsnmp/*.xsd +%dir %{_datadir}/nut/dmfnutscan.d +%dir %{_datadir}/nut/dmfsnmp.d +%{_datadir}/nut/dmfnutscan.d/*.dmf +%{_datadir}/nut/dmfsnmp.d/*.dmf %files -n libupsclient1 %defattr(-,root,root) From 7615bd3806391cd7d3135d4b261d12865fc61e6f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 14 Sep 2016 10:57:06 +0200 Subject: [PATCH 014/207] nut.spec : fix mixed spaces vs tabs Signed-off-by: Jim Klimov --- obs/nut.spec | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index b7ecce0c25..abe9c78dba 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -240,18 +240,18 @@ sh autogen.sh %configure --disable-static --with-pic --libexecdir=%{_prefix}/lib\ --sysconfdir=%{CONFPATH}\ --datadir=%{_datadir}/nut\ - --with-ssl --with-openssl\ - --with-libltdl=yes\ + --with-ssl --with-openssl\ + --with-libltdl=yes\ --with-cgi=auto\ - --with-serial\ - --with-usb\ - --with-snmp\ - --with-neon\ - --with-snmp_dmf_lua\ + --with-serial\ + --with-usb\ + --with-snmp\ + --with-neon\ + --with-snmp_dmf_lua\ --with-dev\ - --with-ipmi \ + --with-ipmi \ --with-powerman=auto\ - --with-doc=man=auto\ + --with-doc=man=auto\ --with-htmlpath=%{HTMLPATH}\ --with-cgipath=%{CGIPATH}\ --with-statepath=%{STATEPATH}\ @@ -259,7 +259,7 @@ sh autogen.sh --with-user=%{USER}\ --with-group=%{GROUP} \ --with-udev-dir=%{_sysconfdir}/udev \ - --enable-option-checking=fatal + --enable-option-checking=fatal (cd tools; python nut-snmpinfo.py) From 3eb5042e7ac5d8236c936facd424490b8ec04522 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 14 Sep 2016 10:58:51 +0200 Subject: [PATCH 015/207] debian.nut-snmp.install debian.libnutscan1.install : fix conflict for dmfnutscan resource dirs delivered by both packages Signed-off-by: Jim Klimov --- obs/debian.libnutscan1.install | 4 +++- obs/debian.nut-snmp.install | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/obs/debian.libnutscan1.install b/obs/debian.libnutscan1.install index 55d88d748b..ce7992a799 100644 --- a/obs/debian.libnutscan1.install +++ b/obs/debian.libnutscan1.install @@ -1,2 +1,4 @@ lib/*/libnutscan.so.* -usr/share/nut/dmfnutscan/* +debian/tmp/bin/nut-scanner-reindex-dmfsnmp +usr/share/nut/dmfnutscan +usr/share/nut/dmfnutscan.d diff --git a/obs/debian.nut-snmp.install b/obs/debian.nut-snmp.install index eaacebada2..cf590d9caa 100644 --- a/obs/debian.nut-snmp.install +++ b/obs/debian.nut-snmp.install @@ -1,7 +1,4 @@ debian/tmp/lib/nut/snmp-ups debian/tmp/lib/nut/snmp-ups-dmf -debian/tmp/bin/nut-scanner-reindex-dmfsnmp usr/share/nut/dmfsnmp -usr/share/nut/dmfnutscan usr/share/nut/dmfsnmp.d -usr/share/nut/dmfnutscan.d From e513b1ca7ce2657d66493922952a6ce785b34167 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 22 Sep 2016 13:56:27 +0200 Subject: [PATCH 016/207] nut.spec : try to fix inability to detect LUA on some RPM buildhosts Signed-off-by: Jim Klimov --- obs/nut.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index abe9c78dba..14e7f339b1 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -96,9 +96,10 @@ BuildRequires: libusb-devel BuildRequires: net-snmp-devel BuildRequires: pkg-config BuildRequires: python -# TODO: Make sure how this is named +# LUA 5.1 or 5.2 is known ok for us, both are modern in current distros (201609xx) +BuildRequires: lua-devel +# TODO: Make sure how this is named to use in CentOS/RHEL (may be not in core but EPEL repos) BuildRequires: python-pycparser -BuildRequires: lua-devel == 5.1 %if 0%{?suse_version} BuildRequires: apache2-devel From 6cc80e5c8fc524a8d88598e25fd55b967f248cac Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 22 Sep 2016 14:04:48 +0200 Subject: [PATCH 017/207] nut.dsc / nut.spec : do not request rebuild and revalidation of DMF files - they were tested in Jenkins NUT-master job (remove build dependency on pycparser and speed up the build) Signed-off-by: Jim Klimov --- obs/debian.rules | 1 + obs/nut.dsc | 7 ++++++- obs/nut.spec | 9 +++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 4bb1d5034f..8934c08ebb 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -27,6 +27,7 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-cgi=auto --with-powerman=auto \ --with-serial --with-usb --with-snmp --with-neon --with-ipmi \ --with-snmp_dmf_lua=yes \ + --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no \ --with-dev \ --disable-static \ --with-statepath=/var/run/nut \ diff --git a/obs/nut.dsc b/obs/nut.dsc index a014bdc05f..9509b2c12b 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,12 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, python-pycparser +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1 +#+++ python-pycparser +# The pycparser is required to rebuild DMF files, but those pre-built +# copies in the git repo/tarball "should" be in sync with original +# C files, so we don't require regeneration for packaging. Also the +# Jenkins NUT-master job should have verified this. Build-Depends-Indep: asciidoc (>= 8.6.3), docbook-xsl, dblatex (>= 0.2.5), libxml2-utils Package-List: libnutclient-dev deb libdevel optional arch=any diff --git a/obs/nut.spec b/obs/nut.spec index 14e7f339b1..f3da4b82bc 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -99,7 +99,11 @@ BuildRequires: python # LUA 5.1 or 5.2 is known ok for us, both are modern in current distros (201609xx) BuildRequires: lua-devel # TODO: Make sure how this is named to use in CentOS/RHEL (may be not in core but EPEL repos) -BuildRequires: python-pycparser +# The pycparser is required to rebuild DMF files, but those pre-built +# copies in the git repo/tarball "should" be in sync with original +# C files, so we don't require regeneration for packaging. Also the +# Jenkins NUT-master job should have verified this. +#BuildRequires: python-pycparser %if 0%{?suse_version} BuildRequires: apache2-devel @@ -260,7 +264,8 @@ sh autogen.sh --with-user=%{USER}\ --with-group=%{GROUP} \ --with-udev-dir=%{_sysconfdir}/udev \ - --enable-option-checking=fatal + --enable-option-checking=fatal\ + --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no (cd tools; python nut-snmpinfo.py) From be08124994122b197b1aff157d03d95eae5a1bc7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 22 Sep 2016 14:05:17 +0200 Subject: [PATCH 018/207] debian.rules : whitespace fixes Signed-off-by: Jim Klimov --- obs/debian.rules | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 8934c08ebb..8542a11d00 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -23,22 +23,22 @@ DEB_CONFIGURE_SYSCONFDIR := /etc/nut DEB_CONFIGURE_INCLUDEDIR := /usr/include DEB_CONFIGURE_MANDIR := /usr/share/man DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ - --with-ssl --with-openssl --with-libltdl=yes \ - --with-cgi=auto --with-powerman=auto \ - --with-serial --with-usb --with-snmp --with-neon --with-ipmi \ - --with-snmp_dmf_lua=yes \ + --with-ssl --with-openssl --with-libltdl=yes \ + --with-cgi=auto --with-powerman=auto \ + --with-serial --with-usb --with-snmp --with-neon --with-ipmi \ + --with-snmp_dmf_lua=yes \ --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no \ - --with-dev \ - --disable-static \ - --with-statepath=/var/run/nut \ - --with-altpidpath=/var/run/nut \ - --with-drvpath=/lib/nut \ - --with-cgipath=/usr/lib/cgi-bin/nut \ - --with-htmlpath=/usr/share/nut/www \ - --with-pidpath=/var/run/nut \ - --datadir=/usr/share/nut \ - --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ - --with-user=nut --with-group=nut + --with-dev \ + --disable-static \ + --with-statepath=/var/run/nut \ + --with-altpidpath=/var/run/nut \ + --with-drvpath=/lib/nut \ + --with-cgipath=/usr/lib/cgi-bin/nut \ + --with-htmlpath=/usr/share/nut/www \ + --with-pidpath=/var/run/nut \ + --datadir=/usr/share/nut \ + --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ + --with-user=nut --with-group=nut ifeq (linux,$(DEB_HOST_ARCH_OS)) DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev --with-systemdsystemunitdir=/lib/systemd/system From 057356e729c51cf246cc8b5499c7e2e186744aea Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 22 Sep 2016 14:07:42 +0200 Subject: [PATCH 019/207] debian.rules : skip even the manpages if the host cannot build them Signed-off-by: Jim Klimov --- obs/debian.rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/obs/debian.rules b/obs/debian.rules index 8542a11d00..941ab67db4 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -48,6 +48,8 @@ endif ifneq ($(shell which asciidoc),) # DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=html-chunked,pdf DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man +else + DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=skip endif pre-build:: debian/compat From e6198652d37f3f009639747fa89378d960b7839d Mon Sep 17 00:00:00 2001 From: Arnaud Quette Date: Thu, 6 Oct 2016 14:52:29 +0200 Subject: [PATCH 020/207] Distribute gen-snmp-subdriver.sh with nut-snmp Signed-off-by: Jim Klimov --- obs/debian.nut-snmp.install | 1 + obs/debian.rules | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/obs/debian.nut-snmp.install b/obs/debian.nut-snmp.install index cf590d9caa..5195c9c507 100644 --- a/obs/debian.nut-snmp.install +++ b/obs/debian.nut-snmp.install @@ -1,4 +1,5 @@ debian/tmp/lib/nut/snmp-ups debian/tmp/lib/nut/snmp-ups-dmf +debian/tmp/usr/sbin/gen-snmp-subdriver.sh usr/share/nut/dmfsnmp usr/share/nut/dmfsnmp.d diff --git a/obs/debian.rules b/obs/debian.rules index 941ab67db4..fa4560e139 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -110,6 +110,10 @@ common-install-arch:: install -m 644 -D $(CURDIR)/debian/nut-server.tmpfiles \ $(CURDIR)/debian/nut-server/usr/lib/tmpfiles.d/nut-server.conf + # Install gen-snmp-subdriver.sh for nut-snmp + install -m 755 -D $(CURDIR)/scripts/subdriver/gen-snmp-subdriver.sh \ + $(CURDIR)/debian/tmp/usr/sbin/gen-snmp-subdriver.sh + extradocs-install: #install documentation mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf From df8b117dce490ca05fc64b6a3424b5abe8df1131 Mon Sep 17 00:00:00 2001 From: Arnaud Quette Date: Thu, 6 Oct 2016 15:40:38 +0200 Subject: [PATCH 021/207] Distribute gen-snmp-subdriver.sh with nut-snmp for RPM Signed-off-by: Jim Klimov --- obs/nut.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index f3da4b82bc..84200c8bc5 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -293,6 +293,7 @@ mv %{buildroot}%{CGIPATH}/*.cgi %{buildroot}%{CGIPATH}/nut find %{buildroot} -type f -name "*.la" -delete -print mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/ +install -m0755 scripts/subdriver/gen-snmp-subdriver.sh %{buildroot}%{_sbindir}/ %pre usr/sbin/useradd -r -g %{GROUP} -s /bin/false \ @@ -385,6 +386,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %dir %{_datadir}/nut/dmfsnmp.d %{_datadir}/nut/dmfnutscan.d/*.dmf %{_datadir}/nut/dmfsnmp.d/*.dmf +%{_sbindir}/gen-snmp-subdriver.sh %files -n libupsclient1 %defattr(-,root,root) From 4625c376cf92e30967d824cd8bce4916e64d8e1d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 12 Apr 2017 16:01:03 +0200 Subject: [PATCH 022/207] Drop remaining references to oldmge-shut Signed-off-by: Jim Klimov --- obs/debian.nut-server.install | 1 - 1 file changed, 1 deletion(-) diff --git a/obs/debian.nut-server.install b/obs/debian.nut-server.install index 4c0f50e069..55d150f8a2 100644 --- a/obs/debian.nut-server.install +++ b/obs/debian.nut-server.install @@ -28,7 +28,6 @@ debian/tmp/lib/nut/tripplite_usb debian/tmp/lib/nut/bcmxcp debian/tmp/lib/nut/bestuferrups debian/tmp/lib/nut/gamatronic -debian/tmp/lib/nut/oldmge-shut debian/tmp/lib/nut/safenet debian/tmp/lib/nut/isbmex debian/tmp/lib/nut/masterguard From 209b41ea1dbcd17a49e6fbd56cb21a14d27d0431 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 13 Oct 2017 18:59:55 +0200 Subject: [PATCH 023/207] debian.rules : enable parallelized packaging Signed-off-by: Jim Klimov --- obs/debian.rules | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/obs/debian.rules b/obs/debian.rules index fa4560e139..f40f2b1396 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -5,6 +5,9 @@ include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/class/python-module.mk include /usr/share/cdbs/1/rules/autoreconf.mk + +export DH_OPTIONS + # We cannot call autoreconf -f -i as it updates INSTALL which is used for doc # generation DEB_DH_AUTORECONF_ARGS = --as-needed @@ -146,3 +149,6 @@ ifeq (linux,$(DEB_HOST_ARCH_OS)) # for Ubuntu # DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 136-1)" endif + +all check dist distcheck install: + dh $@ --parallel From 2c3a54668aa853eff4d318bdca62128df3657dda Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 19 Oct 2017 00:53:15 +0200 Subject: [PATCH 024/207] Use DH_COMPAT=10 to enable parallel build support by default Signed-off-by: Jim Klimov --- obs/debian.compat | 2 +- obs/debian.rules | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/obs/debian.compat b/obs/debian.compat index 45a4fb75db..f599e28b8a 100644 --- a/obs/debian.compat +++ b/obs/debian.compat @@ -1 +1 @@ -8 +10 diff --git a/obs/debian.rules b/obs/debian.rules index f40f2b1396..e77d01ae98 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -8,6 +8,10 @@ include /usr/share/cdbs/1/rules/autoreconf.mk export DH_OPTIONS +# This is the debhelper compatibility version to use. +# JIM: 10+ enables parallel builds by default +export DH_COMPAT=10 + # We cannot call autoreconf -f -i as it updates INSTALL which is used for doc # generation DEB_DH_AUTORECONF_ARGS = --as-needed From 5c2eb90e3c0b23c6d39fb2c426439cff07a41135 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sun, 31 Dec 2017 15:59:28 +0100 Subject: [PATCH 025/207] packaging : use --with-docs=man=dist-auto Signed-off-by: Jim Klimov --- obs/debian.rules | 12 +++++++----- obs/nut.spec | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index e77d01ae98..66f89dd5cf 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -52,12 +52,14 @@ ifeq (linux,$(DEB_HOST_ARCH_OS)) endif # only build documentation if asciidoc is installed -ifneq ($(shell which asciidoc),) +#ifneq ($(shell which asciidoc),) # DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=html-chunked,pdf - DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man -else - DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=skip -endif +#else +# DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=skip +#endif + +# Try to use dist'ed docs if available, fall back to auto in other cases +DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man=dist-auto pre-build:: debian/compat (cd tools; python nut-snmpinfo.py) diff --git a/obs/nut.spec b/obs/nut.spec index 84200c8bc5..2f98df0ff9 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -256,7 +256,7 @@ sh autogen.sh --with-dev\ --with-ipmi \ --with-powerman=auto\ - --with-doc=man=auto\ + --with-doc=man=dist-auto\ --with-htmlpath=%{HTMLPATH}\ --with-cgipath=%{CGIPATH}\ --with-statepath=%{STATEPATH}\ From d23f8f888724e07d9bdeb16e821b505bdd979132 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sun, 31 Dec 2017 18:58:34 +0100 Subject: [PATCH 026/207] debian.rules : avoid re-configuring before "make install" again Signed-off-by: Jim Klimov --- obs/debian.rules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index 66f89dd5cf..0c4787f310 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -61,10 +61,12 @@ endif # Try to use dist'ed docs if available, fall back to auto in other cases DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man=dist-auto -pre-build:: debian/compat +configure: configure.ac (cd tools; python nut-snmpinfo.py) sh autogen.sh +pre-build:: debian/compat configure + common-install-arch:: # install the bash completion script mkdir -p $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/ From b1ca53a5d1e98280ef663198866072b1a9492ead Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 2 Jan 2018 14:57:48 +0100 Subject: [PATCH 027/207] nut.spec : fix "bindir" macro to "_bindir" Signed-off-by: Jim Klimov --- obs/nut.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 2f98df0ff9..24cc7fd19c 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -2,7 +2,7 @@ # spec file for package nut.spec # # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. -# Copyright (c) 2016 Eaton EEIC. +# Copyright (c) 2016-2018 Eaton EEIC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -335,7 +335,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{_sysconfdir}/bash_completion.d/* %{_sysconfdir}/logrotate.d/* %{_bindir}/* -%exclude %{bindir}/nut-scanner-reindex-dmfsnmp +%exclude %{_bindir}/nut-scanner-reindex-dmfsnmp %{_datadir}/nut %exclude %{_datadir}/nut/dmfnutscan %exclude %{_datadir}/nut/dmfsnmp @@ -373,7 +373,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %defattr(-,root,root) %{MODELPATH}/snmp-ups %{MODELPATH}/netxml-ups -%{bindir}/nut-scanner-reindex-dmfsnmp +%{_bindir}/nut-scanner-reindex-dmfsnmp %{_mandir}/man8/netxml-ups*.* %{_mandir}/man8/snmp-ups*.* %dir %{_datadir}/nut/dmfnutscan From 475a5eab793f709559a601b3bc1b33313c266bc1 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 2 Jan 2018 15:16:27 +0100 Subject: [PATCH 028/207] nut.spec : use proper systemdshutdowndir relevant for current distro/arch Signed-off-by: Jim Klimov --- obs/nut.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 24cc7fd19c..69bf67ecd5 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -34,6 +34,7 @@ %define USBNONHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | fgrep -a -A1 _USB | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') %define systemdsystemunitdir %(pkg-config --variable=systemdsystemunitdir systemd) %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) +%define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) Name: nut Version: 2.7.4 @@ -365,9 +366,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %exclude %{MODELPATH}/netxml-ups %attr(700,%{USER},%{GROUP}) %{STATEPATH} %{systemdsystemunitdir}/* -%dir %{_libdir}/systemd/ -%dir %{_libdir}/systemd/system-shutdown/ -%{_libdir}/systemd/system-shutdown/nutshutdown +%{systemdshutdowndir}/nutshutdown %files drivers-net %defattr(-,root,root) From b62a626031b567ff04942cae502ecefb8acb3a2f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 2 Jan 2018 15:53:48 +0100 Subject: [PATCH 029/207] Packaging : pass the systemd*dir arguments to configure script Signed-off-by: Jim Klimov --- obs/debian.rules | 27 +++++++++++++++++---------- obs/nut.spec | 1 + 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 0c4787f310..118cb12036 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -17,6 +17,9 @@ export DH_COMPAT=10 DEB_DH_AUTORECONF_ARGS = --as-needed DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) +systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir systemd) +systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd) +systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd) # List any files which are not installed include /usr/share/cdbs/1/rules/utils.mk @@ -48,7 +51,11 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-user=nut --with-group=nut ifeq (linux,$(DEB_HOST_ARCH_OS)) - DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev --with-systemdsystemunitdir=/lib/systemd/system + DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev + DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir + DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdshutdowndir +### DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir=$(systemdsystemunitdir) +### DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir=/lib/systemd/system endif # only build documentation if asciidoc is installed @@ -103,17 +110,17 @@ common-install-arch:: $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so # Install systemd files only on systems where it's supported - install -m 644 -D $(CURDIR)/debian/tmp/lib/systemd/system/nut-monitor.service \ - $(CURDIR)/debian/nut-client/lib/systemd/system/nut-monitor.service - install -D $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/systemd/system-shutdown/nutshutdown \ - $(CURDIR)/debian/nut-server/lib/systemd/system-shutdown/nutshutdown - install -m 644 -D $(CURDIR)/debian/tmp/lib/systemd/system/nut-server.service \ - $(CURDIR)/debian/nut-server/lib/systemd/system/nut-server.service - install -m 644 -t $(CURDIR)/debian/nut-server/lib/systemd/system \ - $(CURDIR)/debian/tmp/lib/systemd/system/nut-driver* + install -m 644 -D $(CURDIR)/debian/tmp/$(systemdsystemunitdir)/nut-monitor.service \ + $(CURDIR)/debian/nut-client/$(systemdsystemunitdir)/nut-monitor.service + install -D $(CURDIR)/debian/tmp/$(systemdshutdowndir)/nutshutdown \ + $(CURDIR)/debian/nut-server/$(systemdshutdowndir)/nutshutdown + install -m 644 -D $(CURDIR)/debian/tmp/$(systemdsystemunitdir)/nut-server.service \ + $(CURDIR)/debian/nut-server/$(systemdsystemunitdir)/nut-server.service + install -m 644 -t $(CURDIR)/debian/nut-server/$(systemdsystemunitdir) \ + $(CURDIR)/debian/tmp/$(systemdsystemunitdir)/nut-driver* # Add a symlink to mask the LSB initscript - ln -s nut-monitor.service $(CURDIR)/debian/nut-client/lib/systemd/system/nut-client.service + ln -s nut-monitor.service $(CURDIR)/debian/nut-client/$(systemdsystemunitdir)/nut-client.service # Install tmpfiles config file to create /run/nut directory install -m 644 -D $(CURDIR)/debian/nut-client.tmpfiles \ diff --git a/obs/nut.spec b/obs/nut.spec index 69bf67ecd5..9138b6c1c9 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -266,6 +266,7 @@ sh autogen.sh --with-group=%{GROUP} \ --with-udev-dir=%{_sysconfdir}/udev \ --enable-option-checking=fatal\ + --with-systemdsystemunitdir --with-systemdshutdowndir \ --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no (cd tools; python nut-snmpinfo.py) From 74dfbc4f3d9fdcedf588624d9db6f015fc6e4bbd Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 2 Jan 2018 16:13:02 +0100 Subject: [PATCH 030/207] nut.spec : dist augeas files Signed-off-by: Jim Klimov --- obs/nut.spec | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 9138b6c1c9..73d4a8dc49 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -368,6 +368,19 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %attr(700,%{USER},%{GROUP}) %{STATEPATH} %{systemdsystemunitdir}/* %{systemdshutdowndir}/nutshutdown +%{_datadir}/augeas/lenses/dist/nuthostsconf.aug +%{_datadir}/augeas/lenses/dist/nutnutconf.aug +%{_datadir}/augeas/lenses/dist/nutupsconf.aug +%{_datadir}/augeas/lenses/dist/nutupsdconf.aug +%{_datadir}/augeas/lenses/dist/nutupsdusers.aug +%{_datadir}/augeas/lenses/dist/nutupsmonconf.aug +%{_datadir}/augeas/lenses/dist/nutupsschedconf.aug +%{_datadir}/augeas/lenses/dist/nutupssetconf.aug +%{_datadir}/augeas/lenses/dist/tests/test_nut.aug +%dir %{_datadir}/augeas +%dir %{_datadir}/augeas/lenses +%dir %{_datadir}/augeas/lenses/dist +%dir %{_datadir}/augeas/lenses/dist/tests %files drivers-net %defattr(-,root,root) From 59fa094112b9e1a2f2e9f52d934c09e1962f5a27 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 2 Jan 2018 16:16:30 +0100 Subject: [PATCH 031/207] nut.spec : suse wants a package Signed-off-by: Jim Klimov --- obs/nut.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 73d4a8dc49..d0fd1ab7ff 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -82,7 +82,9 @@ Requires: %{_bindir}/pgrep Requires: %{_bindir}/pkill Requires: %{_bindir}/readlink Requires: usbutils -#Requires(post): udev +%if 0%{?suse_version} +Requires(post): udev +%endif BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: avahi-devel From b3d939cd5b6ae902f788a7fd2413ed38ffa4856f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 2 Jan 2018 16:33:04 +0100 Subject: [PATCH 032/207] Debian packaging : require pkg-config, and provide some fallbacks if systemd dirs are unknown Signed-off-by: Jim Klimov --- obs/debian.control | 3 ++- obs/debian.rules | 14 ++++++++------ obs/nut.dsc | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index 6b5e6df58e..96103c9989 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -19,7 +19,8 @@ Build-Depends: debhelper (>= 8.1.3), libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, - lua5.1 + lua5.1, + pkg-config Build-Depends-Indep: asciidoc (>= 8.6.3), docbook-xsl, dblatex (>= 0.2.5), diff --git a/obs/debian.rules b/obs/debian.rules index 118cb12036..d881d29315 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -17,9 +17,11 @@ export DH_COMPAT=10 DEB_DH_AUTORECONF_ARGS = --as-needed DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) -systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir systemd) -systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd) -systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd) + +# echoed fallbacks are for Ubuntu primarily +systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir systemd || echo /lib/systemd/system) +systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd || echo /lib/systemd) +systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) # List any files which are not installed include /usr/share/cdbs/1/rules/utils.mk @@ -52,10 +54,10 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ ifeq (linux,$(DEB_HOST_ARCH_OS)) DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev - DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir - DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdshutdowndir -### DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir=$(systemdsystemunitdir) +### DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir ### DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir=/lib/systemd/system + DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir=$(systemdsystemunitdir) + DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdshutdowndir=$(systemdshutdowndir) endif # only build documentation if asciidoc is installed diff --git a/obs/nut.dsc b/obs/nut.dsc index 9509b2c12b..a8bf06c3e4 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1 +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From eb38be4e3ba451cb2f7d4603d47a4b97cacce45a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 3 Jan 2018 09:34:26 +0100 Subject: [PATCH 033/207] nut.spec : publish augeas files Signed-off-by: Jim Klimov --- obs/nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/obs/nut.spec b/obs/nut.spec index d0fd1ab7ff..1ec8b49225 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -269,6 +269,7 @@ sh autogen.sh --with-udev-dir=%{_sysconfdir}/udev \ --enable-option-checking=fatal\ --with-systemdsystemunitdir --with-systemdshutdowndir \ + --with-augeas-lenses-dir=/usr/share/augeas/lenses/dist \ --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no (cd tools; python nut-snmpinfo.py) From eb8b773da181b979f83bffc78732a268db63861e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 15 Jan 2018 21:58:37 +0100 Subject: [PATCH 034/207] nut.spec : avoid "nut" vs "nut-drivers-net" conflict over gen-snmp-subdriver.sh Signed-off-by: Jim Klimov --- obs/nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/obs/nut.spec b/obs/nut.spec index 1ec8b49225..60fe8f650a 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -368,6 +368,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{MODELPATH}/* %exclude %{MODELPATH}/snmp-ups %exclude %{MODELPATH}/netxml-ups +%exclude %{_sbindir}/gen-snmp-subdriver.sh %attr(700,%{USER},%{GROUP}) %{STATEPATH} %{systemdsystemunitdir}/* %{systemdshutdowndir}/nutshutdown From c6206ee17a954de495c990ee3a737fbda60f4224 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 3 Sep 2018 21:00:33 +0200 Subject: [PATCH 035/207] nut.spec : fix RPM packaging for OBS Signed-off-by: Jim Klimov --- obs/debian.nut-server.install | 2 ++ obs/nut.spec | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/obs/debian.nut-server.install b/obs/debian.nut-server.install index 55d150f8a2..d00e0bad2f 100644 --- a/obs/debian.nut-server.install +++ b/obs/debian.nut-server.install @@ -1,6 +1,7 @@ debian/tmp/bin/nut-scanner debian/tmp/sbin/upsd debian/tmp/sbin/upsdrvctl +debian/tmp/sbin/upsdrvsvcctl debian/tmp/usr/share/nut/cmdvartab debian/tmp/usr/share/nut/driver.list debian/tmp/*/udev/rules.d/[0-9][0-9]-*.rules @@ -8,6 +9,7 @@ debian/tmp/etc/avahi/services/nut.service debian/tmp/etc/nut/ups.conf debian/tmp/etc/nut/upsd.conf debian/tmp/etc/nut/upsd.users +debian/tmp/lib/nut/nut-driver-enumerator.sh debian/tmp/lib/nut/genericups debian/tmp/lib/nut/mge-shut debian/tmp/lib/nut/rhino diff --git a/obs/nut.spec b/obs/nut.spec index 60fe8f650a..5d9488f7e2 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -304,7 +304,7 @@ install -m0755 scripts/subdriver/gen-snmp-subdriver.sh %{buildroot}%{_sbindir}/ usr/sbin/useradd -r -g %{GROUP} -s /bin/false \ -c "UPS daemon" -d /sbin %{USER} 2>/dev/null || : %if %{defined opensuse_version} -%service_add_pre nut-driver.service nut-server.service nut-monitor.service +%service_add_pre nut-driver@.service nut-server.service nut-monitor.service nut-driver.target nut.target %endif %post @@ -316,17 +316,17 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use # And finally trigger udev to set permissions according to newly installed rules files. /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device %if %{defined opensuse_version} -%service_add_post nut-driver.service nut-server.service nut-monitor.service +%service_add_post nut-driver@.service nut-server.service nut-monitor.service nut-driver-enumerator.service nut-driver.target nut.target %endif %preun %if %{defined opensuse_version} -%service_del_preun nut-driver.service nut-server.service nut-monitor.service +%service_del_preun nut-driver@.service nut-server.service nut-monitor.service nut-driver-enumerator.service nut-driver.target nut.target %endif %postun %if %{defined opensuse_version} -%service_del_postun nut-driver.service nut-server.service nut-monitor.service +%service_del_postun nut-driver@.service nut-server.service nut-monitor.service nut-driver-enumerator.service nut-driver.target nut.target %endif %post -n libupsclient1 -p /sbin/ldconfig @@ -385,6 +385,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %dir %{_datadir}/augeas/lenses %dir %{_datadir}/augeas/lenses/dist %dir %{_datadir}/augeas/lenses/dist/tests +%{_libexecdir}/nut-driver-enumerator.sh %files drivers-net %defattr(-,root,root) From b9dcb8b9a0b72462a0786bab73dd48c3fe3ce334 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 5 Sep 2018 17:05:37 +0200 Subject: [PATCH 036/207] nut.spec : remove commented-away references to private OBS patches that are not used anymore Signed-off-by: Jim Klimov --- obs/nut.spec | 53 ---------------------------------------------------- 1 file changed, 53 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 5d9488f7e2..d97d18b604 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -43,38 +43,7 @@ Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring) License: GPL-2.0+ Group: Hardware/UPS Url: http://www.networkupstools.org/ -#Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz - -# git clone https://github.com/vyskocilm/nut daisychain+DMF -# git archive --prefix nut-2.7.4/ -o ~/work/BIOS/ROZ-OBS/Pool\:master/nut/nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz HEAD Source0: %{name}-%{version}.tar.gz -#Source: nut-2.7.4-DMF+daisychain-cb7c7ea8b0d.tar.gz -#Patch2: 0002-nut-monitor-paths.patch -#Patch3: 0003-install-dev-files-in-usr.patch -#Patch4: 0004-fix-systemd-service.patch -#Patch6: 0006-ups-conf-maxretry.patch -#Patch8: 0008-drop-w3c-icons.patch -#Patch11: 0011-libnutscanner-scan-one-ip-xml-http.patch -#Patch14: 0014-upsrdvctl-nowait.patch -#Patch15: 0015-Use-target-for-drivers-in-systemd.patch -#Patch16: 0021-xml_scan_3tries.patch -### already upstream -###Patch17: 0024-snmp-ups-Eaton-3ph-UPS-improvements.patch -###Patch18: 0025-Fix-nut-scanner-compilation-in-some-environments.patch -###Patch19: 0026-snmp-ups-support-Raritan-Dominion-PX2-PDU.patch -#Patch20: 0027-snmp-ups-support-APC-PDU.patch -### can't be merged, upstream change -###Patch21: 0028-nut-scanner-additional-search-path.patch -### can't be merged, upstream change -###Patch29: 0029-netvision-mib-uses-0-as-dfl.patch -### daisy chain is upstream -### Patch30: 0030-daisychain.patch -### Patch31: 0031-daisychain-complement.patch -### Patch32: 0032-snmp-ups-fix-some-regression-due-to-daisychain.patch -### Patch33: 0033-snmp-ups-fix-memory-leaks.patch -#Patch34: 0034-fix_xmlv4_segfault.patch -###Patch35: 0035-daisychain+DMF.patch -###Patch36: 0036-post-carlos-dmf-fixes.patch Requires: %{_bindir}/fgrep Requires: %{_bindir}/grep @@ -220,28 +189,6 @@ Detailed information about supported hardware can be found in %prep %setup -q -#%patch2 -p1 -#%patch3 -p1 -#%patch4 -p1 -#%patch6 -p1 -#%patch8 -p1 -#%patch11 -p1 -#%patch14 -p1 -#%patch15 -p1 -#%patch16 -p1 -### % patch17 -p1 -### % patch18 -p1 -### % patch19 -p1 -#%patch20 -p1 -### % patch21 -p1 -### % patch29 -p1 -### % patch30 -p1 -### % patch31 -p1 -### % patch32 -p1 -### % patch33 -p1 -#%patch34 -p1 -### % patch35 -p1 -### % patch36 -p1 %build sh autogen.sh From 3a23d4f0fcf48eabd9586fdaab063e4b93f1627f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 5 Sep 2018 17:11:22 +0200 Subject: [PATCH 037/207] nut.spec : whitespace Signed-off-by: Jim Klimov --- obs/nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index d97d18b604..e8feb017af 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -20,8 +20,8 @@ %define apache_serverroot %(%{_sbindir}/apxs2 -q datadir 2>/dev/null || %{_sbindir}/apxs -q PREFIX) %define CGIPATH %{apache_serverroot}/cgi-bin %define HTMLPATH %{apache_serverroot}/htdocs -%define MODELPATH %{_libexecdir}/ups/driver -%define STATEPATH %{_localstatedir}/lib/ups +%define MODELPATH %{_libexecdir}/ups/driver +%define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups %define USER upsd %define GROUP daemon From d27841a379bafbb2b716ef6353e456640f37cc44 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 5 Sep 2018 17:22:08 +0200 Subject: [PATCH 038/207] nut.spec : do not redefine (differently) paths set by %configure macro, try to set them directly Signed-off-by: Jim Klimov --- obs/nut.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index e8feb017af..86a7016997 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -23,6 +23,9 @@ %define MODELPATH %{_libexecdir}/ups/driver %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups +### Note: this is /etc/nut in Debian version +%define _sysconfdir /etc/ups +%define _datadir %{_datadir}/nut %define USER upsd %define GROUP daemon %define LBRACE ( @@ -192,9 +195,7 @@ Detailed information about supported hardware can be found in %build sh autogen.sh -%configure --disable-static --with-pic --libexecdir=%{_prefix}/lib\ - --sysconfdir=%{CONFPATH}\ - --datadir=%{_datadir}/nut\ +%configure --disable-static --with-pic \ --with-ssl --with-openssl\ --with-libltdl=yes\ --with-cgi=auto\ From 52f2e409a5edf1aff53efd0ba249e26301886a07 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 6 Sep 2018 22:18:56 +0200 Subject: [PATCH 039/207] nut.spec : do not use the configure macro Signed-off-by: Jim Klimov --- obs/nut.spec | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 86a7016997..6e9bd59fdb 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -24,8 +24,6 @@ %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups ### Note: this is /etc/nut in Debian version -%define _sysconfdir /etc/ups -%define _datadir %{_datadir}/nut %define USER upsd %define GROUP daemon %define LBRACE ( @@ -193,9 +191,19 @@ Detailed information about supported hardware can be found in %prep %setup -q +# Note: NOT configure macro, due to override of --sysconfdir and --datadir +# values just for the recipe part but not for whole specfile %build sh autogen.sh -%configure --disable-static --with-pic \ +./configure --disable-static --with-pic \ + --prefix=%{_prefix}\ + --execdir=%{_prefix}\ + --bindir=%{_bindir}\ + --sbindir=%{_sbindir}\ + --libdir=%{_libdir}\ + --libexecdir=%{_libexecdir}\ + --sysconfdir=%{CONFPATH}\ + --datadir=%{_datadir}/nut\ --with-ssl --with-openssl\ --with-libltdl=yes\ --with-cgi=auto\ From dfa1a6eab0f2b43692170e02fde347d4ab2c125d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 6 Sep 2018 22:30:41 +0200 Subject: [PATCH 040/207] nut.spec : do not use the configure macro Signed-off-by: Jim Klimov --- obs/nut.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 6e9bd59fdb..79b71ddc7e 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -197,7 +197,6 @@ Detailed information about supported hardware can be found in sh autogen.sh ./configure --disable-static --with-pic \ --prefix=%{_prefix}\ - --execdir=%{_prefix}\ --bindir=%{_bindir}\ --sbindir=%{_sbindir}\ --libdir=%{_libdir}\ From 0478c426c53b3651d2625e8b560fe24768494d53 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 09:32:44 +0200 Subject: [PATCH 041/207] Introduce (debian) nut-common package for user account and shared FS objects Signed-off-by: Jim Klimov --- obs/debian.control | 6 +- obs/debian.nut-cgi.postinst | 22 +----- obs/debian.nut-client.postinst | 36 ++-------- obs/debian.nut-common.install | 1 + obs/debian.nut-common.postinst | 72 +++++++++++++++++++ obs/debian.nut-common.prerm | 36 ++++++++++ ...nt.tmpfiles => debian.nut-common.tmpfiles} | 0 obs/debian.nut-server.postinst | 36 ++-------- obs/debian.nut-server.tmpfiles | 1 - obs/debian.rules | 10 ++- 10 files changed, 133 insertions(+), 87 deletions(-) create mode 100644 obs/debian.nut-common.install create mode 100644 obs/debian.nut-common.postinst create mode 100644 obs/debian.nut-common.prerm rename obs/{debian.nut-client.tmpfiles => debian.nut-common.tmpfiles} (100%) delete mode 100644 obs/debian.nut-server.tmpfiles diff --git a/obs/debian.control b/obs/debian.control index 96103c9989..6f6e413188 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -48,7 +48,7 @@ Description: network UPS tools - metapackage Package: nut-server Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-client (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-common (= ${binary:Version}), nut-client (= ${binary:Version}) Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml Conflicts: nut-hal-drivers Replaces: nut (<< 2.7.4-11~) @@ -65,7 +65,7 @@ Description: network UPS tools - core system Package: nut-client Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), nut-common (= ${binary:Version}) Provides: ups-monitor Conflicts: ups-monitor Recommends: bash-completion @@ -84,7 +84,7 @@ Description: network UPS tools - clients Package: nut-cgi Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, adduser +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, nut-common (= ${binary:Version}) Recommends: apache2 | httpd-cgi Suggests: nut Description: network UPS tools - web interface diff --git a/obs/debian.nut-cgi.postinst b/obs/debian.nut-cgi.postinst index e082532566..66a7cdba4d 100644 --- a/obs/debian.nut-cgi.postinst +++ b/obs/debian.nut-cgi.postinst @@ -1,28 +1,12 @@ #!/bin/sh -e +# Note: nut-common should be installed first and it delivers +# the user accounts and the sysconfdir (/etc/nut) + case "$1" in configure) - # make sure the nut user exists and has correct memberships - if ! getent group nut >/dev/null; then - addgroup --quiet --system nut - fi - if ! getent passwd nut >/dev/null; then - adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut - elif ! groups nut | grep -qw nut; then - adduser nut nut - fi -# for Ubuntu, while waiting for a proper debconf -# if ! groups nut | grep -qw dialout; then -# adduser nut dialout -# fi - - # Ensure /etc/nut is readable/crossable for others - if [ -d /etc/nut/ ] ; then - chmod 755 /etc/nut - fi - # Ensure nut-cgi configuration files are readable by others for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do if [ -f /etc/nut/$file ] ; then diff --git a/obs/debian.nut-client.postinst b/obs/debian.nut-client.postinst index 4b0485045a..79cb62fb1f 100644 --- a/obs/debian.nut-client.postinst +++ b/obs/debian.nut-client.postinst @@ -1,29 +1,15 @@ #!/bin/sh -e +# Note: nut-common should be installed first and it delivers +# the user accounts and the sysconfdir (/etc/nut) + case "$1" in configure) - # make sure the nut user exists and has correct memberships - if ! getent group nut >/dev/null; then - addgroup --quiet --system nut - fi - if ! getent passwd nut >/dev/null; then - adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut - elif ! groups nut | grep -qw nut; then - adduser nut nut - fi -# for Ubuntu, while waiting for a proper debconf -# if ! groups nut | grep -qw dialout; then -# adduser nut dialout -# fi - - # make sure that conffiles are secured and have the correct ownerships - # on first install + # make sure that nut-client conffiles are secured and have + # the correct ownerships on first install if [ -z "$2" ] ; then - if [ -d /etc/nut/ ] ; then - chown root:nut /etc/nut/ - fi for file in nut.conf upsmon.conf upssched.conf ; do if [ -f /etc/nut/$file ] ; then chown root:nut /etc/nut/$file @@ -32,18 +18,6 @@ case "$1" in done fi - # make sure that /var/run/nut exists and has the correct ownerships - if [ ! -d /var/run/nut ] ; then - mkdir -p /var/run/nut - fi - if [ -d /var/run/nut ] ; then - chown root:nut /var/run/nut - chmod 770 /var/run/nut - if which restorecon >/dev/null 2>&1; then - restorecon /var/run/nut - fi - fi - if dpkg --compare-versions "$2" le "2.6.4-2~" && [ -f /etc/init.d/nut ] ; then if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then diff --git a/obs/debian.nut-common.install b/obs/debian.nut-common.install new file mode 100644 index 0000000000..1297259bd2 --- /dev/null +++ b/obs/debian.nut-common.install @@ -0,0 +1 @@ +debian/tmp/lib/systemd/system/nut.target diff --git a/obs/debian.nut-common.postinst b/obs/debian.nut-common.postinst new file mode 100644 index 0000000000..f8f1c30a4f --- /dev/null +++ b/obs/debian.nut-common.postinst @@ -0,0 +1,72 @@ +#!/bin/sh -e + +# This package is a common prerequisite for nut-server, nut-client, nut-cgi +# and other NUT packages that deliver running programs. It creates the user +# accounts and delivers some common files (e.g. the sysconfdir /etc/nut and +# systemd nut.target) that are not quite attributable to any one particular +# package. + +case "$1" in + + configure) + + # make sure the nut user exists and has correct memberships + if ! getent group nut >/dev/null; then + addgroup --quiet --system nut + fi + if ! getent passwd nut >/dev/null; then + adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut + elif ! groups nut | grep -qw nut; then + adduser nut nut + fi +# for Ubuntu, while waiting for a proper debconf +# if ! groups nut | grep -qw dialout; then +# adduser nut dialout +# fi + + # Ensure /etc/nut is readable/crossable for others + # If the (old) config directory exists, retain existing rights + # that the user might have set up for their local system needs + if [ ! -d /etc/nut ] ; then + mkdir -p /etc/nut/ + chown root:nut /etc/nut/ + chmod 755 /etc/nut/ + fi + + # make sure that /var/run/nut exists and has the correct ownerships + # (note that on newer systems, after reboot, the /run/nut is created + # by systemd using the tmpfiles configuration snippet) + if [ ! -d /var/run/nut ] ; then + mkdir -p /var/run/nut + fi + if [ -d /var/run/nut ] ; then + chown root:nut /var/run/nut + chmod 770 /var/run/nut + if which restorecon >/dev/null 2>&1; then + restorecon /var/run/nut + fi + fi + ;; + + abort-upgrade) + # do nothing + ;; + + abort-remove) + # do nothing + ;; + + abort-deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-common.prerm b/obs/debian.nut-common.prerm new file mode 100644 index 0000000000..a158bc572b --- /dev/null +++ b/obs/debian.nut-common.prerm @@ -0,0 +1,36 @@ +#!/bin/sh -e + +# the DEBHELPER token is purposely not used +# because we don't want the daemon to be +# stopped during an upgrade + +case "$1" in + + remove) + # Packaging assumes that this package is removed last + # of all its dependencies, so remove what we created + [ -d /var/run/nut ] && rm -rf /var/run/nut/ + ;; + + upgrade) + # do nothing + ;; + + failed-upgrade) + # do nothing + ;; + + deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-client.tmpfiles b/obs/debian.nut-common.tmpfiles similarity index 100% rename from obs/debian.nut-client.tmpfiles rename to obs/debian.nut-common.tmpfiles diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index 33221262fe..1d55bcd2c3 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -1,29 +1,15 @@ #!/bin/sh -e +# Note: nut-common should be installed first and it delivers +# the user accounts and the sysconfdir (/etc/nut) + case "$1" in configure) - # make sure the nut user exists and has correct memberships - if ! getent group nut >/dev/null; then - addgroup --quiet --system nut - fi - if ! getent passwd nut >/dev/null; then - adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut - elif ! groups nut | grep -qw nut; then - adduser nut nut - fi -# for Ubuntu, while waiting for a proper debconf -# if ! groups nut | grep -qw dialout; then -# adduser nut dialout -# fi - - # make sure that conffiles are secured and have the correct ownerships - # on first install + # make sure that nut-server conffiles are secured and have + # the correct ownerships on first install if [ -z "$2" ] ; then - if [ -d /etc/nut/ ] ; then - chown root:nut /etc/nut/ - fi for file in ups.conf upsd.conf upsd.users ; do if [ -f /etc/nut/$file ] ; then chown root:nut /etc/nut/$file @@ -32,18 +18,6 @@ case "$1" in done fi - # make sure that /var/run/nut exists and has the correct ownerships - if [ ! -d /var/run/nut ] ; then - mkdir -p /var/run/nut - fi - if [ -d /var/run/nut ] ; then - chown root:nut /var/run/nut - chmod 770 /var/run/nut - if which restorecon >/dev/null 2>&1; then - restorecon /var/run/nut - fi - fi - # make sure that /var/lib/nut has the correct permissions and ownerships if [ -d /var/lib/nut ] ; then chown root:nut /var/lib/nut diff --git a/obs/debian.nut-server.tmpfiles b/obs/debian.nut-server.tmpfiles deleted file mode 100644 index bf195cf142..0000000000 --- a/obs/debian.nut-server.tmpfiles +++ /dev/null @@ -1 +0,0 @@ -d /run/nut 0770 root nut - - diff --git a/obs/debian.rules b/obs/debian.rules index d881d29315..f2c678f8c9 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -112,21 +112,27 @@ common-install-arch:: $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so # Install systemd files only on systems where it's supported + ### Package files for nut-client: install -m 644 -D $(CURDIR)/debian/tmp/$(systemdsystemunitdir)/nut-monitor.service \ $(CURDIR)/debian/nut-client/$(systemdsystemunitdir)/nut-monitor.service + ### Package files for nut-server: install -D $(CURDIR)/debian/tmp/$(systemdshutdowndir)/nutshutdown \ $(CURDIR)/debian/nut-server/$(systemdshutdowndir)/nutshutdown install -m 644 -D $(CURDIR)/debian/tmp/$(systemdsystemunitdir)/nut-server.service \ $(CURDIR)/debian/nut-server/$(systemdsystemunitdir)/nut-server.service + # This should cover nut-driver.target, nut-driver@.service, + # nut-driver-enumerator.path, nut-driver-enumerator.service install -m 644 -t $(CURDIR)/debian/nut-server/$(systemdsystemunitdir) \ - $(CURDIR)/debian/tmp/$(systemdsystemunitdir)/nut-driver* + $(CURDIR)/debian/tmp/$(systemdsystemunitdir)/nut-driver* - # Add a symlink to mask the LSB initscript + # Add a symlink to mask the LSB initscript for nut-client: ln -s nut-monitor.service $(CURDIR)/debian/nut-client/$(systemdsystemunitdir)/nut-client.service # Install tmpfiles config file to create /run/nut directory + ### Package files for nut-client: install -m 644 -D $(CURDIR)/debian/nut-client.tmpfiles \ $(CURDIR)/debian/nut-client/usr/lib/tmpfiles.d/nut-client.conf + ### Package files for nut-server: install -m 644 -D $(CURDIR)/debian/nut-server.tmpfiles \ $(CURDIR)/debian/nut-server/usr/lib/tmpfiles.d/nut-server.conf From f8f2e81b7afe5943d05f3f33993bdfba8da9f09d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 10:10:37 +0200 Subject: [PATCH 042/207] Add systemd registration of installed units Signed-off-by: Jim Klimov --- obs/debian.nut-client.postinst | 4 ++++ obs/debian.nut-common.postinst | 4 ++++ obs/debian.nut-server.postinst | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/obs/debian.nut-client.postinst b/obs/debian.nut-client.postinst index 79cb62fb1f..c6ffece89d 100644 --- a/obs/debian.nut-client.postinst +++ b/obs/debian.nut-client.postinst @@ -27,6 +27,10 @@ case "$1" in fi update-rc.d nut remove >/dev/null fi + + /bin/systemctl daemon-reload + /bin/systemctl enable nut-monitor.service + ;; abort-upgrade) diff --git a/obs/debian.nut-common.postinst b/obs/debian.nut-common.postinst index f8f1c30a4f..014a2c3ffd 100644 --- a/obs/debian.nut-common.postinst +++ b/obs/debian.nut-common.postinst @@ -46,6 +46,10 @@ case "$1" in restorecon /var/run/nut fi fi + + /bin/systemctl daemon-reload + /bin/systemctl enable nut.target + ;; abort-upgrade) diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index 1d55bcd2c3..37bcfdadb3 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -39,6 +39,12 @@ case "$1" in fi update-rc.d nut remove >/dev/null fi + + /bin/systemctl daemon-reload + /bin/systemctl enable nut-driver.target + /bin/systemctl enable nut-driver-enumerator.service + /bin/systemctl enable nut-driver-enumerator.path + ;; abort-upgrade) From 63e4ff5ebdd3be0ff4af115558893b83c7ecba67 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 11:44:02 +0200 Subject: [PATCH 043/207] Add systemd startup of installed units Signed-off-by: Jim Klimov --- obs/debian.nut-client.postinst | 3 +++ obs/debian.nut-common.postinst | 1 + obs/debian.nut-server.postinst | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/obs/debian.nut-client.postinst b/obs/debian.nut-client.postinst index c6ffece89d..b26dff7aee 100644 --- a/obs/debian.nut-client.postinst +++ b/obs/debian.nut-client.postinst @@ -30,6 +30,9 @@ case "$1" in /bin/systemctl daemon-reload /bin/systemctl enable nut-monitor.service + if [ -s /etc/nut/upsmon.conf ] ; then + /bin/systemctl start nut-monitor.service + fi ;; diff --git a/obs/debian.nut-common.postinst b/obs/debian.nut-common.postinst index 014a2c3ffd..e704fb7d5e 100644 --- a/obs/debian.nut-common.postinst +++ b/obs/debian.nut-common.postinst @@ -49,6 +49,7 @@ case "$1" in /bin/systemctl daemon-reload /bin/systemctl enable nut.target + /bin/systemctl start nut.target ;; diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index 37bcfdadb3..bc7ca21485 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -42,8 +42,24 @@ case "$1" in /bin/systemctl daemon-reload /bin/systemctl enable nut-driver.target - /bin/systemctl enable nut-driver-enumerator.service + /bin/systemctl start nut-driver.target + + # Watch *changes* to /etc/nut/ups.conf and trigger nut-driver-enumerator.service then /bin/systemctl enable nut-driver-enumerator.path + /bin/systemctl start nut-driver-enumerator.path + + # The nut-driver-enumerator.path reacts to changes of /etc/nut/ups.conf + # but does not execute the service handler (to add or remove nut-driver + # service instances) initially, whether the configuration exists or not. + # Running the script allows to handle that properly. + /bin/systemctl enable nut-driver-enumerator.service + /bin/systemctl start nut-driver-enumerator.service + + /bin/systemctl enable nut-server.service + # upsd accounts must be defined (if existed before) to start the service + if [ -s /etc/nut/upsd.conf ] && [ -s /etc/nut/ups.conf ]; then + /bin/systemctl start nut-server.service + fi ;; From 49135ee0f55997f3c6d0ee03d488d1f7bd1167be Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 11:58:38 +0200 Subject: [PATCH 044/207] Add systemd shutdown of installed units during uninstallation of the packages Signed-off-by: Jim Klimov --- obs/debian.nut-client.prerm | 36 ++++++++++++++++++++++++++++++++++++ obs/debian.nut-common.prerm | 3 +++ obs/debian.nut-server.prerm | 22 +++++++++++++++++++++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 obs/debian.nut-client.prerm diff --git a/obs/debian.nut-client.prerm b/obs/debian.nut-client.prerm new file mode 100644 index 0000000000..c2761a6d1e --- /dev/null +++ b/obs/debian.nut-client.prerm @@ -0,0 +1,36 @@ +#!/bin/sh -e + +# the DEBHELPER token is purposely not used +# because we don't want the daemon to be +# stopped during an upgrade + +case "$1" in + + remove) + /bin/systemctl stop nut-client.service + /bin/systemctl disable nut-client.service + + ;; + + upgrade) + # do nothing + ;; + + failed-upgrade) + # do nothing + ;; + + deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff --git a/obs/debian.nut-common.prerm b/obs/debian.nut-common.prerm index a158bc572b..54f374288b 100644 --- a/obs/debian.nut-common.prerm +++ b/obs/debian.nut-common.prerm @@ -9,6 +9,9 @@ case "$1" in remove) # Packaging assumes that this package is removed last # of all its dependencies, so remove what we created + /bin/systemctl stop nut.target + /bin/systemctl disable nut.target + [ -d /var/run/nut ] && rm -rf /var/run/nut/ ;; diff --git a/obs/debian.nut-server.prerm b/obs/debian.nut-server.prerm index 6292ef83c7..ab68f66fcd 100644 --- a/obs/debian.nut-server.prerm +++ b/obs/debian.nut-server.prerm @@ -12,7 +12,27 @@ case "$1" in [ -f /etc/hotplug/usb/libhidups ] && rm -f /etc/hotplug/usb/libhidups [ -L /usr/doc/nut ] && rm -f /usr/doc/nut - # do stop the daemon on remove + + # do stop the daemons on remove + /bin/systemctl stop nut-driver.target + /bin/systemctl disable nut-driver.target + + /bin/systemctl stop nut-driver-enumerator.path + /bin/systemctl disable nut-driver-enumerator.path + + /bin/systemctl stop nut-driver-enumerator.service + /bin/systemctl disable nut-driver-enumerator.service + + /bin/systemctl stop nut-server.service + /bin/systemctl disable nut-server.service + + if [ -x /lib/nut/nut-driver-enumerator.sh ] ; then + for DRV in `/lib/nut/nut-driver-enumerator.sh --list-services 2>/dev/null` ; do + /bin/systemctl stop "$DRV" + /bin/systemctl disable "$DRV" + done + fi + invoke-rc.d nut stop && sleep 1 [ -d /var/run/nut ] && rm -rf /var/run/nut/ ;; From 9bbfd95b36ad861ad60f568a0284fa1f4f87fe1f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 12:05:03 +0200 Subject: [PATCH 045/207] debian.control : clarify where packages provide clients for "a local or remote NUT server" Signed-off-by: Jim Klimov --- obs/debian.control | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index 6f6e413188..9905c071cc 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -80,7 +80,7 @@ Description: network UPS tools - clients changes. . This package provides NUT's clients that allows the user to control - and monitor the UPS. + and monitor the UPS by connecting to a local or remote NUT server. Package: nut-cgi Architecture: any @@ -96,6 +96,8 @@ Description: network UPS tools - web interface . This package provides an HTTP interface for Network UPS Tools which makes it possible to monitor the core NUT system with a web browser. + Note that the CGI script would connect from web-server context to its local + or remote NUT server. Package: nut-snmp Architecture: any @@ -282,7 +284,8 @@ Description: network UPS tools - GUI application to monitor UPS status through the server, and are notified whenever the power status changes. . - This package provides nut-monitor, a GUI application to monitor UPS status. + This package provides nut-monitor, a GUI application to monitor the + UPS status on a local or remote NUT server. Package: libups-nut-perl Section: perl From 957ad8e87e49d0247aa4ca61c3745046c7e8efc1 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 12:05:41 +0200 Subject: [PATCH 046/207] debian.control : update sub-driver packages to rely on just the nut-server package, not nut metapackage Signed-off-by: Jim Klimov --- obs/debian.control | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index 9905c071cc..770d47c3e3 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -101,7 +101,7 @@ Description: network UPS tools - web interface Package: nut-snmp Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}) Description: network UPS tools - SNMP driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and @@ -115,7 +115,7 @@ Description: network UPS tools - SNMP driver Package: nut-ipmi Architecture: linux-any kfreebsd-any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}) Description: network UPS tools - IPMI driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and @@ -130,7 +130,7 @@ Description: network UPS tools - IPMI driver Package: nut-xml Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}) Description: network UPS tools - XML/HTTP driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and @@ -145,7 +145,7 @@ Description: network UPS tools - XML/HTTP driver Package: nut-powerman-pdu Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, nut (= ${binary:Version}), powerman (>= 2.3.3) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}), powerman (>= 2.3.3) Description: network UPS tools - PowerMan PDU driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and From 1066962e1cbc4cd3eb563e456b2d957d51d5b6c7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 14:11:00 +0200 Subject: [PATCH 047/207] debian.rules : deliver one nut-common.conf tmpfiles config instead of two same files for client and server Signed-off-by: Jim Klimov --- obs/debian.rules | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index f2c678f8c9..71b5788b76 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -129,12 +129,8 @@ common-install-arch:: ln -s nut-monitor.service $(CURDIR)/debian/nut-client/$(systemdsystemunitdir)/nut-client.service # Install tmpfiles config file to create /run/nut directory - ### Package files for nut-client: - install -m 644 -D $(CURDIR)/debian/nut-client.tmpfiles \ - $(CURDIR)/debian/nut-client/usr/lib/tmpfiles.d/nut-client.conf - ### Package files for nut-server: - install -m 644 -D $(CURDIR)/debian/nut-server.tmpfiles \ - $(CURDIR)/debian/nut-server/usr/lib/tmpfiles.d/nut-server.conf + install -m 644 -D $(CURDIR)/debian/nut-common.tmpfiles \ + $(CURDIR)/debian/nut-common/usr/lib/tmpfiles.d/nut-common.conf # Install gen-snmp-subdriver.sh for nut-snmp install -m 755 -D $(CURDIR)/scripts/subdriver/gen-snmp-subdriver.sh \ From 6550c2cfe3b7b31eb74c14569abf9332b9893fdd Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 26 Sep 2018 16:03:03 +0200 Subject: [PATCH 048/207] debian.control : reference nut-common Signed-off-by: Jim Klimov --- obs/debian.control | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/obs/debian.control b/obs/debian.control index 770d47c3e3..131c3ef5dc 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -46,6 +46,22 @@ Description: network UPS tools - metapackage This package is a metapackage that installs both nut-server and nut-client, in most cases it is sufficient for a basic UPS monitoring system. +Package: nut-common +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) +Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml +Conflicts: nut-hal-drivers +Replaces: nut (<< 2.7.4-11~) +Breaks: nut (<< 2.6.1-2~) +Description: network UPS tools - core system + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides shared files for NUT's core system. + Package: nut-server Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-common (= ${binary:Version}), nut-client (= ${binary:Version}) From 5c17ba942fbfccc56884be822c787392bc4a6487 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 27 Sep 2018 11:54:31 +0200 Subject: [PATCH 049/207] debian.nut-*.post/pre-inst/rm : call /bin/systemctl only on systems where it is available, and do not block on attempts to start the services Signed-off-by: Jim Klimov --- obs/debian.nut-client.postinst | 11 +++++---- obs/debian.nut-client.prerm | 8 ++++--- obs/debian.nut-common.postinst | 10 ++++---- obs/debian.nut-common.prerm | 7 ++++-- obs/debian.nut-server.postinst | 43 ++++++++++++++++++---------------- obs/debian.nut-server.prerm | 37 +++++++++++++++-------------- 6 files changed, 66 insertions(+), 50 deletions(-) diff --git a/obs/debian.nut-client.postinst b/obs/debian.nut-client.postinst index b26dff7aee..c8812e96f8 100644 --- a/obs/debian.nut-client.postinst +++ b/obs/debian.nut-client.postinst @@ -28,10 +28,13 @@ case "$1" in update-rc.d nut remove >/dev/null fi - /bin/systemctl daemon-reload - /bin/systemctl enable nut-monitor.service - if [ -s /etc/nut/upsmon.conf ] ; then - /bin/systemctl start nut-monitor.service + # SystemD-specific actions + if [ -x /bin/systemctl ] ; then + /bin/systemctl daemon-reload + /bin/systemctl enable nut-monitor.service + if [ -s /etc/nut/upsmon.conf ] ; then + /bin/systemctl start --no-block nut-monitor.service + fi fi ;; diff --git a/obs/debian.nut-client.prerm b/obs/debian.nut-client.prerm index c2761a6d1e..0e96a1fef4 100644 --- a/obs/debian.nut-client.prerm +++ b/obs/debian.nut-client.prerm @@ -7,9 +7,11 @@ case "$1" in remove) - /bin/systemctl stop nut-client.service - /bin/systemctl disable nut-client.service - + # SystemD-specific actions + if [ -x /bin/systemctl ] ; then + /bin/systemctl stop nut-client.service + /bin/systemctl disable nut-client.service + fi ;; upgrade) diff --git a/obs/debian.nut-common.postinst b/obs/debian.nut-common.postinst index e704fb7d5e..56c8da4ea3 100644 --- a/obs/debian.nut-common.postinst +++ b/obs/debian.nut-common.postinst @@ -47,10 +47,12 @@ case "$1" in fi fi - /bin/systemctl daemon-reload - /bin/systemctl enable nut.target - /bin/systemctl start nut.target - + # SystemD-specific actions + if [ -x /bin/systemctl ] ; then + /bin/systemctl daemon-reload + /bin/systemctl enable nut.target + /bin/systemctl start --no-block nut.target + fi ;; abort-upgrade) diff --git a/obs/debian.nut-common.prerm b/obs/debian.nut-common.prerm index 54f374288b..07b8cfbd92 100644 --- a/obs/debian.nut-common.prerm +++ b/obs/debian.nut-common.prerm @@ -9,8 +9,11 @@ case "$1" in remove) # Packaging assumes that this package is removed last # of all its dependencies, so remove what we created - /bin/systemctl stop nut.target - /bin/systemctl disable nut.target + # SystemD-specific actions + if [ -x /bin/systemctl ] ; then + /bin/systemctl stop nut.target + /bin/systemctl disable nut.target + fi [ -d /var/run/nut ] && rm -rf /var/run/nut/ ;; diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index bc7ca21485..79a6c58d20 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -40,27 +40,30 @@ case "$1" in update-rc.d nut remove >/dev/null fi - /bin/systemctl daemon-reload - /bin/systemctl enable nut-driver.target - /bin/systemctl start nut-driver.target - - # Watch *changes* to /etc/nut/ups.conf and trigger nut-driver-enumerator.service then - /bin/systemctl enable nut-driver-enumerator.path - /bin/systemctl start nut-driver-enumerator.path - - # The nut-driver-enumerator.path reacts to changes of /etc/nut/ups.conf - # but does not execute the service handler (to add or remove nut-driver - # service instances) initially, whether the configuration exists or not. - # Running the script allows to handle that properly. - /bin/systemctl enable nut-driver-enumerator.service - /bin/systemctl start nut-driver-enumerator.service - - /bin/systemctl enable nut-server.service - # upsd accounts must be defined (if existed before) to start the service - if [ -s /etc/nut/upsd.conf ] && [ -s /etc/nut/ups.conf ]; then - /bin/systemctl start nut-server.service - fi + # SystemD-specific actions + if [ -x /bin/systemctl ] ; then + /bin/systemctl daemon-reload + + # Watch *changes* to /etc/nut/ups.conf and trigger nut-driver-enumerator.service then + /bin/systemctl enable nut-driver-enumerator.path + /bin/systemctl start --no-block nut-driver-enumerator.path + + # The nut-driver-enumerator.path reacts to changes of /etc/nut/ups.conf + # but does not execute the service handler (to add or remove nut-driver + # service instances) initially, whether the configuration exists or not. + # Running the script allows to handle that properly. + /bin/systemctl enable nut-driver-enumerator.service + /bin/systemctl start --no-block nut-driver-enumerator.service + + /bin/systemctl enable nut-server.service + # upsd accounts must be defined (if existed before) to start the service + if [ -s /etc/nut/upsd.conf ] && [ -s /etc/nut/ups.conf ]; then + /bin/systemctl start --no-block nut-server.service + fi + /bin/systemctl enable nut-driver.target + /bin/systemctl start --no-block nut-driver.target + fi ;; abort-upgrade) diff --git a/obs/debian.nut-server.prerm b/obs/debian.nut-server.prerm index ab68f66fcd..ab4e6de0d3 100644 --- a/obs/debian.nut-server.prerm +++ b/obs/debian.nut-server.prerm @@ -14,23 +14,26 @@ case "$1" in [ -L /usr/doc/nut ] && rm -f /usr/doc/nut # do stop the daemons on remove - /bin/systemctl stop nut-driver.target - /bin/systemctl disable nut-driver.target - - /bin/systemctl stop nut-driver-enumerator.path - /bin/systemctl disable nut-driver-enumerator.path - - /bin/systemctl stop nut-driver-enumerator.service - /bin/systemctl disable nut-driver-enumerator.service - - /bin/systemctl stop nut-server.service - /bin/systemctl disable nut-server.service - - if [ -x /lib/nut/nut-driver-enumerator.sh ] ; then - for DRV in `/lib/nut/nut-driver-enumerator.sh --list-services 2>/dev/null` ; do - /bin/systemctl stop "$DRV" - /bin/systemctl disable "$DRV" - done + # SystemD-specific actions + if [ -x /bin/systemctl ] ; then + /bin/systemctl stop nut-driver.target + /bin/systemctl disable nut-driver.target + + /bin/systemctl stop nut-driver-enumerator.path + /bin/systemctl disable nut-driver-enumerator.path + + /bin/systemctl stop nut-driver-enumerator.service + /bin/systemctl disable nut-driver-enumerator.service + + /bin/systemctl stop nut-server.service + /bin/systemctl disable nut-server.service + + if [ -x /lib/nut/nut-driver-enumerator.sh ] ; then + for DRV in `/lib/nut/nut-driver-enumerator.sh --list-services 2>/dev/null` ; do + /bin/systemctl stop "$DRV" + /bin/systemctl disable "$DRV" + done + fi fi invoke-rc.d nut stop && sleep 1 From e60c7ec27fbca1bbc63f6c825f4c39dde495e3dc Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 27 Sep 2018 12:06:16 +0200 Subject: [PATCH 050/207] debian.nut-*.post/pre-inst/rm : do not fail package installation if could not start services Signed-off-by: Jim Klimov --- obs/debian.nut-client.postinst | 2 +- obs/debian.nut-common.postinst | 2 +- obs/debian.nut-server.postinst | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/obs/debian.nut-client.postinst b/obs/debian.nut-client.postinst index c8812e96f8..6b21d2d183 100644 --- a/obs/debian.nut-client.postinst +++ b/obs/debian.nut-client.postinst @@ -33,7 +33,7 @@ case "$1" in /bin/systemctl daemon-reload /bin/systemctl enable nut-monitor.service if [ -s /etc/nut/upsmon.conf ] ; then - /bin/systemctl start --no-block nut-monitor.service + /bin/systemctl start --no-block nut-monitor.service || true fi fi diff --git a/obs/debian.nut-common.postinst b/obs/debian.nut-common.postinst index 56c8da4ea3..a60c891d27 100644 --- a/obs/debian.nut-common.postinst +++ b/obs/debian.nut-common.postinst @@ -51,7 +51,7 @@ case "$1" in if [ -x /bin/systemctl ] ; then /bin/systemctl daemon-reload /bin/systemctl enable nut.target - /bin/systemctl start --no-block nut.target + /bin/systemctl start --no-block nut.target || true fi ;; diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index 79a6c58d20..2706bd1a0c 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -46,23 +46,23 @@ case "$1" in # Watch *changes* to /etc/nut/ups.conf and trigger nut-driver-enumerator.service then /bin/systemctl enable nut-driver-enumerator.path - /bin/systemctl start --no-block nut-driver-enumerator.path + /bin/systemctl start --no-block nut-driver-enumerator.path || true # The nut-driver-enumerator.path reacts to changes of /etc/nut/ups.conf # but does not execute the service handler (to add or remove nut-driver # service instances) initially, whether the configuration exists or not. # Running the script allows to handle that properly. /bin/systemctl enable nut-driver-enumerator.service - /bin/systemctl start --no-block nut-driver-enumerator.service + /bin/systemctl start --no-block nut-driver-enumerator.service || true /bin/systemctl enable nut-server.service # upsd accounts must be defined (if existed before) to start the service if [ -s /etc/nut/upsd.conf ] && [ -s /etc/nut/ups.conf ]; then - /bin/systemctl start --no-block nut-server.service + /bin/systemctl start --no-block nut-server.service || true fi /bin/systemctl enable nut-driver.target - /bin/systemctl start --no-block nut-driver.target + /bin/systemctl start --no-block nut-driver.target || true fi ;; From e6ca41884733aaa61f7244121abb1873a296bb79 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 27 Sep 2018 12:50:05 +0200 Subject: [PATCH 051/207] debian.control : new nut-common has no opinion about old nut-hal-drivers Signed-off-by: Jim Klimov --- obs/debian.control | 1 - 1 file changed, 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index 131c3ef5dc..3f1d26a58a 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -50,7 +50,6 @@ Package: nut-common Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml -Conflicts: nut-hal-drivers Replaces: nut (<< 2.7.4-11~) Breaks: nut (<< 2.6.1-2~) Description: network UPS tools - core system From 6b0c65637eb8ae000fe20e8631e6b8cf0201142e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 27 Sep 2018 13:11:04 +0200 Subject: [PATCH 052/207] debian.control : have "nut" metapackage explicitly depend on nut-common to pre-create things Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index 3f1d26a58a..641a308b2a 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -35,7 +35,7 @@ XS-Testsuite: autopkgtest Package: nut Architecture: all Section: metapackages -Depends: ${misc:Depends}, nut-server (= ${binary:Version}), nut-client (= ${binary:Version}) +Depends: ${misc:Depends}, nut-common (= ${binary:Version}), nut-server (= ${binary:Version}), nut-client (= ${binary:Version}) Description: network UPS tools - metapackage Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and From f33af06822376b20cc9ac0c024ae2e1fc5642bc2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 27 Sep 2018 13:11:41 +0200 Subject: [PATCH 053/207] debian.control : "nut-server" should have no business requiring "nut-client" Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index 641a308b2a..eef2728b13 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -63,7 +63,7 @@ Description: network UPS tools - core system Package: nut-server Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-common (= ${binary:Version}), nut-client (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-common (= ${binary:Version}) Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml Conflicts: nut-hal-drivers Replaces: nut (<< 2.7.4-11~) From 0a62338663e0188e6202a3563a8d2edc8aec65eb Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 28 Sep 2018 00:11:36 +0200 Subject: [PATCH 054/207] nut-(client|server|common).postinst : skip DEBHELPER in our case Signed-off-by: Jim Klimov --- obs/debian.nut-client.postinst | 2 +- obs/debian.nut-common.postinst | 2 +- obs/debian.nut-server.postinst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/obs/debian.nut-client.postinst b/obs/debian.nut-client.postinst index 6b21d2d183..32273a7d9b 100644 --- a/obs/debian.nut-client.postinst +++ b/obs/debian.nut-client.postinst @@ -58,6 +58,6 @@ case "$1" in esac -#DEBHELPER# +# Skip DEBHELPER because in this case we handle systemd in target OS better by ourselves # exit 0 diff --git a/obs/debian.nut-common.postinst b/obs/debian.nut-common.postinst index a60c891d27..0121d233c6 100644 --- a/obs/debian.nut-common.postinst +++ b/obs/debian.nut-common.postinst @@ -74,6 +74,6 @@ case "$1" in esac -#DEBHELPER# +# Skip DEBHELPER because in this case we handle systemd in target OS better by ourselves # exit 0 diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index 2706bd1a0c..9dde53a458 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -85,6 +85,6 @@ case "$1" in esac -#DEBHELPER# +# Skip DEBHELPER because in this case we handle systemd in target OS better by ourselves # exit 0 From d73855ad506b38ef21a72b00fff6be9ffc18ed0a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 5 Oct 2018 00:05:49 +0200 Subject: [PATCH 055/207] nut-driver-enumerator : use --reconfigure to remake units from scratch in Debian postinstall Signed-off-by: Jim Klimov --- obs/debian.nut-server.postinst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index 9dde53a458..7b8e80a72a 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -42,6 +42,9 @@ case "$1" in # SystemD-specific actions if [ -x /bin/systemctl ] ; then + echo "Register NUT drivers (if any)..." + AUTO_START=no /lib/nut/nut-driver-enumerator.sh --reconfigure + /bin/systemctl daemon-reload # Watch *changes* to /etc/nut/ups.conf and trigger nut-driver-enumerator.service then From 4563117816588a411c8eebbabe47db1b5dc15c6b Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 5 Oct 2018 03:08:19 +0200 Subject: [PATCH 056/207] debian.nut-server.postinst : REPORT_RESTART_42=no when reconfiguring Signed-off-by: Jim Klimov --- obs/debian.nut-server.postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.nut-server.postinst b/obs/debian.nut-server.postinst index 7b8e80a72a..26502724c5 100644 --- a/obs/debian.nut-server.postinst +++ b/obs/debian.nut-server.postinst @@ -43,7 +43,7 @@ case "$1" in # SystemD-specific actions if [ -x /bin/systemctl ] ; then echo "Register NUT drivers (if any)..." - AUTO_START=no /lib/nut/nut-driver-enumerator.sh --reconfigure + REPORT_RESTART_42=no AUTO_START=no /lib/nut/nut-driver-enumerator.sh --reconfigure /bin/systemctl daemon-reload From 260a5974d953dfe6a59b5becf9c8e1da21ce70dc Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 6 Dec 2018 00:24:43 +0100 Subject: [PATCH 057/207] debian.control : rephrase nut-server description Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index eef2728b13..9c1c4e4999 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -68,7 +68,7 @@ Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml Conflicts: nut-hal-drivers Replaces: nut (<< 2.7.4-11~) Breaks: nut (<< 2.6.1-2~) -Description: network UPS tools - core system +Description: network UPS tools - data server, serial and USB drivers Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware From 10c86ac3b4128493f6fa167656453075b675478c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 6 Dec 2018 00:25:09 +0100 Subject: [PATCH 058/207] debian.control : nut-ipmi should have run-time deps on IPMI libs Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index 9c1c4e4999..f2cf4beedd 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -130,7 +130,7 @@ Description: network UPS tools - SNMP driver Package: nut-ipmi Architecture: linux-any kfreebsd-any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}), libfreeipmi (>= 0.8.5) [!hurd-i386], libipmimonitoring (>= 1.1.5-2) [!hurd-i386] Description: network UPS tools - IPMI driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and From c737a89fc6e1f476d92f4ecbb414f507ce3990da Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 20 Feb 2019 20:45:35 +0100 Subject: [PATCH 059/207] Problem: libnutclient not found in consumer packaged builds Solution: update the hardcoded pathnames in recipes, leave some comments for improvement Signed-off-by: Jim Klimov Signed-off-by: Jim Klimov --- obs/debian.control | 4 ++-- obs/debian.libnutclient0.lintian-overrides | 1 - ...nt0.install => debian.libnutclient1.install} | 0 obs/debian.libnutclient1.lintian-overrides | 1 + obs/debian.rules | 17 ++++++++++++++--- obs/nut.dsc | 4 ++-- 6 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 obs/debian.libnutclient0.lintian-overrides rename obs/{debian.libnutclient0.install => debian.libnutclient1.install} (100%) create mode 100644 obs/debian.libnutclient1.lintian-overrides diff --git a/obs/debian.control b/obs/debian.control index f2cf4beedd..d5fd9786bc 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -243,7 +243,7 @@ Description: network UPS tools - development files . This package provides the development files. -Package: libnutclient0 +Package: libnutclient1 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -261,7 +261,7 @@ Description: network UPS tools - new client library Package: libnutclient-dev Section: libdevel Architecture: any -Depends: libnutclient0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Depends: libnutclient1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: network UPS tools - development files Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and diff --git a/obs/debian.libnutclient0.lintian-overrides b/obs/debian.libnutclient0.lintian-overrides deleted file mode 100644 index 6f2da5475a..0000000000 --- a/obs/debian.libnutclient0.lintian-overrides +++ /dev/null @@ -1 +0,0 @@ -libnutclient0: no-symbols-control-file shlib-missing-in-symbols-control-file diff --git a/obs/debian.libnutclient0.install b/obs/debian.libnutclient1.install similarity index 100% rename from obs/debian.libnutclient0.install rename to obs/debian.libnutclient1.install diff --git a/obs/debian.libnutclient1.lintian-overrides b/obs/debian.libnutclient1.lintian-overrides new file mode 100644 index 0000000000..19a0063f09 --- /dev/null +++ b/obs/debian.libnutclient1.lintian-overrides @@ -0,0 +1 @@ +libnutclient1: no-symbols-control-file shlib-missing-in-symbols-control-file diff --git a/obs/debian.rules b/obs/debian.rules index 71b5788b76..bed2ba8314 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -23,6 +23,12 @@ systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir syste systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd || echo /lib/systemd) systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) +# FIXME: Find a smarter way to set those from main codebase recipes... +# Something like `grep 'version-info' **/Makefile.am` ? +SO_MAJOR_LIBUPSCLIENT=4 +SO_MAJOR_LIBNUTCLIENT=1 +SO_MAJOR_LIBNUTSCAN=1 + # List any files which are not installed include /usr/share/cdbs/1/rules/utils.mk common-binary-post-install-arch:: list-missing @@ -76,6 +82,11 @@ configure: configure.ac pre-build:: debian/compat configure +# FIXME : The recipe below is a crime scene regarding hardcoded paths that +# are more or less relevant for a particular OS distribution and version, +# and for certain nearby packages that are impacted by this, as was relevant +# at the time this recipe was written. Maybe more proper make macros can be +# used to rectify paths below and allow better manageable per-distro builds. common-install-arch:: # install the bash completion script mkdir -p $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/ @@ -102,13 +113,13 @@ common-install-arch:: # Move -dev file to /usr rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so - ln -s /lib/$(DEB_HOST_MULTIARCH)/libupsclient.so.4 \ + ln -s /lib/$(DEB_HOST_MULTIARCH)/libupsclient.so.$(SO_MAJOR_LIBUPSCLIENT) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so - ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutclient.so.0 \ + ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutclient.so.$(SO_MAJOR_LIBNUTCLIENT) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so - ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.1 \ + ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.$(SO_MAJOR_LIBNUTSCAN) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so # Install systemd files only on systems where it's supported diff --git a/obs/nut.dsc b/obs/nut.dsc index a8bf06c3e4..744c1c0ef0 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -1,6 +1,6 @@ Format: 1.0 Source: nut -Binary: nut, nut-server, nut-client, nut-cgi, nut-snmp, nut-ipmi, nut-xml, nut-powerman-pdu, nut-doc, libupsclient4, libupsclient-dev, libnutclient0, libnutclient-dev, python-nut, nut-monitor, libups-nut-perl +Binary: nut, nut-server, nut-client, nut-cgi, nut-snmp, nut-ipmi, nut-xml, nut-powerman-pdu, nut-doc, libupsclient4, libupsclient-dev, libnutclient1, libnutclient-dev, python-nut, nut-monitor, libups-nut-perl Architecture: any all Version: 2.7.4-12 Maintainer: Arnaud Quette @@ -19,7 +19,7 @@ Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autor Build-Depends-Indep: asciidoc (>= 8.6.3), docbook-xsl, dblatex (>= 0.2.5), libxml2-utils Package-List: libnutclient-dev deb libdevel optional arch=any - libnutclient0 deb libs optional arch=any + libnutclient1 deb libs optional arch=any libnutscan-dev deb libdevel optional arch=any libnutscan1 deb libs optional arch=any libups-nut-perl deb perl optional arch=all From f542c4bdbaf9462b5ad1fa8a99289704df417b3d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 20 Feb 2019 21:07:40 +0100 Subject: [PATCH 060/207] debian.rules : make sure wanted SONAMES exist (numbers remained unchanged) Signed-off-by: Jim Klimov --- obs/debian.rules | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index bed2ba8314..998eae82eb 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -111,14 +111,17 @@ common-install-arch:: mv $${f} $(CURDIR)/debian/tmp/etc/nut/$${nf}; \ done - # Move -dev file to /usr + # Move -dev file to /usr; make sure wanted SONAMES exist (numbers unchanged) rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so + test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so.$(SO_MAJOR_LIBUPSCLIENT) && \ ln -s /lib/$(DEB_HOST_MULTIARCH)/libupsclient.so.$(SO_MAJOR_LIBUPSCLIENT) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so + test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so.$(SO_MAJOR_LIBNUTCLIENT) && \ ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutclient.so.$(SO_MAJOR_LIBNUTCLIENT) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so + test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.$(SO_MAJOR_LIBNUTSCAN) && \ ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.$(SO_MAJOR_LIBNUTSCAN) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so From fed0573aa49153fa4c74f555810ad511b209f1fb Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 3 Apr 2019 13:10:34 +0200 Subject: [PATCH 061/207] debian.rules : update SO_MAJOR_LIBUPSCLIENT for 42ity packaging Signed-off-by: Jim Klimov --- obs/debian.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index 998eae82eb..f197a28637 100644 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -25,7 +25,7 @@ systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd | # FIXME: Find a smarter way to set those from main codebase recipes... # Something like `grep 'version-info' **/Makefile.am` ? -SO_MAJOR_LIBUPSCLIENT=4 +SO_MAJOR_LIBUPSCLIENT=5 SO_MAJOR_LIBNUTCLIENT=1 SO_MAJOR_LIBNUTSCAN=1 From a36768395865a3c51363efb2d5d4004748bc193e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 12 Apr 2019 17:41:27 +0200 Subject: [PATCH 062/207] Debian packaging: explicitly request libjpeg-dev so OBS is not confused for Debian 9 options Signed-off-by: Jim Klimov --- obs/debian.control | 1 + obs/nut.dsc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index d5fd9786bc..f3d552cf8a 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -9,6 +9,7 @@ Build-Depends: debhelper (>= 8.1.3), dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, + libjpeg-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, diff --git a/obs/nut.dsc b/obs/nut.dsc index 744c1c0ef0..5745583f63 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From 7986cc35a4ce632af51c4af2695231ce4fcf8283 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 12 Apr 2019 17:42:58 +0200 Subject: [PATCH 063/207] nut.spec : do not fail making build dir trees Signed-off-by: Jim Klimov --- obs/nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 79b71ddc7e..ab28be0f30 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -244,10 +244,10 @@ mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d install -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/ mkdir -p %{buildroot}%{STATEPATH} rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample -mkdir %{buildroot}/bin +mkdir -p %{buildroot}/bin mv %{buildroot}%{_bindir}/upssched-cmd %{buildroot}/bin/upssched-cmd # Rename web pages to not conflict with apache2-example-pages or user home page: -mkdir %{buildroot}%{HTMLPATH}/nut %{buildroot}%{CGIPATH}/nut +mkdir -p %{buildroot}%{HTMLPATH}/nut %{buildroot}%{CGIPATH}/nut mv %{buildroot}%{HTMLPATH}/*.{html,png} %{buildroot}%{HTMLPATH}/nut/ mv %{buildroot}%{CGIPATH}/*.cgi %{buildroot}%{CGIPATH}/nut find %{buildroot} -type f -name "*.la" -delete -print From 9664c7bd5f117dbbae3744a68fb13c0d50595307 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 12 Apr 2019 18:37:31 +0200 Subject: [PATCH 064/207] Debian packaging: explicitly request libssl*-dev so OBS is not confused for Debian 9 options Signed-off-by: Jim Klimov --- obs/debian.control | 1 + obs/nut.dsc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index f3d552cf8a..c3a3564535 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -11,6 +11,7 @@ Build-Depends: debhelper (>= 8.1.3), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libjpeg-dev, libsnmp-dev | libsnmp9-dev, + libssl1.0-dev | libssl-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), diff --git a/obs/nut.dsc b/obs/nut.dsc index 5745583f63..7008dabf07 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From ac9ea2366133685b5fd3937a024ee6488ea1491d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 14 Mar 2020 22:57:13 +0100 Subject: [PATCH 065/207] Fix formal 42ity packaging for nut-monitor.png icon (recent master branch added different resolutions) Signed-off-by: Jim Klimov --- obs/debian.nut-monitor.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.nut-monitor.install b/obs/debian.nut-monitor.install index 6cbef89947..f92d0850ee 100644 --- a/obs/debian.nut-monitor.install +++ b/obs/debian.nut-monitor.install @@ -2,6 +2,6 @@ scripts/python/app/NUT-Monitor usr/bin/ scripts/python/app/nut-monitor.desktop usr/share/applications/ scripts/python/app/gui-*.glade usr/share/nut-monitor/ scripts/python/app/locale/ usr/share/ -scripts/python/app/nut-monitor.png usr/share/pixmaps/ +scripts/python/app/icons/48x48/nut-monitor.png usr/share/pixmaps/ scripts/python/app/pixmaps usr/share/nut-monitor/ debian/nut-monitor.xpm usr/share/pixmaps/ From 2ad29cf9ffa25f7655405ce97473bcbd5936b189 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 6 Dec 2019 17:51:10 +0100 Subject: [PATCH 066/207] Introduce "runbasedir" in debian packaging on OBS to use /run or /var/run as appropriate Signed-off-by: Jim Klimov --- obs/debian.Makefile.in | 381 ------------------ ...-client.init => debian.nut-client.init.in} | 4 +- ...postinst => debian.nut-common.postinst.in} | 14 +- ...ommon.prerm => debian.nut-common.prerm.in} | 2 +- obs/debian.nut-common.tmpfiles | 1 - obs/debian.nut-common.tmpfiles.in | 1 + ...-server.init => debian.nut-server.init.in} | 4 +- ...erver.prerm => debian.nut-server.prerm.in} | 2 +- obs/debian.rules | 16 +- 9 files changed, 27 insertions(+), 398 deletions(-) delete mode 100644 obs/debian.Makefile.in rename obs/{debian.nut-client.init => debian.nut-client.init.in} (98%) rename obs/{debian.nut-common.postinst => debian.nut-common.postinst.in} (86%) rename obs/{debian.nut-common.prerm => debian.nut-common.prerm.in} (91%) delete mode 100644 obs/debian.nut-common.tmpfiles create mode 100644 obs/debian.nut-common.tmpfiles.in rename obs/{debian.nut-server.init => debian.nut-server.init.in} (98%) rename obs/{debian.nut-server.prerm => debian.nut-server.prerm.in} (96%) mode change 100644 => 100755 obs/debian.rules diff --git a/obs/debian.Makefile.in b/obs/debian.Makefile.in deleted file mode 100644 index aca99247d6..0000000000 --- a/obs/debian.Makefile.in +++ /dev/null @@ -1,381 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = packaging/debian -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \ - $(top_srcdir)/m4/nut_arg_with.m4 \ - $(top_srcdir)/m4/nut_check_hiddev.m4 \ - $(top_srcdir)/m4/nut_check_ipv6.m4 \ - $(top_srcdir)/m4/nut_check_libgd.m4 \ - $(top_srcdir)/m4/nut_check_libhal.m4 \ - $(top_srcdir)/m4/nut_check_libneon.m4 \ - $(top_srcdir)/m4/nut_check_libnetsnmp.m4 \ - $(top_srcdir)/m4/nut_check_libssl.m4 \ - $(top_srcdir)/m4/nut_check_libusb.m4 \ - $(top_srcdir)/m4/nut_report_feature.m4 \ - $(top_srcdir)/m4/nut_type_socklen_t.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CONFPATH = @CONFPATH@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@ -DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@ -DRIVER_MAN_LIST = @DRIVER_MAN_LIST@ -DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@ -HAL_FDI_PATH = @HAL_FDI_PATH@ -HAL_USER = @HAL_USER@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBGD_CFLAGS = @LIBGD_CFLAGS@ -LIBGD_LDFLAGS = @LIBGD_LDFLAGS@ -LIBHAL_CFLAGS = @LIBHAL_CFLAGS@ -LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@ -LIBNEON_CFLAGS = @LIBNEON_CFLAGS@ -LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@ -LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@ -LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSSL_CFLAGS = @LIBSSL_CFLAGS@ -LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@ -LIBTOOL = @LIBTOOL@ -LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ -LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@ -LINUX_HIDDEV = @LINUX_HIDDEV@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NETLIBS = @NETLIBS@ -NMEDIT = @NMEDIT@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -RUN_AS_GROUP = @RUN_AS_GROUP@ -RUN_AS_USER = @RUN_AS_USER@ -SED = @SED@ -SERLIBS = @SERLIBS@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STATEPATH = @STATEPATH@ -STRIP = @STRIP@ -SUN_LIBUSB = @SUN_LIBUSB@ -VERSION = @VERSION@ -WORDS_BIGENDIAN = @WORDS_BIGENDIAN@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -cgiexecdir = @cgiexecdir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -driverexecdir = @driverexecdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -hotplugdir = @hotplugdir@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -udevdir = @udevdir@ -EXTRA_DIST = changelog control copyright description.subst hotplug \ - nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \ - nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \ - nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \ - nut.init nut.links nut.postinst nut.postrm nut.preinst nut.prerm \ - nut.README.Debian nut.templates nut.TODO.Debian \ - rules watch po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \ - po/pt.po po/pt_BR.po po/templates.pot po/vi.po - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu packaging/debian/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu packaging/debian/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-exec-am: - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/obs/debian.nut-client.init b/obs/debian.nut-client.init.in similarity index 98% rename from obs/debian.nut-client.init rename to obs/debian.nut-client.init.in index 15a9f75f37..c582cdaac2 100644 --- a/obs/debian.nut-client.init +++ b/obs/debian.nut-client.init.in @@ -19,7 +19,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nut-client DESC="NUT - power device monitor and shutdown controller" CONFIG=/etc/nut/nut.conf -pid_dir=/var/run/nut +pid_dir=@runbasedir@/nut upsmon_pid=${pid_dir}/upsmon.pid upsmon=/sbin/upsmon log=">/dev/null 2>/dev/null" @@ -50,7 +50,7 @@ if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then exit 0 fi -# Check if /var/run/nut exists and has the correct perms +# Check if (/var)/run/nut exists and has the correct perms check_var_directory() { [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ && chown root:nut ${pid_dir} \ diff --git a/obs/debian.nut-common.postinst b/obs/debian.nut-common.postinst.in similarity index 86% rename from obs/debian.nut-common.postinst rename to obs/debian.nut-common.postinst.in index 0121d233c6..74c96a34da 100644 --- a/obs/debian.nut-common.postinst +++ b/obs/debian.nut-common.postinst.in @@ -33,17 +33,17 @@ case "$1" in chmod 755 /etc/nut/ fi - # make sure that /var/run/nut exists and has the correct ownerships + # make sure that (/var)/run/nut exists and has the correct ownerships # (note that on newer systems, after reboot, the /run/nut is created # by systemd using the tmpfiles configuration snippet) - if [ ! -d /var/run/nut ] ; then - mkdir -p /var/run/nut + if [ ! -d @runbasedir@/nut ] ; then + mkdir -p @runbasedir@/nut fi - if [ -d /var/run/nut ] ; then - chown root:nut /var/run/nut - chmod 770 /var/run/nut + if [ -d @runbasedir@/nut ] ; then + chown root:nut @runbasedir@/nut + chmod 770 @runbasedir@/nut if which restorecon >/dev/null 2>&1; then - restorecon /var/run/nut + restorecon @runbasedir@/nut fi fi diff --git a/obs/debian.nut-common.prerm b/obs/debian.nut-common.prerm.in similarity index 91% rename from obs/debian.nut-common.prerm rename to obs/debian.nut-common.prerm.in index 07b8cfbd92..f77183acd3 100644 --- a/obs/debian.nut-common.prerm +++ b/obs/debian.nut-common.prerm.in @@ -15,7 +15,7 @@ case "$1" in /bin/systemctl disable nut.target fi - [ -d /var/run/nut ] && rm -rf /var/run/nut/ + [ -d @runbasedir@/nut ] && rm -rf @runbasedir@/nut/ ;; upgrade) diff --git a/obs/debian.nut-common.tmpfiles b/obs/debian.nut-common.tmpfiles deleted file mode 100644 index bf195cf142..0000000000 --- a/obs/debian.nut-common.tmpfiles +++ /dev/null @@ -1 +0,0 @@ -d /run/nut 0770 root nut - - diff --git a/obs/debian.nut-common.tmpfiles.in b/obs/debian.nut-common.tmpfiles.in new file mode 100644 index 0000000000..09fce33876 --- /dev/null +++ b/obs/debian.nut-common.tmpfiles.in @@ -0,0 +1 @@ +d @runbasedir@/nut 0770 root nut - - diff --git a/obs/debian.nut-server.init b/obs/debian.nut-server.init.in similarity index 98% rename from obs/debian.nut-server.init rename to obs/debian.nut-server.init.in index c539bd5ebe..701b702e90 100644 --- a/obs/debian.nut-server.init +++ b/obs/debian.nut-server.init.in @@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nut-server DESC="NUT - power devices information server and drivers" CONFIG=/etc/nut/nut.conf -pid_dir=/var/run/nut +pid_dir=@runbasedir@/nut upsd_pid=${pid_dir}/upsd.pid upsd=/sbin/upsd upsdrvctl=/sbin/upsdrvctl @@ -48,7 +48,7 @@ if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then exit 0 fi -# Check if /var/run/nut exists and has the correct perms +# Check if (/var)/run/nut exists and has the correct perms check_var_directory() { [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ && chown root:nut ${pid_dir} \ diff --git a/obs/debian.nut-server.prerm b/obs/debian.nut-server.prerm.in similarity index 96% rename from obs/debian.nut-server.prerm rename to obs/debian.nut-server.prerm.in index ab4e6de0d3..cb87e3972d 100644 --- a/obs/debian.nut-server.prerm +++ b/obs/debian.nut-server.prerm.in @@ -37,7 +37,7 @@ case "$1" in fi invoke-rc.d nut stop && sleep 1 - [ -d /var/run/nut ] && rm -rf /var/run/nut/ + [ -d @runbasedir@/nut ] && rm -rf @runbasedir@/nut/ ;; upgrade) diff --git a/obs/debian.rules b/obs/debian.rules old mode 100644 new mode 100755 index f197a28637..080ea446f7 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -23,6 +23,9 @@ systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir syste systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd || echo /lib/systemd) systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) +# Newer systems have just /run (and yet newer systemd noisily suggests it) +runbasedir := $(shell test -d /run && echo /run || echo /var/run) + # FIXME: Find a smarter way to set those from main codebase recipes... # Something like `grep 'version-info' **/Makefile.am` ? SO_MAJOR_LIBUPSCLIENT=5 @@ -48,12 +51,12 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no \ --with-dev \ --disable-static \ - --with-statepath=/var/run/nut \ - --with-altpidpath=/var/run/nut \ + --with-statepath=$(runbasedir)/nut \ + --with-altpidpath=$(runbasedir)/nut \ --with-drvpath=/lib/nut \ --with-cgipath=/usr/lib/cgi-bin/nut \ --with-htmlpath=/usr/share/nut/www \ - --with-pidpath=/var/run/nut \ + --with-pidpath=$(runbasedir)/nut \ --datadir=/usr/share/nut \ --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ --with-user=nut --with-group=nut @@ -88,6 +91,13 @@ pre-build:: debian/compat configure # at the time this recipe was written. Maybe more proper make macros can be # used to rectify paths below and allow better manageable per-distro builds. common-install-arch:: + # prepare debian packaging files + mkdir -p $(CURDIR)/debian + for F in debian.nut-client.init debian.nut-common.postinst debian.nut-common.prerm debian.nut-server.init debian.nut-server.prerm debian.nut-common.tmpfiles ; do \ + echo " SED $F.in => $F" ; \ + sed 's,@runbasedir[@],$(runbasedir),g' < "$(CURDIR)/obs/$$F.in" > $(CURDIR)/debian/"$$F" || exit ; \ + done + # install the bash completion script mkdir -p $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/ cp $(CURDIR)/scripts/misc/nut.bash_completion \ From 6f4debd7121c0a2e8edd3789e33a975c5a6e5e4b Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 6 Dec 2019 23:45:49 +0100 Subject: [PATCH 067/207] debian.rules : fix away debian. prefix for *.in templates Signed-off-by: Jim Klimov --- obs/debian.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 080ea446f7..bd8b3b84bb 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -93,9 +93,9 @@ pre-build:: debian/compat configure common-install-arch:: # prepare debian packaging files mkdir -p $(CURDIR)/debian - for F in debian.nut-client.init debian.nut-common.postinst debian.nut-common.prerm debian.nut-server.init debian.nut-server.prerm debian.nut-common.tmpfiles ; do \ + for F in nut-client.init nut-common.postinst nut-common.prerm nut-server.init nut-server.prerm nut-common.tmpfiles ; do \ echo " SED $F.in => $F" ; \ - sed 's,@runbasedir[@],$(runbasedir),g' < "$(CURDIR)/obs/$$F.in" > $(CURDIR)/debian/"$$F" || exit ; \ + sed 's,@runbasedir[@],$(runbasedir),g' < "$(CURDIR)/obs/debian.$$F.in" > $(CURDIR)/debian/"$$F" || exit ; \ done # install the bash completion script From 36e14be93e0b0836b220cf87897edbf8f4951ac1 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 20 Jan 2021 10:27:04 +0100 Subject: [PATCH 068/207] FTY OBS packaging: require libsystemd-dev in the build root (to use pkgconfig systemd queries) Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- obs/nut.dsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index c3a3564535..fd630fac23 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, - dh-systemd (>= 1.14), + dh-systemd (>= 1.14), libsystemd-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libjpeg-dev, libsnmp-dev | libsnmp9-dev, diff --git a/obs/nut.dsc b/obs/nut.dsc index 7008dabf07..9a4f1e8fb3 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From e4b8f1e9209eeb719baaf23bdd2e99523f35772a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 21 Jan 2021 01:21:55 +0100 Subject: [PATCH 069/207] nut.dsc: clarify that any python 2/3 is okay, but we need an interpreter called "python" to be generic Signed-off-by: Jim Klimov --- obs/nut.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.dsc b/obs/nut.dsc index 9a4f1e8fb3..3ffcd87f28 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From 36f40d3b320f12ca77b370e89671dabfcce5aec0 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 21 Jan 2021 01:35:32 +0100 Subject: [PATCH 070/207] debian.control: clarify that any python 2/3 is okay, but we need an interpreter called "python" to be generic Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index fd630fac23..1c849f7811 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 8.1.3), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), - python (>= 2.6.6-3~), + python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, From f7e14fe5185403210624439365d56c9e6d45785a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 21 Jan 2021 02:03:33 +0100 Subject: [PATCH 071/207] debian.rules: clarify that any python 2/3 is okay, but we need an interpreter called "python" to be generic Signed-off-by: Jim Klimov --- obs/debian.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index bd8b3b84bb..d9fc14637c 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -178,7 +178,7 @@ common-install-indep:: mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc binary-install/nut-monitor:: - dh_python2 -pnut-monitor + dh_python2 -pnut-monitor || dh_python3 -pnut-monitor || dh_python -pnut-monitor DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server --restart-after-upgrade DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client --restart-after-upgrade From 0e2f25b156057f26d686d4d9b72ec0fed53c531a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 21 Jan 2021 02:26:40 +0100 Subject: [PATCH 072/207] debian.rules, nut.dsc: ask for dh_python2 | dh_python3 | dh_pypy Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- obs/nut.dsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index 1c849f7811..8d2832d5e7 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 8.1.3), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), - python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, + python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, dh_python2 | dh_python3 | dh_pypy, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, diff --git a/obs/nut.dsc b/obs/nut.dsc index 3ffcd87f28..9ac865f5a7 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh_python2 | dh_python3 | dh_pypy #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From 650f0d2814906a92f61b9cd88eb50a4a6b5f15f3 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 21 Jan 2021 02:30:00 +0100 Subject: [PATCH 073/207] debian.rules, nut.dsc: rather ask for dh-python | dh-python2 | dh-python3 | dh-pypy Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- obs/nut.dsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index 8d2832d5e7..f86080c4ea 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 8.1.3), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), - python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, dh_python2 | dh_python3 | dh_pypy, + python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, dh-python | dh-python2 | dh-python3 | dh-pypy, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, diff --git a/obs/nut.dsc b/obs/nut.dsc index 9ac865f5a7..44f629a491 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh_python2 | dh_python3 | dh_pypy +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh-python | dh-python2 | dh-python3 | dh-pypy #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From 464f128694e2b5018437239b198944083169368b Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 10 Feb 2021 22:48:41 +0100 Subject: [PATCH 074/207] obs packaging: avoid warnings from systemd-sysv about legacy init scripts without a service unit Signed-off-by: Jim Klimov --- obs/debian.nut-client.links | 1 + obs/debian.rules | 1 + 2 files changed, 2 insertions(+) diff --git a/obs/debian.nut-client.links b/obs/debian.nut-client.links index c8d27c5584..2248aa2b45 100644 --- a/obs/debian.nut-client.links +++ b/obs/debian.nut-client.links @@ -1 +1,2 @@ +# Legacy compat etc/init.d/nut-client etc/init.d/ups-monitor diff --git a/obs/debian.rules b/obs/debian.rules index d9fc14637c..97bf5f8028 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -151,6 +151,7 @@ common-install-arch:: # Add a symlink to mask the LSB initscript for nut-client: ln -s nut-monitor.service $(CURDIR)/debian/nut-client/$(systemdsystemunitdir)/nut-client.service + ln -s nut-monitor.service $(CURDIR)/debian/nut-client/$(systemdsystemunitdir)/ups-monitor.service # Install tmpfiles config file to create /run/nut directory install -m 644 -D $(CURDIR)/debian/nut-common.tmpfiles \ From 14afb55265fd9abb6a48d01f5c52fb6d414d5a80 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 4 May 2021 15:36:42 +0200 Subject: [PATCH 075/207] pkgsrc.obs: tell OBS pusher to append gitdate to version Signed-off-by: Jim Klimov --- obs/pkgsrc.obs | 1 + 1 file changed, 1 insertion(+) create mode 100644 obs/pkgsrc.obs diff --git a/obs/pkgsrc.obs b/obs/pkgsrc.obs new file mode 100644 index 0000000000..b920a89b53 --- /dev/null +++ b/obs/pkgsrc.obs @@ -0,0 +1 @@ +USE_GITCOMMIT_VERSION=yes From 2315e164abe1266dd6db47ed5d5e90155bdd9918 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 4 May 2021 15:44:01 +0200 Subject: [PATCH 076/207] pkgsrc.obs: tell OBS pusher to append gitdate to version (first line must be from a specific range of values) Signed-off-by: Jim Klimov --- obs/pkgsrc.obs | 1 + 1 file changed, 1 insertion(+) diff --git a/obs/pkgsrc.obs b/obs/pkgsrc.obs index b920a89b53..c332d140f8 100644 --- a/obs/pkgsrc.obs +++ b/obs/pkgsrc.obs @@ -1 +1,2 @@ +default USE_GITCOMMIT_VERSION=yes From 655ae4177ee298316d0d7c65c798c00dcf8ebc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 17 May 2021 15:12:06 +0000 Subject: [PATCH 077/207] Add new package for nut client stub Signed-off-by: Jim Klimov --- obs/debian.control | 28 +++++++++++++++++++ obs/debian.libnutclientstub-dev.install | 4 +++ obs/debian.libnutclientstub1.install | 1 + ...debian.libnutclientstub1.lintian-overrides | 1 + 4 files changed, 34 insertions(+) create mode 100644 obs/debian.libnutclientstub-dev.install create mode 100644 obs/debian.libnutclientstub1.install create mode 100644 obs/debian.libnutclientstub1.lintian-overrides diff --git a/obs/debian.control b/obs/debian.control index f86080c4ea..10334901f4 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -260,6 +260,21 @@ Description: network UPS tools - new client library . This package provides the new shared client library. +Package: libnutclientstub1 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: network UPS tools - new client library Stub + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the new shared client library Stub. + Package: libnutclient-dev Section: libdevel Architecture: any @@ -273,6 +288,19 @@ Description: network UPS tools - development files . This package provides the development files for the new client library. +Package: libnutclientstub-dev +Section: libdevel +Architecture: any +Depends: libnutclientstub1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: network UPS tools - development files for stub + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package provides the development files for the new client library stub. + Package: python-nut Section: python Architecture: all diff --git a/obs/debian.libnutclientstub-dev.install b/obs/debian.libnutclientstub-dev.install new file mode 100644 index 0000000000..2536e97649 --- /dev/null +++ b/obs/debian.libnutclientstub-dev.install @@ -0,0 +1,4 @@ +usr/lib/*/libnutclientstub.so +usr/lib/*/libnutclientstub.a +usr/lib/*/pkgconfig/libnutclientstub.pc +usr/include/nutclientmem.h diff --git a/obs/debian.libnutclientstub1.install b/obs/debian.libnutclientstub1.install new file mode 100644 index 0000000000..34df3f1b28 --- /dev/null +++ b/obs/debian.libnutclientstub1.install @@ -0,0 +1 @@ +lib/*/libnutclientstub.so.* diff --git a/obs/debian.libnutclientstub1.lintian-overrides b/obs/debian.libnutclientstub1.lintian-overrides new file mode 100644 index 0000000000..2479407fa6 --- /dev/null +++ b/obs/debian.libnutclientstub1.lintian-overrides @@ -0,0 +1 @@ +libnutclientstub1: no-symbols-control-file shlib-missing-in-symbols-control-file From cf219c0f1a5b3f2085ddc7472863dd46e7962292 Mon Sep 17 00:00:00 2001 From: "Clappier, Eric" Date: Tue, 18 May 2021 15:42:34 +0200 Subject: [PATCH 078/207] Fix issue in debian rules for libnutclientstub Signed-off-by: Jim Klimov --- obs/debian.rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/obs/debian.rules b/obs/debian.rules index 97bf5f8028..9d988f3d41 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -30,6 +30,7 @@ runbasedir := $(shell test -d /run && echo /run || echo /var/run) # Something like `grep 'version-info' **/Makefile.am` ? SO_MAJOR_LIBUPSCLIENT=5 SO_MAJOR_LIBNUTCLIENT=1 +SO_MAJOR_LIBNUTCLIENTSTUB=1 SO_MAJOR_LIBNUTSCAN=1 # List any files which are not installed @@ -130,6 +131,10 @@ common-install-arch:: test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so.$(SO_MAJOR_LIBNUTCLIENT) && \ ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutclient.so.$(SO_MAJOR_LIBNUTCLIENT) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutclient.so + rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutclientstub.so + test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutclientstub.so.$(SO_MAJOR_LIBNUTCLIENTSTUB) && \ + ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutclientstub.so.$(SO_MAJOR_LIBNUTCLIENTSTUB) \ + $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutclientstub.so rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.$(SO_MAJOR_LIBNUTSCAN) && \ ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.$(SO_MAJOR_LIBNUTSCAN) \ From 371ac8d83eeec712302d26f0736ce8510bc50ecd Mon Sep 17 00:00:00 2001 From: "Clappier, Eric" Date: Tue, 18 May 2021 16:48:08 +0200 Subject: [PATCH 079/207] Remove lib static for libnutclientstub dev install Signed-off-by: Jim Klimov --- obs/debian.libnutclientstub-dev.install | 1 - 1 file changed, 1 deletion(-) diff --git a/obs/debian.libnutclientstub-dev.install b/obs/debian.libnutclientstub-dev.install index 2536e97649..fc4abb12b1 100644 --- a/obs/debian.libnutclientstub-dev.install +++ b/obs/debian.libnutclientstub-dev.install @@ -1,4 +1,3 @@ usr/lib/*/libnutclientstub.so -usr/lib/*/libnutclientstub.a usr/lib/*/pkgconfig/libnutclientstub.pc usr/include/nutclientmem.h From 39c6dff37ce2a1eacc28563b5db2cc27e50d922f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 12 Aug 2021 12:40:45 +0200 Subject: [PATCH 080/207] Update debian.control Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index 10334901f4..430dfa617f 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, - dh-systemd (>= 1.14), libsystemd-dev, + libsystemd-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libjpeg-dev, libsnmp-dev | libsnmp9-dev, From d7058d6f69e2e5ec73d463eb7eb2fae6e2eb14ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 13 Aug 2021 06:04:00 +0200 Subject: [PATCH 081/207] Update nut.dsc Signed-off-by: Jim Klimov --- obs/nut.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.dsc b/obs/nut.dsc index 44f629a491..ccd5e4437c 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, dh-systemd (>= 1.14), libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh-python | dh-python2 | dh-python3 | dh-pypy +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh-python | dh-python2 | dh-python3 | dh-pypy #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From 0069d35d92489ba8abaa1562ad6fe59947dc7bc7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 9 Feb 2022 14:01:30 +0100 Subject: [PATCH 082/207] packaging/debian: update for nut-modbus and nut-linux-i2c driver packages Signed-off-by: Jim Klimov --- obs/debian.changelog | 6 ++++++ obs/debian.control | 31 +++++++++++++++++++++++++++++-- obs/debian.nut-server.install | 2 ++ obs/debian.nut-server.manpages | 2 ++ obs/nut-linux-i2c.install | 2 ++ obs/nut-linux-i2c.manpages | 2 ++ obs/nut-modbus.install | 3 +++ obs/nut-modbus.manpages | 3 +++ obs/nut.dsc | 8 +++++--- 9 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 obs/nut-linux-i2c.install create mode 100644 obs/nut-linux-i2c.manpages create mode 100644 obs/nut-modbus.install create mode 100644 obs/nut-modbus.manpages diff --git a/obs/debian.changelog b/obs/debian.changelog index e071d2e0e2..af5c586cb2 100644 --- a/obs/debian.changelog +++ b/obs/debian.changelog @@ -1,3 +1,9 @@ +nut (2.7.4-14) UNRELEASED; urgency=high + + * Ported packaging recipes over upstream NUT, commented away DMF + + -- Jim Klimov Wed, 9 Feb 2022 14:00:00 +0200 + nut (2.7.4-13) UNRELEASED; urgency=high * Base on daisychain+DMF branch from vyskocilm fork @ github diff --git a/obs/debian.control b/obs/debian.control index 430dfa617f..36405a20ff 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -19,6 +19,8 @@ Build-Depends: debhelper (>= 8.1.3), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, dh-python | dh-python2 | dh-python3 | dh-pypy, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], + libmodbus-dev (>= 3.1.6), + libi2c-dev (>= 4.0), libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, @@ -51,7 +53,7 @@ Description: network UPS tools - metapackage Package: nut-common Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) -Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml +Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-modbus, nut-linux-i2c, nut-xml Replaces: nut (<< 2.7.4-11~) Breaks: nut (<< 2.6.1-2~) Description: network UPS tools - core system @@ -66,7 +68,7 @@ Description: network UPS tools - core system Package: nut-server Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-common (= ${binary:Version}) -Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml +Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-modbus, nut-linux-i2c, nut-xml Conflicts: nut-hal-drivers Replaces: nut (<< 2.7.4-11~) Breaks: nut (<< 2.6.1-2~) @@ -145,6 +147,31 @@ Description: network UPS tools - IPMI driver popular brands, such as Dell, HP, IBM. It adds an IPMI interface to the core NUT system. +Package: nut-modbus +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}), libmodbus (>= 3.1.6) +Description: network UPS tools - Modbus drivers + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package currently provides several drivers that can monitor + modbus devices (phoenixcontact_modbus generic_modbus huawei-ups2000). + +Package: nut-linux-i2c +Architecture: linux-any +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}), libi2c0 (>= 4.0) +Description: network UPS tools - Linux I2C drivers + Network UPS Tools (NUT) is a client/server monitoring system that + allows computers to share uninterruptible power supply (UPS) and + power distribution unit (PDU) hardware. Clients access the hardware + through the server, and are notified whenever the power status + changes. + . + This package currently provides asem and pijuice drivers for I2C bus. + Package: nut-xml Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}) diff --git a/obs/debian.nut-server.install b/obs/debian.nut-server.install index d00e0bad2f..41c92b834b 100644 --- a/obs/debian.nut-server.install +++ b/obs/debian.nut-server.install @@ -58,3 +58,5 @@ debian/tmp/lib/nut/nutdrv_atcl_usb debian/tmp/lib/nut/nutdrv_qx debian/tmp/lib/nut/riello_ser debian/tmp/lib/nut/riello_usb +debian/tmp/lib/nut/microsol-apc +debian/tmp/lib/nut/nutdrv_siemens-sitop diff --git a/obs/debian.nut-server.manpages b/obs/debian.nut-server.manpages index d5cf07ed18..9f69f2c1d1 100644 --- a/obs/debian.nut-server.manpages +++ b/obs/debian.nut-server.manpages @@ -51,3 +51,5 @@ debian/tmp/usr/share/man/man8/nutdrv_atcl_usb.8 debian/tmp/usr/share/man/man8/nutdrv_qx.8 debian/tmp/usr/share/man/man8/riello_ser.8 debian/tmp/usr/share/man/man8/riello_usb.8 +debian/tmp/usr/share/man/man8/microsol-apc.8 +debian/tmp/usr/share/man/man8/nutdrv_siemens-sitop.8 diff --git a/obs/nut-linux-i2c.install b/obs/nut-linux-i2c.install new file mode 100644 index 0000000000..9122412c6f --- /dev/null +++ b/obs/nut-linux-i2c.install @@ -0,0 +1,2 @@ +debian/tmp/lib/nut/asem +debian/tmp/lib/nut/pijuice diff --git a/obs/nut-linux-i2c.manpages b/obs/nut-linux-i2c.manpages new file mode 100644 index 0000000000..9c85e7bb49 --- /dev/null +++ b/obs/nut-linux-i2c.manpages @@ -0,0 +1,2 @@ +debian/tmp/usr/share/man/man8/asem.8 +debian/tmp/usr/share/man/man8/pijuice.8 diff --git a/obs/nut-modbus.install b/obs/nut-modbus.install new file mode 100644 index 0000000000..957282d838 --- /dev/null +++ b/obs/nut-modbus.install @@ -0,0 +1,3 @@ +debian/tmp/lib/nut/phoenixcontact_modbus +debian/tmp/lib/nut/generic_modbus +debian/tmp/lib/nut/huawei-ups2000 \ No newline at end of file diff --git a/obs/nut-modbus.manpages b/obs/nut-modbus.manpages new file mode 100644 index 0000000000..447aac81dc --- /dev/null +++ b/obs/nut-modbus.manpages @@ -0,0 +1,3 @@ +debian/tmp/usr/share/man/man8/phoenixcontact_modbus.8 +debian/tmp/usr/share/man/man8/generic_modbus.8 +debian/tmp/usr/share/man/man8/huawei-ups2000.8 diff --git a/obs/nut.dsc b/obs/nut.dsc index ccd5e4437c..29b6c3ba3f 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -1,8 +1,8 @@ Format: 1.0 Source: nut -Binary: nut, nut-server, nut-client, nut-cgi, nut-snmp, nut-ipmi, nut-xml, nut-powerman-pdu, nut-doc, libupsclient4, libupsclient-dev, libnutclient1, libnutclient-dev, python-nut, nut-monitor, libups-nut-perl +Binary: nut, nut-server, nut-client, nut-cgi, nut-snmp, nut-ipmi, nut-modbus, nut-linux-i2c, nut-xml, nut-powerman-pdu, nut-doc, libupsclient4, libupsclient-dev, libnutclient1, libnutclient-dev, python-nut, nut-monitor, libups-nut-perl Architecture: any all -Version: 2.7.4-12 +Version: 2.7.4-14 Maintainer: Arnaud Quette Uploaders: Laurent Bigonville Homepage: http://www.networkupstools.org/ @@ -10,7 +10,7 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh-python | dh-python2 | dh-python3 | dh-pypy +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh-python | dh-python2 | dh-python3 | dh-pypy, libmodbus-dev, libi2c-dev #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original @@ -30,6 +30,8 @@ Package-List: nut-client deb admin optional arch=any nut-doc deb doc optional arch=all nut-ipmi deb admin optional arch=linux-any,kfreebsd-any + nut-linux-i2c deb admin optional arch=linux-any + nut-modbus deb admin optional arch=any nut-monitor deb admin optional arch=all nut-powerman-pdu deb admin extra arch=any nut-server deb admin optional arch=any From 21d916c11fc568582c022e6108726c841403e73b Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 10 Feb 2022 13:19:02 +0100 Subject: [PATCH 083/207] packaging/debian/control: update "libmodbus5" dependency name for Debian 11 Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index 36405a20ff..739dc9ac01 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -149,7 +149,7 @@ Description: network UPS tools - IPMI driver Package: nut-modbus Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}), libmodbus (>= 3.1.6) +Depends: ${shlibs:Depends}, ${misc:Depends}, nut-server (= ${binary:Version}), libmodbus5 (>= 3.1.6) Description: network UPS tools - Modbus drivers Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and From d99441e22de432e0e44094bc74e18f1602223cd7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 10 Feb 2022 20:34:41 +0100 Subject: [PATCH 084/207] packaging/debian/rules: report PKG_CONFIG_PATH default Signed-off-by: Jim Klimov --- obs/debian.rules | 1 + 1 file changed, 1 insertion(+) diff --git a/obs/debian.rules b/obs/debian.rules index 9d988f3d41..4eddab6022 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -83,6 +83,7 @@ DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man=dist-auto configure: configure.ac (cd tools; python nut-snmpinfo.py) sh autogen.sh + echo "PKG_CONFIG_PATH default:" ; pkg-config --variable pc_path pkg-config || true pre-build:: debian/compat configure From d376d207a47960e037dd9b6641246579c86675f3 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 10 Feb 2022 20:34:29 +0100 Subject: [PATCH 085/207] packaging/debian/rules: define a systemdtmpfilesdir Signed-off-by: Jim Klimov --- obs/debian.rules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index 4eddab6022..19b383dfca 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -22,6 +22,7 @@ DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir systemd || echo /lib/systemd/system) systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd || echo /lib/systemd) systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) +systemdtmpfilesdir := $(shell pkg-config --variable=systemdtmpfilesdir systemd || echo /usr/lib/tmpfiles.d) # Newer systems have just /run (and yet newer systemd noisily suggests it) runbasedir := $(shell test -d /run && echo /run || echo /var/run) @@ -68,6 +69,7 @@ ifeq (linux,$(DEB_HOST_ARCH_OS)) ### DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir=/lib/systemd/system DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir=$(systemdsystemunitdir) DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdshutdowndir=$(systemdshutdowndir) + DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdtmpfilesdir=$(systemdtmpfilesdir) endif # only build documentation if asciidoc is installed @@ -161,7 +163,7 @@ common-install-arch:: # Install tmpfiles config file to create /run/nut directory install -m 644 -D $(CURDIR)/debian/nut-common.tmpfiles \ - $(CURDIR)/debian/nut-common/usr/lib/tmpfiles.d/nut-common.conf + $(CURDIR)/debian/nut-common$(systemdtmpfilesdir)/nut-common.conf # Install gen-snmp-subdriver.sh for nut-snmp install -m 755 -D $(CURDIR)/scripts/subdriver/gen-snmp-subdriver.sh \ From 842ccc9222e418ef1a4117450257a1e0e5f224c1 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 30 Jul 2025 13:16:53 +0200 Subject: [PATCH 086/207] obs/README.adoc, obs/Makefile.am, Makefile.am, configure.ac: document the "obs" directory and cover it with scripting [#1209] Signed-off-by: Jim Klimov --- Makefile.am | 5 +- configure.ac | 1 + obs/Makefile.am | 122 ++++++++++++++++++++++++++++++++++++++++++++++++ obs/README.adoc | 23 +++++++++ 4 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 obs/Makefile.am create mode 100644 obs/README.adoc diff --git a/Makefile.am b/Makefile.am index 0646b54128..22b7ae93f0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,7 +41,7 @@ ACLOCAL_AMFLAGS = -I m4 # depend on stuff in "common" or tools being built first! Also "data" depends # (during "dist" time) on scripts in "tools". SUBDIRS = include common clients conf drivers tools data \ - lib scripts server tests docs/man docs + lib obs scripts server tests docs/man docs # Note: not generated from SUBDIRS, because not all are recursive: SUBDIRS_ALL_RECURSIVE = \ @@ -55,6 +55,7 @@ SUBDIRS_ALL_RECURSIVE = \ all/tools/nutconf \ all-recursive/tools \ all/lib \ + all/obs \ all-recursive/scripts \ all/server \ all/tests/NIT \ @@ -275,6 +276,7 @@ all-libs-local/tools/nut-scanner: all-libs-local/drivers all-libs-local/common a all/conf \ all/lib \ +all/obs \ .ChangeLog.adoc-parsed.latest/docs \ ChangeLog.adoc-parsed/docs \ all-recursive/data: @@ -643,6 +645,7 @@ SPELLCHECK_DIRS_MOST = \ spellcheck/conf \ spellcheck/data \ spellcheck/data/htmlcgi \ + spellcheck/obs \ spellcheck/scripts \ spellcheck/scripts/Solaris \ spellcheck/scripts/Windows \ diff --git a/configure.ac b/configure.ac index 96e1757c66..90fde4f7cd 100644 --- a/configure.ac +++ b/configure.ac @@ -6789,6 +6789,7 @@ AC_CONFIG_FILES([ lib/libnutclientstub.pc lib/libnutscan.pc lib/Makefile + obs/Makefile scripts/Aix/nut-aix.spec scripts/RedHat/ups scripts/augeas/Makefile diff --git a/obs/Makefile.am b/obs/Makefile.am new file mode 100644 index 0000000000..f278bce54f --- /dev/null +++ b/obs/Makefile.am @@ -0,0 +1,122 @@ +# Network UPS Tools: obs (root) + +EXTRA_DIST = README.adoc + +# Also EXTRA_DIST the recipe-related files (so OBS can use tarballs if they like) + +# Debian/Ubuntu recipes: +EXTRA_DIST += \ + control \ + debian.Makefile.am \ + debian.NEWS \ + debian.changelog \ + debian.compat \ + debian.control \ + debian.copyright \ + debian.description.subst \ + debian.gbp.conf \ + debian.hotplug \ + debian.libnutclient-dev.install \ + debian.libnutclient-dev.manpages \ + debian.libnutclient1.install \ + debian.libnutclient1.lintian-overrides \ + debian.libnutclientstub-dev.install \ + debian.libnutclientstub1.install \ + debian.libnutclientstub1.lintian-overrides \ + debian.libnutscan-dev.install \ + debian.libnutscan1.install \ + debian.libups-nut-perl.install \ + debian.libupsclient-dev.install \ + debian.libupsclient-dev.manpages \ + debian.libupsclient4.install \ + debian.nut-cgi.README.Debian \ + debian.nut-cgi.docs \ + debian.nut-cgi.install \ + debian.nut-cgi.manpages \ + debian.nut-cgi.postinst \ + debian.nut-cgi.postrm \ + debian.nut-client.init.in \ + debian.nut-client.install \ + debian.nut-client.links \ + debian.nut-client.lintian-overrides \ + debian.nut-client.maintscript \ + debian.nut-client.manpages \ + debian.nut-client.postinst \ + debian.nut-client.preinst \ + debian.nut-client.prerm \ + debian.nut-common.install \ + debian.nut-common.postinst.in \ + debian.nut-common.prerm.in \ + debian.nut-common.tmpfiles.in \ + debian.nut-doc.doc-base.nut-developer-guide \ + debian.nut-doc.doc-base.nut-faq \ + debian.nut-doc.doc-base.nut-packager-guide \ + debian.nut-doc.doc-base.nut-user-manual \ + debian.nut-doc.install \ + debian.nut-ipmi.install \ + debian.nut-ipmi.manpages \ + debian.nut-monitor.install \ + debian.nut-monitor.menu \ + debian.nut-monitor.xpm \ + debian.nut-powerman-pdu.install \ + debian.nut-powerman-pdu.manpages \ + debian.nut-server.dirs \ + debian.nut-server.init.in \ + debian.nut-server.install \ + debian.nut-server.manpages \ + debian.nut-server.postinst \ + debian.nut-server.postrm \ + debian.nut-server.preinst \ + debian.nut-server.prerm.in \ + debian.nut-snmp.docs \ + debian.nut-snmp.install \ + debian.nut-snmp.manpages \ + debian.nut-xml.install \ + debian.nut-xml.manpages \ + debian.nut.README.Debian \ + debian.nut.TODO.Debian \ + debian.nut.docs \ + debian.python-nut.install \ + debian.rules \ + debian.series \ + debian.watch \ + nut-linux-i2c.install \ + nut-linux-i2c.manpages \ + nut-modbus.install \ + nut-modbus.manpages \ + nut.changes \ + nut.dsc + +# RedHAT/Fedora/CentOS/... recipes: +EXTRA_DIST += \ + nut.spec + +# PKGSRC recipes: +EXTRA_DIST += \ + pkgsrc.obs + +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install-sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) $(AM_MAKEFLAGS) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) $(AM_MAKEFLAGS) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) $(AM_MAKEFLAGS) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) $(AM_MAKEFLAGS) -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked + +MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/obs/README.adoc b/obs/README.adoc new file mode 100644 index 0000000000..defe15c093 --- /dev/null +++ b/obs/README.adoc @@ -0,0 +1,23 @@ += Packaging recipes for OBS + +This directory holds reference NUT packaging recipes for RPM, DEB and +other formats, and is primarily aimed at automation of builds with the +link:https://openbuildservice.org/[Open Build Service (OBS)]. Note that +beside the on-line service, the software is open-source and any project +may install and run their own; back-end scripts may be added to support +more operating systems (even not necessarily Linux). + +NOTE: The layout of files and directories here is dictated by current +expectations of the OBS software (if at some point it has to be a flat +mess with no structure -- so be it). + +The recipe files themselves would likely cross-pollinate with popular +distributions, to allow easier replacement of standard, supported and +stale package builds with those of experimental development iterations. + +This should be in part facilitated by the NUT Semantic Versioning scheme (see +linkdoc:developer-guide[NUT Semantic Versioning,versioning,docs/nut-versioning.adoc]) +which adds version number components to expose the "age" of each such +iteration as a number of commits merged into the common development trunk +since a preceding release, and a number of commits unique to a feature +branch. From 7bd15d755739c2e6c2d138b7e4dc2c39b34a8b33 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 30 Jul 2025 18:01:52 +0200 Subject: [PATCH 087/207] docs/qa-guide.adoc: mention OBS [#1209] Signed-off-by: Jim Klimov --- docs/qa-guide.adoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/qa-guide.adoc b/docs/qa-guide.adoc index 22a657c2a0..43f4494d7f 100644 --- a/docs/qa-guide.adoc +++ b/docs/qa-guide.adoc @@ -520,6 +520,21 @@ gcc and clang, C standards, and requiring to pass builds at least in a mode without warnings (and checking the other cases where any warnings are made fatal). +Open Build Service (OBS) +~~~~~~~~~~~~~~~~~~~~~~~~ +[[NUT_CI_OBS]] + +The SuSE-backed software suite and on-line instance of the Open Build +Service (OBS) allows building packages for a wide range of Linux (and +potentially non-Linux) operating system distributions. + +This can be seen as an additional CI test for multi-platform portability, +but mainly allows NUT users to get recent development builds as "proper" +packages. + +* https://build.opensuse.org/ +* https://openbuildservice.org/ + Continuous Integration (NUT CI farm) build agent preparation ------------------------------------------------------------ [[NUTCI_farm_agents]] From 9221eeefd75729d04e12aa93a104a5b3aff0964c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 14:22:49 +0200 Subject: [PATCH 088/207] obs/nut.spec: expand python requirements Signed-off-by: Jim Klimov --- obs/nut.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index ab28be0f30..50798088ea 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -3,6 +3,7 @@ # # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2016-2018 Eaton EEIC. +# Copyright (c) 2025 by Jim Klimov # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -68,7 +69,8 @@ BuildRequires: libtool-ltdl-devel BuildRequires: libusb-devel BuildRequires: net-snmp-devel BuildRequires: pkg-config -BuildRequires: python +# Maybe older Pythons are also okay, but were not tested for ages +BuildRequires: (python >= 2.6 or python3 or python2) # LUA 5.1 or 5.2 is known ok for us, both are modern in current distros (201609xx) BuildRequires: lua-devel # TODO: Make sure how this is named to use in CentOS/RHEL (may be not in core but EPEL repos) From dca299ed425453e690811c23681268e3f8b21aef Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 15:00:58 +0200 Subject: [PATCH 089/207] obs/nut.spec: update heading metadata Signed-off-by: Jim Klimov --- obs/nut.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 50798088ea..1071d98e7d 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -39,12 +39,13 @@ %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) Name: nut -Version: 2.7.4 -Release: 12 +# NOTE: OBS should rewrite this: +Version: 2.8.4 +Release: 1 Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring) License: GPL-2.0+ Group: Hardware/UPS -Url: http://www.networkupstools.org/ +Url: https://www.networkupstools.org/ Source0: %{name}-%{version}.tar.gz Requires: %{_bindir}/fgrep From 4740120bcaf36290b57fa6b5e9bf83c9dfb804de Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 15:01:10 +0200 Subject: [PATCH 090/207] obs/nut.spec: accept either libusb-0.1 or 1.0 Signed-off-by: Jim Klimov --- obs/nut.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 1071d98e7d..4eb18258b0 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -67,7 +67,8 @@ BuildRequires: gcc-c++ BuildRequires: gd-devel BuildRequires: libtool BuildRequires: libtool-ltdl-devel -BuildRequires: libusb-devel +# libusb-0.1 or libusb-1.0: +BuildRequires: (libusb-devel or libusbx-devel) BuildRequires: net-snmp-devel BuildRequires: pkg-config # Maybe older Pythons are also okay, but were not tested for ages From 5041dcb3760a3867c8b27093d3582e231258a698 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 15:06:53 +0200 Subject: [PATCH 091/207] obs/nut.spec: accept either httpd-devel or apache2-devel Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 4eb18258b0..63f7388a1b 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -101,7 +101,7 @@ BuildRequires: asciidoc %if 0%{?centos_version} BuildRequires: cppunit-devel BuildRequires: dbus-glib-devel -BuildRequires: httpd-devel +BuildRequires: (httpd-devel or apache2-devel) BuildRequires: neon-devel BuildRequires: openssl-devel BuildRequires: tcp_wrappers-devel From c9bf30b4d4e7d913daf8d32ce6d508baf30bee49 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 15:11:09 +0200 Subject: [PATCH 092/207] obs/nut.spec: make DMF builds and deliveries optional (currently off by default) Signed-off-by: Jim Klimov --- obs/nut.spec | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 63f7388a1b..5e4dbe1cd8 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -37,6 +37,7 @@ %define systemdsystemunitdir %(pkg-config --variable=systemdsystemunitdir systemd) %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) +%define NUTPKG_WITH_DMF 0 Name: nut # NOTE: OBS should rewrite this: @@ -75,12 +76,15 @@ BuildRequires: pkg-config BuildRequires: (python >= 2.6 or python3 or python2) # LUA 5.1 or 5.2 is known ok for us, both are modern in current distros (201609xx) BuildRequires: lua-devel + +%if 0%{?NUTPKG_WITH_DMF} # TODO: Make sure how this is named to use in CentOS/RHEL (may be not in core but EPEL repos) # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original # C files, so we don't require regeneration for packaging. Also the # Jenkins NUT-master job should have verified this. #BuildRequires: python-pycparser +%endif %if 0%{?suse_version} BuildRequires: apache2-devel @@ -214,7 +218,6 @@ sh autogen.sh --with-usb\ --with-snmp\ --with-neon\ - --with-snmp_dmf_lua\ --with-dev\ --with-ipmi \ --with-powerman=auto\ @@ -229,7 +232,10 @@ sh autogen.sh --enable-option-checking=fatal\ --with-systemdsystemunitdir --with-systemdshutdowndir \ --with-augeas-lenses-dir=/usr/share/augeas/lenses/dist \ +%if 0%{?NUTPKG_WITH_DMF} + --with-snmp_dmf_lua\ --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no +%endif (cd tools; python nut-snmpinfo.py) @@ -350,9 +356,11 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %defattr(-,root,root) %{MODELPATH}/snmp-ups %{MODELPATH}/netxml-ups -%{_bindir}/nut-scanner-reindex-dmfsnmp %{_mandir}/man8/netxml-ups*.* %{_mandir}/man8/snmp-ups*.* +%{_sbindir}/gen-snmp-subdriver.sh +%if 0%{?NUTPKG_WITH_DMF} +%{_bindir}/nut-scanner-reindex-dmfsnmp %dir %{_datadir}/nut/dmfnutscan %dir %{_datadir}/nut/dmfsnmp %{_datadir}/nut/dmfnutscan/*.dmf @@ -363,7 +371,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %dir %{_datadir}/nut/dmfsnmp.d %{_datadir}/nut/dmfnutscan.d/*.dmf %{_datadir}/nut/dmfsnmp.d/*.dmf -%{_sbindir}/gen-snmp-subdriver.sh +%endif %files -n libupsclient1 %defattr(-,root,root) From 11d1b5d662bf7e80107d50ad19cad9aaf0939663 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 15:48:41 +0200 Subject: [PATCH 093/207] obs/nut.spec: make IPMI, AVAHI and POWERMAN builds optional (if package seems available to be installed) Signed-off-by: Jim Klimov --- obs/nut.spec | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 5e4dbe1cd8..af985175fd 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -37,8 +37,14 @@ %define systemdsystemunitdir %(pkg-config --variable=systemdsystemunitdir systemd) %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) + %define NUTPKG_WITH_DMF 0 +# Not all distros have it +%define NUTPKG_WITH_FREEIPMI %( (yum search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; dnf search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; zypper search -s freeipmi-devel | grep -E '(lib)?freeipmi-devel' && exit ; urpmq --sources freeipmi-devel && exit ; pkcon search name freeipmi-devel | grep -E '(Available|Installed).*freeipmi-devel' && exit;) >&2 && echo 1 || echo 0) +%define NUTPKG_WITH_POWERMAN %( (yum search powerman-devel | grep -E '^(lib)?powerman-devel\.' && exit ; dnf search powerman-devel | grep -E '^(lib)?powerman-devel\.' && exit ; zypper search -s powerman-devel | grep -E '(lib)?powerman-devel' && exit ; urpmq --sources powerman-devel && exit ; pkcon search name powerman-devel | grep -E '(Available|Installed).*powerman-devel' && exit;) >&2 && echo 1 || echo 0) +%define NUTPKG_WITH_AVAHI %( (yum search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; dnf search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; zypper search -s avahi-devel | grep -E '(lib)?avahi-devel' && exit ; urpmq --sources avahi-devel && exit ; pkcon search name avahi-devel | grep -E '(Available|Installed).*avahi-devel' && exit;) >&2 && echo 1 || echo 0) + Name: nut # NOTE: OBS should rewrite this: Version: 2.8.4 @@ -60,10 +66,17 @@ Requires(post): udev %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: avahi-devel # To fix end-of-line encoding: BuildRequires: dos2unix -BuildRequires: freeipmi-devel + +%if 0${?NUTPKG_WITH_AVAHI} +BuildRequires: avahi-devel +%endif + +%if 0${?NUTPKG_WITH_FREEIPMI} +BuildRequires: (libfreeipmi-devel or freeipmi-devel) +%endif + BuildRequires: gcc-c++ BuildRequires: gd-devel BuildRequires: libtool @@ -86,6 +99,10 @@ BuildRequires: lua-devel #BuildRequires: python-pycparser %endif +%if 0${?NUTPKG_WITH_POWERMAN} +BuildRequires: powerman-devel +%endif + %if 0%{?suse_version} BuildRequires: apache2-devel BuildRequires: dbus-1-glib-devel @@ -93,7 +110,6 @@ BuildRequires: libcppunit-devel BuildRequires: libneon-devel BuildRequires: libopenssl-devel BuildRequires: systemd-rpm-macros -BuildRequires: powerman-devel BuildRequires: tcpd-devel # TODO: For doc build: move out of opensuse ###BuildRequires: asciidoc @@ -219,7 +235,7 @@ sh autogen.sh --with-snmp\ --with-neon\ --with-dev\ - --with-ipmi \ + --with-ipmi=auto\ --with-powerman=auto\ --with-doc=man=dist-auto\ --with-htmlpath=%{HTMLPATH}\ From 6bf36379d57d97f3b13c0b6baeb19ab629da05a2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 15:49:12 +0200 Subject: [PATCH 094/207] obs/nut.spec: refactor BuildRequires to avoid catering to distro-specific macro names Signed-off-by: Jim Klimov --- obs/nut.spec | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index af985175fd..3b7bb2a45d 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -99,43 +99,37 @@ BuildRequires: lua-devel #BuildRequires: python-pycparser %endif +# Variant names in different distros +# For some may have to fiddle with +# %if 0%{?centos_version} +# %if 0%{?suse_version} +# %if 0%{?rhel_version}>=7 +# and whatnot + +BuildRequires: (httpd-devel or apache2-devel) +BuildRequires: (libcppunit-devel or cppunit-devel) +BuildRequires: (dbus-1-glib-devel or dbus-glib-devel) +BuildRequires: (tcpd-devel or tcp_wrappers-devel) + +# May be plain "neon" and "libusb" in RHEL7 or older? +BuildRequires: (libneon-devel or neon-devel) +BuildRequires: (libopenssl-devel or openssl-devel) + %if 0${?NUTPKG_WITH_POWERMAN} BuildRequires: powerman-devel %endif %if 0%{?suse_version} -BuildRequires: apache2-devel -BuildRequires: dbus-1-glib-devel -BuildRequires: libcppunit-devel -BuildRequires: libneon-devel -BuildRequires: libopenssl-devel BuildRequires: systemd-rpm-macros -BuildRequires: tcpd-devel -# TODO: For doc build: move out of opensuse -###BuildRequires: asciidoc BuildRequires: dblatex -BuildRequires: libxslt-tools %endif -BuildRequires: asciidoc -%if 0%{?centos_version} -BuildRequires: cppunit-devel -BuildRequires: dbus-glib-devel -BuildRequires: (httpd-devel or apache2-devel) -BuildRequires: neon-devel -BuildRequires: openssl-devel -BuildRequires: tcp_wrappers-devel -BuildRequires: libxslt -%endif +BuildRequires: (libxslt-tools or libxslt) +BuildRequires: asciidoc %if 0%{?rhel_version}>=7 -BuildRequires: dbus-glib-devel -BuildRequires: httpd-devel BuildRequires: libusb BuildRequires: neon -BuildRequires: openssl-devel -BuildRequires: tcp_wrappers-devel -BuildRequires: libxslt %endif %if %{defined opensuse_version} From fca2efc822901c94cf4837167f862348ce095480 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 15:57:10 +0200 Subject: [PATCH 095/207] obs/nut.spec: make TCP_WRAPPERS builds optional (if package seems available to be installed - was obsoleted in many distros) Signed-off-by: Jim Klimov --- obs/nut.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 3b7bb2a45d..1f25cf7712 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -44,6 +44,7 @@ %define NUTPKG_WITH_FREEIPMI %( (yum search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; dnf search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; zypper search -s freeipmi-devel | grep -E '(lib)?freeipmi-devel' && exit ; urpmq --sources freeipmi-devel && exit ; pkcon search name freeipmi-devel | grep -E '(Available|Installed).*freeipmi-devel' && exit;) >&2 && echo 1 || echo 0) %define NUTPKG_WITH_POWERMAN %( (yum search powerman-devel | grep -E '^(lib)?powerman-devel\.' && exit ; dnf search powerman-devel | grep -E '^(lib)?powerman-devel\.' && exit ; zypper search -s powerman-devel | grep -E '(lib)?powerman-devel' && exit ; urpmq --sources powerman-devel && exit ; pkcon search name powerman-devel | grep -E '(Available|Installed).*powerman-devel' && exit;) >&2 && echo 1 || echo 0) %define NUTPKG_WITH_AVAHI %( (yum search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; dnf search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; zypper search -s avahi-devel | grep -E '(lib)?avahi-devel' && exit ; urpmq --sources avahi-devel && exit ; pkcon search name avahi-devel | grep -E '(Available|Installed).*avahi-devel' && exit;) >&2 && echo 1 || echo 0) +%define NUTPKG_WITH_TCPWRAP %( (yum search tcp_wrappers-devel | grep -E '^(lib)?tcp_wrappers-devel\.' && exit ; dnf search tcp_wrappers-devel | grep -E '^(lib)?tcp_wrappers-devel\.' && exit ; zypper search -s tcp_wrappers-devel | grep -E '(lib)?tcp_wrappers-devel' && exit ; urpmq --sources tcp_wrappers-devel && exit ; pkcon search name tcp_wrappers-devel | grep -E '(Available|Installed).*tcp_wrappers-devel' && exit;) >&2 && echo 1 || echo 0) Name: nut # NOTE: OBS should rewrite this: @@ -109,7 +110,10 @@ BuildRequires: lua-devel BuildRequires: (httpd-devel or apache2-devel) BuildRequires: (libcppunit-devel or cppunit-devel) BuildRequires: (dbus-1-glib-devel or dbus-glib-devel) + +%if 0${?NUTPKG_WITH_TCPWRAP} BuildRequires: (tcpd-devel or tcp_wrappers-devel) +%endif # May be plain "neon" and "libusb" in RHEL7 or older? BuildRequires: (libneon-devel or neon-devel) From 406eb55438da9bfca2d27552ef04137897d0482c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:02:21 +0200 Subject: [PATCH 096/207] obs/nut.spec: fix typos; make cppunit-devel optional (not in RHEL7) Signed-off-by: Jim Klimov --- obs/nut.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 1f25cf7712..3fb1edcf07 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -70,11 +70,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build # To fix end-of-line encoding: BuildRequires: dos2unix -%if 0${?NUTPKG_WITH_AVAHI} +%if 0%{?NUTPKG_WITH_AVAHI} BuildRequires: avahi-devel %endif -%if 0${?NUTPKG_WITH_FREEIPMI} +%if 0%{?NUTPKG_WITH_FREEIPMI} BuildRequires: (libfreeipmi-devel or freeipmi-devel) %endif @@ -108,10 +108,13 @@ BuildRequires: lua-devel # and whatnot BuildRequires: (httpd-devel or apache2-devel) -BuildRequires: (libcppunit-devel or cppunit-devel) BuildRequires: (dbus-1-glib-devel or dbus-glib-devel) -%if 0${?NUTPKG_WITH_TCPWRAP} +%if 0%{?rhel_version}>=8 || ! 0%{?rhel_version} +BuildRequires: (libcppunit-devel or cppunit-devel) +%endif + +%if 0%{?NUTPKG_WITH_TCPWRAP} BuildRequires: (tcpd-devel or tcp_wrappers-devel) %endif @@ -119,7 +122,7 @@ BuildRequires: (tcpd-devel or tcp_wrappers-devel) BuildRequires: (libneon-devel or neon-devel) BuildRequires: (libopenssl-devel or openssl-devel) -%if 0${?NUTPKG_WITH_POWERMAN} +%if 0%{?NUTPKG_WITH_POWERMAN} BuildRequires: powerman-devel %endif From 522a0666c9f71af31e76c32ddac1cd5664de763e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:06:01 +0200 Subject: [PATCH 097/207] obs/nut.spec: LUA only needed for DMF builds Signed-off-by: Jim Klimov --- obs/nut.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 3fb1edcf07..8e528169a0 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -88,10 +88,11 @@ BuildRequires: net-snmp-devel BuildRequires: pkg-config # Maybe older Pythons are also okay, but were not tested for ages BuildRequires: (python >= 2.6 or python3 or python2) + +%if 0%{?NUTPKG_WITH_DMF} # LUA 5.1 or 5.2 is known ok for us, both are modern in current distros (201609xx) BuildRequires: lua-devel -%if 0%{?NUTPKG_WITH_DMF} # TODO: Make sure how this is named to use in CentOS/RHEL (may be not in core but EPEL repos) # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From f3c2c7e9fb9296b65a58c8d020b619cdbc90a404 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:06:26 +0200 Subject: [PATCH 098/207] obs/nut.spec: revise neon dependency Signed-off-by: Jim Klimov --- obs/nut.spec | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 8e528169a0..1b2ad7d771 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -120,8 +120,8 @@ BuildRequires: (tcpd-devel or tcp_wrappers-devel) %endif # May be plain "neon" and "libusb" in RHEL7 or older? -BuildRequires: (libneon-devel or neon-devel) -BuildRequires: (libopenssl-devel or openssl-devel) +BuildRequires: (libneon-devel or neon-devel or neon) +BuildRequires: (libopenssl-devel or openssl-devel or openssl) %if 0%{?NUTPKG_WITH_POWERMAN} BuildRequires: powerman-devel @@ -135,11 +135,6 @@ BuildRequires: dblatex BuildRequires: (libxslt-tools or libxslt) BuildRequires: asciidoc -%if 0%{?rhel_version}>=7 -BuildRequires: libusb -BuildRequires: neon -%endif - %if %{defined opensuse_version} # Package provides driver for USB HID UPSes, but people can live with hal addon: Enhances: %{USBHIDDRIVERS} From e3aed3a575b1912ff521d4d0ae75e958b6d02729 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:06:39 +0200 Subject: [PATCH 099/207] obs/nut.spec: do not call "python" directly Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 1b2ad7d771..5160a43d2c 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -250,7 +250,7 @@ sh autogen.sh --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no %endif -(cd tools; python nut-snmpinfo.py) +### via Make now ### (cd tools; python nut-snmpinfo.py) make %{?_smp_mflags} PORT=$(sed -n 's/#define PORT //p' config.log) From c4d5942febed49d14c20a0cdb8c55e2674d36f65 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:31:05 +0200 Subject: [PATCH 100/207] obs/nut.spec: explicitly "Prefer" something when OBS sees we "have choice for (X or Y)" Signed-off-by: Jim Klimov --- obs/nut.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 5160a43d2c..fc76b17b39 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -84,6 +84,7 @@ BuildRequires: libtool BuildRequires: libtool-ltdl-devel # libusb-0.1 or libusb-1.0: BuildRequires: (libusb-devel or libusbx-devel) +#!Prefer: libusbx-devel BuildRequires: net-snmp-devel BuildRequires: pkg-config # Maybe older Pythons are also okay, but were not tested for ages @@ -121,7 +122,9 @@ BuildRequires: (tcpd-devel or tcp_wrappers-devel) # May be plain "neon" and "libusb" in RHEL7 or older? BuildRequires: (libneon-devel or neon-devel or neon) +#!Prefer: (libneon-devel or neon-devel) BuildRequires: (libopenssl-devel or openssl-devel or openssl) +#!Prefer: (libopenssl-devel or openssl-devel) %if 0%{?NUTPKG_WITH_POWERMAN} BuildRequires: powerman-devel From 7c75d84837bc95199d72bb30e5f320fc797abef1 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:46:05 +0200 Subject: [PATCH 101/207] obs/nut.spec: hide dblatex Signed-off-by: Jim Klimov --- obs/nut.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index fc76b17b39..487fdfd3fe 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -132,7 +132,8 @@ BuildRequires: powerman-devel %if 0%{?suse_version} BuildRequires: systemd-rpm-macros -BuildRequires: dblatex +# Only needed for PDF generation, we do not package that now +#BuildRequires: dblatex %endif BuildRequires: (libxslt-tools or libxslt) From d0548186eb1cfb8517bbee8aca9be5c4d23df3fb Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:49:14 +0200 Subject: [PATCH 102/207] obs/nut.spec: reword comment Signed-off-by: Jim Klimov --- obs/nut.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 487fdfd3fe..6fc5c5dc99 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -103,10 +103,10 @@ BuildRequires: lua-devel %endif # Variant names in different distros -# For some may have to fiddle with -# %if 0%{?centos_version} -# %if 0%{?suse_version} -# %if 0%{?rhel_version}>=7 +# For some platforms we may have to fiddle with distro-named macros like +# % if 0 % {?centos_version} +# % if 0 % {?suse_version} +# % if 0 % {?rhel_version}>=7 # and whatnot BuildRequires: (httpd-devel or apache2-devel) From eb5b344830993223eecc64dfe53f2f8ff63833dc Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:49:45 +0200 Subject: [PATCH 103/207] obs/nut.spec: exclude DMF artifacts from main pkg only if NUTPKG_WITH_DMF in the first place Signed-off-by: Jim Klimov --- obs/nut.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 6fc5c5dc99..4b98443ecc 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -322,12 +322,16 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %{_sysconfdir}/bash_completion.d/* %{_sysconfdir}/logrotate.d/* %{_bindir}/* +%if 0%{?NUTPKG_WITH_DMF} %exclude %{_bindir}/nut-scanner-reindex-dmfsnmp +%endif %{_datadir}/nut +%if 0%{?NUTPKG_WITH_DMF} %exclude %{_datadir}/nut/dmfnutscan %exclude %{_datadir}/nut/dmfsnmp %exclude %{_datadir}/nut/dmfnutscan.d %exclude %{_datadir}/nut/dmfsnmp.d +%endif %{_mandir}/man5/*.* %{_mandir}/man8/*.* %exclude %{_mandir}/man8/netxml-ups*.* From 7cc236b34f1675434b54ec8881e3c4d3c157d3d1 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:52:13 +0200 Subject: [PATCH 104/207] obs/nut.spec: many docs files were renamed to *.adoc Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 4b98443ecc..9708b02e6a 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -317,7 +317,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %files %defattr(-,root,root) -%doc AUTHORS COPYING ChangeLog MAINTAINERS NEWS README UPGRADING docs/*.txt docs/cables +%doc AUTHORS COPYING LICENSE-DCO LICENSE-GPL2 LICENSE-GPL3 ChangeLog MAINTAINERS NEWS.adoc README.adoc UPGRADING.adoc docs/*.adoc docs/*.txt docs/cables /bin/* %{_sysconfdir}/bash_completion.d/* %{_sysconfdir}/logrotate.d/* From 42ea364f29e03dde502acd627f469d4b724bda19 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:55:28 +0200 Subject: [PATCH 105/207] obs/debian.changelog, obs/nut.dsc: bump formal versioning Signed-off-by: Jim Klimov --- obs/debian.changelog | 6 ++++++ obs/nut.dsc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/obs/debian.changelog b/obs/debian.changelog index af5c586cb2..092c093c21 100644 --- a/obs/debian.changelog +++ b/obs/debian.changelog @@ -1,3 +1,9 @@ +nut (2.8.4-1) UNRELEASED; urgency=high + + * Revising recipes for OBS builds + + -- Jim Klimov Sun, 5 Oct 2025 14:00:00 +0200 + nut (2.7.4-14) UNRELEASED; urgency=high * Ported packaging recipes over upstream NUT, commented away DMF diff --git a/obs/nut.dsc b/obs/nut.dsc index 29b6c3ba3f..8410468f24 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -2,7 +2,7 @@ Format: 1.0 Source: nut Binary: nut, nut-server, nut-client, nut-cgi, nut-snmp, nut-ipmi, nut-modbus, nut-linux-i2c, nut-xml, nut-powerman-pdu, nut-doc, libupsclient4, libupsclient-dev, libnutclient1, libnutclient-dev, python-nut, nut-monitor, libups-nut-perl Architecture: any all -Version: 2.7.4-14 +Version: 2.8.4-1 Maintainer: Arnaud Quette Uploaders: Laurent Bigonville Homepage: http://www.networkupstools.org/ From 56e343e637e5f293194e5c3b4efe0ccb57a6f4c6 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:56:33 +0200 Subject: [PATCH 106/207] obs/debian.rules: do not run python directly anymore Signed-off-by: Jim Klimov --- obs/debian.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index 19b383dfca..84e0a20b89 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -83,7 +83,7 @@ endif DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man=dist-auto configure: configure.ac - (cd tools; python nut-snmpinfo.py) + ###Part of normal build now### (cd tools; python nut-snmpinfo.py) sh autogen.sh echo "PKG_CONFIG_PATH default:" ; pkg-config --variable pc_path pkg-config || true From 5584e0ad7575ceed41e5635f77ba041f4b9787ec Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 16:58:54 +0200 Subject: [PATCH 107/207] obs/debian.control: support several libusb implementations Signed-off-by: Jim Klimov --- obs/debian.control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.control b/obs/debian.control index 739dc9ac01..3c94286e09 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 8.1.3), libjpeg-dev, libsnmp-dev | libsnmp9-dev, libssl1.0-dev | libssl-dev, - libusb-dev (>= 0.1.8), + libusb-1.0-dev | libusb-0.1-dev | libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), From e7fae7e096816d1ae1f54c33452a2c1506850c8f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 17:12:23 +0200 Subject: [PATCH 108/207] obs/nut.spec: deliver files that are built and installed but were not listed Signed-off-by: Jim Klimov --- obs/nut.spec | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 9708b02e6a..554635f4e0 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -35,6 +35,8 @@ %define USBHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | fgrep -a -A1 USBHID-UPS | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') %define USBNONHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | fgrep -a -A1 _USB | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') %define systemdsystemunitdir %(pkg-config --variable=systemdsystemunitdir systemd) +%define systemdsystempresetdir %(pkg-config --variable=systemdsystempresetdir systemd || pkg-config --variable=systemdsystempresetdir libsystemd) +%define systemdtmpfilesdir %(pkg-config --variable=systemdtmpfilesdir systemd || pkg-config --variable=systemdtmpfilesdir libsystemd) %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) @@ -200,6 +202,22 @@ interface for monitoring and administering UPS hardware. Detailed information about supported hardware can be found in %{_docdir}/nut. +%package gui +Summary: Network UPS Tools Web Server Support (GUI client) +Group: Hardware/UPS +Requires: %{name} = %{version} +BuildRequires: (python >= 2.6 or python3 or python2) + +%description gui +Graphical user interface client for the Network UPS Tools, +written in Python. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + %package devel Summary: Network UPS Tools (Uninterruptible Power Supply Monitoring) Group: Development/Libraries/C and C++ @@ -333,6 +351,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %exclude %{_datadir}/nut/dmfsnmp.d %endif %{_mandir}/man5/*.* +%{_mandir}/man7/*.* %{_mandir}/man8/*.* %exclude %{_mandir}/man8/netxml-ups*.* %exclude %{_mandir}/man8/snmp-ups*.* @@ -357,6 +376,8 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %exclude %{_sbindir}/gen-snmp-subdriver.sh %attr(700,%{USER},%{GROUP}) %{STATEPATH} %{systemdsystemunitdir}/* +%{systemdsystempresetdir}/* +%{systemdtmpfilesdir}/* %{systemdshutdowndir}/nutshutdown %{_datadir}/augeas/lenses/dist/nuthostsconf.aug %{_datadir}/augeas/lenses/dist/nutnutconf.aug @@ -405,11 +426,18 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %config(noreplace) %{CONFPATH}/upsstats-single.html %config(noreplace) %{CONFPATH}/upsstats.html +%files gui +%defattr(-,root,root) +# TODO: NUT-Monitor where available +# TODO: Detect path from chosen interpreter or NUT build config files? +/usr/lib/python*/*-packages/* + %files devel %defattr(-,root,root) %{_includedir}/*.h %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/*.* +%{_libexecdir}/sockdebug %changelog From 5ebb08890fb592a1fb35d320d80ffadc748df798 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 17:21:51 +0200 Subject: [PATCH 109/207] obs/nut.spec: rename "GROUP" which tends to pull in package type string Signed-off-by: Jim Klimov --- obs/nut.spec | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 554635f4e0..4c5523e59e 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -25,8 +25,8 @@ %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups ### Note: this is /etc/nut in Debian version -%define USER upsd -%define GROUP daemon +%define NUT_USER upsd +%define NUT_GROUP daemon %define LBRACE ( %define RBRACE ) %define QUOTE " @@ -261,8 +261,8 @@ sh autogen.sh --with-cgipath=%{CGIPATH}\ --with-statepath=%{STATEPATH}\ --with-drvpath=%{MODELPATH}\ - --with-user=%{USER}\ - --with-group=%{GROUP} \ + --with-user=%{NUT_USER}\ + --with-group=%{NUT_GROUP} \ --with-udev-dir=%{_sysconfdir}/udev \ --enable-option-checking=fatal\ --with-systemdsystemunitdir --with-systemdshutdowndir \ @@ -301,17 +301,17 @@ install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{_sysconfdir}/bash_ install -m0755 scripts/subdriver/gen-snmp-subdriver.sh %{buildroot}%{_sbindir}/ %pre -usr/sbin/useradd -r -g %{GROUP} -s /bin/false \ - -c "UPS daemon" -d /sbin %{USER} 2>/dev/null || : +usr/sbin/useradd -r -g %{NUT_GROUP} -s /bin/false \ + -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null || : %if %{defined opensuse_version} %service_add_pre nut-driver@.service nut-server.service nut-monitor.service nut-driver.target nut.target %endif %post # Be sure that all files are owned by a dedicated user. -bin/chown -R %{USER}:%{GROUP} %{STATEPATH} +bin/chown -R %{NUT_USER}:%{NUT_GROUP} %{STATEPATH} # Be sure that all files are owned by a dedicated user. -bin/chown %{USER}:root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users +bin/chown %{NUT_USER}:root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users # And finally trigger udev to set permissions according to newly installed rules files. /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device @@ -361,9 +361,9 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %dir %{_sysconfdir}/udev/rules.d %config(noreplace) %{_sysconfdir}/udev/rules.d/*.rules %config(noreplace) %{CONFPATH}/hosts.conf -%config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsd.conf -%config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsd.users -%config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsmon.conf +%config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsd.conf +%config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsd.users +%config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsmon.conf %dir %{CONFPATH} %config(noreplace) %{CONFPATH}/nut.conf %config(noreplace) %{CONFPATH}/ups.conf @@ -374,7 +374,7 @@ bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.use %exclude %{MODELPATH}/snmp-ups %exclude %{MODELPATH}/netxml-ups %exclude %{_sbindir}/gen-snmp-subdriver.sh -%attr(700,%{USER},%{GROUP}) %{STATEPATH} +%attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH} %{systemdsystemunitdir}/* %{systemdsystempresetdir}/* %{systemdtmpfilesdir}/* From d59d6f1e0b2a2eddb616bc50f13e2c45b8da2551 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 17:23:17 +0200 Subject: [PATCH 110/207] obs/nut.spec: only run udevadm where available Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 4c5523e59e..aac653e5cc 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -314,7 +314,7 @@ bin/chown -R %{NUT_USER}:%{NUT_GROUP} %{STATEPATH} bin/chown %{NUT_USER}:root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users # And finally trigger udev to set permissions according to newly installed rules files. -/sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device +if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device ; fi %if %{defined opensuse_version} %service_add_post nut-driver@.service nut-server.service nut-monitor.service nut-driver-enumerator.service nut-driver.target nut.target %endif From 96c81647b9d0f72331ec17a8620a92964ed2db3c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 17:31:48 +0200 Subject: [PATCH 111/207] obs/debian.nut.docs: update file name lists Signed-off-by: Jim Klimov --- obs/debian.nut.docs | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/obs/debian.nut.docs b/obs/debian.nut.docs index d0026f76e3..e16c35721b 100644 --- a/obs/debian.nut.docs +++ b/obs/debian.nut.docs @@ -1,18 +1,46 @@ AUTHORS MAINTAINERS -README -UPGRADING +README.adoc +NEWS.adoc +UPGRADING.adoc +docs/FAQ.txt docs/acknowledgements.txt +docs/asciidoc.txt +docs/cables.txt +docs/ci-farm-do-setup.adoc +docs/ci-farm-lxc-setup.txt docs/config-notes.txt +docs/config-prereqs.txt +docs/configure.txt +docs/contact-closure.txt +docs/daisychain.txt +docs/design.txt +docs/developer-guide.txt +docs/developers.txt docs/documentation.txt docs/download.txt -docs/FAQ.txt docs/features.txt +docs/hid-subdrivers.txt docs/history.txt +docs/macros.txt +docs/maintainer-guide.txt +docs/net-protocol.txt +docs/new-clients.txt +docs/new-drivers.txt docs/nut-names.txt +docs/nut-qa.txt +docs/nut-versioning.adoc +docs/nutdrv_qx-subdrivers.txt docs/outlets.txt docs/packager-guide.txt +docs/qa-guide.adoc +docs/release-notes.txt docs/scheduling.txt docs/security.txt +docs/sms-brazil-protocol.txt +docs/snmp-subdrivers.txt +docs/snmp.txt +docs/sock-protocol.txt +docs/solaris-usb.txt docs/support.txt docs/user-manual.txt From 4a3f701ff1cb530dab0e5d49a05f49280b6bcc77 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 17:36:47 +0200 Subject: [PATCH 112/207] obs/nut.spec: avoid "chown USER:GROUP" syntax Signed-off-by: Jim Klimov --- obs/nut.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index aac653e5cc..71153cb4f6 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -309,9 +309,12 @@ usr/sbin/useradd -r -g %{NUT_GROUP} -s /bin/false \ %post # Be sure that all files are owned by a dedicated user. -bin/chown -R %{NUT_USER}:%{NUT_GROUP} %{STATEPATH} +# Some systems struggle with "chown USER:GROUP" so we separate them here: +bin/chown -R %{NUT_USER} %{STATEPATH} +bin/chgrp -R %{NUT_GROUP} %{STATEPATH} # Be sure that all files are owned by a dedicated user. -bin/chown %{NUT_USER}:root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users +bin/chown %{NUT_USER} %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users +bin/chgrp root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users # And finally trigger udev to set permissions according to newly installed rules files. if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device ; fi From be4f5fd9ea98bfc3057db2cecde61eeafd34eda5 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 17:38:48 +0200 Subject: [PATCH 113/207] obs/debian.nut-monitor.install: GUI glade files have moved Signed-off-by: Jim Klimov --- obs/debian.nut-monitor.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.nut-monitor.install b/obs/debian.nut-monitor.install index f92d0850ee..8c2975fd06 100644 --- a/obs/debian.nut-monitor.install +++ b/obs/debian.nut-monitor.install @@ -1,6 +1,6 @@ scripts/python/app/NUT-Monitor usr/bin/ scripts/python/app/nut-monitor.desktop usr/share/applications/ -scripts/python/app/gui-*.glade usr/share/nut-monitor/ +scripts/python/app/ui/gui-*.glade usr/share/nut-monitor/ scripts/python/app/locale/ usr/share/ scripts/python/app/icons/48x48/nut-monitor.png usr/share/pixmaps/ scripts/python/app/pixmaps usr/share/nut-monitor/ From 64cf028a08479e666791931aa774b123b166da3d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 7 Oct 2025 17:39:36 +0200 Subject: [PATCH 114/207] obs/nut.spec: fix sub-package name for NUT-Monitor (GUI) Signed-off-by: Jim Klimov --- obs/nut.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 71153cb4f6..92eee2d4dc 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -202,13 +202,13 @@ interface for monitoring and administering UPS hardware. Detailed information about supported hardware can be found in %{_docdir}/nut. -%package gui +%package monitor Summary: Network UPS Tools Web Server Support (GUI client) Group: Hardware/UPS Requires: %{name} = %{version} BuildRequires: (python >= 2.6 or python3 or python2) -%description gui +%description monitor Graphical user interface client for the Network UPS Tools, written in Python. @@ -429,7 +429,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %config(noreplace) %{CONFPATH}/upsstats-single.html %config(noreplace) %{CONFPATH}/upsstats.html -%files gui +%files monitor %defattr(-,root,root) # TODO: NUT-Monitor where available # TODO: Detect path from chosen interpreter or NUT build config files? From ea3633cba145e9dc587e3a142fc118d07f99a02f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 13:45:24 +0200 Subject: [PATCH 115/207] obs/nut.spec: only use apache_serverroot if we can detect it; otherwise dump NUT CGI artifacts under our _libexecdir and _datadir Signed-off-by: Jim Klimov --- obs/nut.spec | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 92eee2d4dc..e66068a5e8 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -17,10 +17,18 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - +# Requires httpd(-devel?) or apache2(-devel?) to be present in this distro: %define apache_serverroot %(%{_sbindir}/apxs2 -q datadir 2>/dev/null || %{_sbindir}/apxs -q PREFIX) -%define CGIPATH %{apache_serverroot}/cgi-bin -%define HTMLPATH %{apache_serverroot}/htdocs +%if 0%{?apache_serverroot:1} +# Rename web pages location to not conflict with apache2-example-pages +# or user home page: +%define CGIPATH %{apache_serverroot}/cgi-bin/nut +%define HTMLPATH %{apache_serverroot}/htdocs/nut +%else +%define CGIPATH %{_libexecdir}/ups/cgi-bin +%define HTMLPATH %{_datadir}/nut/htdocs +%endif + %define MODELPATH %{_libexecdir}/ups/driver %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups @@ -291,10 +299,6 @@ mkdir -p %{buildroot}%{STATEPATH} rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample mkdir -p %{buildroot}/bin mv %{buildroot}%{_bindir}/upssched-cmd %{buildroot}/bin/upssched-cmd -# Rename web pages to not conflict with apache2-example-pages or user home page: -mkdir -p %{buildroot}%{HTMLPATH}/nut %{buildroot}%{CGIPATH}/nut -mv %{buildroot}%{HTMLPATH}/*.{html,png} %{buildroot}%{HTMLPATH}/nut/ -mv %{buildroot}%{CGIPATH}/*.cgi %{buildroot}%{CGIPATH}/nut find %{buildroot} -type f -name "*.la" -delete -print mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/ @@ -424,8 +428,8 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %files cgi %defattr(-,root,root) -%{CGIPATH}/nut -%{HTMLPATH}/nut +%{CGIPATH} +%{HTMLPATH} %config(noreplace) %{CONFPATH}/upsstats-single.html %config(noreplace) %{CONFPATH}/upsstats.html From ce3f487cdcb5fde60540f78a3a857ba9c0dd0e7f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 13:46:28 +0200 Subject: [PATCH 116/207] obs/nut.spec: actually detect ability to build NUTPKG_WITH_DMF (sources available or not in this branch) Signed-off-by: Jim Klimov --- obs/nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index e66068a5e8..1e76bbec0d 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -42,13 +42,16 @@ # Collect all devices listed in ups-nut-device.fdi: %define USBHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | fgrep -a -A1 USBHID-UPS | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') %define USBNONHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | fgrep -a -A1 _USB | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') + +# Collect systemd related paths so we can package files there: %define systemdsystemunitdir %(pkg-config --variable=systemdsystemunitdir systemd) %define systemdsystempresetdir %(pkg-config --variable=systemdsystempresetdir systemd || pkg-config --variable=systemdsystempresetdir libsystemd) %define systemdtmpfilesdir %(pkg-config --variable=systemdtmpfilesdir systemd || pkg-config --variable=systemdtmpfilesdir libsystemd) %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) -%define NUTPKG_WITH_DMF 0 +# Does this NUT branch have DMF feature code? +%define NUTPKG_WITH_DMF %( test -d scripts/DMF && echo 1 || echo 0 ) # Not all distros have it %define NUTPKG_WITH_FREEIPMI %( (yum search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; dnf search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; zypper search -s freeipmi-devel | grep -E '(lib)?freeipmi-devel' && exit ; urpmq --sources freeipmi-devel && exit ; pkcon search name freeipmi-devel | grep -E '(Available|Installed).*freeipmi-devel' && exit;) >&2 && echo 1 || echo 0) From e754ded634a4ca1518ec60ee0043cdc03fa0c97e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 13:49:03 +0200 Subject: [PATCH 117/207] obs/nut.spec: update comments Signed-off-by: Jim Klimov --- obs/nut.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 1e76bbec0d..5480a7c9c3 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -129,11 +129,14 @@ BuildRequires: (dbus-1-glib-devel or dbus-glib-devel) BuildRequires: (libcppunit-devel or cppunit-devel) %endif +# Obsoleted/away in newer distros %if 0%{?NUTPKG_WITH_TCPWRAP} BuildRequires: (tcpd-devel or tcp_wrappers-devel) %endif # May be plain "neon" and "libusb" in RHEL7 or older? +# OBS: This may need `osc meta prjconf` to `Prefer:` one +# certain variant in case several hits happen on a builder: BuildRequires: (libneon-devel or neon-devel or neon) #!Prefer: (libneon-devel or neon-devel) BuildRequires: (libopenssl-devel or openssl-devel or openssl) From 8fd10a4ec23ff80178b53da73d5aa0b9489e9a18 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 13:54:04 +0200 Subject: [PATCH 118/207] obs/nut.spec: post: neuter faults of chown/chgrp/chmod (some rpmbuilds fail self-check due to lack of accounts) Signed-off-by: Jim Klimov --- obs/nut.spec | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 5480a7c9c3..64b5484dd2 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -319,13 +319,16 @@ usr/sbin/useradd -r -g %{NUT_GROUP} -s /bin/false \ %post # Be sure that all files are owned by a dedicated user. -# Some systems struggle with "chown USER:GROUP" so we separate them here: -bin/chown -R %{NUT_USER} %{STATEPATH} -bin/chgrp -R %{NUT_GROUP} %{STATEPATH} +# Some systems do not have the users or groups during rpmbuild +# pre/port tests, so we neuter faults with a warning echo. +# Some systems struggle with "chown USER:GROUP" so we separate +# them into two commands here: +bin/chown -R %{NUT_USER} %{STATEPATH} || echo "WARNING: Could not secure state path '%{STATEPATH}'" >&2 +bin/chgrp -R %{NUT_GROUP} %{STATEPATH} || echo "WARNING: Could not secure state path '%{STATEPATH}'" >&2 # Be sure that all files are owned by a dedicated user. -bin/chown %{NUT_USER} %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users -bin/chgrp root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users -bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users +bin/chown %{NUT_USER} %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users || echo "WARNING: Could not secure config files in path '%{CONFPATH}'" >&2 +bin/chgrp root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users || echo "WARNING: Could not secure config files in path '%{CONFPATH}'" >&2 +bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users || echo "WARNING: Could not secure config files in path '%{CONFPATH}'" >&2 # And finally trigger udev to set permissions according to newly installed rules files. if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device ; fi %if %{defined opensuse_version} From 28363625dce23f76a18eff531935878565f756d5 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 14:18:06 +0200 Subject: [PATCH 119/207] obs/nut.spec: exclude in root package whatever we put into sub-packages (rpmbuild seems to duplicate this) Signed-off-by: Jim Klimov --- obs/nut.spec | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 64b5484dd2..65a46261b6 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -409,6 +409,25 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %dir %{_datadir}/augeas/lenses/dist %dir %{_datadir}/augeas/lenses/dist/tests %{_libexecdir}/nut-driver-enumerator.sh +# Exclude whatever other packages bring, some rpmbuild versions seem to dump +# everything into the base package and then complain about duplicates/conflicts: +### libupsclient1 +%exclude %{_libdir}/*.so.* +### nut-cgi +%exclude %{CGIPATH} +%exclude %{HTMLPATH} +%exclude %{CONFPATH}/*.html +### nut-monitor +# TODO: Actually package NUT-Monitor app and scripts where available +# TODO: Detect path from chosen interpreter or NUT build config files? +%exclude /usr/lib/python*/*-packages/* +### nut-devel +%exclude %{_includedir}/*.h +%exclude %{_libdir}/*.so +%exclude %{_libdir}/pkgconfig/*.pc +%exclude %{_mandir}/man3/*.* +%exclude %{_libexecdir}/sockdebug + %files drivers-net %defattr(-,root,root) @@ -432,6 +451,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %endif %files -n libupsclient1 +# TODO: Separate or rename for other nut-libs (nut-scanner, nutconf C++)? %defattr(-,root,root) %{_libdir}/*.so.* @@ -444,7 +464,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %files monitor %defattr(-,root,root) -# TODO: NUT-Monitor where available +# TODO: Actually package NUT-Monitor app and scripts where available # TODO: Detect path from chosen interpreter or NUT build config files? /usr/lib/python*/*-packages/* From 0920996a14076c8c82e5d7e18811fa7f1709e34c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 14:18:29 +0200 Subject: [PATCH 120/207] obs/nut.spec: try another way of checking that apache_serverroot is defined and not empty Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 65a46261b6..7d343bd4ca 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -19,7 +19,7 @@ # Requires httpd(-devel?) or apache2(-devel?) to be present in this distro: %define apache_serverroot %(%{_sbindir}/apxs2 -q datadir 2>/dev/null || %{_sbindir}/apxs -q PREFIX) -%if 0%{?apache_serverroot:1} +%if %{?apache_serverroot} # Rename web pages location to not conflict with apache2-example-pages # or user home page: %define CGIPATH %{apache_serverroot}/cgi-bin/nut From f08798177089e9d3562795f511eb40f6ee7602d4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 14:24:05 +0200 Subject: [PATCH 121/207] obs/debian.rules: fix a shell/make typo Signed-off-by: Jim Klimov --- obs/debian.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index 84e0a20b89..9d1a581c1c 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -98,7 +98,7 @@ common-install-arch:: # prepare debian packaging files mkdir -p $(CURDIR)/debian for F in nut-client.init nut-common.postinst nut-common.prerm nut-server.init nut-server.prerm nut-common.tmpfiles ; do \ - echo " SED $F.in => $F" ; \ + echo " SED $$F.in => $$F" ; \ sed 's,@runbasedir[@],$(runbasedir),g' < "$(CURDIR)/obs/debian.$$F.in" > $(CURDIR)/debian/"$$F" || exit ; \ done From 6b70c5486f72630c125e041c1cd568b41f26dad4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 14:24:27 +0200 Subject: [PATCH 122/207] obs/debian.rules: binary-install/nut-monitor: use dh_python* more clearly Signed-off-by: Jim Klimov --- obs/debian.rules | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index 9d1a581c1c..6383590446 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -187,7 +187,14 @@ common-install-indep:: mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc binary-install/nut-monitor:: - dh_python2 -pnut-monitor || dh_python3 -pnut-monitor || dh_python -pnut-monitor + if (command -v dh_python2) ; then \ + dh_python2 -pnut-monitor ; \ + else if (command -v dh_python3) ; then \ + dh_python3 -pnut-monitor ; \ + else if (command -v dh_python) ; then \ + dh_python -pnut-monitor ; \ + else echo "$@: no implementation of dh_python was found!" >&2 ; exit 1 ; \ + fi; fi; fi DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server --restart-after-upgrade DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client --restart-after-upgrade From c85197ea516f0ae2c420bc32dc102e4020fc0675 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 14:50:05 +0200 Subject: [PATCH 123/207] obs/nut.spec: comment about %(cmd) definitions Signed-off-by: Jim Klimov --- obs/nut.spec | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 7d343bd4ca..2f9eadcdf3 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -17,16 +17,25 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +# NOTE: Evaluations in percent-round-parentheses below happen in the +# build area already populated with packages according to "Required:" +# lines. We can test for OS feature availability here if needed (e.g. +# to decide if we deliver a sub-package with certain dependencies), +# but can not decide that we can/must install something and then we +# would have the needed OS capability. + # Requires httpd(-devel?) or apache2(-devel?) to be present in this distro: -%define apache_serverroot %(%{_sbindir}/apxs2 -q datadir 2>/dev/null || %{_sbindir}/apxs -q PREFIX) -%if %{?apache_serverroot} +%define apache_serverroot %(%{_sbindir}/apxs2 -q datadir || %{_sbindir}/apxs -q PREFIX || true) +%if 0%{?apache_serverroot} == 0 +# Dump nut-cgi artifacts under our own locations, so end-users can +# integrate them later. +%define CGIPATH %{_libexecdir}/ups/cgi-bin +%define HTMLPATH %{_datadir}/nut/htdocs +%else # Rename web pages location to not conflict with apache2-example-pages # or user home page: %define CGIPATH %{apache_serverroot}/cgi-bin/nut %define HTMLPATH %{apache_serverroot}/htdocs/nut -%else -%define CGIPATH %{_libexecdir}/ups/cgi-bin -%define HTMLPATH %{_datadir}/nut/htdocs %endif %define MODELPATH %{_libexecdir}/ups/driver @@ -54,6 +63,9 @@ %define NUTPKG_WITH_DMF %( test -d scripts/DMF && echo 1 || echo 0 ) # Not all distros have it +# FIXME: No use searching remote repos; can use rpm queries based on whatever +# did get installed according to Requires lines below, to decide whether we +# deliver certain sub-packages though. %define NUTPKG_WITH_FREEIPMI %( (yum search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; dnf search freeipmi-devel | grep -E '^(lib)?freeipmi-devel\.' && exit ; zypper search -s freeipmi-devel | grep -E '(lib)?freeipmi-devel' && exit ; urpmq --sources freeipmi-devel && exit ; pkcon search name freeipmi-devel | grep -E '(Available|Installed).*freeipmi-devel' && exit;) >&2 && echo 1 || echo 0) %define NUTPKG_WITH_POWERMAN %( (yum search powerman-devel | grep -E '^(lib)?powerman-devel\.' && exit ; dnf search powerman-devel | grep -E '^(lib)?powerman-devel\.' && exit ; zypper search -s powerman-devel | grep -E '(lib)?powerman-devel' && exit ; urpmq --sources powerman-devel && exit ; pkcon search name powerman-devel | grep -E '(Available|Installed).*powerman-devel' && exit;) >&2 && echo 1 || echo 0) %define NUTPKG_WITH_AVAHI %( (yum search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; dnf search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; zypper search -s avahi-devel | grep -E '(lib)?avahi-devel' && exit ; urpmq --sources avahi-devel && exit ; pkcon search name avahi-devel | grep -E '(Available|Installed).*avahi-devel' && exit;) >&2 && echo 1 || echo 0) From 59e4634595d1a4d94efb2d34b1626867545f5321 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 14:56:46 +0200 Subject: [PATCH 124/207] obs/debian.rules: bump SO_MAJOR_LIB* vars and add libnutconf installation Signed-off-by: Jim Klimov --- obs/debian.rules | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 6383590446..51a3db430c 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -28,11 +28,12 @@ systemdtmpfilesdir := $(shell pkg-config --variable=systemdtmpfilesdir systemd | runbasedir := $(shell test -d /run && echo /run || echo /var/run) # FIXME: Find a smarter way to set those from main codebase recipes... -# Something like `grep 'version-info' **/Makefile.am` ? -SO_MAJOR_LIBUPSCLIENT=5 -SO_MAJOR_LIBNUTCLIENT=1 +# Something like `git grep 'version-info' '*.am'` ? +SO_MAJOR_LIBUPSCLIENT=7 +SO_MAJOR_LIBNUTCLIENT=2 SO_MAJOR_LIBNUTCLIENTSTUB=1 -SO_MAJOR_LIBNUTSCAN=1 +SO_MAJOR_LIBNUTSCAN=4 +SO_MAJOR_LIBNUTCONF=0 # List any files which are not installed include /usr/share/cdbs/1/rules/utils.mk @@ -51,7 +52,7 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-serial --with-usb --with-snmp --with-neon --with-ipmi \ --with-snmp_dmf_lua=yes \ --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no \ - --with-dev \ + --with-dev --with-dev-libnutconf \ --disable-static \ --with-statepath=$(runbasedir)/nut \ --with-altpidpath=$(runbasedir)/nut \ @@ -142,6 +143,10 @@ common-install-arch:: test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.$(SO_MAJOR_LIBNUTSCAN) && \ ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutscan.so.$(SO_MAJOR_LIBNUTSCAN) \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutscan.so + rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutconf.so + test -s $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libnutconf.so.$(SO_MAJOR_LIBNUTCONF) && \ + ln -s /lib/$(DEB_HOST_MULTIARCH)/libnutconf.so.$(SO_MAJOR_LIBNUTCONF) \ + $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnutconf.so # Install systemd files only on systems where it's supported ### Package files for nut-client: From 6f1a4b5406964d71a13e51fbe413a28039b19978 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 15:05:28 +0200 Subject: [PATCH 125/207] obs/nut.spec: try another way of checking that apache_serverroot is defined and not empty Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 2f9eadcdf3..01cbcdeac1 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -26,7 +26,7 @@ # Requires httpd(-devel?) or apache2(-devel?) to be present in this distro: %define apache_serverroot %(%{_sbindir}/apxs2 -q datadir || %{_sbindir}/apxs -q PREFIX || true) -%if 0%{?apache_serverroot} == 0 +%if "0%{?apache_serverroot}" == "0" # Dump nut-cgi artifacts under our own locations, so end-users can # integrate them later. %define CGIPATH %{_libexecdir}/ups/cgi-bin From ff1a824a2e2b099b2304a4e392f16f35d5ae9950 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 17:23:58 +0200 Subject: [PATCH 126/207] obs/nut.spec: require basic tooling used in rpmlint checks Signed-off-by: Jim Klimov --- obs/nut.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 01cbcdeac1..65428b04f0 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -81,6 +81,13 @@ Group: Hardware/UPS Url: https://www.networkupstools.org/ Source0: %{name}-%{version}.tar.gz +Requires: %{_bindir}/bash +Requires: %{_bindir}/sh +Requires: %{_sbindir}/sh +Requires: %{_bindir}/chown +Requires: %{_bindir}/chgrp +Requires: %{_bindir}/chmod +Requires: %{_bindir}/rm Requires: %{_bindir}/fgrep Requires: %{_bindir}/grep Requires: %{_bindir}/pgrep From c44bbca2f22c002d35f967f94c073167ec800091 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 17:48:29 +0200 Subject: [PATCH 127/207] obs/README.adoc, docs/nut.dict: update info about OBS recipes [#1209] Signed-off-by: Jim Klimov --- docs/nut.dict | 1 + obs/README.adoc | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/nut.dict b/docs/nut.dict index dcc4f726da..c2e59d1df1 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -2764,6 +2764,7 @@ optimizations optiups oq os +osc ostream other's otheruser diff --git a/obs/README.adoc b/obs/README.adoc index defe15c093..fdf8d8259f 100644 --- a/obs/README.adoc +++ b/obs/README.adoc @@ -2,15 +2,22 @@ This directory holds reference NUT packaging recipes for RPM, DEB and other formats, and is primarily aimed at automation of builds with the -link:https://openbuildservice.org/[Open Build Service (OBS)]. Note that -beside the on-line service, the software is open-source and any project -may install and run their own; back-end scripts may be added to support -more operating systems (even not necessarily Linux). +link:https://openbuildservice.org/[Open Build Service (OBS)]. + +Note that beside the on-line service, the software is open-source and +any project may install and run their own server instance. The `osc build` +command can also be used on a workstation to iterate recipe nuances for +different distributions. In theory, back-end scripts may be added to +support more operating systems over time (even not necessarily Linux). NOTE: The layout of files and directories here is dictated by current expectations of the OBS software (if at some point it has to be a flat mess with no structure -- so be it). +For some practical details see: + +* https://github.com/networkupstools/nut/issues/1209 + The recipe files themselves would likely cross-pollinate with popular distributions, to allow easier replacement of standard, supported and stale package builds with those of experimental development iterations. From b77d47ba2378600e43e42537f162d500ab8be5f3 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 17:58:17 +0200 Subject: [PATCH 128/207] obs/debian.nut-cgi.docs: README renamed to *.adoc Signed-off-by: Jim Klimov --- obs/debian.nut-cgi.docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.nut-cgi.docs b/obs/debian.nut-cgi.docs index 80796c9b00..0caede9ebc 100644 --- a/obs/debian.nut-cgi.docs +++ b/obs/debian.nut-cgi.docs @@ -1 +1 @@ -data/html/README +data/html/README.adoc From 00174b88843c8cc74afcba1bc324ce85acbee883 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 18:10:55 +0200 Subject: [PATCH 129/207] obs/debian.rules: make NUTPKG_WITH_DMF optional (based on the branch we build) Signed-off-by: Jim Klimov --- obs/debian.rules | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 51a3db430c..bb0c3f8a12 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -24,6 +24,9 @@ systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd || systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) systemdtmpfilesdir := $(shell pkg-config --variable=systemdtmpfilesdir systemd || echo /usr/lib/tmpfiles.d) +# Does this NUT branch have DMF feature code? +NUTPKG_WITH_DMF := $(test -d scripts/DMF && echo 1 || echo 0) + # Newer systems have just /run (and yet newer systemd noisily suggests it) runbasedir := $(shell test -d /run && echo /run || echo /var/run) @@ -50,8 +53,6 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-ssl --with-openssl --with-libltdl=yes \ --with-cgi=auto --with-powerman=auto \ --with-serial --with-usb --with-snmp --with-neon --with-ipmi \ - --with-snmp_dmf_lua=yes \ - --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no \ --with-dev --with-dev-libnutconf \ --disable-static \ --with-statepath=$(runbasedir)/nut \ @@ -64,6 +65,12 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ --with-user=nut --with-group=nut +ifeq (1,$(NUTPKG_WITH_DMF)) +DEB_CONFIGURE_EXTRA_FLAGS += \ + --with-snmp_dmf_lua=yes \ + --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no +endif + ifeq (linux,$(DEB_HOST_ARCH_OS)) DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev ### DEB_CONFIGURE_EXTRA_FLAGS+=--with-systemdsystemunitdir @@ -88,7 +95,17 @@ configure: configure.ac sh autogen.sh echo "PKG_CONFIG_PATH default:" ; pkg-config --variable pc_path pkg-config || true -pre-build:: debian/compat configure +ifeq (0,$(NUTPKG_WITH_DMF)) +# hide +patch-recipe-dmf: + sed 's,^([^#].*dmf.*)$$,#\1,' -i debian.*.install +else +# expose +patch-recipe-dmf: + sed 's,^#(.*dmf.*)$$,\1,' -i debian.*.install +endif + +pre-build:: patch-recipe-dmf debian/compat configure # FIXME : The recipe below is a crime scene regarding hardcoded paths that # are more or less relevant for a particular OS distribution and version, From bea96979160e312a1f20cde8eabf50c08cc89a2b Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 18:18:39 +0200 Subject: [PATCH 130/207] obs/nut.spec: %pre: try to groupadd to be sure Signed-off-by: Jim Klimov --- obs/nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/obs/nut.spec b/obs/nut.spec index 65428b04f0..066275b183 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -330,6 +330,7 @@ install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{_sysconfdir}/bash_ install -m0755 scripts/subdriver/gen-snmp-subdriver.sh %{buildroot}%{_sbindir}/ %pre +usr/sbin/groupadd -r -g %{NUT_GROUP} 2>/dev/null || : usr/sbin/useradd -r -g %{NUT_GROUP} -s /bin/false \ -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null || : %if %{defined opensuse_version} From ebdb0504d38a8feee57a9945528d929bfc8f1dff Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 19:41:00 +0200 Subject: [PATCH 131/207] obs/nut.spec: address some concerns from rpmlint Signed-off-by: Jim Klimov --- obs/nut.spec | 84 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 65 insertions(+), 19 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 066275b183..ea8ff6fbd5 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -41,6 +41,17 @@ %define MODELPATH %{_libexecdir}/ups/driver %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups + +### FIXME: Detect properly? +# W: suse-filelist-forbidden-udev-userdirs /etc/udev/rules.d/62-nut-usbups.rules is not allowed in SUSE +# This directory is for user files, use /usr/lib/udev/rules.d +%define UDEVRULEPATH %(test -d /usr/lib/udev && echo /usr/lib/udev || echo "%{_sysconfdir}/udev") + +### FIXME: Detect properly? +# W: suse-filelist-forbidden-bashcomp-userdirs /etc/bash_completion.d/nut.bash_completion is not allowed in SUSE +# This directory is for user files, use /usr/share/bash-completion/completions/ +%define BASHCOMPLETIONPATH %(test -d /usr/share/bash-completion/completions && echo /usr/share/bash-completion/completions || echo "%{_sysconfdir}/bash_completion.d") + ### Note: this is /etc/nut in Debian version %define NUT_USER upsd %define NUT_GROUP daemon @@ -59,6 +70,10 @@ %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) +%define NUT_SYSTEMD_UNITS_SERVICE_TARGET %(cd scripts/systemd && ls -1 *.{service,target}{,.in} | sed 's,.in$,,' | sort | uniq) +%define NUT_SYSTEMD_UNITS_OTHER %(cd scripts/systemd && ls -1 *.{path,timer}{,.in} | sed 's,.in$,,' | sort | uniq) +%define NUT_SYSTEMD_UNITS_PRESET %(cd scripts/systemd && ls -1 *.preset{,.in} | sed 's,.in$,,' | sort | uniq) + # Does this NUT branch have DMF feature code? %define NUTPKG_WITH_DMF %( test -d scripts/DMF && echo 1 || echo 0 ) @@ -296,7 +311,7 @@ sh autogen.sh --with-drvpath=%{MODELPATH}\ --with-user=%{NUT_USER}\ --with-group=%{NUT_GROUP} \ - --with-udev-dir=%{_sysconfdir}/udev \ + --with-udev-dir=%{UDEVRULEPATH} \ --enable-option-checking=fatal\ --with-systemdsystemunitdir --with-systemdshutdowndir \ --with-augeas-lenses-dir=/usr/share/augeas/lenses/dist \ @@ -315,26 +330,51 @@ fi %install make DESTDIR=%{buildroot} install %{?_smp_mflags} -mkdir -p %{buildroot}%{STATEPATH} +mkdir -p %{buildroot}%{STATEPATH}/upssched # SuSE rc mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d -install -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/ -mkdir -p %{buildroot}%{STATEPATH} +# Avoid W: incoherent-logrotate-file /etc/logrotate.d/nutlogd +install -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/nut rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample mkdir -p %{buildroot}/bin mv %{buildroot}%{_bindir}/upssched-cmd %{buildroot}/bin/upssched-cmd find %{buildroot} -type f -name "*.la" -delete -print -mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d -install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/ +mkdir -p %{buildroot}%{BASHCOMPLETIONPATH} +install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{BASHCOMPLETIONPATH}/ install -m0755 scripts/subdriver/gen-snmp-subdriver.sh %{buildroot}%{_sbindir}/ +# TODO: Detect path from chosen interpreter or NUT build config files? +# Avoid W: non-executable-script /usr/lib/python3.6/site-packages/PyNUT.py 644 /usr/bin/python... +# Not really relevant for the module (not directly runnable, but has the shebang just in case) +chmod +x %{buildroot}/usr/lib/python*/*-packages/*.py +if [ x"%{systemdtmpfilesdir}" != x ]; then + # Deliver these dirs by packaging: + sed 's,^(. %{STATEPATH}(/upssched)*( .*)*)$,#PACKAGED#\1,' -i %{buildroot}%{systemdtmpfilesdir}/nut-common-tmpfiles.conf +fi +find %{buildroot} -type f -name '*.sh' -o -name '*.py' -o -name '*.pl' | \ +# Use deterministic script interpreters: +while read F ; do + if head -1 "$F" | grep bin/env >/dev/null ; then + F_SHEBANG="`head -1 "$F"`" + + F_SHELL_SHORT="`echo "$F_SHEBANG" | sed -e 's,^.*bin/env *,,'`" -e 's, .*$,,' \ + && [ -n "$F_SHELL_SHORT" ] \ + || { echo "WARNING: Failed to extract an interpreter from shebang '${F_SHEBANG}'" >&2 ; continue ; } + + F_SHELL_PATH="`command -v "$F_SHELL_SHORT"`" \ + && [ -n "$F_SHELL_PATH" ] && [ -x "$F_SHELL_PATH" ] \ + || { echo "WARNING: Failed to find executable path to interpreter '${F_SHELL_SHORT}' from shebang '${F_SHEBANG}'" >&2 ; continue; } + + sed '1 s,^.*$,#!'"${F_SHELL_PATH}," -i "$F" + fi +done %pre usr/sbin/groupadd -r -g %{NUT_GROUP} 2>/dev/null || : usr/sbin/useradd -r -g %{NUT_GROUP} -s /bin/false \ -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null || : %if %{defined opensuse_version} -%service_add_pre nut-driver@.service nut-server.service nut-monitor.service nut-driver.target nut.target +%service_add_pre %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif %post @@ -351,19 +391,24 @@ bin/chgrp root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.us bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users || echo "WARNING: Could not secure config files in path '%{CONFPATH}'" >&2 # And finally trigger udev to set permissions according to newly installed rules files. if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device ; fi -%if %{defined opensuse_version} -%service_add_post nut-driver@.service nut-server.service nut-monitor.service nut-driver-enumerator.service nut-driver.target nut.target +%if "x%{systemdtmpfilesdir}" != "x" +%tmpfiles_create nut-common-tmpfiles.conf +%endif +%if "x%{systemdsystemunitdir}" != "x" +%service_add_post %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif %preun -%if %{defined opensuse_version} -%service_del_preun nut-driver@.service nut-server.service nut-monitor.service nut-driver-enumerator.service nut-driver.target nut.target +%if "x%{systemdsystemunitdir}" != "x" +%service_del_preun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif +: %postun -%if %{defined opensuse_version} -%service_del_postun nut-driver@.service nut-server.service nut-monitor.service nut-driver-enumerator.service nut-driver.target nut.target +%if "x%{systemdsystemunitdir}" != "x" +%service_del_postun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif +: %post -n libupsclient1 -p /sbin/ldconfig @@ -373,8 +418,8 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %defattr(-,root,root) %doc AUTHORS COPYING LICENSE-DCO LICENSE-GPL2 LICENSE-GPL3 ChangeLog MAINTAINERS NEWS.adoc README.adoc UPGRADING.adoc docs/*.adoc docs/*.txt docs/cables /bin/* -%{_sysconfdir}/bash_completion.d/* -%{_sysconfdir}/logrotate.d/* +%{BASHCOMPLETIONPATH}/* +%config(noreplace) %{_sysconfdir}/logrotate.d/* %{_bindir}/* %if 0%{?NUTPKG_WITH_DMF} %exclude %{_bindir}/nut-scanner-reindex-dmfsnmp @@ -393,9 +438,9 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %exclude %{_mandir}/man8/snmp-ups*.* %dir %{_libexecdir}/ups %{_sbindir}/* -%dir %{_sysconfdir}/udev -%dir %{_sysconfdir}/udev/rules.d -%config(noreplace) %{_sysconfdir}/udev/rules.d/*.rules +%dir %{UDEVRULEPATH} +%dir %{UDEVRULEPATH}/rules.d +%config(noreplace) %{UDEVRULEPATH}/rules.d/*.rules %config(noreplace) %{CONFPATH}/hosts.conf %config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsd.conf %config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsd.users @@ -410,7 +455,8 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %exclude %{MODELPATH}/snmp-ups %exclude %{MODELPATH}/netxml-ups %exclude %{_sbindir}/gen-snmp-subdriver.sh -%attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH} +%attr(770,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH} +%attr(770,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH}/upssched %{systemdsystemunitdir}/* %{systemdsystempresetdir}/* %{systemdtmpfilesdir}/* From 5b1f94af9f008cf8f71b311f953f3825ca091143 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 19:43:00 +0200 Subject: [PATCH 132/207] obs/nut.spec: only package docs/cables/*.txt, not the whole builddir Signed-off-by: Jim Klimov --- obs/nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index ea8ff6fbd5..dd55627995 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -349,7 +349,7 @@ install -m0755 scripts/subdriver/gen-snmp-subdriver.sh %{buildroot}%{_sbindir}/ chmod +x %{buildroot}/usr/lib/python*/*-packages/*.py if [ x"%{systemdtmpfilesdir}" != x ]; then # Deliver these dirs by packaging: - sed 's,^(. %{STATEPATH}(/upssched)*( .*)*)$,#PACKAGED#\1,' -i %{buildroot}%{systemdtmpfilesdir}/nut-common-tmpfiles.conf + sed 's,^\(. %{STATEPATH}\(/upssched\)*\( .*\)*\)$,#PACKAGED#\1,' -i %{buildroot}%{systemdtmpfilesdir}/nut-common-tmpfiles.conf fi find %{buildroot} -type f -name '*.sh' -o -name '*.py' -o -name '*.pl' | \ # Use deterministic script interpreters: @@ -416,7 +416,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %files %defattr(-,root,root) -%doc AUTHORS COPYING LICENSE-DCO LICENSE-GPL2 LICENSE-GPL3 ChangeLog MAINTAINERS NEWS.adoc README.adoc UPGRADING.adoc docs/*.adoc docs/*.txt docs/cables +%doc AUTHORS COPYING LICENSE-DCO LICENSE-GPL2 LICENSE-GPL3 ChangeLog MAINTAINERS NEWS.adoc README.adoc UPGRADING.adoc docs/*.adoc docs/*.txt docs/cables/*.txt /bin/* %{BASHCOMPLETIONPATH}/* %config(noreplace) %{_sysconfdir}/logrotate.d/* From fd640663f6b5c8984a4f07f23bfa3d458029f287 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 19:45:56 +0200 Subject: [PATCH 133/207] obs/debian.rules: fix sed with parentheses Signed-off-by: Jim Klimov --- obs/debian.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index bb0c3f8a12..3f4ce7df7e 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -98,11 +98,11 @@ configure: configure.ac ifeq (0,$(NUTPKG_WITH_DMF)) # hide patch-recipe-dmf: - sed 's,^([^#].*dmf.*)$$,#\1,' -i debian.*.install + for F in debian.*.install ; do sed 's,^\([^#].*dmf.*\)$$,#\1,' -i "$$F" || exit ; done else # expose patch-recipe-dmf: - sed 's,^#(.*dmf.*)$$,\1,' -i debian.*.install + for F in debian.*.install ; do sed 's,^#\(.*dmf.*\)$$,\1,' -i "$$F" || exit ; done endif pre-build:: patch-recipe-dmf debian/compat configure From ef249628075b229c82bf5fbfa90b9bf292bf34bd Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 20:35:01 +0200 Subject: [PATCH 134/207] obs/nut.spec: fix rpm-var expansion for conditionals Signed-off-by: Jim Klimov --- obs/nut.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index dd55627995..ec5e7242ca 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -391,21 +391,21 @@ bin/chgrp root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.us bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users || echo "WARNING: Could not secure config files in path '%{CONFPATH}'" >&2 # And finally trigger udev to set permissions according to newly installed rules files. if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device ; fi -%if "x%{systemdtmpfilesdir}" != "x" +%if "x%{?systemdtmpfilesdir}" != "x" %tmpfiles_create nut-common-tmpfiles.conf %endif -%if "x%{systemdsystemunitdir}" != "x" +%if "x%{?systemdsystemunitdir}" != "x" %service_add_post %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif %preun -%if "x%{systemdsystemunitdir}" != "x" +%if "x%{?systemdsystemunitdir}" != "x" %service_del_preun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif : %postun -%if "x%{systemdsystemunitdir}" != "x" +%if "x%{?systemdsystemunitdir}" != "x" %service_del_postun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif : From 74dae363aa1d7997d4b49be1ae550885be9da29b Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 20:35:31 +0200 Subject: [PATCH 135/207] obs/nut.spec: udev rules no longer under /etc - not a %config (hopefully) Signed-off-by: Jim Klimov --- obs/nut.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index ec5e7242ca..b43ac72748 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -440,7 +440,8 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %{_sbindir}/* %dir %{UDEVRULEPATH} %dir %{UDEVRULEPATH}/rules.d -%config(noreplace) %{UDEVRULEPATH}/rules.d/*.rules +### FIXME: if under /etc ### %config(noreplace) %{UDEVRULEPATH}/rules.d/*.rules +%{UDEVRULEPATH}/rules.d/*.rules %config(noreplace) %{CONFPATH}/hosts.conf %config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsd.conf %config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsd.users From ebd578d3f27260ae0ad4f1fcd0f5a582582bddc9 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 20:46:54 +0200 Subject: [PATCH 136/207] obs/debian.rules: search for systemd configs also in libsystemd Signed-off-by: Jim Klimov --- obs/debian.rules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 3f4ce7df7e..ce8f763262 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -19,10 +19,10 @@ DEB_DH_AUTORECONF_ARGS = --as-needed DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) # echoed fallbacks are for Ubuntu primarily -systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir systemd || echo /lib/systemd/system) -systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir systemd || echo /lib/systemd) -systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) -systemdtmpfilesdir := $(shell pkg-config --variable=systemdtmpfilesdir systemd || echo /usr/lib/tmpfiles.d) +systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir libsystemd || pkg-config --variable=systemdsystemunitdir systemd || echo /lib/systemd/system) +systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir libsystemd || shell pkg-config --variable=systemdutildir systemd || echo /lib/systemd) +systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir libsystemd || shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) +systemdtmpfilesdir := $(shell pkg-config --variable=systemdtmpfilesdir libsystemd || shell pkg-config --variable=systemdtmpfilesdir systemd || echo /usr/lib/tmpfiles.d) # Does this NUT branch have DMF feature code? NUTPKG_WITH_DMF := $(test -d scripts/DMF && echo 1 || echo 0) From d2a06532ef7c21af6c41411efc9ec348e13b5d56 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 20:47:11 +0200 Subject: [PATCH 137/207] obs/debian.rules: fix check for NUTPKG_WITH_DMF Signed-off-by: Jim Klimov --- obs/debian.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index ce8f763262..162e2feb02 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -25,7 +25,7 @@ systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir libsystem systemdtmpfilesdir := $(shell pkg-config --variable=systemdtmpfilesdir libsystemd || shell pkg-config --variable=systemdtmpfilesdir systemd || echo /usr/lib/tmpfiles.d) # Does this NUT branch have DMF feature code? -NUTPKG_WITH_DMF := $(test -d scripts/DMF && echo 1 || echo 0) +NUTPKG_WITH_DMF := $(shell test -d scripts/DMF && echo 1 || echo 0) # Newer systems have just /run (and yet newer systemd noisily suggests it) runbasedir := $(shell test -d /run && echo /run || echo /var/run) From 9e445d9ab5ec09669d131307da6b62603dbc24ff Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 20:47:30 +0200 Subject: [PATCH 138/207] obs/debian.rules: fix iteration for debian *.install fixup (DMF) Signed-off-by: Jim Klimov --- obs/debian.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 162e2feb02..85c8bd8bf3 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -98,11 +98,11 @@ configure: configure.ac ifeq (0,$(NUTPKG_WITH_DMF)) # hide patch-recipe-dmf: - for F in debian.*.install ; do sed 's,^\([^#].*dmf.*\)$$,#\1,' -i "$$F" || exit ; done + for F in debian.*.install debian/*.install ; do [ -s "$$F" ] || continue ; sed 's,^\([^#].*dmf.*\)$$,#\1,' -i "$$F" || exit ; done else # expose patch-recipe-dmf: - for F in debian.*.install ; do sed 's,^#\(.*dmf.*\)$$,\1,' -i "$$F" || exit ; done + for F in debian.*.install debian/*.install ; do [ -s "$$F" ] || continue ; sed 's,^#\(.*dmf.*\)$$,\1,' -i "$$F" || exit ; done endif pre-build:: patch-recipe-dmf debian/compat configure From 7610aabc806818608d1f385dc6fdafd32601bd87 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 21:01:28 +0200 Subject: [PATCH 139/207] obs/debian.rules: fix pkg-config search for systemd vars Signed-off-by: Jim Klimov --- obs/debian.rules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 85c8bd8bf3..da35916750 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -19,10 +19,10 @@ DEB_DH_AUTORECONF_ARGS = --as-needed DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) # echoed fallbacks are for Ubuntu primarily -systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir libsystemd || pkg-config --variable=systemdsystemunitdir systemd || echo /lib/systemd/system) -systemdsystemdutildir := $(shell pkg-config --variable=systemdutildir libsystemd || shell pkg-config --variable=systemdutildir systemd || echo /lib/systemd) -systemdshutdowndir := $(shell pkg-config --variable=systemdshutdowndir libsystemd || shell pkg-config --variable=systemdshutdowndir systemd || echo /lib/systemd/system-shutdown) -systemdtmpfilesdir := $(shell pkg-config --variable=systemdtmpfilesdir libsystemd || shell pkg-config --variable=systemdtmpfilesdir systemd || echo /usr/lib/tmpfiles.d) +systemdsystemunitdir := $(shell OUT="`pkg-config --variable=systemdsystemunitdir libsystemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || OUT="`pkg-config --variable=systemdsystemunitdir systemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || echo /lib/systemd/system) +systemdsystemdutildir := $(shell OUT="`pkg-config --variable=systemdutildir libsystemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || OUT="`pkg-config --variable=systemdutildir systemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || echo /lib/systemd) +systemdshutdowndir := $(shell OUT="`pkg-config --variable=systemdshutdowndir libsystemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || OUT="`pkg-config --variable=systemdshutdowndir systemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || echo /lib/systemd/system-shutdown) +systemdtmpfilesdir := $(shell OUT="`pkg-config --variable=systemdtmpfilesdir libsystemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || OUT="`pkg-config --variable=systemdtmpfilesdir systemd`" && [ -n "$$OUT" ] && { echo "$$OUT" ; exit; } || echo /usr/lib/tmpfiles.d) # Does this NUT branch have DMF feature code? NUTPKG_WITH_DMF := $(shell test -d scripts/DMF && echo 1 || echo 0) From 79157c80152bb726e977c4a0d504bd2b441775d7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 8 Oct 2025 21:05:27 +0200 Subject: [PATCH 140/207] obs/nut.spec: reshuffle NUT_SYSTEMD_UNITS_SERVICE_TARGET definition Signed-off-by: Jim Klimov --- obs/nut.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index b43ac72748..8821cc5171 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -70,7 +70,9 @@ %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) -%define NUT_SYSTEMD_UNITS_SERVICE_TARGET %(cd scripts/systemd && ls -1 *.{service,target}{,.in} | sed 's,.in$,,' | sort | uniq) +#%define NUT_SYSTEMD_UNITS_SERVICE_TARGET %(cd scripts/systemd && ls -1 *.{service,target}{,.in} | sed 's,.in$,,' | sort | uniq) +%define NUT_SYSTEMD_UNITS_SERVICE_TARGET nut-driver-enumerator.service nut-driver.target nut-driver@.service nut-logger.service nut-monitor.service nut-server.service nut-sleep.service nut-udev-settle.service nut.target + %define NUT_SYSTEMD_UNITS_OTHER %(cd scripts/systemd && ls -1 *.{path,timer}{,.in} | sed 's,.in$,,' | sort | uniq) %define NUT_SYSTEMD_UNITS_PRESET %(cd scripts/systemd && ls -1 *.preset{,.in} | sed 's,.in$,,' | sort | uniq) From 19c70294c80fe4934b28fe0191ff671b269e2cde Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 00:44:42 +0000 Subject: [PATCH 141/207] obs/nut.dsc, obs/debian.control: do not require "python-is-..." which confuses cdbs Signed-off-by: Jim Klimov --- obs/debian.control | 3 ++- obs/nut.dsc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/obs/debian.control b/obs/debian.control index 3c94286e09..e14a9b93a3 100644 --- a/obs/debian.control +++ b/obs/debian.control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 8.1.3), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), - python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, dh-python | dh-python2 | dh-python3 | dh-pypy, + python2 | python3, dh-python | dh-python2 | dh-python3 | dh-pypy, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libmodbus-dev (>= 3.1.6), @@ -25,6 +25,7 @@ Build-Depends: debhelper (>= 8.1.3), liblua5.1-0-dev, lua5.1, pkg-config +#python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, Build-Depends-Indep: asciidoc (>= 8.6.3), docbook-xsl, dblatex (>= 0.2.5), diff --git a/obs/nut.dsc b/obs/nut.dsc index 8410468f24..8c910131a3 100644 --- a/obs/nut.dsc +++ b/obs/nut.dsc @@ -10,7 +10,8 @@ Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git Testsuite: autopkgtest -Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~) | python-is-python2 | python-is-python3, python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh-python | dh-python2 | dh-python3 | dh-pypy, libmodbus-dev, libi2c-dev +Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-autoreconf, libsystemd-dev, libjpeg-dev, libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libssl1.0-dev | libssl-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6), python2 | python3, libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev, libtool, libltdl-dev, liblua5.1-0-dev, lua5.1, pkg-config, dh-python | dh-python2 | dh-python3 | dh-pypy, libmodbus-dev, libi2c-dev +# , python (>= 2.6.6-3~) | python-is-python2 | python-is-python3 #+++ python-pycparser # The pycparser is required to rebuild DMF files, but those pre-built # copies in the git repo/tarball "should" be in sync with original From e60ed00d66de6dadf8ad76e2a4858c3c2e270ec0 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 01:40:59 +0000 Subject: [PATCH 142/207] obs/debian.rules: convince cdbs about dh_python3 when it is the only viable option Signed-off-by: Jim Klimov --- obs/debian.rules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/obs/debian.rules b/obs/debian.rules index da35916750..97b85eb61f 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -6,6 +6,16 @@ include /usr/share/cdbs/1/class/python-module.mk include /usr/share/cdbs/1/rules/autoreconf.mk +# CDBS has some issues detecting something other than dh_python2 +# which is absent on Debian 12+ and Ubuntu 25.04 for example. +ifeq (,$(shell command -v dh_python2)) +ifneq (,$(shell command -v dh_python3)) +ifneq (,$(shell command -v python3)) +cdbs_curpythonsystems := python3 +endif +endif +endif + export DH_OPTIONS # This is the debhelper compatibility version to use. From 304babb71342274edb5e39e82ff07426b11bd455 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:15:12 +0000 Subject: [PATCH 143/207] ci_build.sh: wrap pkg-rpm and pkg-deb (PoC) Signed-off-by: Jim Klimov --- ci_build.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ci_build.sh b/ci_build.sh index adec0daa92..77b33e7bc5 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -1478,6 +1478,8 @@ if [ -z "$BUILD_TYPE" ] ; then win|windows|cross-windows-mingw) BUILD_TYPE="cross-windows-mingw" ; shift ;; + pkg*) BUILD_TYPE="$1" ; shift ;; + spellcheck|spellcheck-interactive|spellcheck-quick|spellcheck-interactive-quick) # Note: this is a little hack to reduce typing # and scrolling in (docs) developer iterations. @@ -2869,6 +2871,28 @@ cross-windows-mingw*) ./build-mingw-nut.sh $cmd ;; +pkg-rpm|pkg-spec) + rm -f nut.spec + cp -f obs/nut.spec . + sed -e 's,^(Version:).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ + -i nut.spec + rpmbuild -ba + ;; + +pkg-deb|pkg-dsc) + rm -rf debian + mkdir -p debian + cd obs || exit + for F in debian.* nut*.install nut*.manpages ; do + ln -s "../obs/$"F "../debian/`echo "$F" | sed 's/debian.//'`" + done + rm -f nut.dsc + cp -f obs/nut.dsc . + sed -e 's,^(Version:).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ + -i nut.dsc + debuild -y + ;; + *) pushd "./builds/${BUILD_TYPE}" && REPO_DIR="$(dirs -l +1)" ./ci_build.sh ;; From 3ec158f8d18291b5778bead2ee318363f7e8feb4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:24:11 +0000 Subject: [PATCH 144/207] obs.*, ci_build.sh: rename debiam recipe files to standard pattern Signed-off-by: Jim Klimov --- ci_build.sh | 2 +- obs/Makefile.am | 10 +++++----- ...-linux-i2c.install => debian.nut-linux-i2c.install} | 0 ...inux-i2c.manpages => debian.nut-linux-i2c.manpages} | 0 obs/{nut-modbus.install => debian.nut-modbus.install} | 0 ...{nut-modbus.manpages => debian.nut-modbus.manpages} | 0 obs/{nut.changes => debian.nut.changes} | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename obs/{nut-linux-i2c.install => debian.nut-linux-i2c.install} (100%) rename obs/{nut-linux-i2c.manpages => debian.nut-linux-i2c.manpages} (100%) rename obs/{nut-modbus.install => debian.nut-modbus.install} (100%) rename obs/{nut-modbus.manpages => debian.nut-modbus.manpages} (100%) rename obs/{nut.changes => debian.nut.changes} (100%) diff --git a/ci_build.sh b/ci_build.sh index 77b33e7bc5..d62535293d 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2883,7 +2883,7 @@ pkg-deb|pkg-dsc) rm -rf debian mkdir -p debian cd obs || exit - for F in debian.* nut*.install nut*.manpages ; do + for F in debian.* ; do ln -s "../obs/$"F "../debian/`echo "$F" | sed 's/debian.//'`" done rm -f nut.dsc diff --git a/obs/Makefile.am b/obs/Makefile.am index f278bce54f..e16077f1c3 100644 --- a/obs/Makefile.am +++ b/obs/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST += \ debian.libupsclient-dev.install \ debian.libupsclient-dev.manpages \ debian.libupsclient4.install \ + debian.nut.changes \ debian.nut-cgi.README.Debian \ debian.nut-cgi.docs \ debian.nut-cgi.install \ @@ -55,6 +56,10 @@ EXTRA_DIST += \ debian.nut-doc.install \ debian.nut-ipmi.install \ debian.nut-ipmi.manpages \ + debian.nut-linux-i2c.install \ + debian.nut-linux-i2c.manpages \ + debian.nut-modbus.install \ + debian.nut-modbus.manpages \ debian.nut-monitor.install \ debian.nut-monitor.menu \ debian.nut-monitor.xpm \ @@ -80,11 +85,6 @@ EXTRA_DIST += \ debian.rules \ debian.series \ debian.watch \ - nut-linux-i2c.install \ - nut-linux-i2c.manpages \ - nut-modbus.install \ - nut-modbus.manpages \ - nut.changes \ nut.dsc # RedHAT/Fedora/CentOS/... recipes: diff --git a/obs/nut-linux-i2c.install b/obs/debian.nut-linux-i2c.install similarity index 100% rename from obs/nut-linux-i2c.install rename to obs/debian.nut-linux-i2c.install diff --git a/obs/nut-linux-i2c.manpages b/obs/debian.nut-linux-i2c.manpages similarity index 100% rename from obs/nut-linux-i2c.manpages rename to obs/debian.nut-linux-i2c.manpages diff --git a/obs/nut-modbus.install b/obs/debian.nut-modbus.install similarity index 100% rename from obs/nut-modbus.install rename to obs/debian.nut-modbus.install diff --git a/obs/nut-modbus.manpages b/obs/debian.nut-modbus.manpages similarity index 100% rename from obs/nut-modbus.manpages rename to obs/debian.nut-modbus.manpages diff --git a/obs/nut.changes b/obs/debian.nut.changes similarity index 100% rename from obs/nut.changes rename to obs/debian.nut.changes From f306cad61f924fba7d8a17a28b1676c409a86ebf Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:25:08 +0000 Subject: [PATCH 145/207] obs/*: drop "control" symlink Signed-off-by: Jim Klimov --- obs/Makefile.am | 1 - obs/control | 1 - 2 files changed, 2 deletions(-) delete mode 120000 obs/control diff --git a/obs/Makefile.am b/obs/Makefile.am index e16077f1c3..006149e736 100644 --- a/obs/Makefile.am +++ b/obs/Makefile.am @@ -6,7 +6,6 @@ EXTRA_DIST = README.adoc # Debian/Ubuntu recipes: EXTRA_DIST += \ - control \ debian.Makefile.am \ debian.NEWS \ debian.changelog \ diff --git a/obs/control b/obs/control deleted file mode 120000 index 467d6decea..0000000000 --- a/obs/control +++ /dev/null @@ -1 +0,0 @@ -debian.control \ No newline at end of file From 0f2f74367143d6d79897040c2f5365bffd176bc2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:28:03 +0000 Subject: [PATCH 146/207] ci_build.sh: pkg-deb: fix shell and sed syntax Signed-off-by: Jim Klimov --- ci_build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci_build.sh b/ci_build.sh index d62535293d..7fe001a8cc 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2882,13 +2882,13 @@ pkg-rpm|pkg-spec) pkg-deb|pkg-dsc) rm -rf debian mkdir -p debian - cd obs || exit + (cd obs || exit for F in debian.* ; do - ln -s "../obs/$"F "../debian/`echo "$F" | sed 's/debian.//'`" - done + ln -s "../obs/$F" "../debian/`echo "$F" | sed 's/debian.//'`" || exit + done) || exit rm -f nut.dsc cp -f obs/nut.dsc . - sed -e 's,^(Version:).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ + sed -e 's,^\(Version:\).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.dsc debuild -y ;; From c2b17e61d24cef613620c7594748c860294d554d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:33:48 +0000 Subject: [PATCH 147/207] ci_build.sh: pkg-deb: force debuikd differently Signed-off-by: Jim Klimov --- ci_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_build.sh b/ci_build.sh index 7fe001a8cc..558bc9cc1f 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2890,7 +2890,7 @@ pkg-deb|pkg-dsc) cp -f obs/nut.dsc . sed -e 's,^\(Version:\).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.dsc - debuild -y + yes | debuild ;; *) From b56453cc85519a1b36db2d9c55bb7647acff7828 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:36:01 +0000 Subject: [PATCH 148/207] ci_build.sh: pkg-deb: install prereqs (TBD;: optional?) Signed-off-by: Jim Klimov --- ci_build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci_build.sh b/ci_build.sh index 558bc9cc1f..6517944ad5 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2890,6 +2890,7 @@ pkg-deb|pkg-dsc) cp -f obs/nut.dsc . sed -e 's,^\(Version:\).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.dsc + dpkg-checkbuilddeps || sudo mk-build-debs -i yes | debuild ;; From adaff5d0ecc40d28f6d25b72182fe8e7f7893c56 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:38:34 +0000 Subject: [PATCH 149/207] ci_build.sh: pkg-deb: clean away cdbs temp leftovers Signed-off-by: Jim Klimov --- ci_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_build.sh b/ci_build.sh index 6517944ad5..3757119070 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2880,7 +2880,7 @@ pkg-rpm|pkg-spec) ;; pkg-deb|pkg-dsc) - rm -rf debian + rm -rf debian config.*cdbs* mkdir -p debian (cd obs || exit for F in debian.* ; do From 8a8831137f619da6611fb6c3ac3313075ab647d3 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 02:51:35 +0000 Subject: [PATCH 150/207] ci_build.sh: pkg*: pre-cleanup more Signed-off-by: Jim Klimov --- ci_build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ci_build.sh b/ci_build.sh index 3757119070..af8c60f3bd 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2872,26 +2872,29 @@ cross-windows-mingw*) ;; pkg-rpm|pkg-spec) - rm -f nut.spec + rm -f nut.spec || true + git clean -fdX || true cp -f obs/nut.spec . sed -e 's,^(Version:).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.spec - rpmbuild -ba + rpmbuild -ba \ + && find . -name '*rpm' ;; pkg-deb|pkg-dsc) - rm -rf debian config.*cdbs* + rm -rf debian config.*cdbs* nut.dsc || true + git clean -fdX || true mkdir -p debian (cd obs || exit for F in debian.* ; do ln -s "../obs/$F" "../debian/`echo "$F" | sed 's/debian.//'`" || exit done) || exit - rm -f nut.dsc cp -f obs/nut.dsc . sed -e 's,^\(Version:\).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.dsc dpkg-checkbuilddeps || sudo mk-build-debs -i - yes | debuild + yes | debuild \ + && find . -name '*deb' ;; *) From 16d3aacd4faa02ab96a5c019bf5a69cf2c913880 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 03:48:11 +0000 Subject: [PATCH 151/207] obs/debian.rules: try harder to detect python2/3 helper Signed-off-by: Jim Klimov --- obs/debian.rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obs/debian.rules b/obs/debian.rules index 97b85eb61f..166baf3baf 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -8,9 +8,9 @@ include /usr/share/cdbs/1/rules/autoreconf.mk # CDBS has some issues detecting something other than dh_python2 # which is absent on Debian 12+ and Ubuntu 25.04 for example. -ifeq (,$(shell command -v dh_python2)) -ifneq (,$(shell command -v dh_python3)) -ifneq (,$(shell command -v python3)) +ifeq (,$(shell command -v dh_python2 || which dh_python2 || dh_python2 --help)) +ifneq (,$(shell command -v dh_python3 || which dh_python3 || dh_python3 --help)) +ifneq (,$(shell command -v python3 || which python3 || python3 --help)) cdbs_curpythonsystems := python3 endif endif From ffb4b2aa8cc3203336fa70977b8ad981afb2795e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 10:18:41 +0200 Subject: [PATCH 152/207] obs/nut.spec: avoid what looks like spec-var expansion in comments Signed-off-by: Jim Klimov --- obs/nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index 8821cc5171..bbdb99520a 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -70,7 +70,7 @@ %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) -#%define NUT_SYSTEMD_UNITS_SERVICE_TARGET %(cd scripts/systemd && ls -1 *.{service,target}{,.in} | sed 's,.in$,,' | sort | uniq) +# % define NUT_SYSTEMD_UNITS_SERVICE_TARGET % (cd scripts/systemd && ls -1 *.{service,target}{,.in} | sed 's,.in$,,' | sort | uniq) %define NUT_SYSTEMD_UNITS_SERVICE_TARGET nut-driver-enumerator.service nut-driver.target nut-driver@.service nut-logger.service nut-monitor.service nut-server.service nut-sleep.service nut-udev-settle.service nut.target %define NUT_SYSTEMD_UNITS_OTHER %(cd scripts/systemd && ls -1 *.{path,timer}{,.in} | sed 's,.in$,,' | sort | uniq) @@ -442,7 +442,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %{_sbindir}/* %dir %{UDEVRULEPATH} %dir %{UDEVRULEPATH}/rules.d -### FIXME: if under /etc ### %config(noreplace) %{UDEVRULEPATH}/rules.d/*.rules +### FIXME: if under /etc ### % config(noreplace) % {UDEVRULEPATH}/rules.d/*.rules %{UDEVRULEPATH}/rules.d/*.rules %config(noreplace) %{CONFPATH}/hosts.conf %config(noreplace) %attr(600,%{NUT_USER},root) %{CONFPATH}/upsd.conf From 8b309010cd0d82a99a80df13ed17698d1b8a80c4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 10:39:24 +0200 Subject: [PATCH 153/207] obs/nut.spec: do not dump sockdebug and NDE script into /usr/libexec directly Signed-off-by: Jim Klimov --- obs/nut.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index bbdb99520a..c6a7d9bf32 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -293,7 +293,7 @@ sh autogen.sh --bindir=%{_bindir}\ --sbindir=%{_sbindir}\ --libdir=%{_libdir}\ - --libexecdir=%{_libexecdir}\ + --libexecdir=%{_libexecdir}/ups\ --sysconfdir=%{CONFPATH}\ --datadir=%{_datadir}/nut\ --with-ssl --with-openssl\ @@ -477,7 +477,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %dir %{_datadir}/augeas/lenses %dir %{_datadir}/augeas/lenses/dist %dir %{_datadir}/augeas/lenses/dist/tests -%{_libexecdir}/nut-driver-enumerator.sh +%{_libexecdir}/ups/nut-driver-enumerator.sh # Exclude whatever other packages bring, some rpmbuild versions seem to dump # everything into the base package and then complain about duplicates/conflicts: ### libupsclient1 @@ -495,7 +495,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %exclude %{_libdir}/*.so %exclude %{_libdir}/pkgconfig/*.pc %exclude %{_mandir}/man3/*.* -%exclude %{_libexecdir}/sockdebug +%exclude %{_libexecdir}/ups/sockdebug %files drivers-net @@ -543,6 +543,6 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/*.* -%{_libexecdir}/sockdebug +%{_libexecdir}/ups/sockdebug %changelog From b4d9b56af45a2991718cc0968a7c8c714d2cae85 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 10:39:48 +0200 Subject: [PATCH 154/207] obs/nut.spec: specify system locations we use via %dir Signed-off-by: Jim Klimov --- obs/nut.spec | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index c6a7d9bf32..8154353003 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -419,6 +419,25 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %files %defattr(-,root,root) %doc AUTHORS COPYING LICENSE-DCO LICENSE-GPL2 LICENSE-GPL3 ChangeLog MAINTAINERS NEWS.adoc README.adoc UPGRADING.adoc docs/*.adoc docs/*.txt docs/cables/*.txt +# List the (system) dirs we impact but do not own for the package +%dir /bin +%dir %{BASHCOMPLETIONPATH} +%dir %{_sysconfdir}/logrotate.d +%dir %{_bindir} +%dir %{_sbindir} +%dir %{_datadir} +%dir %{_docdir} +%dir %{_mandir}/man1 +%dir %{_mandir}/man3 +%dir %{_mandir}/man5 +%dir %{_mandir}/man7 +%dir %{_mandir}/man8 +%dir %{_libexecdir} +%dir %{systemdsystemunitdir} +%dir %{systemdsystempresetdir} +%dir %{systemdtmpfilesdir} +%dir %{systemdshutdowndir} +# List the file patterns to install from proto area /bin/* %{BASHCOMPLETIONPATH}/* %config(noreplace) %{_sysconfdir}/logrotate.d/* From 872320cf06dafcc35084dd8322dec8749b022cc8 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 10:40:06 +0200 Subject: [PATCH 155/207] obs/nut.spec: comment about alias man pages seen as duplicate files in package Signed-off-by: Jim Klimov --- obs/nut.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index 8154353003..ddb82949d3 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -561,6 +561,12 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %{_includedir}/*.h %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc +# FIXME: Alias man page files... use symlinks or what? +# [ 139s] nut-devel.x86_64: W: files-duplicate /usr/share/man/man3/nutclient_execute_device_command.3.gz /usr/share/man/man3/nutclient_get_device_command_description.3.gz:/usr/share/man/man3/nutclient_get_device_commands.3.gz:/usr/share/man/man3/nutclient_has_device_command.3.gz +# [ 139s] nut-devel.x86_64: W: files-duplicate /usr/share/man/man3/nutclient_get_device_num_logins.3.gz /usr/share/man/man3/nutclient_authenticate.3.gz:/usr/share/man/man3/nutclient_device_forced_shutdown.3.gz:/usr/share/man/man3/nutclient_device_login.3.gz:/usr/share/man/man3/nutclient_device_master.3.gz:/usr/share/man/man3/nutclient_logout.3.gz +# [ 139s] nut-devel.x86_64: W: files-duplicate /usr/share/man/man3/nutclient_get_devices.3.gz /usr/share/man/man3/nutclient_get_device_description.3.gz:/usr/share/man/man3/nutclient_has_device.3.gz +# [ 139s] nut-devel.x86_64: W: files-duplicate /usr/share/man/man3/nutclient_set_device_variable_value.3.gz /usr/share/man/man3/nutclient_get_device_rw_variables.3.gz:/usr/share/man/man3/nutclient_get_device_variable_description.3.gz:/usr/share/man/man3/nutclient_get_device_variable_values.3.gz:/usr/share/man/man3/nutclient_get_device_variables.3.gz:/usr/share/man/man3/nutclient_has_device_variable.3.gz:/usr/share/man/man3/nutclient_set_device_variable_values.3.gz +# [ 139s] nut-devel.x86_64: W: files-duplicate /usr/share/man/man3/nutclient_tcp_get_timeout.3.gz /usr/share/man/man3/nutclient_tcp_create_client.3.gz:/usr/share/man/man3/nutclient_tcp_disconnect.3.gz:/usr/share/man/man3/nutclient_tcp_is_connected.3.gz:/usr/share/man/man3/nutclient_tcp_reconnect.3.gz:/usr/share/man/man3/nutclient_tcp_set_timeout.3.gz %{_mandir}/man3/*.* %{_libexecdir}/ups/sockdebug From 0a7ff40bc7a0a4edcdc92086c7d67a06270440f2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 10:45:02 +0200 Subject: [PATCH 156/207] obs/nut.spec: seems there is no "%if X != Y" syntax Signed-off-by: Jim Klimov --- obs/nut.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index ddb82949d3..f7b0737780 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -393,21 +393,25 @@ bin/chgrp root %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.us bin/chmod 600 %{CONFPATH}/upsd.conf %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users || echo "WARNING: Could not secure config files in path '%{CONFPATH}'" >&2 # And finally trigger udev to set permissions according to newly installed rules files. if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device ; fi -%if "x%{?systemdtmpfilesdir}" != "x" +%if "x%{?systemdtmpfilesdir}" == "x" +%else %tmpfiles_create nut-common-tmpfiles.conf %endif -%if "x%{?systemdsystemunitdir}" != "x" +%if "x%{?systemdsystemunitdir}" == "x" +%else %service_add_post %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif %preun -%if "x%{?systemdsystemunitdir}" != "x" +%if "x%{?systemdsystemunitdir}" == "x" +%else %service_del_preun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif : %postun -%if "x%{?systemdsystemunitdir}" != "x" +%if "x%{?systemdsystemunitdir}" == "x" +%else %service_del_postun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif : From 8a6cc349241ba87e8a86624db434abeab9af0e19 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 10:48:49 +0200 Subject: [PATCH 157/207] obs/nut.spec: announce where and how we rewrite shebangs Signed-off-by: Jim Klimov --- obs/nut.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index f7b0737780..7fd2d98aab 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -353,8 +353,8 @@ if [ x"%{systemdtmpfilesdir}" != x ]; then # Deliver these dirs by packaging: sed 's,^\(. %{STATEPATH}\(/upssched\)*\( .*\)*\)$,#PACKAGED#\1,' -i %{buildroot}%{systemdtmpfilesdir}/nut-common-tmpfiles.conf fi -find %{buildroot} -type f -name '*.sh' -o -name '*.py' -o -name '*.pl' | \ # Use deterministic script interpreters: +find %{buildroot} -type f -name '*.sh' -o -name '*.py' -o -name '*.pl' | \ while read F ; do if head -1 "$F" | grep bin/env >/dev/null ; then F_SHEBANG="`head -1 "$F"`" @@ -367,6 +367,7 @@ while read F ; do && [ -n "$F_SHELL_PATH" ] && [ -x "$F_SHELL_PATH" ] \ || { echo "WARNING: Failed to find executable path to interpreter '${F_SHELL_SHORT}' from shebang '${F_SHEBANG}'" >&2 ; continue; } + echo "REWRITING shebang from '$F_SHEBANG' to '#!${F_SHELL_PATH}' in '$F'" >&2 sed '1 s,^.*$,#!'"${F_SHELL_PATH}," -i "$F" fi done From d4caf7a465c826599c089fbf98664546837d11f4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 11:15:08 +0200 Subject: [PATCH 158/207] obs/nut.spec: reject found apache_serverroot that is under /usr/share Signed-off-by: Jim Klimov --- obs/nut.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 7fd2d98aab..a792b84319 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -26,7 +26,9 @@ # Requires httpd(-devel?) or apache2(-devel?) to be present in this distro: %define apache_serverroot %(%{_sbindir}/apxs2 -q datadir || %{_sbindir}/apxs -q PREFIX || true) -%if "0%{?apache_serverroot}" == "0" +%if "0%{?apache_serverroot}" == "0" || 0%(echo '%{apache_serverroot}' | grep -E '^%{_datadir}' >/dev/null && echo 1 || echo 0) > 0 +# Spec-var is undefined or empty, or matches the pattern triggering +# E: arch-dependent-file-in-usr-share (Badness: 590) # Dump nut-cgi artifacts under our own locations, so end-users can # integrate them later. %define CGIPATH %{_libexecdir}/ups/cgi-bin From fff0a7db5ecdf83604c9e7ef21d7d84d593590ff Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 11:16:14 +0200 Subject: [PATCH 159/207] obs/nut.spec: abstract the LIBEXECPATH as a spec-var Signed-off-by: Jim Klimov --- obs/nut.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/obs/nut.spec b/obs/nut.spec index a792b84319..90a8c55b3f 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -24,6 +24,8 @@ # but can not decide that we can/must install something and then we # would have the needed OS capability. +%define LIBEXECPATH %{_libexecdir}/ups + # Requires httpd(-devel?) or apache2(-devel?) to be present in this distro: %define apache_serverroot %(%{_sbindir}/apxs2 -q datadir || %{_sbindir}/apxs -q PREFIX || true) %if "0%{?apache_serverroot}" == "0" || 0%(echo '%{apache_serverroot}' | grep -E '^%{_datadir}' >/dev/null && echo 1 || echo 0) > 0 @@ -31,7 +33,7 @@ # E: arch-dependent-file-in-usr-share (Badness: 590) # Dump nut-cgi artifacts under our own locations, so end-users can # integrate them later. -%define CGIPATH %{_libexecdir}/ups/cgi-bin +%define CGIPATH %{LIBEXECPATH}/cgi-bin %define HTMLPATH %{_datadir}/nut/htdocs %else # Rename web pages location to not conflict with apache2-example-pages @@ -40,7 +42,7 @@ %define HTMLPATH %{apache_serverroot}/htdocs/nut %endif -%define MODELPATH %{_libexecdir}/ups/driver +%define MODELPATH %{LIBEXECPATH}/driver %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups @@ -295,7 +297,7 @@ sh autogen.sh --bindir=%{_bindir}\ --sbindir=%{_sbindir}\ --libdir=%{_libdir}\ - --libexecdir=%{_libexecdir}/ups\ + --libexecdir=%{LIBEXECPATH}\ --sysconfdir=%{CONFPATH}\ --datadir=%{_datadir}/nut\ --with-ssl --with-openssl\ @@ -464,7 +466,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %{_mandir}/man8/*.* %exclude %{_mandir}/man8/netxml-ups*.* %exclude %{_mandir}/man8/snmp-ups*.* -%dir %{_libexecdir}/ups +%dir %{LIBEXECPATH} %{_sbindir}/* %dir %{UDEVRULEPATH} %dir %{UDEVRULEPATH}/rules.d @@ -503,7 +505,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %dir %{_datadir}/augeas/lenses %dir %{_datadir}/augeas/lenses/dist %dir %{_datadir}/augeas/lenses/dist/tests -%{_libexecdir}/ups/nut-driver-enumerator.sh +%{LIBEXECPATH}/nut-driver-enumerator.sh # Exclude whatever other packages bring, some rpmbuild versions seem to dump # everything into the base package and then complain about duplicates/conflicts: ### libupsclient1 @@ -521,7 +523,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %exclude %{_libdir}/*.so %exclude %{_libdir}/pkgconfig/*.pc %exclude %{_mandir}/man3/*.* -%exclude %{_libexecdir}/ups/sockdebug +%exclude %{LIBEXECPATH}/sockdebug %files drivers-net @@ -575,6 +577,6 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro # [ 139s] nut-devel.x86_64: W: files-duplicate /usr/share/man/man3/nutclient_set_device_variable_value.3.gz /usr/share/man/man3/nutclient_get_device_rw_variables.3.gz:/usr/share/man/man3/nutclient_get_device_variable_description.3.gz:/usr/share/man/man3/nutclient_get_device_variable_values.3.gz:/usr/share/man/man3/nutclient_get_device_variables.3.gz:/usr/share/man/man3/nutclient_has_device_variable.3.gz:/usr/share/man/man3/nutclient_set_device_variable_values.3.gz # [ 139s] nut-devel.x86_64: W: files-duplicate /usr/share/man/man3/nutclient_tcp_get_timeout.3.gz /usr/share/man/man3/nutclient_tcp_create_client.3.gz:/usr/share/man/man3/nutclient_tcp_disconnect.3.gz:/usr/share/man/man3/nutclient_tcp_is_connected.3.gz:/usr/share/man/man3/nutclient_tcp_reconnect.3.gz:/usr/share/man/man3/nutclient_tcp_set_timeout.3.gz %{_mandir}/man3/*.* -%{_libexecdir}/ups/sockdebug +%{LIBEXECPATH}/sockdebug %changelog From 996e0c700a787682bbda5b3bdc6a6deac3040274 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 11:26:35 +0200 Subject: [PATCH 160/207] obs/nut.spec: do not mention man1 Signed-off-by: Jim Klimov --- obs/nut.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index 90a8c55b3f..cdab368066 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -436,7 +436,9 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %dir %{_sbindir} %dir %{_datadir} %dir %{_docdir} -%dir %{_mandir}/man1 +# NOTE: Currently this only delivers libupsclient-config.1 +# and only if not building with pkg-config available: +#% dir % {_mandir}/man1 %dir %{_mandir}/man3 %dir %{_mandir}/man5 %dir %{_mandir}/man7 From 24c12b76d3dd9224013bb46be36898bb9d578809 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 11:33:32 +0200 Subject: [PATCH 161/207] obs/nut.spec: abstract the DOCPATH as a spec-var Signed-off-by: Jim Klimov --- obs/nut.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/obs/nut.spec b/obs/nut.spec index cdab368066..dd1fef0f2b 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -45,6 +45,9 @@ %define MODELPATH %{LIBEXECPATH}/driver %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups +# RPM on OpenSUSE goes: +# DOCDIR=/home/abuild/rpmbuild/BUILD/nut-2.8.4.428-build/BUILDROOT/usr/share/doc/packages/nut +%define DOCPATH %{_docdir}/nut ### FIXME: Detect properly? # W: suse-filelist-forbidden-udev-userdirs /etc/udev/rules.d/62-nut-usbups.rules is not allowed in SUSE @@ -300,6 +303,7 @@ sh autogen.sh --libexecdir=%{LIBEXECPATH}\ --sysconfdir=%{CONFPATH}\ --datadir=%{_datadir}/nut\ + --docdir=%{DOCPATH}\ --with-ssl --with-openssl\ --with-libltdl=yes\ --with-cgi=auto\ @@ -436,6 +440,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %dir %{_sbindir} %dir %{_datadir} %dir %{_docdir} +%dir %{DOCPATH} # NOTE: Currently this only delivers libupsclient-config.1 # and only if not building with pkg-config available: #% dir % {_mandir}/man1 From f0647e828f9fe5f46c603466ef0d7ce03c819ad8 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 11:34:25 +0200 Subject: [PATCH 162/207] obs/nut.spec: shebangs: fix shell and sed syntax Signed-off-by: Jim Klimov --- obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/nut.spec b/obs/nut.spec index dd1fef0f2b..6ac7ce5ae5 100644 --- a/obs/nut.spec +++ b/obs/nut.spec @@ -367,7 +367,7 @@ while read F ; do if head -1 "$F" | grep bin/env >/dev/null ; then F_SHEBANG="`head -1 "$F"`" - F_SHELL_SHORT="`echo "$F_SHEBANG" | sed -e 's,^.*bin/env *,,'`" -e 's, .*$,,' \ + F_SHELL_SHORT="`echo "$F_SHEBANG" | sed -e 's,^.*bin/env *,,' -e 's, .*$,,'`" \ && [ -n "$F_SHELL_SHORT" ] \ || { echo "WARNING: Failed to extract an interpreter from shebang '${F_SHEBANG}'" >&2 ; continue ; } From 42288f3746fed6f5a2a860960eed1a57997c6242 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 12:22:22 +0200 Subject: [PATCH 163/207] Move obs/ to scripts/obs/ for consistency with other helper code Signed-off-by: Jim Klimov --- Makefile.am | 6 ++---- ci_build.sh | 8 ++++---- configure.ac | 2 +- scripts/Makefile.am | 4 ++-- {obs => scripts/obs}/Makefile.am | 0 {obs => scripts/obs}/README.adoc | 0 {obs => scripts/obs}/debian.Makefile.am | 0 {obs => scripts/obs}/debian.NEWS | 0 {obs => scripts/obs}/debian.changelog | 0 {obs => scripts/obs}/debian.compat | 0 {obs => scripts/obs}/debian.control | 0 {obs => scripts/obs}/debian.copyright | 0 {obs => scripts/obs}/debian.description.subst | 0 {obs => scripts/obs}/debian.gbp.conf | 0 {obs => scripts/obs}/debian.hotplug | 0 {obs => scripts/obs}/debian.libnutclient-dev.install | 0 {obs => scripts/obs}/debian.libnutclient-dev.manpages | 0 {obs => scripts/obs}/debian.libnutclient1.install | 0 .../obs}/debian.libnutclient1.lintian-overrides | 0 {obs => scripts/obs}/debian.libnutclientstub-dev.install | 0 {obs => scripts/obs}/debian.libnutclientstub1.install | 0 .../obs}/debian.libnutclientstub1.lintian-overrides | 0 {obs => scripts/obs}/debian.libnutscan-dev.install | 0 {obs => scripts/obs}/debian.libnutscan1.install | 0 {obs => scripts/obs}/debian.libups-nut-perl.install | 0 {obs => scripts/obs}/debian.libupsclient-dev.install | 0 {obs => scripts/obs}/debian.libupsclient-dev.manpages | 0 {obs => scripts/obs}/debian.libupsclient4.install | 0 {obs => scripts/obs}/debian.nut-cgi.README.Debian | 0 {obs => scripts/obs}/debian.nut-cgi.docs | 0 {obs => scripts/obs}/debian.nut-cgi.install | 0 {obs => scripts/obs}/debian.nut-cgi.manpages | 0 {obs => scripts/obs}/debian.nut-cgi.postinst | 0 {obs => scripts/obs}/debian.nut-cgi.postrm | 0 {obs => scripts/obs}/debian.nut-client.init.in | 0 {obs => scripts/obs}/debian.nut-client.install | 0 {obs => scripts/obs}/debian.nut-client.links | 0 {obs => scripts/obs}/debian.nut-client.lintian-overrides | 0 {obs => scripts/obs}/debian.nut-client.maintscript | 0 {obs => scripts/obs}/debian.nut-client.manpages | 0 {obs => scripts/obs}/debian.nut-client.postinst | 0 {obs => scripts/obs}/debian.nut-client.preinst | 0 {obs => scripts/obs}/debian.nut-client.prerm | 0 {obs => scripts/obs}/debian.nut-common.install | 0 {obs => scripts/obs}/debian.nut-common.postinst.in | 0 {obs => scripts/obs}/debian.nut-common.prerm.in | 0 {obs => scripts/obs}/debian.nut-common.tmpfiles.in | 0 .../obs}/debian.nut-doc.doc-base.nut-developer-guide | 0 {obs => scripts/obs}/debian.nut-doc.doc-base.nut-faq | 0 .../obs}/debian.nut-doc.doc-base.nut-packager-guide | 0 .../obs}/debian.nut-doc.doc-base.nut-user-manual | 0 {obs => scripts/obs}/debian.nut-doc.install | 0 {obs => scripts/obs}/debian.nut-ipmi.install | 0 {obs => scripts/obs}/debian.nut-ipmi.manpages | 0 {obs => scripts/obs}/debian.nut-linux-i2c.install | 0 {obs => scripts/obs}/debian.nut-linux-i2c.manpages | 0 {obs => scripts/obs}/debian.nut-modbus.install | 0 {obs => scripts/obs}/debian.nut-modbus.manpages | 0 {obs => scripts/obs}/debian.nut-monitor.install | 0 {obs => scripts/obs}/debian.nut-monitor.menu | 0 {obs => scripts/obs}/debian.nut-monitor.xpm | 0 {obs => scripts/obs}/debian.nut-powerman-pdu.install | 0 {obs => scripts/obs}/debian.nut-powerman-pdu.manpages | 0 {obs => scripts/obs}/debian.nut-server.dirs | 0 {obs => scripts/obs}/debian.nut-server.init.in | 0 {obs => scripts/obs}/debian.nut-server.install | 0 {obs => scripts/obs}/debian.nut-server.manpages | 0 {obs => scripts/obs}/debian.nut-server.postinst | 0 {obs => scripts/obs}/debian.nut-server.postrm | 0 {obs => scripts/obs}/debian.nut-server.preinst | 0 {obs => scripts/obs}/debian.nut-server.prerm.in | 0 {obs => scripts/obs}/debian.nut-snmp.docs | 0 {obs => scripts/obs}/debian.nut-snmp.install | 0 {obs => scripts/obs}/debian.nut-snmp.manpages | 0 {obs => scripts/obs}/debian.nut-xml.install | 0 {obs => scripts/obs}/debian.nut-xml.manpages | 0 {obs => scripts/obs}/debian.nut.README.Debian | 0 {obs => scripts/obs}/debian.nut.TODO.Debian | 0 {obs => scripts/obs}/debian.nut.changes | 0 {obs => scripts/obs}/debian.nut.docs | 0 {obs => scripts/obs}/debian.python-nut.install | 0 {obs => scripts/obs}/debian.rules | 2 +- {obs => scripts/obs}/debian.series | 0 {obs => scripts/obs}/debian.watch | 0 {obs => scripts/obs}/nut.dsc | 0 {obs => scripts/obs}/nut.spec | 0 {obs => scripts/obs}/pkgsrc.obs | 0 87 files changed, 10 insertions(+), 12 deletions(-) rename {obs => scripts/obs}/Makefile.am (100%) rename {obs => scripts/obs}/README.adoc (100%) rename {obs => scripts/obs}/debian.Makefile.am (100%) rename {obs => scripts/obs}/debian.NEWS (100%) rename {obs => scripts/obs}/debian.changelog (100%) rename {obs => scripts/obs}/debian.compat (100%) rename {obs => scripts/obs}/debian.control (100%) rename {obs => scripts/obs}/debian.copyright (100%) rename {obs => scripts/obs}/debian.description.subst (100%) rename {obs => scripts/obs}/debian.gbp.conf (100%) rename {obs => scripts/obs}/debian.hotplug (100%) rename {obs => scripts/obs}/debian.libnutclient-dev.install (100%) rename {obs => scripts/obs}/debian.libnutclient-dev.manpages (100%) rename {obs => scripts/obs}/debian.libnutclient1.install (100%) rename {obs => scripts/obs}/debian.libnutclient1.lintian-overrides (100%) rename {obs => scripts/obs}/debian.libnutclientstub-dev.install (100%) rename {obs => scripts/obs}/debian.libnutclientstub1.install (100%) rename {obs => scripts/obs}/debian.libnutclientstub1.lintian-overrides (100%) rename {obs => scripts/obs}/debian.libnutscan-dev.install (100%) rename {obs => scripts/obs}/debian.libnutscan1.install (100%) rename {obs => scripts/obs}/debian.libups-nut-perl.install (100%) rename {obs => scripts/obs}/debian.libupsclient-dev.install (100%) rename {obs => scripts/obs}/debian.libupsclient-dev.manpages (100%) rename {obs => scripts/obs}/debian.libupsclient4.install (100%) rename {obs => scripts/obs}/debian.nut-cgi.README.Debian (100%) rename {obs => scripts/obs}/debian.nut-cgi.docs (100%) rename {obs => scripts/obs}/debian.nut-cgi.install (100%) rename {obs => scripts/obs}/debian.nut-cgi.manpages (100%) rename {obs => scripts/obs}/debian.nut-cgi.postinst (100%) rename {obs => scripts/obs}/debian.nut-cgi.postrm (100%) rename {obs => scripts/obs}/debian.nut-client.init.in (100%) rename {obs => scripts/obs}/debian.nut-client.install (100%) rename {obs => scripts/obs}/debian.nut-client.links (100%) rename {obs => scripts/obs}/debian.nut-client.lintian-overrides (100%) rename {obs => scripts/obs}/debian.nut-client.maintscript (100%) rename {obs => scripts/obs}/debian.nut-client.manpages (100%) rename {obs => scripts/obs}/debian.nut-client.postinst (100%) rename {obs => scripts/obs}/debian.nut-client.preinst (100%) rename {obs => scripts/obs}/debian.nut-client.prerm (100%) rename {obs => scripts/obs}/debian.nut-common.install (100%) rename {obs => scripts/obs}/debian.nut-common.postinst.in (100%) rename {obs => scripts/obs}/debian.nut-common.prerm.in (100%) rename {obs => scripts/obs}/debian.nut-common.tmpfiles.in (100%) rename {obs => scripts/obs}/debian.nut-doc.doc-base.nut-developer-guide (100%) rename {obs => scripts/obs}/debian.nut-doc.doc-base.nut-faq (100%) rename {obs => scripts/obs}/debian.nut-doc.doc-base.nut-packager-guide (100%) rename {obs => scripts/obs}/debian.nut-doc.doc-base.nut-user-manual (100%) rename {obs => scripts/obs}/debian.nut-doc.install (100%) rename {obs => scripts/obs}/debian.nut-ipmi.install (100%) rename {obs => scripts/obs}/debian.nut-ipmi.manpages (100%) rename {obs => scripts/obs}/debian.nut-linux-i2c.install (100%) rename {obs => scripts/obs}/debian.nut-linux-i2c.manpages (100%) rename {obs => scripts/obs}/debian.nut-modbus.install (100%) rename {obs => scripts/obs}/debian.nut-modbus.manpages (100%) rename {obs => scripts/obs}/debian.nut-monitor.install (100%) rename {obs => scripts/obs}/debian.nut-monitor.menu (100%) rename {obs => scripts/obs}/debian.nut-monitor.xpm (100%) rename {obs => scripts/obs}/debian.nut-powerman-pdu.install (100%) rename {obs => scripts/obs}/debian.nut-powerman-pdu.manpages (100%) rename {obs => scripts/obs}/debian.nut-server.dirs (100%) rename {obs => scripts/obs}/debian.nut-server.init.in (100%) rename {obs => scripts/obs}/debian.nut-server.install (100%) rename {obs => scripts/obs}/debian.nut-server.manpages (100%) rename {obs => scripts/obs}/debian.nut-server.postinst (100%) rename {obs => scripts/obs}/debian.nut-server.postrm (100%) rename {obs => scripts/obs}/debian.nut-server.preinst (100%) rename {obs => scripts/obs}/debian.nut-server.prerm.in (100%) rename {obs => scripts/obs}/debian.nut-snmp.docs (100%) rename {obs => scripts/obs}/debian.nut-snmp.install (100%) rename {obs => scripts/obs}/debian.nut-snmp.manpages (100%) rename {obs => scripts/obs}/debian.nut-xml.install (100%) rename {obs => scripts/obs}/debian.nut-xml.manpages (100%) rename {obs => scripts/obs}/debian.nut.README.Debian (100%) rename {obs => scripts/obs}/debian.nut.TODO.Debian (100%) rename {obs => scripts/obs}/debian.nut.changes (100%) rename {obs => scripts/obs}/debian.nut.docs (100%) rename {obs => scripts/obs}/debian.python-nut.install (100%) rename {obs => scripts/obs}/debian.rules (98%) rename {obs => scripts/obs}/debian.series (100%) rename {obs => scripts/obs}/debian.watch (100%) rename {obs => scripts/obs}/nut.dsc (100%) rename {obs => scripts/obs}/nut.spec (100%) rename {obs => scripts/obs}/pkgsrc.obs (100%) diff --git a/Makefile.am b/Makefile.am index 22b7ae93f0..8fc1436077 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,7 +41,7 @@ ACLOCAL_AMFLAGS = -I m4 # depend on stuff in "common" or tools being built first! Also "data" depends # (during "dist" time) on scripts in "tools". SUBDIRS = include common clients conf drivers tools data \ - lib obs scripts server tests docs/man docs + lib scripts server tests docs/man docs # Note: not generated from SUBDIRS, because not all are recursive: SUBDIRS_ALL_RECURSIVE = \ @@ -55,7 +55,6 @@ SUBDIRS_ALL_RECURSIVE = \ all/tools/nutconf \ all-recursive/tools \ all/lib \ - all/obs \ all-recursive/scripts \ all/server \ all/tests/NIT \ @@ -276,7 +275,6 @@ all-libs-local/tools/nut-scanner: all-libs-local/drivers all-libs-local/common a all/conf \ all/lib \ -all/obs \ .ChangeLog.adoc-parsed.latest/docs \ ChangeLog.adoc-parsed/docs \ all-recursive/data: @@ -645,7 +643,6 @@ SPELLCHECK_DIRS_MOST = \ spellcheck/conf \ spellcheck/data \ spellcheck/data/htmlcgi \ - spellcheck/obs \ spellcheck/scripts \ spellcheck/scripts/Solaris \ spellcheck/scripts/Windows \ @@ -653,6 +650,7 @@ SPELLCHECK_DIRS_MOST = \ spellcheck/scripts/external_apis \ spellcheck/scripts/hotplug \ spellcheck/scripts/installer \ + spellcheck/scripts/obs \ spellcheck/scripts/python \ spellcheck/scripts/systemd \ spellcheck/scripts/udev \ diff --git a/ci_build.sh b/ci_build.sh index af8c60f3bd..69a5a73231 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2874,7 +2874,7 @@ cross-windows-mingw*) pkg-rpm|pkg-spec) rm -f nut.spec || true git clean -fdX || true - cp -f obs/nut.spec . + cp -f scripts/obs/nut.spec . sed -e 's,^(Version:).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.spec rpmbuild -ba \ @@ -2885,11 +2885,11 @@ pkg-deb|pkg-dsc) rm -rf debian config.*cdbs* nut.dsc || true git clean -fdX || true mkdir -p debian - (cd obs || exit + (cd scripts/obs || exit for F in debian.* ; do - ln -s "../obs/$F" "../debian/`echo "$F" | sed 's/debian.//'`" || exit + ln -s "../scripts/obs/$F" "../../debian/`echo "$F" | sed 's/debian.//'`" || exit done) || exit - cp -f obs/nut.dsc . + cp -f scripts/obs/nut.dsc . sed -e 's,^\(Version:\).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.dsc dpkg-checkbuilddeps || sudo mk-build-debs -i diff --git a/configure.ac b/configure.ac index 90fde4f7cd..d06c73f83f 100644 --- a/configure.ac +++ b/configure.ac @@ -6789,7 +6789,6 @@ AC_CONFIG_FILES([ lib/libnutclientstub.pc lib/libnutscan.pc lib/Makefile - obs/Makefile scripts/Aix/nut-aix.spec scripts/RedHat/ups scripts/augeas/Makefile @@ -6809,6 +6808,7 @@ AC_CONFIG_FILES([ scripts/HP-UX/nut.psf scripts/installer/Makefile scripts/misc/nut.bash_completion + scripts/obs/Makefile scripts/python/Makefile scripts/python/module/Makefile scripts/python/module/PyNUT.py diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 748aff54cb..0c60ce9a77 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -30,9 +30,9 @@ EXTRA_DIST = \ valgrind/valgrind.sh.in \ Windows/halt.c -SUBDIRS = augeas devd hotplug installer python systemd udev ufw Solaris Windows upsdrvsvcctl external_apis +SUBDIRS = augeas devd hotplug installer obs python systemd udev ufw Solaris Windows upsdrvsvcctl external_apis -SPELLCHECK_SRC = README.adoc RedHat/README.adoc usb_resetter/README.adoc valgrind/README.adoc +SPELLCHECK_SRC = README.adoc RedHat/README.adoc usb_resetter/README.adoc valgrind/README.adoc obs/README.adoc # NOTE: Due to portability, we do not use a GNU percent-wildcard extension. # We also have to export some variables that may be tainted by relative diff --git a/obs/Makefile.am b/scripts/obs/Makefile.am similarity index 100% rename from obs/Makefile.am rename to scripts/obs/Makefile.am diff --git a/obs/README.adoc b/scripts/obs/README.adoc similarity index 100% rename from obs/README.adoc rename to scripts/obs/README.adoc diff --git a/obs/debian.Makefile.am b/scripts/obs/debian.Makefile.am similarity index 100% rename from obs/debian.Makefile.am rename to scripts/obs/debian.Makefile.am diff --git a/obs/debian.NEWS b/scripts/obs/debian.NEWS similarity index 100% rename from obs/debian.NEWS rename to scripts/obs/debian.NEWS diff --git a/obs/debian.changelog b/scripts/obs/debian.changelog similarity index 100% rename from obs/debian.changelog rename to scripts/obs/debian.changelog diff --git a/obs/debian.compat b/scripts/obs/debian.compat similarity index 100% rename from obs/debian.compat rename to scripts/obs/debian.compat diff --git a/obs/debian.control b/scripts/obs/debian.control similarity index 100% rename from obs/debian.control rename to scripts/obs/debian.control diff --git a/obs/debian.copyright b/scripts/obs/debian.copyright similarity index 100% rename from obs/debian.copyright rename to scripts/obs/debian.copyright diff --git a/obs/debian.description.subst b/scripts/obs/debian.description.subst similarity index 100% rename from obs/debian.description.subst rename to scripts/obs/debian.description.subst diff --git a/obs/debian.gbp.conf b/scripts/obs/debian.gbp.conf similarity index 100% rename from obs/debian.gbp.conf rename to scripts/obs/debian.gbp.conf diff --git a/obs/debian.hotplug b/scripts/obs/debian.hotplug similarity index 100% rename from obs/debian.hotplug rename to scripts/obs/debian.hotplug diff --git a/obs/debian.libnutclient-dev.install b/scripts/obs/debian.libnutclient-dev.install similarity index 100% rename from obs/debian.libnutclient-dev.install rename to scripts/obs/debian.libnutclient-dev.install diff --git a/obs/debian.libnutclient-dev.manpages b/scripts/obs/debian.libnutclient-dev.manpages similarity index 100% rename from obs/debian.libnutclient-dev.manpages rename to scripts/obs/debian.libnutclient-dev.manpages diff --git a/obs/debian.libnutclient1.install b/scripts/obs/debian.libnutclient1.install similarity index 100% rename from obs/debian.libnutclient1.install rename to scripts/obs/debian.libnutclient1.install diff --git a/obs/debian.libnutclient1.lintian-overrides b/scripts/obs/debian.libnutclient1.lintian-overrides similarity index 100% rename from obs/debian.libnutclient1.lintian-overrides rename to scripts/obs/debian.libnutclient1.lintian-overrides diff --git a/obs/debian.libnutclientstub-dev.install b/scripts/obs/debian.libnutclientstub-dev.install similarity index 100% rename from obs/debian.libnutclientstub-dev.install rename to scripts/obs/debian.libnutclientstub-dev.install diff --git a/obs/debian.libnutclientstub1.install b/scripts/obs/debian.libnutclientstub1.install similarity index 100% rename from obs/debian.libnutclientstub1.install rename to scripts/obs/debian.libnutclientstub1.install diff --git a/obs/debian.libnutclientstub1.lintian-overrides b/scripts/obs/debian.libnutclientstub1.lintian-overrides similarity index 100% rename from obs/debian.libnutclientstub1.lintian-overrides rename to scripts/obs/debian.libnutclientstub1.lintian-overrides diff --git a/obs/debian.libnutscan-dev.install b/scripts/obs/debian.libnutscan-dev.install similarity index 100% rename from obs/debian.libnutscan-dev.install rename to scripts/obs/debian.libnutscan-dev.install diff --git a/obs/debian.libnutscan1.install b/scripts/obs/debian.libnutscan1.install similarity index 100% rename from obs/debian.libnutscan1.install rename to scripts/obs/debian.libnutscan1.install diff --git a/obs/debian.libups-nut-perl.install b/scripts/obs/debian.libups-nut-perl.install similarity index 100% rename from obs/debian.libups-nut-perl.install rename to scripts/obs/debian.libups-nut-perl.install diff --git a/obs/debian.libupsclient-dev.install b/scripts/obs/debian.libupsclient-dev.install similarity index 100% rename from obs/debian.libupsclient-dev.install rename to scripts/obs/debian.libupsclient-dev.install diff --git a/obs/debian.libupsclient-dev.manpages b/scripts/obs/debian.libupsclient-dev.manpages similarity index 100% rename from obs/debian.libupsclient-dev.manpages rename to scripts/obs/debian.libupsclient-dev.manpages diff --git a/obs/debian.libupsclient4.install b/scripts/obs/debian.libupsclient4.install similarity index 100% rename from obs/debian.libupsclient4.install rename to scripts/obs/debian.libupsclient4.install diff --git a/obs/debian.nut-cgi.README.Debian b/scripts/obs/debian.nut-cgi.README.Debian similarity index 100% rename from obs/debian.nut-cgi.README.Debian rename to scripts/obs/debian.nut-cgi.README.Debian diff --git a/obs/debian.nut-cgi.docs b/scripts/obs/debian.nut-cgi.docs similarity index 100% rename from obs/debian.nut-cgi.docs rename to scripts/obs/debian.nut-cgi.docs diff --git a/obs/debian.nut-cgi.install b/scripts/obs/debian.nut-cgi.install similarity index 100% rename from obs/debian.nut-cgi.install rename to scripts/obs/debian.nut-cgi.install diff --git a/obs/debian.nut-cgi.manpages b/scripts/obs/debian.nut-cgi.manpages similarity index 100% rename from obs/debian.nut-cgi.manpages rename to scripts/obs/debian.nut-cgi.manpages diff --git a/obs/debian.nut-cgi.postinst b/scripts/obs/debian.nut-cgi.postinst similarity index 100% rename from obs/debian.nut-cgi.postinst rename to scripts/obs/debian.nut-cgi.postinst diff --git a/obs/debian.nut-cgi.postrm b/scripts/obs/debian.nut-cgi.postrm similarity index 100% rename from obs/debian.nut-cgi.postrm rename to scripts/obs/debian.nut-cgi.postrm diff --git a/obs/debian.nut-client.init.in b/scripts/obs/debian.nut-client.init.in similarity index 100% rename from obs/debian.nut-client.init.in rename to scripts/obs/debian.nut-client.init.in diff --git a/obs/debian.nut-client.install b/scripts/obs/debian.nut-client.install similarity index 100% rename from obs/debian.nut-client.install rename to scripts/obs/debian.nut-client.install diff --git a/obs/debian.nut-client.links b/scripts/obs/debian.nut-client.links similarity index 100% rename from obs/debian.nut-client.links rename to scripts/obs/debian.nut-client.links diff --git a/obs/debian.nut-client.lintian-overrides b/scripts/obs/debian.nut-client.lintian-overrides similarity index 100% rename from obs/debian.nut-client.lintian-overrides rename to scripts/obs/debian.nut-client.lintian-overrides diff --git a/obs/debian.nut-client.maintscript b/scripts/obs/debian.nut-client.maintscript similarity index 100% rename from obs/debian.nut-client.maintscript rename to scripts/obs/debian.nut-client.maintscript diff --git a/obs/debian.nut-client.manpages b/scripts/obs/debian.nut-client.manpages similarity index 100% rename from obs/debian.nut-client.manpages rename to scripts/obs/debian.nut-client.manpages diff --git a/obs/debian.nut-client.postinst b/scripts/obs/debian.nut-client.postinst similarity index 100% rename from obs/debian.nut-client.postinst rename to scripts/obs/debian.nut-client.postinst diff --git a/obs/debian.nut-client.preinst b/scripts/obs/debian.nut-client.preinst similarity index 100% rename from obs/debian.nut-client.preinst rename to scripts/obs/debian.nut-client.preinst diff --git a/obs/debian.nut-client.prerm b/scripts/obs/debian.nut-client.prerm similarity index 100% rename from obs/debian.nut-client.prerm rename to scripts/obs/debian.nut-client.prerm diff --git a/obs/debian.nut-common.install b/scripts/obs/debian.nut-common.install similarity index 100% rename from obs/debian.nut-common.install rename to scripts/obs/debian.nut-common.install diff --git a/obs/debian.nut-common.postinst.in b/scripts/obs/debian.nut-common.postinst.in similarity index 100% rename from obs/debian.nut-common.postinst.in rename to scripts/obs/debian.nut-common.postinst.in diff --git a/obs/debian.nut-common.prerm.in b/scripts/obs/debian.nut-common.prerm.in similarity index 100% rename from obs/debian.nut-common.prerm.in rename to scripts/obs/debian.nut-common.prerm.in diff --git a/obs/debian.nut-common.tmpfiles.in b/scripts/obs/debian.nut-common.tmpfiles.in similarity index 100% rename from obs/debian.nut-common.tmpfiles.in rename to scripts/obs/debian.nut-common.tmpfiles.in diff --git a/obs/debian.nut-doc.doc-base.nut-developer-guide b/scripts/obs/debian.nut-doc.doc-base.nut-developer-guide similarity index 100% rename from obs/debian.nut-doc.doc-base.nut-developer-guide rename to scripts/obs/debian.nut-doc.doc-base.nut-developer-guide diff --git a/obs/debian.nut-doc.doc-base.nut-faq b/scripts/obs/debian.nut-doc.doc-base.nut-faq similarity index 100% rename from obs/debian.nut-doc.doc-base.nut-faq rename to scripts/obs/debian.nut-doc.doc-base.nut-faq diff --git a/obs/debian.nut-doc.doc-base.nut-packager-guide b/scripts/obs/debian.nut-doc.doc-base.nut-packager-guide similarity index 100% rename from obs/debian.nut-doc.doc-base.nut-packager-guide rename to scripts/obs/debian.nut-doc.doc-base.nut-packager-guide diff --git a/obs/debian.nut-doc.doc-base.nut-user-manual b/scripts/obs/debian.nut-doc.doc-base.nut-user-manual similarity index 100% rename from obs/debian.nut-doc.doc-base.nut-user-manual rename to scripts/obs/debian.nut-doc.doc-base.nut-user-manual diff --git a/obs/debian.nut-doc.install b/scripts/obs/debian.nut-doc.install similarity index 100% rename from obs/debian.nut-doc.install rename to scripts/obs/debian.nut-doc.install diff --git a/obs/debian.nut-ipmi.install b/scripts/obs/debian.nut-ipmi.install similarity index 100% rename from obs/debian.nut-ipmi.install rename to scripts/obs/debian.nut-ipmi.install diff --git a/obs/debian.nut-ipmi.manpages b/scripts/obs/debian.nut-ipmi.manpages similarity index 100% rename from obs/debian.nut-ipmi.manpages rename to scripts/obs/debian.nut-ipmi.manpages diff --git a/obs/debian.nut-linux-i2c.install b/scripts/obs/debian.nut-linux-i2c.install similarity index 100% rename from obs/debian.nut-linux-i2c.install rename to scripts/obs/debian.nut-linux-i2c.install diff --git a/obs/debian.nut-linux-i2c.manpages b/scripts/obs/debian.nut-linux-i2c.manpages similarity index 100% rename from obs/debian.nut-linux-i2c.manpages rename to scripts/obs/debian.nut-linux-i2c.manpages diff --git a/obs/debian.nut-modbus.install b/scripts/obs/debian.nut-modbus.install similarity index 100% rename from obs/debian.nut-modbus.install rename to scripts/obs/debian.nut-modbus.install diff --git a/obs/debian.nut-modbus.manpages b/scripts/obs/debian.nut-modbus.manpages similarity index 100% rename from obs/debian.nut-modbus.manpages rename to scripts/obs/debian.nut-modbus.manpages diff --git a/obs/debian.nut-monitor.install b/scripts/obs/debian.nut-monitor.install similarity index 100% rename from obs/debian.nut-monitor.install rename to scripts/obs/debian.nut-monitor.install diff --git a/obs/debian.nut-monitor.menu b/scripts/obs/debian.nut-monitor.menu similarity index 100% rename from obs/debian.nut-monitor.menu rename to scripts/obs/debian.nut-monitor.menu diff --git a/obs/debian.nut-monitor.xpm b/scripts/obs/debian.nut-monitor.xpm similarity index 100% rename from obs/debian.nut-monitor.xpm rename to scripts/obs/debian.nut-monitor.xpm diff --git a/obs/debian.nut-powerman-pdu.install b/scripts/obs/debian.nut-powerman-pdu.install similarity index 100% rename from obs/debian.nut-powerman-pdu.install rename to scripts/obs/debian.nut-powerman-pdu.install diff --git a/obs/debian.nut-powerman-pdu.manpages b/scripts/obs/debian.nut-powerman-pdu.manpages similarity index 100% rename from obs/debian.nut-powerman-pdu.manpages rename to scripts/obs/debian.nut-powerman-pdu.manpages diff --git a/obs/debian.nut-server.dirs b/scripts/obs/debian.nut-server.dirs similarity index 100% rename from obs/debian.nut-server.dirs rename to scripts/obs/debian.nut-server.dirs diff --git a/obs/debian.nut-server.init.in b/scripts/obs/debian.nut-server.init.in similarity index 100% rename from obs/debian.nut-server.init.in rename to scripts/obs/debian.nut-server.init.in diff --git a/obs/debian.nut-server.install b/scripts/obs/debian.nut-server.install similarity index 100% rename from obs/debian.nut-server.install rename to scripts/obs/debian.nut-server.install diff --git a/obs/debian.nut-server.manpages b/scripts/obs/debian.nut-server.manpages similarity index 100% rename from obs/debian.nut-server.manpages rename to scripts/obs/debian.nut-server.manpages diff --git a/obs/debian.nut-server.postinst b/scripts/obs/debian.nut-server.postinst similarity index 100% rename from obs/debian.nut-server.postinst rename to scripts/obs/debian.nut-server.postinst diff --git a/obs/debian.nut-server.postrm b/scripts/obs/debian.nut-server.postrm similarity index 100% rename from obs/debian.nut-server.postrm rename to scripts/obs/debian.nut-server.postrm diff --git a/obs/debian.nut-server.preinst b/scripts/obs/debian.nut-server.preinst similarity index 100% rename from obs/debian.nut-server.preinst rename to scripts/obs/debian.nut-server.preinst diff --git a/obs/debian.nut-server.prerm.in b/scripts/obs/debian.nut-server.prerm.in similarity index 100% rename from obs/debian.nut-server.prerm.in rename to scripts/obs/debian.nut-server.prerm.in diff --git a/obs/debian.nut-snmp.docs b/scripts/obs/debian.nut-snmp.docs similarity index 100% rename from obs/debian.nut-snmp.docs rename to scripts/obs/debian.nut-snmp.docs diff --git a/obs/debian.nut-snmp.install b/scripts/obs/debian.nut-snmp.install similarity index 100% rename from obs/debian.nut-snmp.install rename to scripts/obs/debian.nut-snmp.install diff --git a/obs/debian.nut-snmp.manpages b/scripts/obs/debian.nut-snmp.manpages similarity index 100% rename from obs/debian.nut-snmp.manpages rename to scripts/obs/debian.nut-snmp.manpages diff --git a/obs/debian.nut-xml.install b/scripts/obs/debian.nut-xml.install similarity index 100% rename from obs/debian.nut-xml.install rename to scripts/obs/debian.nut-xml.install diff --git a/obs/debian.nut-xml.manpages b/scripts/obs/debian.nut-xml.manpages similarity index 100% rename from obs/debian.nut-xml.manpages rename to scripts/obs/debian.nut-xml.manpages diff --git a/obs/debian.nut.README.Debian b/scripts/obs/debian.nut.README.Debian similarity index 100% rename from obs/debian.nut.README.Debian rename to scripts/obs/debian.nut.README.Debian diff --git a/obs/debian.nut.TODO.Debian b/scripts/obs/debian.nut.TODO.Debian similarity index 100% rename from obs/debian.nut.TODO.Debian rename to scripts/obs/debian.nut.TODO.Debian diff --git a/obs/debian.nut.changes b/scripts/obs/debian.nut.changes similarity index 100% rename from obs/debian.nut.changes rename to scripts/obs/debian.nut.changes diff --git a/obs/debian.nut.docs b/scripts/obs/debian.nut.docs similarity index 100% rename from obs/debian.nut.docs rename to scripts/obs/debian.nut.docs diff --git a/obs/debian.python-nut.install b/scripts/obs/debian.python-nut.install similarity index 100% rename from obs/debian.python-nut.install rename to scripts/obs/debian.python-nut.install diff --git a/obs/debian.rules b/scripts/obs/debian.rules similarity index 98% rename from obs/debian.rules rename to scripts/obs/debian.rules index 166baf3baf..c144d21036 100755 --- a/obs/debian.rules +++ b/scripts/obs/debian.rules @@ -127,7 +127,7 @@ common-install-arch:: mkdir -p $(CURDIR)/debian for F in nut-client.init nut-common.postinst nut-common.prerm nut-server.init nut-server.prerm nut-common.tmpfiles ; do \ echo " SED $$F.in => $$F" ; \ - sed 's,@runbasedir[@],$(runbasedir),g' < "$(CURDIR)/obs/debian.$$F.in" > $(CURDIR)/debian/"$$F" || exit ; \ + sed 's,@runbasedir[@],$(runbasedir),g' < "$(CURDIR)/scripts/obs/debian.$$F.in" > $(CURDIR)/debian/"$$F" || exit ; \ done # install the bash completion script diff --git a/obs/debian.series b/scripts/obs/debian.series similarity index 100% rename from obs/debian.series rename to scripts/obs/debian.series diff --git a/obs/debian.watch b/scripts/obs/debian.watch similarity index 100% rename from obs/debian.watch rename to scripts/obs/debian.watch diff --git a/obs/nut.dsc b/scripts/obs/nut.dsc similarity index 100% rename from obs/nut.dsc rename to scripts/obs/nut.dsc diff --git a/obs/nut.spec b/scripts/obs/nut.spec similarity index 100% rename from obs/nut.spec rename to scripts/obs/nut.spec diff --git a/obs/pkgsrc.obs b/scripts/obs/pkgsrc.obs similarity index 100% rename from obs/pkgsrc.obs rename to scripts/obs/pkgsrc.obs From 72ad4738be137f2ebfc829516881f596e61f7b84 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 12:34:09 +0200 Subject: [PATCH 164/207] scripts/obs/_service: add a copy of working OBS recipe Signed-off-by: Jim Klimov --- scripts/obs/Makefile.am | 2 +- scripts/obs/_service | 59 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 scripts/obs/_service diff --git a/scripts/obs/Makefile.am b/scripts/obs/Makefile.am index 006149e736..e6e3c79dd8 100644 --- a/scripts/obs/Makefile.am +++ b/scripts/obs/Makefile.am @@ -1,6 +1,6 @@ # Network UPS Tools: obs (root) -EXTRA_DIST = README.adoc +EXTRA_DIST = README.adoc _service # Also EXTRA_DIST the recipe-related files (so OBS can use tarballs if they like) diff --git a/scripts/obs/_service b/scripts/obs/_service new file mode 100644 index 0000000000..2cb090a9a4 --- /dev/null +++ b/scripts/obs/_service @@ -0,0 +1,59 @@ + + + https://github.com/jimklimov/nut.git + git + FTY-obs + + + + @PARENT_TAG@.@TAG_OFFSET@ + v(.*) + .git + nut + + scripts/obs/nut.dsc + scripts/obs/nut.spec + scripts/obs/pkgsrc.* + + enable + + + + + + + + + + *.tar + */scripts/obs/debian.* + + + + + nut + + + + *.tar + gz + + \ No newline at end of file From 47e279ddd01d8f7d3bc4e566fe7f7caeaafcb179 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 12:34:41 +0200 Subject: [PATCH 165/207] scripts/obs/README.adoc: update with Practical setup and Other notes Signed-off-by: Jim Klimov --- docs/nut.dict | 4 +++- scripts/obs/README.adoc | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/docs/nut.dict b/docs/nut.dict index c2e59d1df1..0f175ab8d5 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -1,4 +1,4 @@ -personal_ws-1.1 en 3566 utf-8 +personal_ws-1.1 en 3575 utf-8 AAC AAS ABI @@ -148,6 +148,7 @@ Breiland Brownell Bs BuildBot +BuildRequires Buildbot Bxx ByPass @@ -2877,6 +2878,7 @@ prio priv privPassword privProtocol +prjconf problemMatcher probu proc diff --git a/scripts/obs/README.adoc b/scripts/obs/README.adoc index fdf8d8259f..938a6b5f7d 100644 --- a/scripts/obs/README.adoc +++ b/scripts/obs/README.adoc @@ -1,5 +1,7 @@ = Packaging recipes for OBS +== Overview + This directory holds reference NUT packaging recipes for RPM, DEB and other formats, and is primarily aimed at automation of builds with the link:https://openbuildservice.org/[Open Build Service (OBS)]. @@ -14,10 +16,36 @@ NOTE: The layout of files and directories here is dictated by current expectations of the OBS software (if at some point it has to be a flat mess with no structure -- so be it). -For some practical details see: +== Practical setup + +The copy of `_service` file represents the directly maintained OBS recipe +in an OBS packaging project, and is the only file needed there (triggering +service runs updates the temporary tarball from git). + +Beside that, `osc meta prjconf --edit` can be used to specify unambiguous +preferences for certain packages, when a distro actually offers a choice +via conditional `BuildRequires` statements, e.g.: + +---- +Prefer: libusbx-devel +Prefer: libusb-1.0-dev +Prefer: neon-devel +---- + +A parent project must be used to define OBS Repositories we build for, which +should usually include a layer with `openSUSE:Tools` to have the OBS helper +scripts needed for package and tarball transformations in the build area, +for example: https://build.opensuse.org/projects/home:jimklimov/meta + +The list of known distros and repositories massaged with these tools can be +seen at https://build.opensuse.org/repositories/openSUSE:Tools + +For some historical and/or practical details see: * https://github.com/networkupstools/nut/issues/1209 +== Other notes + The recipe files themselves would likely cross-pollinate with popular distributions, to allow easier replacement of standard, supported and stale package builds with those of experimental development iterations. @@ -28,3 +56,7 @@ which adds version number components to expose the "age" of each such iteration as a number of commits merged into the common development trunk since a preceding release, and a number of commits unique to a feature branch. + +Maybe some way of pre-making a dist tarball (with `VERSION_DEFAULT`, man +pages pre-built, etc.) and using that would be better, to be explored +(ideally if we can do this within OBS). From 84d82f3f02630c50b32c9fbc15ad4daa08432a4f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 12:37:03 +0200 Subject: [PATCH 166/207] ci_build.sh: add failsafes into pkg* build types Signed-off-by: Jim Klimov --- ci_build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci_build.sh b/ci_build.sh index 69a5a73231..c78f2b7acc 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2872,6 +2872,11 @@ cross-windows-mingw*) ;; pkg-rpm|pkg-spec) + echo "WARNING: package build recipes manipulate directly your current workspace" >&2 + echo " and would remove any git-ignored files, might leave trash afterwards!" >&2 + echo " Press Ctrl+C to abort if this is a problem" >&2 + sleep 5 + rm -f nut.spec || true git clean -fdX || true cp -f scripts/obs/nut.spec . @@ -2882,6 +2887,11 @@ pkg-rpm|pkg-spec) ;; pkg-deb|pkg-dsc) + echo "WARNING: package build recipes manipulate directly your current workspace" >&2 + echo " and would remove any git-ignored files, might leave trash afterwards!" >&2 + echo " Press Ctrl+C to abort if this is a problem" >&2 + sleep 5 + rm -rf debian config.*cdbs* nut.dsc || true git clean -fdX || true mkdir -p debian From d8de298a8674c1d9dfee9a009c0999caa24c0ab7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 12:45:36 +0200 Subject: [PATCH 167/207] scripts/obs/nut.spec: let the SPEC version reflect in NUT self-identification Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 6ac7ce5ae5..fee5a8c0a4 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -294,6 +294,12 @@ Detailed information about supported hardware can be found in # Note: NOT configure macro, due to override of --sysconfdir and --datadir # values just for the recipe part but not for whole specfile %build +# May be pre-populated if building from tarball, or derived from git +# Otherwise let the SPEC version reflect in NUT self-identification +if [ ! -s VERSION_DEFAULT ] && [ ! -e .git ] && [ -n '%{version}' ] ; then + echo NUT_VERSION_DEFAULT='%{version}' > VERSION_DEFAULT +fi + sh autogen.sh ./configure --disable-static --with-pic \ --prefix=%{_prefix}\ From f0448b4e0761c327bb170fc78ad69c4c8548296e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 14:53:57 +0200 Subject: [PATCH 168/207] scripts/obs/nut.spec: refactor how we get HTMLPATH and CGIPATH, they may be different in APXS output Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index fee5a8c0a4..797526a692 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -27,19 +27,26 @@ %define LIBEXECPATH %{_libexecdir}/ups # Requires httpd(-devel?) or apache2(-devel?) to be present in this distro: -%define apache_serverroot %(%{_sbindir}/apxs2 -q datadir || %{_sbindir}/apxs -q PREFIX || true) -%if "0%{?apache_serverroot}" == "0" || 0%(echo '%{apache_serverroot}' | grep -E '^%{_datadir}' >/dev/null && echo 1 || echo 0) > 0 +%define apache_serverroot_data %(%{_sbindir}/apxs2 -q datadir || %{_sbindir}/apxs -q PREFIX || true) +# FIXME: is naming correct for both versions? +%define apache_serverroot_cgi %(%{_sbindir}/apxs2 -q cgidir || %{_sbindir}/apxs -q cgidir || true) + +%if "0%{?apache_serverroot_cgi}" == "0" || 0%(echo '%{apache_serverroot_cgi}' | grep -E '^%{_datadir}' >/dev/null && echo 1 || echo 0) > 0 # Spec-var is undefined or empty, or matches the pattern triggering # E: arch-dependent-file-in-usr-share (Badness: 590) # Dump nut-cgi artifacts under our own locations, so end-users can # integrate them later. %define CGIPATH %{LIBEXECPATH}/cgi-bin +%else +%define CGIPATH %{apache_serverroot_cgi}/cgi-bin/nut +%endif + +%if "0%{?apache_serverroot_data}" == "0" %define HTMLPATH %{_datadir}/nut/htdocs %else # Rename web pages location to not conflict with apache2-example-pages # or user home page: -%define CGIPATH %{apache_serverroot}/cgi-bin/nut -%define HTMLPATH %{apache_serverroot}/htdocs/nut +%define HTMLPATH %{apache_serverroot_data}/htdocs/nut %endif %define MODELPATH %{LIBEXECPATH}/driver From 24fff584ea4de3b5bacc575862541e24444226f2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 15:15:13 +0200 Subject: [PATCH 169/207] scripts/obs/nut.spec: require user/group for post-install script context Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 797526a692..7172f88464 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -128,6 +128,9 @@ Requires: usbutils %if 0%{?suse_version} Requires(post): udev %endif +Requires(post): group(%{NUT_GROUP}) +Requires(post): user(%{NUT_USER}) + BuildRoot: %{_tmppath}/%{name}-%{version}-build # To fix end-of-line encoding: From 4b07052ad43385f134ad5d1bb64f9a97ddca9457 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 15:17:54 +0200 Subject: [PATCH 170/207] scripts/obs/nut.spec: require more tools for SUSE platform tests on OBS Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 7172f88464..d816279d03 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -118,6 +118,7 @@ Requires: %{_sbindir}/sh Requires: %{_bindir}/chown Requires: %{_bindir}/chgrp Requires: %{_bindir}/chmod +BuildRequires: %{_sbindir}/chroot Requires: %{_bindir}/rm Requires: %{_bindir}/fgrep Requires: %{_bindir}/grep @@ -130,6 +131,7 @@ Requires(post): udev %endif Requires(post): group(%{NUT_GROUP}) Requires(post): user(%{NUT_USER}) +Requires(postun): %{_bindir}/sh BuildRoot: %{_tmppath}/%{name}-%{version}-build From b287635a3e14b8a954e734e2048330f0240e9883 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 15:22:12 +0200 Subject: [PATCH 171/207] scripts/obs/nut.spec: do not package directly-named "/bin" objects Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index d816279d03..f4f4042ba5 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -451,7 +451,6 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %defattr(-,root,root) %doc AUTHORS COPYING LICENSE-DCO LICENSE-GPL2 LICENSE-GPL3 ChangeLog MAINTAINERS NEWS.adoc README.adoc UPGRADING.adoc docs/*.adoc docs/*.txt docs/cables/*.txt # List the (system) dirs we impact but do not own for the package -%dir /bin %dir %{BASHCOMPLETIONPATH} %dir %{_sysconfdir}/logrotate.d %dir %{_bindir} @@ -472,7 +471,6 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %dir %{systemdtmpfilesdir} %dir %{systemdshutdowndir} # List the file patterns to install from proto area -/bin/* %{BASHCOMPLETIONPATH}/* %config(noreplace) %{_sysconfdir}/logrotate.d/* %{_bindir}/* From 4b0abe252345ea7a3fd3f5fcb7b42152acbfd880 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 15:26:20 +0200 Subject: [PATCH 172/207] scripts/obs/nut.spec: dep on chroot does not work like this Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index f4f4042ba5..d1d7515262 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -118,7 +118,7 @@ Requires: %{_sbindir}/sh Requires: %{_bindir}/chown Requires: %{_bindir}/chgrp Requires: %{_bindir}/chmod -BuildRequires: %{_sbindir}/chroot +###BuildRequires: % {_sbindir}/chroot Requires: %{_bindir}/rm Requires: %{_bindir}/fgrep Requires: %{_bindir}/grep From ecc517c87f647b06d4a7980b4c62842846ac8f83 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 15:35:18 +0200 Subject: [PATCH 173/207] scripts/obs/nut.spec: dep on accounts for pkg self-test does not work like this Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index d1d7515262..1380fa81fa 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -129,8 +129,8 @@ Requires: usbutils %if 0%{?suse_version} Requires(post): udev %endif -Requires(post): group(%{NUT_GROUP}) -Requires(post): user(%{NUT_USER}) +#Requires(post): group(% {NUT_GROUP}) +#Requires(post): user(% {NUT_USER}) Requires(postun): %{_bindir}/sh BuildRoot: %{_tmppath}/%{name}-%{version}-build From a29b650f05b6ce950b110d06f7c21b4f676d4053 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 15:38:23 +0200 Subject: [PATCH 174/207] scripts/obs/nut.spec: BuildRequires: libxml2-devel Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 1380fa81fa..3d71a557c4 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -154,6 +154,7 @@ BuildRequires: libtool-ltdl-devel BuildRequires: (libusb-devel or libusbx-devel) #!Prefer: libusbx-devel BuildRequires: net-snmp-devel +BuildRequires: libxml2-devel BuildRequires: pkg-config # Maybe older Pythons are also okay, but were not tested for ages BuildRequires: (python >= 2.6 or python3 or python2) From a18738944766baebdbef450fa5a63e7e3e7d7bec Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 15:56:29 +0200 Subject: [PATCH 175/207] scripts/obs/nut.spec: fix systemdtmpfilesdir determination Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 3d71a557c4..4f36f62b48 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -80,7 +80,7 @@ # Collect systemd related paths so we can package files there: %define systemdsystemunitdir %(pkg-config --variable=systemdsystemunitdir systemd) %define systemdsystempresetdir %(pkg-config --variable=systemdsystempresetdir systemd || pkg-config --variable=systemdsystempresetdir libsystemd) -%define systemdtmpfilesdir %(pkg-config --variable=systemdtmpfilesdir systemd || pkg-config --variable=systemdtmpfilesdir libsystemd) +%define systemdtmpfilesdir %(pkg-config --variable=tmpfilesdir systemd || pkg-config --variable=tmpfilesdir libsystemd) %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) From 9692a9766fe3699ceb479db23c71b328ddb2b6fd Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 16:00:23 +0200 Subject: [PATCH 176/207] scripts/obs/nut.spec: fence delivery of systemd files (check if we could resolve the the paths involved) Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 4f36f62b48..185ccc34c6 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -467,10 +467,22 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %dir %{_mandir}/man7 %dir %{_mandir}/man8 %dir %{_libexecdir} +%if "x%{?systemdsystemunitdir}" == "x" +%else %dir %{systemdsystemunitdir} +%endif +%if "x%{?systemdsystempresetdir}" == "x" +%else %dir %{systemdsystempresetdir} +%endif +%if "x%{?systemdtmpfilesdir}" == "x" +%else %dir %{systemdtmpfilesdir} +%endif +%if "x%{?systemdshutdowndir}" == "x" +%else %dir %{systemdshutdowndir} +%endif # List the file patterns to install from proto area %{BASHCOMPLETIONPATH}/* %config(noreplace) %{_sysconfdir}/logrotate.d/* @@ -512,10 +524,22 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %exclude %{_sbindir}/gen-snmp-subdriver.sh %attr(770,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH} %attr(770,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH}/upssched +%if "x%{?systemdsystemunitdir}" == "x" +%else %{systemdsystemunitdir}/* +%endif +%if "x%{?systemdsystempresetdir}" == "x" +%else %{systemdsystempresetdir}/* +%endif +%if "x%{?systemdtmpfilesdir}" == "x" +%else %{systemdtmpfilesdir}/* +%endif +%if "x%{?systemdshutdowndir}" == "x" +%else %{systemdshutdowndir}/nutshutdown +%endif %{_datadir}/augeas/lenses/dist/nuthostsconf.aug %{_datadir}/augeas/lenses/dist/nutnutconf.aug %{_datadir}/augeas/lenses/dist/nutupsconf.aug From 2378cbe46101d8cd4f9332357e551248d419ac49 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 16:06:42 +0200 Subject: [PATCH 177/207] scripts/obs/nut.spec: do not relocate upssched-cmd to hard-coded /bin Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 185ccc34c6..823a430f1e 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -366,8 +366,6 @@ mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d # Avoid W: incoherent-logrotate-file /etc/logrotate.d/nutlogd install -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/nut rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample -mkdir -p %{buildroot}/bin -mv %{buildroot}%{_bindir}/upssched-cmd %{buildroot}/bin/upssched-cmd find %{buildroot} -type f -name "*.la" -delete -print mkdir -p %{buildroot}%{BASHCOMPLETIONPATH} install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{BASHCOMPLETIONPATH}/ From 8eaa33c506433ab56bbbc8b819637ce0134922ed Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 16:52:21 +0200 Subject: [PATCH 178/207] scripts/obs/nut.spec: revise pre/port-in/un snippets Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 823a430f1e..6bf48a04ed 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -401,7 +401,8 @@ done usr/sbin/groupadd -r -g %{NUT_GROUP} 2>/dev/null || : usr/sbin/useradd -r -g %{NUT_GROUP} -s /bin/false \ -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null || : -%if %{defined opensuse_version} +%if "x%{?systemdsystemunitdir}" == "x" +%else %service_add_pre %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif @@ -430,17 +431,17 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %preun %if "x%{?systemdsystemunitdir}" == "x" +: %else %service_del_preun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif -: %postun %if "x%{?systemdsystemunitdir}" == "x" +: %else %service_del_postun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif -: %post -n libupsclient1 -p /sbin/ldconfig From 0e9d7aa0cf64a193860c8e9be102f4a89c166823 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 16:52:46 +0200 Subject: [PATCH 179/207] scripts/obs/nut.spec: comment away "%dir" and "%exclude" hacks that felt superfluous and probably are Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 6bf48a04ed..1591e3e04c 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -451,21 +451,21 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %defattr(-,root,root) %doc AUTHORS COPYING LICENSE-DCO LICENSE-GPL2 LICENSE-GPL3 ChangeLog MAINTAINERS NEWS.adoc README.adoc UPGRADING.adoc docs/*.adoc docs/*.txt docs/cables/*.txt # List the (system) dirs we impact but do not own for the package -%dir %{BASHCOMPLETIONPATH} -%dir %{_sysconfdir}/logrotate.d -%dir %{_bindir} -%dir %{_sbindir} -%dir %{_datadir} -%dir %{_docdir} -%dir %{DOCPATH} +#% dir % {BASHCOMPLETIONPATH} +#% dir % {_sysconfdir}/logrotate.d +#% dir % {_bindir} +#% dir % {_sbindir} +#% dir % {_datadir} +#% dir % {_docdir} +#% dir % {DOCPATH} # NOTE: Currently this only delivers libupsclient-config.1 # and only if not building with pkg-config available: #% dir % {_mandir}/man1 -%dir %{_mandir}/man3 -%dir %{_mandir}/man5 -%dir %{_mandir}/man7 -%dir %{_mandir}/man8 -%dir %{_libexecdir} +#% dir % {_mandir}/man3 +#% dir % {_mandir}/man5 +#% dir % {_mandir}/man7 +#% dir % {_mandir}/man8 +#% dir % {_libexecdir} %if "x%{?systemdsystemunitdir}" == "x" %else %dir %{systemdsystemunitdir} @@ -556,21 +556,21 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro # Exclude whatever other packages bring, some rpmbuild versions seem to dump # everything into the base package and then complain about duplicates/conflicts: ### libupsclient1 -%exclude %{_libdir}/*.so.* +#% exclude % {_libdir}/*.so.* ### nut-cgi -%exclude %{CGIPATH} -%exclude %{HTMLPATH} -%exclude %{CONFPATH}/*.html +#% exclude % {CGIPATH} +#% exclude % {HTMLPATH} +#% exclude % {CONFPATH}/*.html ### nut-monitor # TODO: Actually package NUT-Monitor app and scripts where available # TODO: Detect path from chosen interpreter or NUT build config files? %exclude /usr/lib/python*/*-packages/* ### nut-devel -%exclude %{_includedir}/*.h -%exclude %{_libdir}/*.so -%exclude %{_libdir}/pkgconfig/*.pc -%exclude %{_mandir}/man3/*.* -%exclude %{LIBEXECPATH}/sockdebug +#% exclude % {_includedir}/*.h +#% exclude % {_libdir}/*.so +#% exclude % {_libdir}/pkgconfig/*.pc +#% exclude % {_mandir}/man3/*.* +#% exclude % {LIBEXECPATH}/sockdebug %files drivers-net From 41eaa764b51a6a4a14288187b60d329fce2fa873 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 17:11:45 +0200 Subject: [PATCH 180/207] scripts/obs/nut.spec: deliver libs each in its ABI-version-named package Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 126 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 117 insertions(+), 9 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 1591e3e04c..9c7903cc9f 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -102,6 +102,17 @@ %define NUTPKG_WITH_AVAHI %( (yum search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; dnf search avahi-devel | grep -E '^(lib)?avahi-devel\.' && exit ; zypper search -s avahi-devel | grep -E '(lib)?avahi-devel' && exit ; urpmq --sources avahi-devel && exit ; pkcon search name avahi-devel | grep -E '(Available|Installed).*avahi-devel' && exit;) >&2 && echo 1 || echo 0) %define NUTPKG_WITH_TCPWRAP %( (yum search tcp_wrappers-devel | grep -E '^(lib)?tcp_wrappers-devel\.' && exit ; dnf search tcp_wrappers-devel | grep -E '^(lib)?tcp_wrappers-devel\.' && exit ; zypper search -s tcp_wrappers-devel | grep -E '(lib)?tcp_wrappers-devel' && exit ; urpmq --sources tcp_wrappers-devel && exit ; pkcon search name tcp_wrappers-devel | grep -E '(Available|Installed).*tcp_wrappers-devel' && exit;) >&2 && echo 1 || echo 0) +# FIXME: Find a smarter way to set those from main codebase recipes... +# Something like `git grep 'version-info' '*.am'` ? +%define SO_MAJOR_LIBUPSCLIENT 7 +%define SO_MAJOR_LIBNUTCLIENT 2 +%define SO_MAJOR_LIBNUTCLIENTSTUB 1 +%define SO_MAJOR_LIBNUTSCAN 4 +%define SO_MAJOR_LIBNUTCONF 0 + +# If not published, nutconf is built with a statically linked library variant +%define NUTPKG_WITH_LIBNUTCONF 0 + Name: nut # NOTE: OBS should rewrite this: Version: 2.8.4 @@ -243,12 +254,53 @@ interface for monitoring and administering UPS hardware. Detailed information about supported hardware can be found in %{_docdir}/nut. -%package -n libupsclient1 +%package -n libupsclient%{SO_MAJOR_LIBUPSCLIENT} +Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring) +Group: System/Libraries + +%description -n libupsclient%{SO_MAJOR_LIBUPSCLIENT} +Shared library for the Network UPS Tools, used by its and third-party C clients. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%package -n libnutclient%{SO_MAJOR_LIBNUTCLIENT} +Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring) +Group: System/Libraries + +%description -n libnutclient%{SO_MAJOR_LIBNUTCLIENT} +Shared library for the Network UPS Tools, used by its and third-party C++ clients. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%package -n libnutclientstub%{SO_MAJOR_LIBNUTCLIENTSTUB} +Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring) +Group: System/Libraries + +%description -n libnutclientstub%{SO_MAJOR_LIBNUTCLIENTSTUB} +Shared stub library for the Network UPS Tools with memory-backed configurations, +primarily used by tests and mocks with its and third-party C++ clients. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. + +%package -n libnutscan%{SO_MAJOR_LIBNUTSCAN} Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring) Group: System/Libraries -%description -n libupsclient1 -Shared library for the Network UPS Tools. +%description -n libnutscan%{SO_MAJOR_LIBNUTSCAN} +Shared library for the Network UPS Tools, used by its nut-scanner and nutconf tools, +and possibly third-party C clients, integrations or tools. Network UPS Tools is a collection of programs which provide a common interface for monitoring and administering UPS hardware. @@ -256,6 +308,23 @@ interface for monitoring and administering UPS hardware. Detailed information about supported hardware can be found in %{_docdir}/nut. +%if 0%{?NUTPKG_WITH_LIBNUTCONF} > 0 +# If not published, nutconf is built with a statically linked library variant +%package -n libnutconf%{SO_MAJOR_LIBNUTCONF} +Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring) +Group: System/Libraries + +%description -n libnutconf%{SO_MAJOR_LIBNUTCONF} +Shared library for the Network UPS Tools, used by its nutconf tool, +and possibly third-party C++ clients, integrations or tools. + +Network UPS Tools is a collection of programs which provide a common +interface for monitoring and administering UPS hardware. + +Detailed information about supported hardware can be found in +%{_docdir}/nut. +%endif + %package cgi Summary: Network UPS Tools Web Server Support (UPS Status Pages) Group: Hardware/UPS @@ -344,6 +413,9 @@ sh autogen.sh --enable-option-checking=fatal\ --with-systemdsystemunitdir --with-systemdshutdowndir \ --with-augeas-lenses-dir=/usr/share/augeas/lenses/dist \ +%if 0%{?NUTPKG_WITH_LIBNUTCONF} > 0 + --with-dev-libnutconf\ +%endif %if 0%{?NUTPKG_WITH_DMF} --with-snmp_dmf_lua\ --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no @@ -443,9 +515,28 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %service_del_postun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %endif -%post -n libupsclient1 -p /sbin/ldconfig +%post -n libupsclient%{SO_MAJOR_LIBUPSCLIENT} -p /sbin/ldconfig + +%postun -n libupsclient%{SO_MAJOR_LIBUPSCLIENT} -p /sbin/ldconfig + +%post -n libnutclient%{SO_MAJOR_LIBNUTCLIENT} -p /sbin/ldconfig + +%postun -n libnutclient%{SO_MAJOR_LIBNUTCLIENT} -p /sbin/ldconfig + +%post -n libnutclientstub%{SO_MAJOR_LIBNUTCLIENTSTUB} -p /sbin/ldconfig -%postun -n libupsclient1 -p /sbin/ldconfig +%postun -n libnutclientstub%{SO_MAJOR_LIBNUTCLIENTSTUB} -p /sbin/ldconfig + +%post -n libnutscan%{SO_MAJOR_LIBNUTSCAN} -p /sbin/ldconfig + +%postun -n libnutscan%{SO_MAJOR_LIBNUTSCAN} -p /sbin/ldconfig + +%if 0%{?NUTPKG_WITH_LIBNUTCONF} > 0 +%post -n libnutconf%{SO_MAJOR_LIBNUTCONF} -p /sbin/ldconfig + +%postun -n libnutconf%{SO_MAJOR_LIBNUTCONF} -p /sbin/ldconfig + +%endif %files %defattr(-,root,root) @@ -555,7 +646,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %{LIBEXECPATH}/nut-driver-enumerator.sh # Exclude whatever other packages bring, some rpmbuild versions seem to dump # everything into the base package and then complain about duplicates/conflicts: -### libupsclient1 +### libupsclient7 etc #% exclude % {_libdir}/*.so.* ### nut-cgi #% exclude % {CGIPATH} @@ -594,10 +685,27 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %{_datadir}/nut/dmfsnmp.d/*.dmf %endif -%files -n libupsclient1 -# TODO: Separate or rename for other nut-libs (nut-scanner, nutconf C++)? +%files -n libupsclient%{SO_MAJOR_LIBUPSCLIENT} +%defattr(-,root,root) +%{_libdir}/libupsclient.so.* + +%files -n libnutclient%{SO_MAJOR_LIBNUTCLIENT} %defattr(-,root,root) -%{_libdir}/*.so.* +%{_libdir}/libnutclient.so.* + +%files -n libnutclientstub%{SO_MAJOR_LIBNUTCLIENTSTUB} +%defattr(-,root,root) +%{_libdir}/libnutclientstub.so.* + +%files -n libnutscan%{SO_MAJOR_LIBNUTSCAN} +%defattr(-,root,root) +%{_libdir}/libnutscan.so.* + +%if 0%{?NUTPKG_WITH_LIBNUTCONF} > 0 +%files -n libnutconf%{SO_MAJOR_LIBNUTCONF} +%defattr(-,root,root) +%{_libdir}/libnutconf.so.* +%endif %files cgi %defattr(-,root,root) From e55839dd82b034fba8e4509e4299c32a82272461 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 17:17:47 +0200 Subject: [PATCH 181/207] scripts/obs/nut.spec: address SUSE rpmlint issues with logrotate Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 9c7903cc9f..c197b519e8 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -146,6 +146,8 @@ Requires(postun): %{_bindir}/sh BuildRoot: %{_tmppath}/%{name}-%{version}-build +Recommends: logrotate + # To fix end-of-line encoding: BuildRequires: dos2unix @@ -437,6 +439,8 @@ mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d # Avoid W: incoherent-logrotate-file /etc/logrotate.d/nutlogd install -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/nut +# As (currently) hard-coded in that file above +mkdir -p %{buildroot}/var/log rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample find %{buildroot} -type f -name "*.la" -delete -print mkdir -p %{buildroot}%{BASHCOMPLETIONPATH} @@ -557,6 +561,8 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro #% dir % {_mandir}/man7 #% dir % {_mandir}/man8 #% dir % {_libexecdir} +# FIXME: Detect from logrotate properties (or our scriptlet file)? +%dir /var/log %if "x%{?systemdsystemunitdir}" == "x" %else %dir %{systemdsystemunitdir} From fad2db0b3cf4001abb0e66bbf4f4052f213dc488 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 17:18:04 +0200 Subject: [PATCH 182/207] scripts/obs/nut.spec: address SUSE rpmlint issues with scripted-only NUT-Monitor package Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index c197b519e8..cfcafb2cf9 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -348,6 +348,7 @@ Summary: Network UPS Tools Web Server Support (GUI client) Group: Hardware/UPS Requires: %{name} = %{version} BuildRequires: (python >= 2.6 or python3 or python2) +BuildArch: noarch %description monitor Graphical user interface client for the Network UPS Tools, From 5c4a9700193f52cdd2406607fad112e75621f472 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 17:18:18 +0200 Subject: [PATCH 183/207] scripts/obs/nut.spec: address SUSE rpmlint issues with "make check" section Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index cfcafb2cf9..ea9d917f4b 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -432,6 +432,9 @@ if test "$PORT" = 3493 ; then PORT=nut fi +%check +make %{?_smp_mflags} check + %install make DESTDIR=%{buildroot} install %{?_smp_mflags} mkdir -p %{buildroot}%{STATEPATH}/upssched From 16e36d3af9dfbe1d3565a390d094bc3e6705c5e5 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 18:04:03 +0200 Subject: [PATCH 184/207] scripts/obs/nut.spec: revise delivery of CGI artifacts as %dir Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index ea9d917f4b..5b18987277 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -719,8 +719,10 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %files cgi %defattr(-,root,root) -%{CGIPATH} -%{HTMLPATH} +%dir %{CGIPATH} +%dir %{HTMLPATH} +%{CGIPATH}/* +%{HTMLPATH}/* %config(noreplace) %{CONFPATH}/upsstats-single.html %config(noreplace) %{CONFPATH}/upsstats.html From c5af3ede0e81a7fd16ffce36e87cc919795f02df Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 20:49:09 +0200 Subject: [PATCH 185/207] scripts/obs/nut.spec: keep excluding from main package stuff that should be in others Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 5b18987277..852dcbc15f 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -657,21 +657,21 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro # Exclude whatever other packages bring, some rpmbuild versions seem to dump # everything into the base package and then complain about duplicates/conflicts: ### libupsclient7 etc -#% exclude % {_libdir}/*.so.* +%exclude %{_libdir}/*.so.* ### nut-cgi -#% exclude % {CGIPATH} -#% exclude % {HTMLPATH} -#% exclude % {CONFPATH}/*.html +%exclude %{CGIPATH} +%exclude %{HTMLPATH} +%exclude %{CONFPATH}/*.html ### nut-monitor # TODO: Actually package NUT-Monitor app and scripts where available # TODO: Detect path from chosen interpreter or NUT build config files? %exclude /usr/lib/python*/*-packages/* ### nut-devel -#% exclude % {_includedir}/*.h -#% exclude % {_libdir}/*.so -#% exclude % {_libdir}/pkgconfig/*.pc -#% exclude % {_mandir}/man3/*.* -#% exclude % {LIBEXECPATH}/sockdebug +%exclude %{_includedir}/*.h +%exclude %{_libdir}/*.so +%exclude %{_libdir}/pkgconfig/*.pc +%exclude %{_mandir}/man3/*.* +%exclude %{LIBEXECPATH}/sockdebug %files drivers-net From d4e826c637fda38e4f988a4735c9b5ada598040a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 21:41:13 +0200 Subject: [PATCH 186/207] scripts/obs/nut.spec: anticipate something like /usr/lib64/python2.7/site-packages/ too Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 852dcbc15f..8c3dfa7533 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -453,7 +453,7 @@ install -m0755 scripts/subdriver/gen-snmp-subdriver.sh %{buildroot}%{_sbindir}/ # TODO: Detect path from chosen interpreter or NUT build config files? # Avoid W: non-executable-script /usr/lib/python3.6/site-packages/PyNUT.py 644 /usr/bin/python... # Not really relevant for the module (not directly runnable, but has the shebang just in case) -chmod +x %{buildroot}/usr/lib/python*/*-packages/*.py +chmod +x %{buildroot}/usr/lib*/python*/*-packages/*.py if [ x"%{systemdtmpfilesdir}" != x ]; then # Deliver these dirs by packaging: sed 's,^\(. %{STATEPATH}\(/upssched\)*\( .*\)*\)$,#PACKAGED#\1,' -i %{buildroot}%{systemdtmpfilesdir}/nut-common-tmpfiles.conf @@ -665,7 +665,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro ### nut-monitor # TODO: Actually package NUT-Monitor app and scripts where available # TODO: Detect path from chosen interpreter or NUT build config files? -%exclude /usr/lib/python*/*-packages/* +%exclude /usr/lib*/python*/*-packages/* ### nut-devel %exclude %{_includedir}/*.h %exclude %{_libdir}/*.so @@ -730,7 +730,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %defattr(-,root,root) # TODO: Actually package NUT-Monitor app and scripts where available # TODO: Detect path from chosen interpreter or NUT build config files? -/usr/lib/python*/*-packages/* +/usr/lib*/python*/*-packages/* %files devel %defattr(-,root,root) From 416aa5e4f481f918ed46c5a672451f83611f0c6c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 21:41:47 +0200 Subject: [PATCH 187/207] scripts/obs/nut.spec: reduce layering of CGIPATH under apache_serverroot_cgi Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 8c3dfa7533..eb3c81e5fb 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -38,7 +38,7 @@ # integrate them later. %define CGIPATH %{LIBEXECPATH}/cgi-bin %else -%define CGIPATH %{apache_serverroot_cgi}/cgi-bin/nut +%define CGIPATH %{apache_serverroot_cgi}/nut %endif %if "0%{?apache_serverroot_data}" == "0" From ef60cd02afc37b3c11e6652abbe4ca7d293cbd69 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 21:43:39 +0200 Subject: [PATCH 188/207] scripts/obs/nut.spec: reduce layering of HTMLPATH under apache_serverroot_data Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index eb3c81e5fb..85309cf53b 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -41,12 +41,12 @@ %define CGIPATH %{apache_serverroot_cgi}/nut %endif -%if "0%{?apache_serverroot_data}" == "0" +%if "0%{?apache_serverroot_data}" == "0" || 0%(test x'%{apache_serverroot_data}' = x'^%{_datadir}' && echo 1 || echo 0) > 0 %define HTMLPATH %{_datadir}/nut/htdocs %else # Rename web pages location to not conflict with apache2-example-pages # or user home page: -%define HTMLPATH %{apache_serverroot_data}/htdocs/nut +%define HTMLPATH %{apache_serverroot_data}/nut %endif %define MODELPATH %{LIBEXECPATH}/driver From 31949e2592d6d5ebe59d31a61c067e270a27b115 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 22:00:17 +0200 Subject: [PATCH 189/207] scripts/obs/nut.spec: deduplicate man page files with symlinks Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 85309cf53b..5ae049c5e3 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -151,6 +151,10 @@ Recommends: logrotate # To fix end-of-line encoding: BuildRequires: dos2unix +# For man page aliases +# https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#fdupes +BuildRequires: fdupes + %if 0%{?NUTPKG_WITH_AVAHI} BuildRequires: avahi-devel %endif @@ -476,6 +480,11 @@ while read F ; do sed '1 s,^.*$,#!'"${F_SHELL_PATH}," -i "$F" fi done +# create symlinks for man pages; skip man1 (not used with pkgconfig +# capable builds), and man7 (one page there): +%fdupes -s %{buildroot}/%{_mandir}/man3 +%fdupes -s %{buildroot}/%{_mandir}/man5 +%fdupes -s %{buildroot}/%{_mandir}/man8 %pre usr/sbin/groupadd -r -g %{NUT_GROUP} 2>/dev/null || : From c71f0693fdccc5f468af93b002698d07226c574d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 22:02:58 +0200 Subject: [PATCH 190/207] scripts/obs/nut.spec, scripts/obs/debian.rules: enable storing build configuration and checking the build with NUT Integration Tests suite, and strip binaries of debug symbols Signed-off-by: Jim Klimov --- scripts/obs/debian.rules | 4 +++- scripts/obs/nut.spec | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/obs/debian.rules b/scripts/obs/debian.rules index c144d21036..d3de4c2030 100755 --- a/scripts/obs/debian.rules +++ b/scripts/obs/debian.rules @@ -73,7 +73,9 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-pidpath=$(runbasedir)/nut \ --datadir=/usr/share/nut \ --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ - --with-user=nut --with-group=nut + --with-user=nut --with-group=nut\ + --enable-strip\ + --enable-keep_nut_report_feature --enable-check-NIT ifeq (1,$(NUTPKG_WITH_DMF)) DEB_CONFIGURE_EXTRA_FLAGS += \ diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 5ae049c5e3..047bc1c652 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -425,8 +425,11 @@ sh autogen.sh %endif %if 0%{?NUTPKG_WITH_DMF} --with-snmp_dmf_lua\ - --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no + --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no\ %endif + --enable-keep_nut_report_feature\ + --enable-strip\ + --enable-check-NIT ### via Make now ### (cd tools; python nut-snmpinfo.py) From d261d7b74b92391c8788e93baa426327ee7db5ed Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 9 Oct 2025 22:14:27 +0200 Subject: [PATCH 191/207] scripts/obs/nut.spec: register other service units (enablement is via presets after all) Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 047bc1c652..658dcf4096 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -84,10 +84,11 @@ %define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd) %define systemdshutdowndir %(pkg-config --variable=systemdshutdowndir systemd) -# % define NUT_SYSTEMD_UNITS_SERVICE_TARGET % (cd scripts/systemd && ls -1 *.{service,target}{,.in} | sed 's,.in$,,' | sort | uniq) -%define NUT_SYSTEMD_UNITS_SERVICE_TARGET nut-driver-enumerator.service nut-driver.target nut-driver@.service nut-logger.service nut-monitor.service nut-server.service nut-sleep.service nut-udev-settle.service nut.target +# % define NUT_SYSTEMD_UNITS_SERVICE_TARGET % (cd scripts/systemd && ls -1 *.{service,target,path,timer}{,.in} | sed 's,.in$,,' | sort | uniq) +%define NUT_SYSTEMD_UNITS_SERVICE_TARGET nut-driver-enumerator.service nut-driver.target nut-driver@.service nut-logger.service nut-monitor.service nut-server.service nut-sleep.service nut-udev-settle.service nut.target nut-driver-enumerator.path +# Most deployments do not want these by default: +%define NUT_SYSTEMD_UNITS_UNCOMMON_NDE nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service -%define NUT_SYSTEMD_UNITS_OTHER %(cd scripts/systemd && ls -1 *.{path,timer}{,.in} | sed 's,.in$,,' | sort | uniq) %define NUT_SYSTEMD_UNITS_PRESET %(cd scripts/systemd && ls -1 *.preset{,.in} | sed 's,.in$,,' | sort | uniq) # Does this NUT branch have DMF feature code? @@ -495,7 +496,7 @@ usr/sbin/useradd -r -g %{NUT_GROUP} -s /bin/false \ -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null || : %if "x%{?systemdsystemunitdir}" == "x" %else -%service_add_pre %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} +%service_add_pre %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %{NUT_SYSTEMD_UNITS_UNCOMMON_NDE} %endif %post @@ -518,21 +519,21 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %endif %if "x%{?systemdsystemunitdir}" == "x" %else -%service_add_post %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} +%service_add_post %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %{NUT_SYSTEMD_UNITS_UNCOMMON_NDE} %endif %preun %if "x%{?systemdsystemunitdir}" == "x" : %else -%service_del_preun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} +%service_del_preun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %{NUT_SYSTEMD_UNITS_UNCOMMON_NDE} %endif %postun %if "x%{?systemdsystemunitdir}" == "x" : %else -%service_del_postun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} +%service_del_postun %{NUT_SYSTEMD_UNITS_SERVICE_TARGET} %{NUT_SYSTEMD_UNITS_UNCOMMON_NDE} %endif %post -n libupsclient%{SO_MAJOR_LIBUPSCLIENT} -p /sbin/ldconfig From dd3cb40e0bee8fcbf2a2b2aebe643fc9d1f2a8e9 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 10 Oct 2025 13:20:46 +0200 Subject: [PATCH 192/207] scripts/obs/README.adoc: update notes on OBS prjconf Signed-off-by: Jim Klimov --- scripts/obs/README.adoc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/obs/README.adoc b/scripts/obs/README.adoc index 938a6b5f7d..c43a66ab61 100644 --- a/scripts/obs/README.adoc +++ b/scripts/obs/README.adoc @@ -22,9 +22,10 @@ The copy of `_service` file represents the directly maintained OBS recipe in an OBS packaging project, and is the only file needed there (triggering service runs updates the temporary tarball from git). -Beside that, `osc meta prjconf --edit` can be used to specify unambiguous -preferences for certain packages, when a distro actually offers a choice -via conditional `BuildRequires` statements, e.g.: +Beside that, a `_config` file in the OBS project repository or live settings +in `osc meta prjconf --edit` can be used to specify unambiguous preferences +for certain packages, when a distro actually offers a choice via conditional +`BuildRequires` statements (and other options), e.g.: ---- Prefer: libusbx-devel @@ -32,6 +33,9 @@ Prefer: libusb-1.0-dev Prefer: neon-devel ---- +* For more details on this, see + https://openbuildservice.org/help/manuals/obs-user-guide/cha-obs-prjconfig + A parent project must be used to define OBS Repositories we build for, which should usually include a layer with `openSUSE:Tools` to have the OBS helper scripts needed for package and tarball transformations in the build area, From bc3f1cde0b927f1771fb226c48d8a4390e435016 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 10 Oct 2025 13:30:47 +0200 Subject: [PATCH 193/207] scripts/obs/_config: track a copy of prjconf data Signed-off-by: Jim Klimov --- scripts/obs/_config | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/obs/_config diff --git a/scripts/obs/_config b/scripts/obs/_config new file mode 100644 index 0000000000..c53e0ce56c --- /dev/null +++ b/scripts/obs/_config @@ -0,0 +1,16 @@ +# OBS prjconf for NUT builds +# See https://openbuildservice.org/help/manuals/obs-user-guide/cha-obs-prjconfig + +# Unambiguous preference if "Requires: (A or B)" offered both hits: +Prefer: libusbx-devel +Prefer: libusb-1.0-dev +Prefer: neon-devel + +%if "x%{_repository}" == "xRaspbian_11" +%else +# Use ccache or sccache (let OBS pick its preference) for faster (re-)builds: +BuildFlags: useccache:nut +%endif + +# Embed GIT URL into package metadata: +BuildFlags: setvcs From 439afe51021661188707e3631eb5c4de6691794c Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 10 Oct 2025 13:57:35 +0200 Subject: [PATCH 194/207] scripts/obs/nut.spec: nut-monitor requires python-base Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 658dcf4096..739b169e59 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -352,6 +352,7 @@ Detailed information about supported hardware can be found in Summary: Network UPS Tools Web Server Support (GUI client) Group: Hardware/UPS Requires: %{name} = %{version} +Requires: python-base BuildRequires: (python >= 2.6 or python3 or python2) BuildArch: noarch From db2576867830f7742a4b748da4a00fb16d3cfe85 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 10 Oct 2025 13:58:54 +0200 Subject: [PATCH 195/207] scripts/obs/nut.spec: hide %dir /var/log (we do not own it), suffice to mkdir it in build area to match our logrotate configuration Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 739b169e59..68ecfe2243 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -580,7 +580,7 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro #% dir % {_mandir}/man8 #% dir % {_libexecdir} # FIXME: Detect from logrotate properties (or our scriptlet file)? -%dir /var/log +#% dir /var/log %if "x%{?systemdsystemunitdir}" == "x" %else %dir %{systemdsystemunitdir} From 6f31e24645ec231f4fb997d118b4827e1d143f37 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 10 Oct 2025 15:56:11 +0200 Subject: [PATCH 196/207] scripts/obs/nut.spec: update comment about python locations Signed-off-by: Jim Klimov --- scripts/obs/nut.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/obs/nut.spec b/scripts/obs/nut.spec index 68ecfe2243..9d718e3d11 100644 --- a/scripts/obs/nut.spec +++ b/scripts/obs/nut.spec @@ -744,6 +744,9 @@ if [ -x /sbin/udevadm ] ; then /sbin/udevadm trigger --subsystem-match=usb --pro %defattr(-,root,root) # TODO: Actually package NUT-Monitor app and scripts where available # TODO: Detect path from chosen interpreter or NUT build config files? +# Maybe specify python version and location using RPM macros, see e.g. +# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/installing_and_using_dynamic_programming_languages/assembly_packaging-python-3-rpms_installing-and-using-dynamic-programming-languages +# Note we MAY be dual-packaging for several python versions and locations. /usr/lib*/python*/*-packages/* %files devel From 7147327ea40621b5073761f339ff8919e1f9feab Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 13 Oct 2025 02:22:34 +0200 Subject: [PATCH 197/207] scripts/obs/debian.rules: update for bleeding-edge CDBS that lacks many scripts Signed-off-by: Jim Klimov --- scripts/obs/debian.rules | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/obs/debian.rules b/scripts/obs/debian.rules index d3de4c2030..9ffeebbb9a 100755 --- a/scripts/obs/debian.rules +++ b/scripts/obs/debian.rules @@ -2,12 +2,15 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk -include /usr/share/cdbs/1/class/python-module.mk +-include /usr/share/cdbs/1/class/python-module.mk -include /usr/share/cdbs/1/rules/autoreconf.mk +-include /usr/share/cdbs/1/rules/autoreconf.mk # CDBS has some issues detecting something other than dh_python2 # which is absent on Debian 12+ and Ubuntu 25.04 for example. +# This hack is broken for Debian Next in Oct 2025, as CDBS sheds +# a lot of older scripts and the helpers seem to get implemented +# somehow differently. ifeq (,$(shell command -v dh_python2 || which dh_python2 || dh_python2 --help)) ifneq (,$(shell command -v dh_python3 || which dh_python3 || dh_python3 --help)) ifneq (,$(shell command -v python3 || which python3 || python3 --help)) @@ -49,7 +52,7 @@ SO_MAJOR_LIBNUTSCAN=4 SO_MAJOR_LIBNUTCONF=0 # List any files which are not installed -include /usr/share/cdbs/1/rules/utils.mk +-include /usr/share/cdbs/1/rules/utils.mk common-binary-post-install-arch:: list-missing DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,-O1 -Wl,--as-needed From 0768fdf38bbeccce81a99e82b97b00ada39592ae Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 13 Oct 2025 03:16:24 +0200 Subject: [PATCH 198/207] scripts/obs/debian.rules: do not mislead about lack of dh_python2 due to our own tests Signed-off-by: Jim Klimov --- scripts/obs/debian.rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/obs/debian.rules b/scripts/obs/debian.rules index 9ffeebbb9a..ef8a2287c9 100755 --- a/scripts/obs/debian.rules +++ b/scripts/obs/debian.rules @@ -11,9 +11,9 @@ include /usr/share/cdbs/1/class/autotools.mk # This hack is broken for Debian Next in Oct 2025, as CDBS sheds # a lot of older scripts and the helpers seem to get implemented # somehow differently. -ifeq (,$(shell command -v dh_python2 || which dh_python2 || dh_python2 --help)) -ifneq (,$(shell command -v dh_python3 || which dh_python3 || dh_python3 --help)) -ifneq (,$(shell command -v python3 || which python3 || python3 --help)) +ifeq (,$(shell command -v dh_python2 || which dh_python2 || dh_python2 --help 2>/dev/null)) +ifneq (,$(shell command -v dh_python3 || which dh_python3 || dh_python3 --help 2>/dev/null)) +ifneq (,$(shell command -v python3 || which python3 || python3 --help 2>/dev/null)) cdbs_curpythonsystems := python3 endif endif From 7d2c99ef0729f4c065b4a121563b656d23091c63 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 13 Oct 2025 03:20:47 +0200 Subject: [PATCH 199/207] scripts/obs/debian.rules: make list-missing optional (absent in new cdbs) Signed-off-by: Jim Klimov --- scripts/obs/debian.rules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/obs/debian.rules b/scripts/obs/debian.rules index ef8a2287c9..21b43e3613 100755 --- a/scripts/obs/debian.rules +++ b/scripts/obs/debian.rules @@ -51,9 +51,11 @@ SO_MAJOR_LIBNUTCLIENTSTUB=1 SO_MAJOR_LIBNUTSCAN=4 SO_MAJOR_LIBNUTCONF=0 +ifneq (,$(shell ls -1 /usr/share/cdbs/1/rules/utils.mk 2>/dev/null)) # List any files which are not installed --include /usr/share/cdbs/1/rules/utils.mk +include /usr/share/cdbs/1/rules/utils.mk common-binary-post-install-arch:: list-missing +endif DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,-O1 -Wl,--as-needed include /usr/share/dpkg/buildflags.mk From 28d1cdf239ea93ef6ed852ad0918b2199d86c875 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 14 Oct 2025 09:54:14 +0200 Subject: [PATCH 200/207] scripts/obs/nut.changes: isn't it a placeholder for RPM changelog? Signed-off-by: Jim Klimov --- ci_build.sh | 4 ++-- scripts/obs/_service | 2 +- scripts/obs/{debian.nut.changes => nut.changes} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename scripts/obs/{debian.nut.changes => nut.changes} (100%) diff --git a/ci_build.sh b/ci_build.sh index c78f2b7acc..5a19fd022b 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -2877,9 +2877,9 @@ pkg-rpm|pkg-spec) echo " Press Ctrl+C to abort if this is a problem" >&2 sleep 5 - rm -f nut.spec || true + rm -f nut.spec nut.changes || true git clean -fdX || true - cp -f scripts/obs/nut.spec . + cp -f scripts/obs/nut.spec scripts/obs/nut.changes . sed -e 's,^(Version:).*$,\1 '"`NUT_VERSION_QUERY=VER50 ./tools/gitlog2version.sh`," \ -i nut.spec rpmbuild -ba \ diff --git a/scripts/obs/_service b/scripts/obs/_service index 2cb090a9a4..81a37d0ecf 100644 --- a/scripts/obs/_service +++ b/scripts/obs/_service @@ -33,11 +33,11 @@ *.tar */scripts/obs/debian.* -