OBS User unknown 2007-08-09 23:24:28 +00:00 committed by Git OBS Bridge
parent cfd44ed65f
commit 0623bea7b1
11 changed files with 247 additions and 194 deletions

View File

@ -1,33 +0,0 @@
--- drivers/newhidups.c
+++ drivers/newhidups.c
@@ -578,7 +578,7 @@
void upsdrv_initups(void)
{
- char *regex_array[5];
+ char *regex_array[6];
int r;
int i;
--- drivers/rhino.h
+++ drivers/rhino.h
@@ -59,7 +59,7 @@
/* data vetor from received and configuration data package - not used yet
unsigned char Dados[ 161 ]; */
/* identification group */
-char Model[12];
+char Model[15];
int RhinoModel; /*, imodel; */
int PotenciaNominal, PowerFactor;
/* input group */
--- drivers/tripplite_usb.c
+++ drivers/tripplite_usb.c
@@ -1038,7 +1038,7 @@
*/
void upsdrv_initups(void)
{
- char *regex_array[5];
+ char *regex_array[6];
int r;
#if 0

View File

@ -1,11 +0,0 @@
--- drivers/gamatronic.c
+++ drivers/gamatronic.c
@@ -125,7 +125,7 @@
void sec_setinfo(int varnum, char *value)
{
- if (sec_varlist[varnum].setcmd != ""){
+ if (*sec_varlist[varnum].setcmd){/*Not empty*/
if (sec_varlist[varnum].flags == FLAG_STRING) {
dstate_setinfo(sec_varlist[varnum].setcmd,"%s", value);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bae249bd862bcd28c7e3760b0205267ec94fe8785c0bdd3cdd9b43f3f7551a73
size 547224

3
nut-2.2.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d32850de66aed8c078d47392113db153587bdd21f57f892fe3468a7f58acd5b2
size 893144

View File

@ -1,5 +1,5 @@
--- conf/upsmon.conf
+++ conf/upsmon.conf
--- conf/upsmon.conf.sample
+++ conf/upsmon.conf.sample
@@ -243,6 +243,15 @@
# IGNORE - Don't do anything
#

85
nut-pkgconfig.patch Normal file
View File

@ -0,0 +1,85 @@
--- configure.in
+++ configure.in
@@ -39,10 +39,6 @@
cgiexecdir='${exec_prefix}/cgi-bin'
driverexecdir='${exec_prefix}/bin'
htmldir='${prefix}/html'
-pkgcfgdir='/usr/lib/pkgconfig'
-if test ! -d "${pkgcfgdir}"; then
- pkgcfgdir=''
-fi
hotplugdir='/etc/hotplug'
if test ! -d "${hotplugdir}"; then
hotplugdir=''
@@ -635,35 +631,6 @@
])
-AC_MSG_CHECKING(whether to enable pkg-config support)
-AC_ARG_WITH(pkgconfig-dir,
- AC_HELP_STRING([--with-pkgconfig-dir=PATH], [where to install pkg-config *.pc files (/usr/lib/pkgconfig)]),
- [
- case "${withval}" in
- yes)
- if test -z "${pkgcfgdir}"; then
- AC_MSG_RESULT(no)
- AC_MSG_ERROR(["pkg-config directory requested but not found])
- fi
- ;;
- auto)
- ;;
- no)
- pkgcfgdir=""
- ;;
- *)
- pkgcfgdir="${withval}"
- ;;
- esac
- ],
- )
-if test -n "${pkgcfgdir}"; then
- AC_MSG_RESULT(using ${pkgcfgdir})
-else
- AC_MSG_RESULT(no)
-fi
-AM_CONDITIONAL(WITH_PKG_CONFIG, test -n "${pkgcfgdir}")
-
AC_MSG_CHECKING(whether to install hotplug rules)
AC_ARG_WITH(hotplug-dir,
AC_HELP_STRING([--with-hotplug-dir=PATH], [where to install hotplug rules (/etc/hotplug)]),
--- lib/Makefile.am
+++ lib/Makefile.am
@@ -1,8 +1,7 @@
# Network UPS Tools: lib
if WITH_LIB
-if WITH_PKG_CONFIG
- pkgcfg_DATA = libupsclient.pc
-endif
+pkgconfig_DATA = libupsclient.pc
+pkgconfigdir = $(libdir)/pkgconfig
bin_SCRIPTS = libupsclient-config
endif
--- lib/libupsclient-config.in
+++ lib/libupsclient-config.in
@@ -10,8 +10,8 @@
Version="@PACKAGE_VERSION@"
prefix=@prefix@
exec_prefix=@exec_prefix@
-Libs="-L@libdir@ -lupsclient @SSL_LDFLAGS@"
-Cflags="-I@includedir@ @SSL_CFLAGS@"
+Libs="-L@libdir@ -lupsclient @LIBSSL_LDFLAGS@"
+Cflags="-I@includedir@ @LIBSSL_CFLAGS@"
case "$1" in
--- lib/libupsclient.pc.in
+++ lib/libupsclient.pc.in
@@ -9,5 +9,5 @@
Name: libupsclient
Description: UPS monitoring with Network UPS Tools
Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lupsclient @SSL_LDFLAGS@
-Cflags: -I${includedir} @SSL_CFLAGS@
+Libs: -L${libdir} -lupsclient @LIBSSL_LDFLAGS@
+Cflags: -I${includedir} @LIBSSL_CFLAGS@

View File

@ -1,5 +1,5 @@
--- conf/upsmon.conf
+++ conf/upsmon.conf
--- conf/upsmon.conf.sample
+++ conf/upsmon.conf.sample
@@ -130,6 +130,8 @@
# Example:
# NOTIFYCMD /usr/local/ups/bin/notifyme

View File

@ -1,33 +1,13 @@
--- conf/Makefile.in
+++ conf/Makefile.in
@@ -17,14 +17,14 @@
install:
@for f in $(SECFILES) ; do \
- $(INSTALLCMD) -m 0600 $$f $(CONFPATH)/$$f.sample; \
+ $(INSTALLCMD) -m 0600 $$f $(CONFPATH)/$$f; \
done
@for f in $(PUBFILES) ; do \
- $(INSTALLCMD) -m 0644 $$f $(CONFPATH)/$$f.sample; \
+ $(INSTALLCMD) -m 0644 $$f $(CONFPATH)/$$f; \
done
install-cgi-conf:
@for f in $(CGIPUB) ; do \
- $(INSTALLCMD) -m 0644 $$f $(CONFPATH)/$$f.sample; \
+ $(INSTALLCMD) -m 0644 $$f $(CONFPATH)/$$f; \
done
--- conf/hosts.conf
+++ conf/hosts.conf
--- conf/hosts.conf.sample
+++ conf/hosts.conf.sample
@@ -27,3 +27,5 @@
# MONITOR myups@localhost "Local UPS"
# MONITOR su2200@10.64.1.1 "Finance department"
# MONITOR matrix@shs-server.example.edu "Sierra High School data room #1"
+
+MONITOR myups@localhost "Local UPS"
--- conf/ups.conf
+++ conf/ups.conf
--- conf/ups.conf.sample
+++ conf/ups.conf.sample
@@ -102,3 +102,8 @@
#
# To find out if your driver supports any extra settings, start it with
@ -37,8 +17,8 @@
+ driver = undefined
+ port = /dev/undefined
+ desc = "Local UPS"
--- conf/upsd.users
+++ conf/upsd.users
--- conf/upsd.users.sample
+++ conf/upsd.users.sample
@@ -68,3 +68,13 @@
# The matching MONITOR line in your upsmon.conf would look like this:
#
@ -53,8 +33,8 @@
+ password = @UPSD_INITIAL_SLAVE_PASSWORD@
+ allowfrom = localhost
+ upsmon slave
--- conf/upsmon.conf
+++ conf/upsmon.conf
--- conf/upsmon.conf.sample
+++ conf/upsmon.conf.sample
@@ -21,13 +21,13 @@
# user, since it creates an opportunity for an attack by changing the
# SHUTDOWNCMD to something malicious.

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Aug 7 19:08:04 CEST 2007 - sbrabec@suse.cz
- Updated to version 2.2.0:
* New build infrastructure, with shared library.
* Support for HAL and Plug and Play.
* New drivers.
* Support for many new devices.
* IPv6 support.
* Client commands now defaults to localhost.
* Driver improvements.
* Documentation improvements.
-------------------------------------------------------------------
Wed May 16 21:32:29 CEST 2007 - olh@suse.de

231
nut.spec
View File

@ -1,5 +1,5 @@
#
# spec file for package nut (Version 2.0.4)
# spec file for package nut (Version 2.2.0)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -11,23 +11,18 @@
# norootforbuild
Name: nut
BuildRequires: apache2-devel gd-devel libusb-devel net-snmp-devel openssl-devel tcpd-devel
%if %suse_version > 1000
BuildRequires: dbus-1
%endif
License: GNU General Public License (GPL)
BuildRequires: apache2-devel dbus-1-devel gd-devel hal-devel libopenssl-devel libusb-devel net-snmp-devel openssl-devel pkg-config tcpd-devel
License: GPL v2 or later
Group: Hardware/UPS
Provides: smartups
Requires: /usr/bin/pgrep /usr/bin/pkill /usr/bin/grep /usr/bin/fgrep /usr/sbin/lsusb /usr/bin/readlink
%if %suse_version > 1000
Requires: %{_bindir}/pgrep %{_bindir}/pkill %{_bindir}/grep %{_bindir}/fgrep %{_sbindir}/lsusb %{_bindir}/readlink
Requires: powersave
%endif
Obsoletes: smartups
Conflicts: apcupsd
Autoreqprov: on
Summary: UPS Monitoring Software
Version: 2.0.4
Release: 59
Version: 2.2.0
Release: 1
URL: http://www.networkupstools.org/
Source: %{name}-%{version}.tar.bz2
Source1: upsd.init
@ -35,16 +30,16 @@ Source2: README.SUSE
Source3: upsd-early-powerdown.init
Source4: upsd.dbus-1
Patch: nut-preconfig.patch
Patch1: %{name}-%{version}-overflow.patch
Patch3: nut-notifyflag.patch
Patch4: nut-powersave.patch
Patch5: %{name}-%{version}-setcmd-literal.patch
Patch5: nut-pkgconfig.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %insserv_prereq /bin/chown /bin/chmod /usr/bin/fgrep /usr/bin/grep /usr/bin/sed /usr/bin/head /usr/bin/md5sum
%define apache_serverroot %(/usr/sbin/apxs2 -q datadir 2>/dev/null || /usr/sbin/apxs -q PREFIX)
PreReq: %insserv_prereq /bin/chown /bin/chmod %{_bindir}/fgrep %{_bindir}/grep %{_bindir}/sed %{_bindir}/head %{_bindir}/md5sum
%define apache_serverroot %(%{_sbindir}/apxs2 -q datadir 2>/dev/null || %{_sbindir}/apxs -q PREFIX)
%define CGIPATH %{apache_serverroot}/cgi-bin
%define MODELPATH /usr/lib/ups/driver
%define STATEPATH /var/lib/ups
%define HTMLPATH %{apache_serverroot}/htdocs
%define MODELPATH %{_prefix}/lib/ups/driver
%define STATEPATH %{_localstatedir}/lib/ups
%define CONFPATH %{_sysconfdir}/ups
%define USER upsd
@ -89,75 +84,93 @@ Authors:
Arjen de Korte <arjen@de-korte.org>
Fabio Di Niro <blaxwan@users.sourceforge.net>
%{_datadir}/doc/packages/nut/README.
%package devel
Summary: UPS Monitoring Software
Group: Hardware/UPS
Requires: %{name} = %{version}
%description devel
This is a developing project to monitor a large assortment of UPS
hardware. Many models have ports on the back to allow other devices to
check the status. If it gives basic information about the power and
battery status, it can probably be supported without too much
difficulty. More advanced features on the higher-end models are also
supported to allow tracking of values over time such as temperature and
voltage.
Network communications are used so that multiple systems can monitor a
single physical UPS and shut down together if necessary without any
special "sharing hardware" on the UPS itself. Detailed information
about supported hardware can be found in
/usr/share/doc/packages/nut/README.
_=====_
- APC Smart-UPS, Back-UPS Pro, Matrix-UPS, Belkin Regulator Pro,
Best Power Fortress, Fortress (FOR), Fortress Telecom (FTC),
Patriot Pro (PRO), Patriot Pro II (PR2), Engetron Jr, Fenton
Technologies PowerPal, PowerOn, PowerPure, Effekta MI/MT/MH
models (2502 cable), PowerGuard PG-600, IPT Anzen, MGE Pulsar,
MGE Pulsar/Comet/Galaxy, Mustek Electronics, Opti-UPS, Advice
Partner/King, PowerCom, Toshiba 1500 series, Trust (KingPro)
425/625, Microdowell BBox, IMV/Victron
- Many models that use the same basic principle to communicate with the
computer. See generic-ups.txt in /usr/share/doc/packages/nut for more
information, including a list of supported equipment.
Authors:
--------
Russell Kroll <rkroll@exploits.org>
Arnaud Quette <arnaud.quette@mgeups.com>
Arjen de Korte <arjen@de-korte.org>
Fabio Di Niro <blaxwan@users.sourceforge.net>
%{_datadir}/doc/packages/nut/README.
%prep
%setup
%setup -q
cp -a %{S:1} %{S:2} %{S:3} %{S:4} .
mv upsd-early-powerdown.init upsd-early-powerdown
%patch
%patch1
%patch3
%if %suse_version > 1000
%patch4
%endif
%patch5
USB_IDS=$(sed -n <scripts/hotplug-ng/nut-usbups.rules.in 's/^SYSFS{idVendor}=="\([0-9a-f]*\)", SYSFS{idProduct}=="\([0-9a-f]*\)".*$/\1:\2/p' | tr '\n' '#' | sed 's/#$//;s/#/\\\\|/g')
if test -z "$USB_IDS" ; then
echo "Format of scripts/hotplug-ng/nut-usbups.rules.in changed. Please fix %%setup."
fi
sed -i "s/@UPSD_USER@/%USER/;s/@USB_IDS@/$USB_IDS/" upsd.init conf/upsmon.conf
sed -i "s/@UPSD_USER@/%USER/g" upsd.init conf/upsmon.conf.sample
%build
%if "%suse_version" == "910"
CFLAGS="$RPM_OPT_FLAGS -DHID_MAX_USAGES=1024" \
%else
CFLAGS="$RPM_OPT_FLAGS" \
%endif
./configure \
--prefix=/usr \
--exec-prefix=/usr \
--sysconfdir=%{CONFPATH} \
--datadir=/usr/share/nut \
--mandir=%{_mandir} \
--with-ssl \
--with-linux-hiddev=/usr/include/linux/hiddev.h \
--with-cgi \
--with-cgipath=%{CGIPATH} \
--with-statepath=%{STATEPATH} \
--with-drvpath=%{MODELPATH} \
--with-user=%{USER} \
autoreconf -f -i
%configure\
--sysconfdir=%{CONFPATH}\
--datadir=%{_datadir}/nut\
--with-all\
--with-linux-hiddev=%{_includedir}/linux/hiddev.h\
--with-htmlpath=%{HTMLPATH}\
--with-cgipath=%{CGIPATH}\
--with-statepath=%{STATEPATH}\
--with-drvpath=%{MODELPATH}\
--with-user=%{USER}\
--with-group=uucp
make %{?jobs:-j %jobs}
cd drivers
EXTRA_DRIVERS=$(sed -n '/^dummycons:/,/^clean:/{/clean/d;/dummycons/d;s/^\([^ .]*\):.*/\1/p}' <Makefile.in)
make %{?jobs:-j %jobs} $EXTRA_DRIVERS
make %{?jobs:-j%jobs}
%install
make DESTDIR=$RPM_BUILD_ROOT install
make DESTDIR=$RPM_BUILD_ROOT install-cgi
cd conf
make DESTDIR=$RPM_BUILD_ROOT install
make DESTDIR=$RPM_BUILD_ROOT install-cgi-conf
cd ..
mkdir -p $RPM_BUILD_ROOT%{STATEPATH}
cd drivers
EXTRA_DRIVERS=$(sed -n '/^dummycons:/,/^clean:/{/clean/d;/dummycons/d;s/^\([^ .]*\):.*/\1/p}' <Makefile.in)
install -m 755 $EXTRA_DRIVERS $RPM_BUILD_ROOT%{MODELPATH}
cd ../man
install -m 644 *.8 $RPM_BUILD_ROOT%{_mandir}/man8/
cd ..
# SuSE rc
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -m 755 upsd.init $RPM_BUILD_ROOT/etc/init.d/upsd
ln -sf ../../etc/init.d/upsd $RPM_BUILD_ROOT/usr/sbin/rcupsd
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
install -m 755 upsd.init $RPM_BUILD_ROOT%{_sysconfdir}/init.d/upsd
ln -sf ../..%{_sysconfdir}/init.d/upsd $RPM_BUILD_ROOT%{_sbindir}/rcupsd
mkdir -p $RPM_BUILD_ROOT%STATEPATH
%if %suse_version > 1000
mkdir -p $RPM_BUILD_ROOT/etc/dbus-1/system.d
install -m 644 upsd.dbus-1 $RPM_BUILD_ROOT/etc/dbus-1/system.d/upsd.conf
%endif
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
install -m 644 upsd.dbus-1 $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/upsd.conf
rename .sample "" $RPM_BUILD_ROOT%{_sysconfdir}/ups/*.sample
%pre
# 2>/dev/null
usr/sbin/useradd -r -o -g daemon -s /bin/false \
-c "UPS daemon" -d /sbin %USER 2>/dev/null || :
@ -177,19 +190,17 @@ bin/chown -R %USER:root %STATEPATH
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
# Install HALT_POWERDOWN_INSERT
%if %suse_version > 1000
if usr/bin/grep -q '^HALT_POWERDOWN_INSERT="\(/etc/init\.d/upsd try-powerdown\|\)"' etc/sysconfig/shutdown ; then
usr/bin/sed -i 's:^\(HALT_POWERDOWN_INSERT="\).*"[[:space:]]*:\1/etc/init.d/upsd try-powerdown":' etc/sysconfig/shutdown
if usr/bin/grep -q '^HALT_POWERDOWN_INSERT="\(%{_sysconfdir}/init\.d/upsd try-powerdown\|\)"' etc/sysconfig/shutdown ; then
usr/bin/sed -i 's:^\(HALT_POWERDOWN_INSERT="\).*"[[:space:]]*:\1%{_sysconfdir}/init.d/upsd try-powerdown":' etc/sysconfig/shutdown
else
echo >&2 "nut: WARNING: Unknown value of HALT_POWERDOWN_INSERT in /etc/sysconfig/shutdown."
echo >&2 "nut: WARNING: Unknown value of HALT_POWERDOWN_INSERT in %{_sysconfdir}/sysconfig/shutdown."
echo >&2 " Keeping unchanged. Should be:"
echo >&2 "HALT_POWERDOWN_INSERT=\"/etc/init.d/upsd try-powerdown\""
echo >&2 "HALT_POWERDOWN_INSERT=\"%{_sysconfdir}/init.d/upsd try-powerdown\""
fi
%endif
# Silently remove /etc/sysconfig/smartups. File is now obsolete and
# Silently remove %{_sysconfdir}/sysconfig/smartups. File is now obsolete and
# values are copied to not replaced config files.
# /etc/sysconfig/smartups was last present in SuSE Linux 10.0
rm -f /etc/sysconfig/smartups
# %{_sysconfdir}/sysconfig/smartups was last present in SuSE Linux 10.0
rm -f %{_sysconfdir}/sysconfig/smartups
%preun
%{stop_on_removal upsd}
@ -197,20 +208,18 @@ rm -f /etc/sysconfig/smartups
%postun
%{restart_on_update upsd}
# Remove HALT_POWERDOWN_INSERT
%if %suse_version > 1000
if test $1 -eq 0 -a ! -f /etc/init.d/upsd ; then
if usr/bin/grep -q '^HALT_POWERDOWN_INSERT="/etc/init\.d/upsd try-powerdown"' etc/sysconfig/shutdown ; then
usr/bin/sed -i 's:^\(HALT_POWERDOWN_INSERT="\)/etc/init\.d/upsd try-powerdown":\1":' etc/sysconfig/shutdown
if test $1 -eq 0 -a ! -f %{_sysconfdir}/init.d/upsd ; then
if usr/bin/grep -q '^HALT_POWERDOWN_INSERT="%{_sysconfdir}/init\.d/upsd try-powerdown"' etc/sysconfig/shutdown ; then
usr/bin/sed -i 's:^\(HALT_POWERDOWN_INSERT="\)%{_sysconfdir}/init\.d/upsd try-powerdown":\1":' etc/sysconfig/shutdown
else
echo >&2 "nut: WARNING: Unknown value of HALT_POWERDOWN_INSERT in /etc/sysconfig/shutdown."
echo >&2 "nut: WARNING: Unknown value of HALT_POWERDOWN_INSERT in %{_sysconfdir}/sysconfig/shutdown."
echo >&2 " Keeping unchanged. Should be:"
echo >&2 "HALT_POWERDOWN_INSERT=\"\""
fi
if test -f /etc/init.d/upsd-early-powerdown ; then
echo >&2 "nut: WARNING: You may want to remove your /etc/init.d/upsd-early-powerdown."
if test -f %{_sysconfdir}/init.d/upsd-early-powerdown ; then
echo >&2 "nut: WARNING: You may want to remove your %{_sysconfdir}/init.d/upsd-early-powerdown."
fi
fi
%endif
%insserv_cleanup
%clean
@ -218,9 +227,19 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc docs/ CHANGES COPYING CREDITS INSTALL MAINTAINERS NEWS README README.SUSE UPGRADING upsd-early-powerdown
%doc %{_mandir}/man8/*
%doc %{_mandir}/man5/*
%doc AUTHORS COPYING ChangeLog MAINTAINERS NEWS README README.SUSE UPGRADING upsd-early-powerdown docs/FAQ docs/*.txt docs/cables
%{_sysconfdir}/init.d/upsd
%{_sysconfdir}/dbus-1/system.d/upsd.conf
%{_sysconfdir}/udev/rules.d/*.rules
%dir %{_prefix}/lib/ups
%{_bindir}/*
%exclude %{_bindir}/*-config
%{_datadir}/nut
%{_libdir}/*.so.*
%doc %{_mandir}/man8/*.*
%doc %{_mandir}/man5/*.*
%{_sbindir}/*
%{CGIPATH}/*.cgi
%dir %{CONFPATH}
%config(noreplace) %{CONFPATH}/hosts.conf
%config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsd.conf
@ -231,23 +250,31 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %{CONFPATH}/upssched.conf
%config(noreplace) %{CONFPATH}/upsstats-single.html
%config(noreplace) %{CONFPATH}/upsstats.html
/etc/init.d/upsd
%if %suse_version > 1000
/etc/dbus-1/system.d/upsd.conf
%endif
%dir %attr(700,%{USER},nogroup) %{STATEPATH}
%dir /usr/lib/ups
%{HTMLPATH}/*.html
%{HTMLPATH}/*.png
%{MODELPATH}
/usr/bin/*
/usr/sbin/*
%dir /usr/share/nut
/usr/share/nut/*
%{CGIPATH}/upsimage.cgi
%{CGIPATH}/upsstats.cgi
%{CGIPATH}/upsset.cgi
%attr(700,%{USER},root) %STATEPATH
%attr(700,%{USER},uucp) %{STATEPATH}
%files devel
%defattr(-,root,root)
%{_bindir}/*-config
%{_includedir}/*.h
%{_libdir}/*.so
%{_libdir}/*.*a
%{_libdir}/pkgconfig/*.pc
%doc %{_mandir}/man3/*.*
%changelog
* Tue Aug 07 2007 - sbrabec@suse.cz
- Updated to version 2.2.0:
* New build infrastructure, with shared library.
* Support for HAL and Plug and Play.
* New drivers.
* Support for many new devices.
* IPv6 support.
* Client commands now defaults to localhost.
* Driver improvements.
* Documentation improvements.
* Wed May 16 2007 - olh@suse.de
- Buildrequires libusb -> libusb-devel
* Tue Feb 20 2007 - mvaner@suse.cz

View File

@ -149,24 +149,16 @@ case "$1" in
if test -n "$UPS_OWNER" ; then
PORTS=$(sed -n 's/^[[:space:]][[:space:]]*port[[:space:]]*=[[:space:]]*//p' < $UPS_CONFIG)
## Change permissions of devices.
## Change permissions of undetectable ports (for detectable ports it's done by udev).
for PORT in $PORTS ; do
if test "$PORT" = auto ; then
PORT=$(LANG=C LC_ALL=C lsusb | grep '\(@USB_IDS@\)' | sed 's:^:/dev/bus/usb/:;s/Bus //;s/ Device /\//;s/: .*//')
if test -z "$PORT" ; then
echo -n "$0: no device for \"port = auto\" in $UPS_CONFIG"
rc_failed 1 ; rc_status -v ; rc_exit
fi
fi
if test -L "$PORT" ; then
PORT=$(readlink -f $PORT)
fi
if test -n "$PORT" && test -c "$PORT" ; then
case "$PORT" in
/dev/ttyS* )
chown $UPS_OWNER $PORT || { rc_failed ; rc_status -v ; rc_exit ; }
else
echo -n "$0: invalid $PORT in $UPS_CONFIG"
rc_failed 2 ; rc_status -v ; rc_exit
fi
;;
esac
done
fi