|
# $Id: LPRng.spec,v 1.6 2008/04/09 13:51:41 slords Exp $ |
|
|
|
|
1 |
Summary: The LPRng print spooler. |
Summary: The LPRng print spooler. |
2 |
Name: LPRng |
Name: LPRng |
3 |
Version: 3.8.32 |
Version: 3.8.35 |
4 |
Release: 2%{?dist} |
Release: 2%{?dist} |
5 |
License: GPL and Artistic |
License: GPL and Artistic |
6 |
Group: System Environment/Daemons |
Group: System Environment/Daemons |
7 |
Source0: ftp://ftp.lprng.com/pub/LPRng/LPRng/%{name}-%{version}.tgz |
Source0: ftp://ftp.lprng.com/pub/LPRng/LPRng/%{name}-%{version}.tgz |
8 |
Source1: lpd.init |
Source1: lpd.init |
9 |
Patch1: LPRng-3.8.32-makefile.patch |
Patch0: LPRng-3.8.35-el5_build_fix.patch |
10 |
URL: http://www.lprng.com |
URL: http://www.lprng.com |
11 |
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root |
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root |
12 |
Obsoletes: lpr |
Obsoletes: lpr |
13 |
Provides: lpr |
Provides: lpr |
14 |
Prereq: /sbin/chkconfig, /etc/rc.d/init.d, mktemp, fileutils, textutils, gawk |
Prereq: /sbin/chkconfig, /etc/rc.d/init.d, mktemp, fileutils, textutils, gawk |
15 |
Prereq: /usr/sbin/alternatives |
BuildPreReq: gettext |
|
BuildPreReq: gettext ed autoconf |
|
|
BuildRequires: /usr/bin/g77 elfutils-libelf-devel ncurses-devel libtermcap-devel |
|
|
BuildRequires: openssl-devel gettext-devel |
|
|
%{!?nokerberos:BuildPrereq: krb5-devel} |
|
|
%{!?nokerberos:Requires: krb5-libs} |
|
|
|
|
|
# We don't ship these files, but create symlinks to them. Other |
|
|
# packages aren't to know though. |
|
|
Provides: %{_bindir}/lp |
|
|
Provides: %{_bindir}/lpq |
|
|
Provides: %{_bindir}/lpr |
|
|
Provides: %{_bindir}/lprm |
|
|
Provides: %{_bindir}/lpstat |
|
|
Provides: %{_bindir}/cancel |
|
|
Provides: %{_sbindir}/lpc |
|
16 |
|
|
17 |
%description |
%description |
18 |
LPRng is an enhanced, extended, and portable implementation of the |
LPRng is an enhanced, extended, and portable implementation of the |
40 |
%prep |
%prep |
41 |
|
|
42 |
%setup -q |
%setup -q |
43 |
%patch1 -p1 |
|
44 |
|
%patch0 -p1 |
45 |
|
|
46 |
# pick up configure.in changes |
# pick up configure.in changes |
47 |
|
|
48 |
# set up gettext |
# set up gettext |
49 |
( |
#( |
50 |
cd po |
#cd po |
51 |
rm Makefile.in.in |
#rm Makefile.in.in |
52 |
ln -s /usr/share/gettext/po/Makefile.in.in . |
#ln -s /usr/share/gettext/po/Makefile.in.in . |
53 |
) |
#) |
54 |
|
|
55 |
#sh CREATE_CONFIGURE |
#sh CREATE_CONFIGURE |
56 |
|
|
57 |
%build |
%build |
|
test -f /usr/share/libtool/config.guess && cp /usr/share/libtool/config.guess . |
|
|
test -f /usr/share/libtool/config.sub && cp /usr/share/libtool/config.sub . |
|
|
#PSHOWALL="-ax" ; export PSHOWALL # So that we don't need /proc mounted |
|
58 |
CFLAGS="$RPM_OPT_FLAGS" ; export CFLAGS |
CFLAGS="$RPM_OPT_FLAGS" ; export CFLAGS |
59 |
%configure --enable-nls \ |
%configure --enable-nls \ |
|
--with-userid=lp \ |
|
|
--with-groupid=lp \ |
|
60 |
--disable-werror \ |
--disable-werror \ |
61 |
%{!?nokerberos:--enable-kerberos LDFLAGS="-L/usr/kerberos/lib" CPPFLAGS="-I/usr/kerberos/include" } |
--with-userid=lp \ |
62 |
|
--with-groupid=lp |
63 |
make MAKEPACKAGE=YES |
make MAKEPACKAGE=YES |
64 |
|
|
65 |
%install |
%install |
69 |
|
|
70 |
make SUID_ROOT_PERMS=" 04755" DESTDIR=${RPM_BUILD_ROOT} MAKEPACKAGE=YES mandir=%{_mandir} install |
make SUID_ROOT_PERMS=" 04755" DESTDIR=${RPM_BUILD_ROOT} MAKEPACKAGE=YES mandir=%{_mandir} install |
71 |
|
|
|
# Remove files we don't ship |
|
|
rm -f %{buildroot}/usr/share/LPRng/*.sample |
|
|
rm -f %{buildroot}%{_sysconfdir}/*.sample |
|
|
rm -f %{buildroot}%{_sysconfdir}/lpd/*.sample |
|
|
rm -f %{buildroot}%{_sysconfdir}/rc.d/init.d/*.sample |
|
|
rm -f %{buildroot}%{_sysconfdir}/lpd/lpd |
|
|
rm -f %{buildroot}%{_sysconfdir}/printcap |
|
|
rm -f %{buildroot}%{_libdir}/liblpr.*a |
|
|
rm -f %{buildroot}%{_sbindir}/lprng_{index_,}certs |
|
|
|
|
72 |
# install init script |
# install init script |
73 |
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d |
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d |
74 |
install -m755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/lpd |
# install -m755 %{_sysconfdir}/lpd/lpd.init ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d/lpd |
|
|
|
|
# Alternatives, to avoid conflicting with cups. |
|
|
for f in %{_bindir}/{cancel,lp,lp{q,r,rm,stat}} %{_sbindir}/lpc |
|
|
do |
|
|
mv %{buildroot}${f} %{buildroot}${f}.LPRng |
|
|
done |
|
|
for f in cancel lp lpq lpr lprm lpstat |
|
|
do |
|
|
mv %{buildroot}%{_mandir}/man1/${f}.1 %{buildroot}%{_mandir}/man1/${f}-LPRng.1 |
|
|
done |
|
|
mv %{buildroot}%{_mandir}/man8/lpc.8 %{buildroot}%{_mandir}/man8/lpc-LPRng.8 |
|
75 |
|
|
76 |
%clean |
%clean |
77 |
rm -rf %{buildroot} |
rm -rf %{buildroot} |
78 |
|
|
79 |
%post |
%post |
|
/sbin/ldconfig |
|
80 |
/sbin/chkconfig --add lpd |
/sbin/chkconfig --add lpd |
|
if [ -w /etc/printcap ] ; then |
|
|
TMP1=`mktemp /etc/printcap.XXXXXX` |
|
|
gawk ' |
|
|
BEGIN { first = 1; cont = 0; last = "" } |
|
|
/^[:space:]*#/ { if(cont) sub("\\\\$", "", last)} |
|
|
{ if(first == 0) print last } |
|
|
{ first = 0 } |
|
|
{ last = $0 } |
|
|
{ cont = 0 } |
|
|
/\\$/ { cont = 1 } |
|
|
END {sub("\\\\$", "", last); print last} |
|
|
' /etc/printcap > ${TMP1} && cat ${TMP1} > /etc/printcap && rm -f ${TMP1} |
|
|
fi |
|
|
|
|
|
# Alternatives |
|
|
/usr/sbin/alternatives --install %{_bindir}/lpr print %{_bindir}/lpr.LPRng 41 \ |
|
|
--slave %{_bindir}/lp print-lp %{_bindir}/lp.LPRng \ |
|
|
--slave %{_bindir}/lpq print-lpq %{_bindir}/lpq.LPRng \ |
|
|
--slave %{_bindir}/lprm print-lprm %{_bindir}/lprm.LPRng \ |
|
|
--slave %{_bindir}/lpstat print-lpstat %{_bindir}/lpstat.LPRng \ |
|
|
--slave %{_bindir}/cancel print-cancel %{_bindir}/cancel.LPRng \ |
|
|
--slave %{_sbindir}/lpc print-lpc %{_sbindir}/lpc.LPRng \ |
|
|
--slave %{_mandir}/man1/cancel.1.gz print-cancelman %{_mandir}/man1/cancel-LPRng.1.gz \ |
|
|
--slave %{_mandir}/man1/lp.1.gz print-lpman %{_mandir}/man1/lp-LPRng.1.gz \ |
|
|
--slave %{_mandir}/man8/lpc.8.gz print-lpcman %{_mandir}/man8/lpc-LPRng.8.gz \ |
|
|
--slave %{_mandir}/man1/lpq.1.gz print-lpqman %{_mandir}/man1/lpq-LPRng.1.gz \ |
|
|
--slave %{_mandir}/man1/lpr.1.gz print-lprman %{_mandir}/man1/lpr-LPRng.1.gz \ |
|
|
--slave %{_mandir}/man1/lprm.1.gz print-lprmman %{_mandir}/man1/lprm-LPRng.1.gz \ |
|
|
--slave %{_mandir}/man1/lpstat.1.gz print-lpstatman %{_mandir}/man1/lpstat-LPRng.1.gz \ |
|
|
--initscript lpd |
|
81 |
|
|
82 |
%preun |
%preun |
83 |
if [ "$1" = 0 ]; then |
if [ "$1" = 0 ]; then |
84 |
/sbin/service lpd stop >/dev/null 2>&1 |
/sbin/service lpd stop |
85 |
/sbin/chkconfig --del lpd |
/sbin/chkconfig --del lpd |
|
/usr/sbin/alternatives --remove print %{_bindir}/lpr.LPRng |
|
86 |
fi |
fi |
87 |
|
|
88 |
%postun |
%postun |
|
/sbin/ldconfig |
|
89 |
if [ "$1" -ge "1" ]; then |
if [ "$1" -ge "1" ]; then |
90 |
/sbin/service lpd condrestart >/dev/null 2>&1 |
/sbin/service lpd start >/dev/null 2>&1 |
91 |
fi |
fi |
92 |
|
|
|
%triggerpostun -- LPRng < 3.8.5-2 |
|
|
# Deal with pre-alternatives packages |
|
|
/usr/sbin/alternatives --auto print |
|
|
|
|
93 |
%files |
%files |
94 |
%defattr(-,root,root) |
%defattr(-,root,root) |
95 |
%config %{_sysconfdir}/lpd/lpd.conf |
%config %{_sysconfdir}/lpd/lpd.conf |
96 |
%config %{_sysconfdir}/lpd/lpd.perms |
%config %{_sysconfdir}/lpd/lpd.perms |
97 |
|
%attr(644,root,root) %{_sysconfdir}/lpd/lpd.conf.sample |
98 |
|
%attr(644,root,root) %{_sysconfdir}/lpd/lpd.perms.sample |
99 |
|
%attr(644,root,root) %{_sysconfdir}/printcap.sample |
100 |
|
%attr(755,root,root) %{_libdir}/* |
101 |
%config %{_sysconfdir}/rc.d/init.d/lpd |
%config %{_sysconfdir}/rc.d/init.d/lpd |
102 |
%attr(755,lp,lp) %{_bindir}/lpq.LPRng |
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/lpd |
103 |
%attr(755,lp,lp) %{_bindir}/lprm.LPRng |
%doc %{_datadir}/LPRng/* |
104 |
%attr(755,lp,lp) %{_bindir}/lpr.LPRng |
%attr(755,lp,lp) %{_bindir}/lpq |
105 |
%attr(755,lp,lp) %{_bindir}/lpstat.LPRng |
%attr(755,lp,lp) %{_bindir}/lprm |
106 |
%{_bindir}/lp.LPRng |
%attr(755,lp,lp) %{_bindir}/lpr |
107 |
%{_bindir}/cancel.LPRng |
%attr(755,lp,lp) %{_bindir}/lpstat |
108 |
%attr(755,lp,lp) %{_sbindir}/lpc.LPRng |
%{_bindir}/lp |
109 |
|
%{_bindir}/cancel |
110 |
|
%attr(755,lp,lp) %{_sbindir}/lpc |
111 |
%attr(755,root,root) %{_sbindir}/lpd |
%attr(755,root,root) %{_sbindir}/lpd |
112 |
|
%attr(755,root,root) %{_sbindir}/lprng_certs |
113 |
|
%attr(755,root,root) %{_sbindir}/lprng_index_certs |
114 |
%attr(755,root,root) %{_sbindir}/checkpc |
%attr(755,root,root) %{_sbindir}/checkpc |
115 |
%attr(755,root,root) /usr/libexec/filters/* |
%attr(755,root,root) /usr/libexec/filters/* |
116 |
%dir /usr/libexec/filters |
%dir /usr/libexec/filters |
120 |
%doc README* VERSION Y2KCompliance |
%doc README* VERSION Y2KCompliance |
121 |
%doc DOCS |
%doc DOCS |
122 |
|
|
123 |
%changelog |
%exclude %{_sysconfdir}/printcap |
124 |
* Fri Jan 11 2008 Shad L. Lords <slords@mail.com> 3.8.32-2.sme |
%exclude %{_sysconfdir}/rc.d/init.d/lpd.sample |
|
- Fix package to use alternatives |
|
|
- Patch Makefile to work correctly |
|
125 |
|
|
126 |
* Thu Nov 13 2003 Patrick Powell <papowell@astart.com> 3.8.32-1 |
%changelog |
127 |
|
* Thu Nov 13 2003 Patrick Powell <papowell@astart.com> 3.8.23-1 |
128 |
- updated everything to fit the new sysconfdir standards |
- updated everything to fit the new sysconfdir standards |
129 |
- the startup script is copied to sysconfdir/lpd/lpd.init as part of the |
- the startup script is copied to sysconfdir/lpd/lpd.init as part of the |
130 |
- normal install now |
- normal install now |