Blob Blame History Raw
Name: powerman
Version: 1.0.25
Release: 2%{?dist}
Summary: PowerMan - Power to the Cluster 

Group: Applications/System
License: GPL
Url: http://sourceforge.net/projects/powerman
Source0: http://dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2
Patch1: powerman-1.0.25-optflags.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: flex bison
%if "%{?fedora}" <= "6"
BuildRequires:  tcp_wrappers
%else
BuildRequires:  tcp_wrappers-devel
%endif

%description
PowerMan is a tool for manipulating remote power control (RPC) devices from a 
central location. Several RPC varieties are supported natively by PowerMan and 
Expect-like configurability simplifies the addition of new devices.

%prep
%setup -q
# Honor $RPM_OPT_FLAGS
%patch1 -p1 -b .optflags

%build
# parallel makes often fail
make -e VERSION=%{version} EXTRA_CFLAGS="$RPM_OPT_FLAGS"

%install
rm -rf $RPM_BUILD_ROOT
make -e install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir}
# work around a problem in the install make file target
rm $RPM_BUILD_ROOT/%{_bindir}/pm
pushd $RPM_BUILD_ROOT/%{_bindir};ln -s powerman pm; popd
# install a default config file
cp examples/%{name}.conf-small \
    $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
# get rid of execute bit on powerman script files to fix rpmlint errror
chmod -x $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/*
# Don't turn on by default
%{__perl} -pi -e 's|chkconfig:.*95 5|chkconfig: - 95 5|g' \
    $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add powerman

%preun
if [ "$1" = 0 ]
then
  # No conditional stop provided. :(
  /sbin/service powerman status
  if [ "$?" -eq 0 ]
  then
    /sbin/service powerman stop
  fi
  /sbin/chkconfig --del powerman
fi

%files
%defattr(-,root,root,-)
%doc ChangeLog DISCLAIMER COPYING NEWS TODO
%doc examples/powerman.conf-*
%{_bindir}/powerman
%{_bindir}/pm
%{_sbindir}/powermand
%dir %{_sysconfdir}/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/*
%{_mandir}/man*/*
%{_initrddir}/%{name}

%changelog
* Wed Feb 07 2007 Jarod Wilson <jwilson@redhat.com> 1.0.25-2
- Release bump to fix devel upgrade path

* Mon Feb 05 2007 Jarod Wilson <jwilson@redhat.com> 1.0.25-1
- New upstream release
- Fixed up compile flags

* Tue Sep 05 2006 Jarod Wilson <jwilson@redhat.com> 1.0.24-3
- Rebuild for new glibc

* Mon Jul 24 2006 Jarod Wilson <jwilson@redhat.com> 1.0.24-2
- Update BuildRequires for updated (minimal-er) mock buildroots

* Tue Jun 13 2006 Jarod Wilson <jwilson@redhat.com> 1.0.24-1
- Assorted mods to conform more with Fedora Extras guidelines

* Fri Apr 21 2006 Ben Woodard <woodard@redhat.com> 1.0.23-4
- Added tcp_wrappers as a requirement so that it can build in mock

* Mon Feb 27 2006 Ben Woodard <woodard@redhat.com> 1.0.23-3
- change perms on files in etc/powerman so that they don't look like scripts
  to rpmlint.
- mark powerman hardware files config files.
- add patch to init file which turns off powerman by default and works around
  a minor problem in rpmlint's handling of chkconfig lines.

* Fri Feb 23 2006 Ben Woodard <woodard@redhat.com>
- Change source to dl.sf.net
- Add args to make
- added flags to allow for parallel building
- changed defattr which was interfering with perms of included files.
- removed explicit attrs for files
- removed man directories from package.
- changed etc to sysconfdir macro.
- powerman initscript not a config file.
- change pm from an absolute symlink to a relative symlink

* Thu Feb 16 2006 Ben Woodard <woodard@redhat.com> 1.0.23-2
- fix permissions on spec file and source file
- Put complete URL in Source0
- Condensed some of the files listed.

* Wed Feb 15 2006 Jim Garlick <garlick@llnl.gov> 1.0.23-1
- new release 1.0.23

* Tue Feb 14 2006 Ben Woodard <woodard@redhat.com> 1.0.22-3
- Changed /usr/bin to bindir
- Changed /usr/sbin to sbindir
- Added COPYING to list of docs.
- Changed /etc/rc.d/init.d/ to initrddir
- Changed /usr/man to mandir
- Added a fully qualified path to the source file.
- Fixed buildroot
- Added a patch which should fix a fc4 build problem.

* Thu Feb 09 2006 Ben Woodard <woodard@redhat.com> 1.0.22-2
- changed the buildroot to match fedora guidlines
- changed permissions of spec and src files.
- added changelog to spec file