Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > 401c000ed050783a22a612ca3486dfaf > files > 5

udhcp-0.9.8-7mdk.src.rpm

# OE: conditional switches
#
#(ie. use with rpm --rebuild):
#
#	--with diet	Compile udhcp against dietlibc


%define build_diet 0

# commandline overrides:
# rpm -ba|--rebuild --with 'xxx'
%{?_with_diet: %{expand: %%define build_diet 1}}

%define name udhcp
%define version 0.9.8
%define release 7mdk

Summary:	Very small DHCP server/client
Name:		%{name}
Version:	%{version}
Release:	%{release}
Source0:	http://opensource.lineo.com/udhcp/source/%{name}-%{version}.tar.bz2
Source1:	udhcpd.conf.bz2
Source2:	udhcpd.init.bz2
Patch0:		%{name}-0.9.7-Makefile.patch.bz2
Patch2:		udhcp-0.9.8-gcc3_4.patch.bz2

# http://www.lart.info/~bwachter/projects/dietlinux/download/current/patches/udhcp-0.9.8-dietlibc.patch
# P1 is rediffed for system dietlibc (only Makefile.dietlibc)
Patch1:		udhcp-0.9.8-dietlibc.patch.bz2

License:	GPL
Group:		System/Servers
URL:		http://opensource.lineo.com/udhcp/
PreReq:		rpm-helper
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

%if %{build_diet}
BuildRequires:	dietlibc-devel >= 0.20-1mdk
%endif

%description 
This is the very small DHCP server and client written by Moreton Bay/Lineo.

%package -n	udhcpd
Summary:	Very small DHCP server
Group:		System/Servers
PreReq:		rpm-helper

%description -n	udhcpd
This is the very small DHCP server written by Moreton Bay/Lineo.

%package -n	udhcpc
Summary:	Very small DHCP client
Group:		System/Configuration/Networking
PreReq:		rpm-helper

%description -n	udhcpc
This is the very small DHCP client written by Moreton Bay/Lineo.

%prep

%setup -q
%patch0 -p0
%patch2 -p1 -b .gcc3_4

%if %{build_diet}
%patch1 -p1 -b .DIET
%endif

%build
%serverbuild

%if %{build_diet}
make -f Makefile.dietlibc
%else
make
%endif

%install
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

install -d %{buildroot}%{_sysconfdir}
install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_localstatedir}/udhcpd

%makeinstall DESTDIR="%{buildroot}"

bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/udhcpd.conf
bzcat %{SOURCE2} > %{buildroot}%{_initrddir}/udhcpd

chmod 644 %{buildroot}%{_sysconfdir}/udhcpd.conf
chmod 755 %{buildroot}%{_initrddir}/udhcpd

touch %{buildroot}%{_localstatedir}/udhcpd/udhcpd.leases

%post -n udhcpd
%_post_service udhcpd
# New udhcpd lease file
if [ ! -f %{_localstatedir}/udhcpd/udhcpd.leases ]; then
    touch %{_localstatedir}/udhcpd/udhcpd.leases
fi

%preun -n udhcpd
%_preun_service udhcpd

%clean
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

%files -n udhcpd
%defattr(-,root,root)
%doc README COPYING AUTHORS TODO samples/udhcpd.conf
%{_mandir}/man1/dumpleases.*
%{_mandir}/man5/udhcpd.conf.*
%{_mandir}/man8/udhcpd.*
%{_sbindir}/udhcpd
%{_bindir}/dumpleases
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/udhcpd.conf
%config(noreplace) %attr(755,root,root) %{_initrddir}/udhcpd
%dir %{_localstatedir}/udhcpd/
%config(noreplace) %ghost %{_localstatedir}/udhcpd/udhcpd.leases

%files -n  udhcpc
%defattr(-,root,root)
%doc README COPYING AUTHORS TODO samples/sample*
/sbin/udhcpc
%dir %{_datadir}/udhcpc/
%{_datadir}/udhcpc/default.*
%{_mandir}/man8/udhcpc.*

%changelog
* Sat Oct 30 2004 Christiaan Welvaart <cjw@daneel.dyndns.org> 0.9.8-7mdk
- patch2: fix build with gcc 3.4

* Sat May 03 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.8-6mdk
- use spec file magic to enable compilation against dietlibc, use
  "rpm --rebuild --with diet udhcp-0.9.8-6mdk.src.rpm"

* Thu Jan 30 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.9.8-5mdk
- rebuild

* Mon Jan 27 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.8-4mdk
- build release
- misc spec file fixes

* Sat Nov 02 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.8-3mdk
- more Mr. Lint fixes (duh!)

* Sat Nov 02 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.8-2mdk
- Mr. Lint fixes
- bzip all sources
- PreReq: rpm-helper
- misc spec file fixes

* Sat Nov 02 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.8-1mdk
- new version

* Mon May 27 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.7-1mdk
- new version
- new P0 (the man page patch is moved upstream)
- rebuilt with gcc 3.1
- misc spec file fixes

* Thu Dec 13 2001 Philippe Libat <philippe@mandrakesoft.com> 0.9.6-1mdk
- First Spec