86a330e
%{!?username:%global username	ip-sentinel}
f7056fd
%global service		ip-sentinel
cdab2d2
%global homedir		%{_var}/lib/ip-sentinel
cdab2d2
%global minitdir	%{_sysconfdir}/minit
cdab2d2
%global minitsvcdir	%minitdir/services/%{name}
5caab51
f90c40f
Summary:	Tool to prevent unauthorized usage of IP addresses
5caab51
Name:		ip-sentinel
f7056fd
Version:	0.12
cdab2d2
Release:	1902%{?dist}
871f849
License:	GPLv2
5caab51
Group:		System Environment/Daemons
f7056fd
URL:		http://www.nongnu.org/ip-sentinel/
cdab2d2
Source0:	http://savannah.nongnu.org/download/ip-sentinel/%{name}-%{version}.tar.bz2
cdab2d2
Source1:	http://savannah.nongnu.org/download/ip-sentinel/%{name}-%{version}.tar.bz2.sig
9225699
Patch0:		ip-sentinel-0.12-pidfile.patch
cdab2d2
Patch1:		ip-sentinel-0.12-glibc.patch
cdab2d2
BuildRoot:	%_tmppath/%{name}-%{version}-%{release}-buildroot
46048e7
Requires:	init(ip-sentinel)
a827053
Provides:	user(%username) = 1
a827053
Provides:	group(%username) = 1
4fa4c27
BuildRequires:	which
7ef32b6
BuildRequires:	fedora-usermgmt-devel
46048e7
a827053
%package sysvinit
5caab51
Summary:		SysV initscripts for ip-sentinel
5caab51
Group:			System Environment/Base
a827053
Provides:		init(ip-sentinel) = sysv
cdab2d2
Requires(preun):	%{name} = %{version}-%{release}
cdab2d2
Requires(postun):	%{name} = %{version}-%{release}
5caab51
Requires(preun):	initscripts
5caab51
Requires(postun):	initscripts
5caab51
Requires(post):		/sbin/chkconfig
5caab51
Requires(preun):	/sbin/chkconfig
cdab2d2
Provides:		%{name}-sysv = %{version}-%{release}
cdab2d2
Obsoletes:		%{name}-sysv < %{version}-%{release}
a827053
BuildArch:		noarch
5caab51
a827053
%package upstart
a827053
Summary:		upstart initscripts for ip-sentinel
a827053
Group:			System Environment/Base
a827053
Source10:		ip-sentinel.upstart
cdab2d2
Provides:		init(%{name}) = upstart
cdab2d2
Requires:		%{name} = %{version}-%{release}
d7864bd
Requires(pre):		/etc/init
a827053
Requires(post):		/usr/bin/killall
a827053
Requires(postun):	/sbin/initctl
a827053
BuildArch:		noarch
5caab51
5caab51
%package minit
5caab51
Summary:		minit initscripts for ip-sentinel
5caab51
Group:			System Environment/Base
cdab2d2
Provides:		init(%{name}) = minit
cdab2d2
Requires:		%{name} = %{version}-%{release}
5caab51
Requires(pre):		minit-setup
5caab51
Requires(postun):	minit-setup
a827053
BuildArch:		noarch
5caab51
5caab51
5caab51
%description
5caab51
IP Sentinel is a tool that tries to prevent unauthorized usage of
5caab51
IP addresses within an ethernet broadcast domain by answering ARP
5caab51
requests. After receiving faked replies, requesting parties store
5caab51
the MAC in their ARP tables and will send future packets to this
5caab51
invalid MAC, rendering the IP unreachable.
5caab51
5caab51
a827053
%description sysvinit
5caab51
IP Sentinel is a tool that tries to prevent unauthorized usage of IP
5caab51
addresses.
5caab51
5caab51
This package provides the scripts which can be used to start ip-sentinel
5caab51
with a SysV initconcept.
5caab51
5caab51
a827053
%description upstart
a827053
IP Sentinel is a tool that tries to prevent unauthorized usage of IP
a827053
addresses.
a827053
a827053
This package provides the scripts which can be used to start ip-sentinel
a827053
with the upstart initconcept.
a827053
a827053
5caab51
%description minit
5caab51
IP Sentinel is a tool that tries to prevent unauthorized usage of IP
5caab51
addresses.
5caab51
5caab51
This package provides the scripts which can be used to start ip-sentinel
5caab51
with the minit initconcept.
5caab51
5caab51
5caab51
%prep
5caab51
%setup -q
9225699
%patch0 -p0 -b .pidfile
cdab2d2
%patch1 -p0
5caab51
5caab51
%build
5caab51
%configure --enable-release \
cdab2d2
	   --with-initrddir=%{_initrddir} \
cdab2d2
	   --with-username=%username \
cdab2d2
           --disable-dietlibc
cdab2d2
make %{?_smp_mflags} all
5caab51
5caab51
5caab51
%install
5caab51
rm -rf $RPM_BUILD_ROOT
5caab51
cdab2d2
make DESTDIR=$RPM_BUILD_ROOT install install-contrib
cdab2d2
install -m750 -d $RPM_BUILD_ROOT%homedir
cdab2d2
install -pD -m 0644 %SOURCE10 $RPM_BUILD_ROOT/etc/init/ip-sentinel.conf
5caab51
cdab2d2
%{!?with_upstart: rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/init}
Enrico Scholz b61577c
%{!?with_minit:   rm -rf $RPM_BUILD_ROOT%minitsvcdir}
5caab51
5caab51
5caab51
%check
cdab2d2
make check
5caab51
5caab51
5caab51
%clean
5caab51
rm -rf $RPM_BUILD_ROOT
5caab51
5caab51
5caab51
%pre
7ef32b6
%__fe_groupadd 1 -r %username &>/dev/null || :
7ef32b6
%__fe_useradd  1 -r -s /sbin/nologin -M -d %homedir		\
e506037
		 -c 'IP sentinel user' -g %username %username &>/dev/null || :
7ef32b6
5caab51
5caab51
%postun
7ef32b6
%__fe_userdel  %username &>/dev/null || :
7ef32b6
%__fe_groupdel %username &>/dev/null || :
5caab51
5caab51
a827053
%post sysvinit
5caab51
/sbin/chkconfig --add %service
5caab51
a827053
%preun sysvinit
5caab51
if test "$1" = "0"; then
cdab2d2
	%{_initrddir}/%service stop >/dev/null
5caab51
	/sbin/chkconfig --del %service
5caab51
fi
5caab51
a827053
%postun sysvinit
5caab51
test "$1" = 0 || %_initrddir/%service condrestart &>/dev/null
5caab51
5caab51
a827053
%post upstart
a827053
/usr/bin/killall -u %username ip-sentinel 2>/dev/null || :
a827053
a827053
%preun upstart
a827053
test "$1" != "0" || /sbin/initctl -q stop ip-sentinel || :
a827053
a827053
5caab51
%files
5caab51
%defattr(-,root,root,-)
5caab51
%doc AUTHORS COPYING ChangeLog NEWS README THANKS
cdab2d2
%{_mandir}/*/*
cdab2d2
%{_sbindir}/*
5caab51
%attr(-,root,%username) %homedir
5caab51
5caab51
a827053
%files sysvinit
5caab51
%defattr(-,root,root,-)
cdab2d2
%config %{_initrddir}/*
cdab2d2
%config(noreplace) %{_sysconfdir}/sysconfig/*
5caab51
5caab51
Enrico Scholz b61577c
%if 0%{?with_upstart:1}
a827053
%files upstart
Enrico Scholz b61577c
  %defattr(-,root,root,-)
Enrico Scholz b61577c
  %config(noreplace) /etc/init/*
Enrico Scholz b61577c
%endif
a827053
a827053
7ef32b6
%if 0%{?with_minit:1}
5caab51
5caab51
%files minit
5caab51
%defattr(-,root,root,-)
5caab51
%dir %minitsvcdir
5caab51
%minitsvcdir/run
5caab51
%minitsvcdir/respawn
5caab51
%config(noreplace) %minitsvcdir/params
5caab51
5caab51
%endif
5caab51
5caab51
5caab51
%changelog
cdab2d2
* Thu Feb 28 2013 Jon Ciesla <limburgher@gmail.com> - 0.12-1902
cdab2d2
- Spec cleanup.
cdab2d2
- Switch from dietlibc to glibc.
cdab2d2
b8dfc50
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-1901
b8dfc50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
b8dfc50
Enrico Scholz b61577c
* Sun Aug 19 2012 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-1900
Enrico Scholz b61577c
- conditionalized upstart and disabled it by default
Enrico Scholz b61577c
01ec92c
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-1303
01ec92c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
01ec92c
8ff219b
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-1302
8ff219b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
8ff219b
bab01a1
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-1301
bab01a1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
bab01a1
d7864bd
* Sun Dec  6 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-1300
d7864bd
- updated -upstart to upstart 0.6.3
d7864bd
ffcea11
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-15
ffcea11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ffcea11
a827053
* Sun Mar  1 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-14
a827053
- added -upstart subpackage
a827053
- renamed -sysv subpackage to -sysvinit to let -upstart win the
a827053
  default dependency resolving
a827053
d3bf3f6
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-13
d3bf3f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
d3bf3f6
871f849
* Thu Jul 31 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.12-12
871f849
- fix license tag
871f849
82746e0
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.12-11
82746e0
- Autorebuild for GCC 4.3
82746e0
74f8290
* Thu Jan 18 2007 David Woodhouse <dwmw2@infradead.org> 0.12-10
74f8290
- rebuilt with PPC support
74f8290
29e69b1
* Thu Oct 05 2006 Christian Iseli <Christian.Iseli@licr.org> 0.12-9
29e69b1
 - rebuilt for unwind info generation, broken in gcc-4.1.1-21
29e69b1
c814def
* Mon Sep 18 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-8
c814def
- rebuilt
c814def
7ef32b6
* Sun Jul  9 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-7
7ef32b6
- rebuilt with dietlibc-0.30
7ef32b6
- use new fedora-usermgmt code
7ef32b6
- use %%bcond_* macros
7ef32b6
46048e7
* Mon Feb 20 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-6
46048e7
- exclude PPC arch because dietlibc is not available there anymore
46048e7
9225699
* Fri Jul  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-5
9225699
- fixed named of pidfile (reported by Razvan Sandu)
9225699
6c428d4
* Wed Jun  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-4
6c428d4
- rebuilt
6c428d4
4fa4c27
* Wed Jun  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-3
4fa4c27
- added 'BuildRequires: which'
4fa4c27
- do not use dietlibc on non-i386 archs running FC3
4fa4c27
547b326
* Thu May 19 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-2
547b326
- use %%dist instead of %%disttag
547b326
f7056fd
* Wed Mar 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-1
f7056fd
- updated to 0.12
f7056fd
5caab51
* Thu Aug 19 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.10.2-0
5caab51
- added support for 'fedora-usermgmt' (enabled with '--with fedora' switch)
5caab51
5caab51
* Thu Jun 17 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.10.1-0
5caab51
- conditionalized building of -minit subpackage
5caab51
5caab51
* Wed Jun 16 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.9.2-0
5caab51
- updated minit filelist
5caab51
- moved /etc/sysconfig/* files into -sysv subpackage; they are not
5caab51
  used for 'minit' anymore
5caab51
5caab51
* Sat Mar 20 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.9-0
5caab51
- workaround https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118773
5caab51
5caab51
* Thu Dec  4 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.8-0
5caab51
- use 'install-contrib'
5caab51
5caab51
* Tue Sep  9 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.7-1
5caab51
- removed more unneeded curlies
5caab51
5caab51
* Tue Aug  5 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.6-1
5caab51
- version 0.6
5caab51
- added minit support
5caab51
- removed unneeded curlies
5caab51
5caab51
* Thu Jul 17 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.5-2
5caab51
- removed %%doc attribute from %%mandir-entries
5caab51
5caab51
* Thu Jul 10 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.5-1
5caab51
- moved 'make check' into the %%check section
5caab51
5caab51
* Sat May 24 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4-1
5caab51
- removed dependencies on /sbin/service
5caab51
- removed packager tag
5caab51
- create and remove group explicitely
5caab51
5caab51
* Wed May 21 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.3-1
5caab51
- applied fedora.us naming scheme
5caab51
- cleanups
5caab51
5caab51
* Fri Nov 15 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.1-1
5caab51
- initial build