+#
+# Conditional build:
+%bcond_with hidups # experimental hidups driver
+%bcond_with new_everups_driver # support for Ever UPS models (broken)
+
Summary: Network UPS Tools
Summary(pl): Sieciowe narzêdzie do UPS-ów
Name: nut
Version: 1.4.1
-Release: 2
+Release: 3
License: GPL
Group: Applications/System
Source0: http://penguin.harrison.k12.co.us/mirrors/nut/release/1.4/%{name}-%{version}.tar.gz
%setup -q
%patch0 -p1
%patch1 -p1
-%{?_with_new_everups_driver:install %{SOURCE4} drivers/everups.c }
+%{?with_new_everups_driver:install %{SOURCE4} drivers/everups.c }
%build
cp -f /usr/share/automake/config.sub .
%{__autoconf}
LDFLAGS="-L%{_prefix}/X11R6/%{_lib}"; export LDFLAGS
%configure \
+ %{?with_hidups:--with-linux-hiddev} \
--with-ssl \
--with-cgi \
--with-linux-hiddev=%{_includedir}/linux/hiddev.h \
--with-user=ups \
--with-group=ups
%{__make} all cgi
+%{?with_hidups:%{__make} hidups}
%install
rm -rf $RPM_BUILD_ROOT
install clients/upsclient.o common/parseconf.o $RPM_BUILD_ROOT%{_libdir}
install clients/upsclient.h include/parseconf.h $RPM_BUILD_ROOT%{_includedir}/nut
+%{?with_hidups:install drivers/hidups $RPM_BUILD_ROOT/lib/nut}
+
cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
#!/bin/sh
/etc/rc.d/init.d/ups powerdown