Name: cwdaemon
Version: 0.9.4
Release: 13%{?dist}
Summary: Morse daemon for the parallel or serial port
Group: System Environment/Daemons
License: GPLv2+
URL: http://www.qsl.net/pg4i/linux/%{name}.html
Source0: http://www.qsl.net/pg4i/download/%{name}-%{version}.tar.gz
Source1: cwdaemon.sysconfig
Source2: cwdaemon.init
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: unixcw-devel pkgconfig
Requires (preun): chkconfig
Requires (preun): initscripts
Requires (post): chkconfig
Requires(postun): initscripts
%description
Cwdaemon is a small daemon which uses the pc parallel or serial port
and a simple transistor switch to output morse code to a transmitter
from a text message sent to it via the udp internet protocol.
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
#remove the test.c we don't know why it is here, if we figure it out we will fix it
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/cwtest.*
#prevent this files to be packed twice
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*_circuit.*
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/cwdaemon.png
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/cwsetup.sh
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/README
sed -i -e "s/schematics directory/documentation directory/g" %{_builddir}/%{name}-%{version}/README
mkdir -p %{buildroot}%{_sysconfdir}
mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,rc.d/init.d}
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/cwdaemon
install -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/rc.d/init.d/cwdaemon
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add cwdaemon
%preun
if [ $1 = 0 ]; then
/sbin/service cwdaemon stop > /dev/null 2>&1
/sbin/chkconfig --del cwdaemon
fi
%postun
if [ "$1" -ge "1" ] ; then
/sbin/service cwdaemon condrestart >/dev/null 2>&1 || :
fi
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README TODO cwdaemon.png schematics/parallelport_circuit.ps schematics/serialport_circuit.ps schematics/parallelport_circuit.jpg schematics/serialport_circuit.jpg cwsetup.sh
%{_sbindir}/%{name}
%{_sysconfdir}/rc.d/init.d/cwdaemon
%config(noreplace) %{_sysconfdir}/sysconfig/cwdaemon
%{_mandir}/man8/%{name}.8.gz
%changelog
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Sep 03 2008 Lucian Langa <cooly@gnome.eu.org> - 0.9.4-9
- fix sysvinit script
* Wed Aug 20 2008 Lucian Langa <cooly@gnome.eu.org> - 0.9.4-8
- added postun scriptlet
* Sun Aug 10 2008 Lucian Langa <cooly@gnome.eu.org> - 0.9.4-7
- Add sysinit script and default configuration file
- Misc cleanups
* Mon Feb 18 2008 Robert 'Bob' Jensen <bob@bobjensen.com> 0.9.4-6
- fix manpage macro
- remove -devel package section and files including test.c
* Mon Feb 18 2008 Robert 'Bob' Jensen <bob@bobjensen.com> 0.9.4-5
- remove symlink from files section
* Mon Feb 18 2008 Robert 'Bob' Jensen <bob@bobjensen.com> 0.9.4-4
- Fix a few things from initial review
- Use sbin macro
- add simlink for second README location
* Sat Feb 16 2008 Robert 'Bob' Jensen <bob@bobjensen.com> 0.9.4-3
- Submit for review
* Mon Nov 19 2007 Sindre Pedersen Bjørdal <foolish@guezz.net> 0.9.4-2
- Update License tag
- Add missing doc files
- Don't package README twice
- Fix permissions for scripts
* Sun Apr 29 2007 Robert 'Bob' Jensen <bob@bobjensen.com> 0.9.4-0
- Initial spec file