diff --git a/nut.changes b/nut.changes index 15b0207..b469d2b 100644 --- a/nut.changes +++ b/nut.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Jan 21 20:17:50 UTC 2018 - suse+build@de-korte.org + +- Fix clash between Group and %define GROUP by renaming the latter + to NUT_GROUP (and USER to NUT_USER) +- Replace duplicate man files by soft links + ------------------------------------------------------------------- Fri Dec 1 14:59:25 UTC 2017 - suse+build@de-korte.org diff --git a/nut.spec b/nut.spec index ee5f6bb..75ff160 100644 --- a/nut.spec +++ b/nut.spec @@ -1,7 +1,7 @@ # # spec file for package nut # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,8 +22,8 @@ %define MODELPATH %{_libexecdir}/ups/driver %define STATEPATH %{_localstatedir}/lib/ups %define CONFPATH %{_sysconfdir}/ups -%define USER upsd -%define GROUP daemon +%define NUT_USER upsd +%define NUT_GROUP daemon %define LBRACE ( %define RBRACE ) %define QUOTE " @@ -63,6 +63,7 @@ BuildRequires: apache2-devel BuildRequires: asciidoc BuildRequires: avahi-devel BuildRequires: dblatex +BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libcppunit-devel BuildRequires: libtool @@ -277,8 +278,8 @@ autoreconf -fvi --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=%{_libexecdir}/udev \ --enable-option-checking=fatal @@ -330,15 +331,18 @@ cp -a docs/*.css docs/*.html docs/*.pdf %{buildroot}%{_docdir}/%{name}/ # Not needed for packaged contents: rm %{buildroot}%{_docdir}/%{name}/packager-guide.* +# Create symlinks for man pages +%fdupes -s %{buildroot}%{_mandir} + %pre %if 0%{?suse_version} < 1330 -getent passwd %{USER} >/dev/null || useradd -r -g %{GROUP} -s /bin/false -c "UPS daemon" -d /sbin %{USER} 2>/dev/null +getent passwd %{NUT_USER} >/dev/null || useradd -r -g %{NUT_GROUP} -s /bin/false -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null %endif %service_add_pre nut-driver.service nut-server.service nut-monitor.service %post # Be sure that all files are owned by a dedicated user. -chown -R %{USER}:%{GROUP} %{STATEPATH} +chown -R %{NUT_USER}:%{NUT_GROUP} %{STATEPATH} # Generate initial passwords. if grep -q "password = @UPSD_INITIAL_MASTER_PASSWORD@" %{CONFPATH}/upsmon.conf %{CONFPATH}/upsd.users; then UPSD_INITIAL_MASTER_PASSWORD=$(head -c 20 /dev/urandom | md5sum | head -c 10) @@ -349,7 +353,7 @@ if grep -q "password = @UPSD_INITIAL_SLAVE_PASSWORD@" %{CONFPATH}/upsd.users ; t sed -i s/@UPSD_INITIAL_SLAVE_PASSWORD@/$UPSD_INITIAL_SLAVE_PASSWORD/ %{CONFPATH}/upsd.users fi # 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 # Migrate Suspend to Disc to the new convention (bnc#449861 and later bnc#871406): # It was never on by default, but documentation up to 11.0 recommends @@ -390,9 +394,9 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/nut %{_udevrulesdir}/*.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 @@ -402,7 +406,7 @@ fi %{MODELPATH}/* %exclude %{MODELPATH}/snmp-ups %exclude %{MODELPATH}/netxml-ups -%attr(700,%{USER},%{GROUP}) %{STATEPATH} +%attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH} %{_unitdir}/*.service %{systemdsystemdutildir}/system-shutdown/* %{_libexecdir}/systemd/system-sleep/%{name}.sh