Blob Blame History Raw
## $id: ip-sentinel.spec.in,v 1.3 2003/05/26 21:53:02 ensc Exp $		--*- rpm-spec -*--

# Copyright (C) 2004,2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


## This package understands the following switches:
## --without dietlibc		...   disable usage of dietlibc
## --without fedora		...   disable fedora specific parts
## --with    minit		...   disable creation of 'minit' subpackage
## --define  username\ name	...   set the name of the user running the daemon


## Fedora Extras specific customization below...
%bcond_without			fedora
%bcond_without			dietlibc
%bcond_with			minit
##


%{!?username:%global username	ip-sentinel}
%global service		ip-sentinel
%global homedir		%_var/lib/ip-sentinel
%global minitdir	%_sysconfdir/minit
%global minitsvcdir	%minitdir/services/%name

%{!?release_func:%global release_func() %1%{?dist}}

Summary:	Tool to prevent unauthorized usage of IP addresses
Name:		ip-sentinel
Version:	0.12
Release:	%release_func 1301
License:	GPLv2
Group:		System Environment/Daemons
URL:		http://www.nongnu.org/ip-sentinel/
Source0:	http://savannah.nongnu.org/download/ip-sentinel/%name-%version.tar.bz2
Source1:	http://savannah.nongnu.org/download/ip-sentinel/%name-%version.tar.bz2.sig
Patch0:		ip-sentinel-0.12-pidfile.patch
BuildRoot:	%_tmppath/%name-%version-%release-buildroot
Requires:	init(ip-sentinel)
Provides:	user(%username) = 1
Provides:	group(%username) = 1
BuildRequires:	which
BuildRequires:	fedora-usermgmt-devel
%{?FE_USERADD_REQ}

%{?with_dietlibc:BuildRequires:	dietlibc}

%package sysvinit
Summary:		SysV initscripts for ip-sentinel
Group:			System Environment/Base
Provides:		init(ip-sentinel) = sysv
Requires(preun):	%name = %version-%release
Requires(postun):	%name = %version-%release
Requires(preun):	initscripts
Requires(postun):	initscripts
Requires(post):		/sbin/chkconfig
Requires(preun):	/sbin/chkconfig
Provides:		%name-sysv = %version-%release
Obsoletes:		%name-sysv < %version-%release
BuildArch:		noarch

%package upstart
Summary:		upstart initscripts for ip-sentinel
Group:			System Environment/Base
Source10:		ip-sentinel.upstart
Provides:		init(%name) = upstart
Requires:		%name = %version-%release
Requires(pre):		/etc/init
Requires(post):		/usr/bin/killall
Requires(postun):	/sbin/initctl
BuildArch:		noarch

%package minit
Summary:		minit initscripts for ip-sentinel
Group:			System Environment/Base
Provides:		init(%name) = minit
Requires:		%name = %version-%release
Requires(pre):		minit-setup
Requires(postun):	minit-setup
BuildArch:		noarch


%description
IP Sentinel is a tool that tries to prevent unauthorized usage of
IP addresses within an ethernet broadcast domain by answering ARP
requests. After receiving faked replies, requesting parties store
the MAC in their ARP tables and will send future packets to this
invalid MAC, rendering the IP unreachable.


%description sysvinit
IP Sentinel is a tool that tries to prevent unauthorized usage of IP
addresses.

This package provides the scripts which can be used to start ip-sentinel
with a SysV initconcept.


%description upstart
IP Sentinel is a tool that tries to prevent unauthorized usage of IP
addresses.

This package provides the scripts which can be used to start ip-sentinel
with the upstart initconcept.


%description minit
IP Sentinel is a tool that tries to prevent unauthorized usage of IP
addresses.

This package provides the scripts which can be used to start ip-sentinel
with the minit initconcept.


%prep
%setup -q
%patch0 -p0 -b .pidfile

%build
%configure --enable-release \
	   --with-initrddir=%_initrddir \
	   --with-username=%username	\
	   %{!?with_dietlibc:--disable}%{?with_dietlibc:--enable}-dietlibc
%__make %{?_smp_mflags} all


%install
rm -rf $RPM_BUILD_ROOT

%__make DESTDIR=$RPM_BUILD_ROOT install install-contrib
%__install -m750 -d $RPM_BUILD_ROOT%homedir
%__install -pD -m 0644 %SOURCE10 $RPM_BUILD_ROOT/etc/init/ip-sentinel.conf

%{!?with_minit:rm -rf $RPM_BUILD_ROOT%minitsvcdir}


%check
%__make check


%clean
rm -rf $RPM_BUILD_ROOT


%pre
%__fe_groupadd 1 -r %username &>/dev/null || :
%__fe_useradd  1 -r -s /sbin/nologin -M -d %homedir		\
		 -c 'IP sentinel user' -g %username %username &>/dev/null || :


%postun
%__fe_userdel  %username &>/dev/null || :
%__fe_groupdel %username &>/dev/null || :


%post sysvinit
/sbin/chkconfig --add %service

%preun sysvinit
if test "$1" = "0"; then
	%_initrddir/%service stop >/dev/null
	/sbin/chkconfig --del %service
fi

%postun sysvinit
test "$1" = 0 || %_initrddir/%service condrestart &>/dev/null


%post upstart
/usr/bin/killall -u %username ip-sentinel 2>/dev/null || :

%preun upstart
test "$1" != "0" || /sbin/initctl -q stop ip-sentinel || :


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README THANKS
%_mandir/*/*
%_sbindir/*
%attr(-,root,%username) %homedir


%files sysvinit
%defattr(-,root,root,-)
%config %_initrddir/*
%config(noreplace) %_sysconfdir/sysconfig/*


%files upstart
%defattr(-,root,root,-)
%config(noreplace) /etc/init/*


%if 0%{?with_minit:1}

%files minit
%defattr(-,root,root,-)
%dir %minitsvcdir
%minitsvcdir/run
%minitsvcdir/respawn
%config(noreplace) %minitsvcdir/params

%endif


%changelog
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-1301
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Dec  6 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-1300
- updated -upstart to upstart 0.6.3

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Sun Mar  1 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-14
- added -upstart subpackage
- renamed -sysv subpackage to -sysvinit to let -upstart win the
  default dependency resolving

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jul 31 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.12-12
- fix license tag

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.12-11
- Autorebuild for GCC 4.3

* Thu Jan 18 2007 David Woodhouse <dwmw2@infradead.org> 0.12-10
- rebuilt with PPC support

* Thu Oct 05 2006 Christian Iseli <Christian.Iseli@licr.org> 0.12-9
 - rebuilt for unwind info generation, broken in gcc-4.1.1-21

* Mon Sep 18 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-8
- rebuilt

* Sun Jul  9 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-7
- rebuilt with dietlibc-0.30
- use new fedora-usermgmt code
- use %%bcond_* macros

* Mon Feb 20 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-6
- exclude PPC arch because dietlibc is not available there anymore

* Fri Jul  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-5
- fixed named of pidfile (reported by Razvan Sandu)

* Wed Jun  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-4
- rebuilt

* Wed Jun  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-3
- added 'BuildRequires: which'
- do not use dietlibc on non-i386 archs running FC3

* Thu May 19 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-2
- use %%dist instead of %%disttag

* Wed Mar 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.12-1
- updated to 0.12

* Thu Aug 19 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.10.2-0
- added support for 'fedora-usermgmt' (enabled with '--with fedora' switch)

* Thu Jun 17 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.10.1-0
- conditionalized building of -minit subpackage

* Wed Jun 16 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.9.2-0
- updated minit filelist
- moved /etc/sysconfig/* files into -sysv subpackage; they are not
  used for 'minit' anymore

* Sat Mar 20 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.9-0
- workaround https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118773

* Thu Dec  4 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.8-0
- use 'install-contrib'

* Tue Sep  9 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.7-1
- removed more unneeded curlies

* Tue Aug  5 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.6-1
- version 0.6
- added minit support
- removed unneeded curlies

* Thu Jul 17 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.5-2
- removed %%doc attribute from %%mandir-entries

* Thu Jul 10 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.5-1
- moved 'make check' into the %%check section

* Sat May 24 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4-1
- removed dependencies on /sbin/service
- removed packager tag
- create and remove group explicitely

* Wed May 21 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.3-1
- applied fedora.us naming scheme
- cleanups

* Fri Nov 15 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.1-1
- initial build