# OE: conditional switches # #(ie. use with rpm --rebuild): # # --with diet Compile dhcp-forwarder against dietlibc %define build_diet 0 # commandline overrides: # rpm -ba|--rebuild --with 'xxx' %{?_with_diet: %{expand: %%define build_diet 1}} %define name dhcp-forwarder %define version 0.8 %define release %mkrel 10 Summary: An DHCP relay agent Name: %{name} Version: %{version} Release: %{release} License: GPL Group: System/Servers URL: http://www.nongnu.org/dhcp-fwd/ Source0: %{name}-%{version}.tar.bz2 Source1: dhcp-fwd.init Source2: dhcp-forwarder.service Conflicts: dhcpd-relay Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 %if %{build_diet} BuildRequires: dietlibc-devel >= 0.20-1 %endif %description dhcp-fwd forwards DHCP messages between subnets with different sublayer broadcast domains. It is similar to the DHCP relay agent dhcrelay of ISC's DHCP, but has the following features which are important for me: * Runs as non-root in a chroot-jail * Uses "normal" AF_INET sockets which allows to uses packagefilters to filter incoming messages. * The DHCP agent IDs can be defined freely * Has a small memory footprint when using dietlibc %prep %setup -q %build %if %{build_diet} %configure --enable-release enable-dietlibc make CC="diet gcc" CFLAGS="-Os -s -static -nostdinc" %else %configure2_5x --enable-release --disable-dietlibc %make %endif %install rm -rf %{buildroot} %makeinstall_std install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/dhcp-fwd install -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/dhcp-forwarder.service install -D -m 644 contrib/dhcp-fwd.conf %{buildroot}%{_sysconfdir}/dhcp-fwd.conf install -D -m 644 contrib/dhcp-fwd.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/dhcp-fwd # (cg) Make sure we mask the sysvinit script name ln -s dhcp-forwarder.service %{buildroot}%{_unitdir}/dhcp-fwd.service install -m 755 -d %{buildroot}/var/lib/dhcpfwd %pre %_pre_useradd dhcp-fwd /var/lib/dhcpfwd /bin/false %post %_post_service dhcp-fwd %preun %_preun_service dhcp-fwd %postun %_postun_userdel dhcp-fwd %files %doc AUTHORS ChangeLog NEWS README %{_initrddir}/dhcp-fwd %{_unitdir}/dhcp-forwarder.service %{_unitdir}/dhcp-fwd.service %config(noreplace) %{_sysconfdir}/sysconfig/dhcp-fwd %config(noreplace) %{_sysconfdir}/dhcp-fwd.conf %{_sbindir}/* %dir /var/lib/dhcpfwd %{_mandir}/man1/* %changelog * Fri Jan 11 2013 umeabot <umeabot> 0.8-10.mga3 + Revision: 348758 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Sat Apr 28 2012 tmb <tmb> 0.8-9.mga2 + Revision: 233667 - Require rpm-helper >= 0.24.8-1 for systemd support - rebuild for versioned rpm-helper requires * Sat Apr 21 2012 colin <colin> 0.8-7.mga2 + Revision: 232341 - Neater masking of sysvinit script under systemd. * Sat Apr 21 2012 colin <colin> 0.8-6.mga2 + Revision: 232329 - Fix masked systemd unit link. * Sat Apr 21 2012 colin <colin> 0.8-5.mga2 + Revision: 232306 - Mask the sysvinit script with the systemd service. * Fri Apr 20 2012 guillomovitch <guillomovitch> 0.8-4.mga2 + Revision: 232007 - init script is not a configuration file - spec cleanup - systemd support * Sun May 08 2011 nanardon <nanardon> 0.8-3.mga1 + Revision: 96374 - imported package dhcp-forwarder