24c5e6c
## This package understands the following switches:
24c5e6c
## --without dietlibc   ...   disable usage of dietlibc
e862391
## --without fedora     ...   disable fedora specific parts
e862391
## --with    minit      ...   disable creation of 'minit' subpackage
24c5e6c
1d0ad61
13e7f0f
## Fedora Extras specific customization below...
f5fce9d
%bcond_without		fedora
e862391
%bcond_without		dietlibc
e862391
%bcond_with		minit
13e7f0f
##
24c5e6c
24c5e6c
13e7f0f
%global	username	dhcp-fwd
13e7f0f
%global homedir		%_var/lib/%username
13e7f0f
%global minitdir	%_sysconfdir/minit
13e7f0f
%global minitsvcdir	%minitdir/services/dhcp-fwd
13e7f0f
%global service		dhcp-fwd
24c5e6c
943bba5
%{!?release_func:%global release_func() %1%{?dist}}
cvsextras 9cf4c97
ec27229
Summary:	DHCP relay agent
cvsextras 9cf4c97
Name:		dhcp-forwarder
ffe8c59
Version:	0.8
64acd84
Release:	%release_func 5
ffe8c59
License:	GPLv3
cvsextras 9cf4c97
Group:		System Environment/Daemons
cvsextras 9cf4c97
URL:		http://www.tu-chemnitz.de/~ensc/dhcp-fwd
24c5e6c
Source0:	http://www.tu-chemnitz.de/~ensc/dhcp-fwd/files/%name-%version.tar.bz2
24c5e6c
Source1:	http://www.tu-chemnitz.de/~ensc/dhcp-fwd/files/%name-%version.tar.bz2.asc
24c5e6c
BuildRoot:	%_tmppath/%name-%version-%release-root
1f7875c
Requires:	init(%name)
658540a
BuildRequires:	which
e862391
BuildRequires:	fedora-usermgmt-devel
66c47e8
Provides:	user(%username) = 11
66c47e8
Provides:	group(%username) = 11
e862391
%{?FE_USERADD_REQ}
24c5e6c
e862391
%{?with_dietlibc:BuildRequires:	dietlibc}
24c5e6c
66c47e8
%package sysvinit
24c5e6c
Summary:		SysV initscripts for dhcp-forwarder
24c5e6c
Group:			System Environment/Base
1f7875c
Provides:		init(%name) = sysv
ec27229
Requires:		%name = %version-%release
24c5e6c
Requires(preun):	%name initscripts
24c5e6c
Requires(postun):	%name initscripts
24c5e6c
Requires(post):		/sbin/chkconfig
24c5e6c
Requires(preun):	/sbin/chkconfig
66c47e8
Provides:		%name-sysv = %version-%release
66c47e8
Obsoletes:		%name-sysv < %version-%release
66c47e8
BuildArch:		noarch
24c5e6c
66c47e8
%package upstart
66c47e8
Summary:		upstart initscripts for dhcp-forwarder
66c47e8
Group:			System Environment/Base
66c47e8
Source10:		dhcp-forwarder.upstart
1f7875c
Provides:		init(%name) = upstart
66c47e8
Requires:		%name = %version-%release
66c47e8
# implicates a conflict with upstart 0.5+
f5fce9d
Requires(pre):		/etc/event.d
1f7875c
Requires(post):		/usr/bin/killall
1f7875c
Requires(postun):	/sbin/initctl
66c47e8
BuildArch:		noarch
24c5e6c
24c5e6c
%package minit
24c5e6c
Summary:		minit initscripts for dhcp-forwarder
24c5e6c
Group:			System Environment/Base
1f7875c
Provides:		init(%name) = minit
ec27229
Requires:		%name = %version-%release
24c5e6c
Requires(pre):		minit-setup
24c5e6c
Requires(postun):	minit-setup
66c47e8
BuildArch:		noarch
cvsextras 9cf4c97
cvsextras 9cf4c97
cvsextras 9cf4c97
%description
cvsextras 9cf4c97
dhcp-fwd forwards DHCP messages between subnets with different sublayer
cvsextras 9cf4c97
broadcast domains. It is similar to the DHCP relay agent dhcrelay of
cvsextras 9cf4c97
ISC's DHCP, but has the following important features:
cvsextras 9cf4c97
cvsextras 9cf4c97
* Runs as non-root in a chroot-environment
cvsextras 9cf4c97
* Uses AF_INET sockets which makes it possible to filter incoming
cvsextras 9cf4c97
  messages with packetfilters
cvsextras 9cf4c97
* The DHCP agent IDs can be defined freely
cvsextras 9cf4c97
* Has a small memory footprint when using dietlibc
cvsextras 9cf4c97
cvsextras 9cf4c97
66c47e8
%description sysvinit
24c5e6c
dhcp-fwd forwards DHCP messages between subnets with different sublayer
24c5e6c
broadcast domains.
24c5e6c
24c5e6c
This package provides the scripts which can be used to start dhcp-forwarder
24c5e6c
with the SysV initconcept.
24c5e6c
24c5e6c
66c47e8
%description upstart
66c47e8
dhcp-fwd forwards DHCP messages between subnets with different sublayer
66c47e8
broadcast domains.
66c47e8
66c47e8
This package provides the scripts which can be used to start dhcp-forwarder
66c47e8
with the upstart initconcept.
66c47e8
66c47e8
24c5e6c
%description minit
24c5e6c
dhcp-fwd forwards DHCP messages between subnets with different sublayer
24c5e6c
broadcast domains.
24c5e6c
24c5e6c
This package provides the scripts which can be used to start dhcp-forwarder
24c5e6c
with the minit initconcept.
24c5e6c
24c5e6c
24c5e6c
cvsextras 9cf4c97
%prep
cvsextras 9cf4c97
%setup -q
cvsextras 9cf4c97
24c5e6c
cvsextras 9cf4c97
%build
24c5e6c
%configure \
24c5e6c
	--enable-release \
ec27229
	--with-initrddir=%_initrddir \
e862391
	%{!?with_dietlibc:--disable}%{?with_dietlibc:--enable}-dietlibc
24c5e6c
%__make %{?_smp_mflags}
24c5e6c
24c5e6c
cvsextras 9cf4c97
%install
cvsextras 9cf4c97
rm -rf $RPM_BUILD_ROOT
cvsextras 9cf4c97
24c5e6c
%__make DESTDIR=$RPM_BUILD_ROOT install install-contrib
66c47e8
%__install -d  -m 0700 $RPM_BUILD_ROOT%homedir
66c47e8
%__install -pD -m 0644 %SOURCE10 $RPM_BUILD_ROOT/etc/event.d/dhcp-forwarder
24c5e6c
e862391
%{!?with_minit:rm -rf $RPM_BUILD_ROOT%minitsvcdir}
24c5e6c
24c5e6c
24c5e6c
%check
24c5e6c
%__make check
24c5e6c
cvsextras 9cf4c97
cvsextras 9cf4c97
%clean
cvsextras 9cf4c97
rm -rf $RPM_BUILD_ROOT
cvsextras 9cf4c97
cvsextras 9cf4c97
cvsextras 9cf4c97
%pre
e862391
%__fe_groupadd 11 -r %username &>/dev/null || :
e862391
%__fe_useradd  11 -r -s /sbin/nologin -M -c 'DHCP Forwarder user' \
e862391
                  -d %homedir -g %username %username &>/dev/null || :
cvsextras 9cf4c97
cvsextras 9cf4c97
24c5e6c
%postun
e862391
%__fe_userdel  %username &>/dev/null || :
e862391
%__fe_groupdel %username &>/dev/null || :
cvsextras 9cf4c97
24c5e6c
66c47e8
%post sysvinit
24c5e6c
/sbin/chkconfig --add %service
24c5e6c
66c47e8
%preun sysvinit
cvsextras 9cf4c97
if test "$1" = "0"; then
24c5e6c
	%_initrddir/%service stop >/dev/null
24c5e6c
	/sbin/chkconfig --del %service
cvsextras 9cf4c97
fi
cvsextras 9cf4c97
66c47e8
%postun sysvinit
ec27229
test "$1" = "0" || %_initrddir/%service condrestart &>/dev/null
24c5e6c
cvsextras 9cf4c97
1f7875c
%post upstart
1f7875c
/usr/bin/killall -u %username dhcp-fwd 2>/dev/null || :
1f7875c
1f7875c
%preun upstart
1f7875c
test "$1" != "0" || /sbin/initctl -q stop dhcp-forwarder || :
1f7875c
1f7875c
cvsextras 9cf4c97
%files
cvsextras 9cf4c97
%defattr(-,root,root,-)
cvsextras 9cf4c97
%doc AUTHORS COPYING ChangeLog NEWS README THANKS
24c5e6c
%_mandir/*/*
24c5e6c
%config(noreplace) %_sysconfdir/dhcp-fwd.conf
24c5e6c
%_sbindir/*
cvsextras 9cf4c97
cvsextras 9cf4c97
## *DO NOT* add %defattr(-,dhcp-fwd,dhcp-fwd); the homedir is used for
cvsextras 9cf4c97
## the chroot() only and there is no reason why the setuid()'ed daemon
cvsextras 9cf4c97
## needs any kind of access there
24c5e6c
%homedir
24c5e6c
24c5e6c
66c47e8
%files sysvinit
24c5e6c
%defattr(-,root,root,-)
24c5e6c
%config %_initrddir/*
24c5e6c
%config(noreplace) %_sysconfdir/sysconfig/*
24c5e6c
24c5e6c
66c47e8
%files upstart
66c47e8
%defattr(-,root,root,-)
66c47e8
%config(noreplace) /etc/event.d/*
66c47e8
1f7875c
e862391
%if 0%{?with_minit:1}
24c5e6c
24c5e6c
%files minit
24c5e6c
%defattr(-,root,root,-)
24c5e6c
%dir %minitsvcdir
24c5e6c
%minitsvcdir/run
24c5e6c
%minitsvcdir/respawn
24c5e6c
%config(noreplace) %minitsvcdir/params
24c5e6c
24c5e6c
%endif
cvsextras 9cf4c97
cvsextras 9cf4c97
cvsextras 9cf4c97
%changelog
64acd84
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8-5
64acd84
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
64acd84
1f7875c
* Sun Mar  1 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.8-4
1f7875c
- added upstart %%scriplets
1f7875c
66c47e8
* Sun Mar  1 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.8-3
66c47e8
- added -upstart subpackage
66c47e8
- renamed -sysv subpackage to -sysvinit to make -upstart win the
66c47e8
  default dependency resolving
66c47e8
d68ff8b
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8-2
d68ff8b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
d68ff8b
ffe8c59
* Tue Dec 30 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.8-1
ffe8c59
- updated to 0.8
ffe8c59
- license is now GPLv3, not GPLv2
ffe8c59
f3bfde5
* Wed Jul 16 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.7-15
f3bfde5
- fix license tag
f3bfde5
e61c0c7
* Fri Feb 22 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.7-14
e61c0c7
- rebuilt with new dietlibc
e61c0c7
95ba2a3
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.7-13
95ba2a3
- Autorebuild for GCC 4.3
95ba2a3
85aee72
* Thu Jan 18 2007 David Woodhouse <dwmw2@infradead.org> 0.7-12
85aee72
- rebuilt with PPC support
85aee72
6865be0
* Thu Oct 05 2006 Christian Iseli <Christian.Iseli@licr.org> 0.7-11
6865be0
 - rebuilt for unwind info generation, broken in gcc-4.1.1-21
6865be0
ae37947
* Mon Sep 18 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.7-10
ae37947
- rebuilt
ae37947
e862391
* Sun Jul  9 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.7-9
e862391
- rebuilt with dietlibc-0.30
e862391
- use new fedora-usermgmt code
e862391
- use %%bcond_* macros
e862391
ea7ac27
* Mon Feb 20 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.7-8
ea7ac27
- exclude PPC arch because dietlibc is not available there anymore
ea7ac27
1d0ad61
* Wed Jun  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.7-7
1d0ad61
- do not build against dietlibc on non-i386 archs running FC3
5989c8e
- added sanity check for builds with mach
658540a
- buildrequire 'which'
5989c8e
943bba5
* Thu May 19 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.7-4
943bba5
- use %%dist instead of %%disttag
943bba5
13e7f0f
* Sun Mar  6 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.7-2
13e7f0f
- fixed bigendian builds (backported from 0.8)
13e7f0f
- s!%%define!%%global! to workaround bugs in rpm's macro-engine
13e7f0f
24c5e6c
* Thu Nov 11 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.7-0.fdr.1
24c5e6c
- fedora'ized it
24c5e6c
24c5e6c
* Thu Aug 19 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.6.1-0
24c5e6c
- added support for 'fedora-usermgmt' (enabled with '--with fedora' switch)
24c5e6c
24c5e6c
* Thu Jun 17 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.6.1-0
24c5e6c
- conditionalized build of -minit subpackage
24c5e6c
24c5e6c
* Thu Aug  7 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.5.1-0
24c5e6c
- added minit support
24c5e6c
- removed superfluous %%doc attribute of %%_mandir entries
24c5e6c
- removed superfluous curlies
24c5e6c
- use 'install-contrib' and cleaned up %%install section
24c5e6c
- moved /etc/sysconfig/* file into -sysv subpackage; it is not used by
24c5e6c
  -minit anymore
24c5e6c
- minor cleanups
24c5e6c
24c5e6c
* Wed Jul 30 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.5-0.fdr.1
24c5e6c
- updated to version 0.5
24c5e6c
cvsextras 9cf4c97
* Tue May 27 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4-0.fdr.2
cvsextras 9cf4c97
- create and remove group explicitely
cvsextras 9cf4c97
- s/adduser/useradd/
cvsextras 9cf4c97
- removed dependency on initscripts by calling the service-script in
cvsextras 9cf4c97
  the %%post/%%preun scriptlets directly
cvsextras 9cf4c97
- do not call '--install-contrib' anymore; it creates too much
cvsextras 9cf4c97
  clutter to make sure that the initscripts will be installed into
24c5e6c
  %%_initrddir but not in /etc/init.d. Instead of, install the
cvsextras 9cf4c97
  scripts manually.
cvsextras 9cf4c97
cvsextras 9cf4c97
* Fri May  2 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4-0.fdr.1
cvsextras 9cf4c97
- cleanups
cvsextras 9cf4c97
- applied fedora.us naming scheme
cvsextras 9cf4c97
cvsextras 9cf4c97
* Wed Aug 28 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.3.1-1
cvsextras 9cf4c97
- Added /etc/sysconfig/dhcp-fwd file
cvsextras 9cf4c97
cvsextras 9cf4c97
* Fri Jul 12 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.2.5-2
cvsextras 9cf4c97
- Renamed username from dhcpfwd to dhcp-fwd
cvsextras 9cf4c97
- Adjusted URL
cvsextras 9cf4c97
cvsextras 9cf4c97
* Fri Jul 12 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.2.5-1
cvsextras 9cf4c97
- version 0.2.5
cvsextras 9cf4c97
- Fixed some typos
cvsextras 9cf4c97
- Added some PreReq's
cvsextras 9cf4c97
- Enhanced %postun script
cvsextras 9cf4c97
cvsextras 9cf4c97
* Mon Jun 17 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.2-2
24c5e6c
- Described purpose of the %%homedir and its handling
cvsextras 9cf4c97
cvsextras 9cf4c97
* Fri Jun 14 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.2-1
cvsextras 9cf4c97
- Added manpage
cvsextras 9cf4c97
cvsextras 9cf4c97
* Thu Jun 13 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.1-0.3
cvsextras 9cf4c97
- Added --without dietlibc option
cvsextras 9cf4c97
0149966
* Sat Jun  1 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
cvsextras 9cf4c97
- Initial build.