Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 8d8912dae17765bed0bcc60e88346cc7 > files > 3

p910nd-0.5-1mdk.src.rpm

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

%define build_diet 0

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

%define name	p910nd
%define version	0.5
%define release	1mdk

Summary:	Tiny non-spooling printer daemon.
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	GPL
Group:		System/Servers
URL:		http://etherboot.sourceforge.net/p910nd
Source0:	%{name}-%{version}.tar.bz2
Source1:	%{name}.init.bz2
PreReq:		rpm-helper
%if %{build_diet}
BuildRequires:	dietlibc-devel >= 0.20-1mdk
%else
Requires:	tcp_wrappers
BuildRequires:	tcp_wrappers-devel
%endif
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

%description
Tiny non-spooling printer daemon for Linux hosts. Accepts data
over a TCP network connection from a spooling host. Useful on
diskless X terminals with local printer.

%prep

%setup -q

bzcat %{SOURCE1} > %{name}.init

%build

%if %{build_diet}
    # OE: use the power of dietlibc
    diet gcc -Os -Wall -s -static -nostdinc -o p910nd p910nd.c
%else
    gcc %{optflags} -DUSE_LIBWRAP -o p910nd p910nd.c -lwrap
%endif

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

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_datadir}/%{name}
install -d %{buildroot}%{_mandir}/man8

install -m755 %{name}.init %{buildroot}%{_initrddir}/%{name}
install -m755 %{name} %{buildroot}%{_sbindir}/
install -m755 *.pl %{buildroot}%{_datadir}/%{name}/
install -m644 %{name}.8 %{buildroot}%{_mandir}/man8/

%post
%_post_service %{name}

%preun
%_preun_service %{name}

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

%files
%defattr(-, root, root)
%config(noreplace) %attr(0755,root,root) %{_initrddir}/%{name}
%attr(0644,root,root) %{_mandir}/man8/%{name}.8*
%attr(0755,root,root) %{_datadir}/%{name}/*.pl
%attr(0755,root,root) %{_sbindir}/%{name}

%changelog
* Tue Jun 17 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.5-1mdk
- initial cooker contrib
- use spec file magic to enable compilation against dietlibc
- added S1 (maybe it should run under xinetd instead?)