From 9bd33b4407fe91bdd75fa2d8dfbd415b25df9cb0 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Nov 05 2009 11:08:27 +0000 Subject: - spec cleanup --- diff --git a/nut-2.2.1-conf.patch b/nut-2.2.1-conf.patch index 7082c78..6b096fe 100644 --- a/nut-2.2.1-conf.patch +++ b/nut-2.2.1-conf.patch @@ -1,12 +1,13 @@ -diff -up nut-2.2.1/conf/upssched.conf.sample.in.conf nut-2.2.1/conf/upssched.conf.sample.in ---- nut-2.2.1/conf/upssched.conf.sample.in.conf 2008-01-09 13:46:29.000000000 +0100 -+++ nut-2.2.1/conf/upssched.conf.sample.in 2008-01-09 13:46:43.000000000 +0100 +Index: nut/conf/upssched.conf.sample.in +=================================================================== +--- nut/conf/upssched.conf.sample.in (revision 2057) ++++ nut/conf/upssched.conf.sample.in (revision 2070) @@ -14,7 +14,7 @@ # A shell script with a big case..esac construct should work nicely for this. # An example has been provided to help you get started. -CMDSCRIPT /usr/local/ups/bin/upssched-cmd -+CMDSCRIPT /usr/bin/upssched-cmd ++CMDSCRIPT @bindir@/upssched-cmd # ============================================================================ # diff --git a/nut.spec b/nut.spec index 8d0c525..cd75844 100644 --- a/nut.spec +++ b/nut.spec @@ -9,43 +9,46 @@ Summary: Network UPS Tools Name: nut Version: 2.4.1 -Release: 6%{?dist} +Release: 7%{?dist} Group: Applications/System License: GPLv2+ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Url: http://www.networkupstools.org/ -Source: http://www.networkupstools.org/source/2.2/%{name}-%{version}.tar.gz +Source: http://www.networkupstools.org/source/2.4/%{name}-%{version}.tar.gz Source1: ups.init Source2: ups.sysconfig Patch0: nut-2.2.1-conf.patch -Patch1: nut-2.2.1-multilib.patch + +# sent upstream, for nut <= 2.4.1 Patch2: nut-2.2.2-udevusb.patch + + Patch3: nut-2.2.2-halpath.patch -Requires: nut-client => 2.0.0 hal dbus-glib +Requires: nut-client => 2.4.0 hal Requires(pre): hal -Requires(post): fileutils /sbin/chkconfig /sbin/service -Requires(postun): fileutils /sbin/chkconfig /sbin/service +Requires(post): fileutils chkconfig initscripts +Requires(postun): fileutils chkconfig initscripts -BuildRequires: gd-devel -BuildRequires: freetype-devel -BuildRequires: netpbm-devel -BuildRequires: libpng-devel -BuildRequires: net-snmp-devel +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: dbus-glib-devel BuildRequires: elfutils-devel -BuildRequires: libX11-devel -BuildRequires: libXpm-devel -BuildRequires: libjpeg-devel BuildRequires: fontconfig-devel -BuildRequires: pkgconfig +BuildRequires: freetype-devel +BuildRequires: gd-devel BuildRequires: hal-devel -BuildRequires: dbus-glib-devel -BuildRequires: openssl-devel -BuildRequires: autoconf -BuildRequires: automake +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel BuildRequires: libtool +BuildRequires: libX11-devel +BuildRequires: libXpm-devel BuildRequires: neon-devel +BuildRequires: net-snmp-devel +BuildRequires: netpbm-devel +BuildRequires: openssl-devel +BuildRequires: pkgconfig BuildRequires: powerman-devel %ifnarch s390 s390x @@ -115,7 +118,6 @@ necessary to develop NUT client applications. %prep %setup -q %patch0 -p1 -b .conf -%patch1 -p1 -b .multilib %patch2 -p1 -b .udevusb %patch3 -p1 -b .halpath @@ -135,7 +137,8 @@ autoreconf -i --with-gd-libs \ --with-linux-hiddev=%{_includedir}/linux/hiddev.h \ --with-pkgconfig-dir=%{_libdir}/pkgconfig \ - --disable-static + --disable-static \ + --libdir=%{_libdir} #remove rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -177,14 +180,26 @@ install -m 644 scripts/hal/ups-nut-device.fdi \ rm -rf %{buildroot}%{_prefix}/html rm -f %{buildroot}%{_libdir}/*.la -cd conf; make install DESTDIR=%{buildroot} +pushd conf; +make install DESTDIR=%{buildroot} for file in %{buildroot}%{_sysconfdir}/ups/*.sample do mv $file %{buildroot}%{_sysconfdir}/ups/`basename $file .sample` done +popd mv %{buildroot}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/lib/udev/rules.d/62-nut-usbups.rules +#pushd %{buildroot} +# fix encoding +for fe in ./docs/cables/powerware.txt +do + iconv -f iso-8859-1 -t utf-8 <$fe >$fe.new + touch -r $fe $fe.new + mv -f $fe.new $fe +done + + %pre /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : @@ -231,7 +246,7 @@ rm -rf %{buildroot} %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users %config(noreplace) %attr(644,root,root) %{_sysconfdir}/sysconfig/ups -%config %attr(644,root,root) /lib/udev/rules.d/62-nut-usbups.rules +%attr(644,root,root) /lib/udev/rules.d/62-nut-usbups.rules %{modeldir}/* %exclude %{modeldir}/netxml-ups %{_sbindir}/upsd @@ -308,7 +323,6 @@ rm -rf %{buildroot} %{_mandir}/man8/upslog.8.gz %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz -%{_mandir}/man8/netxml-ups.8.gz %files cgi %defattr(-,root,root,-) @@ -343,6 +357,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libupsclient.pc %changelog +* Thu Nov 05 2009 Michal Hlavinka - 2.4.1-7 +- spec cleanup + * Wed May 20 2009 Michal Hlavinka - 2.4.1-6 - fix coexistence with virtualbox (#488368) diff --git a/ups.init b/ups.init index 72a8851..1fe9449 100644 --- a/ups.init +++ b/ups.init @@ -12,6 +12,7 @@ ### BEGIN INIT INFO # Provides: ups # Required-Start: $syslog $network $named +# Required-Stop: $local_fs # Default-Stop: 0 1 6 # Short-Description: Starts the Network UPS tools # Description: Network UPS Tools is a collection of programs which provide a common \