LPRng-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. %define nokerberos False
  2. %define _initdir /etc/rc.d/init.d
  3. %define use_alternatives 1
  4. Summary: LPRng Print Spooler
  5. Summary(ja): LPRng プリントスプーラ
  6. Name: LPRng
  7. Version: 3.8.21
  8. Release: 1%{?_dist_release}
  9. License: GPL and Artistic
  10. Group: System Environment/Daemons
  11. Source0: ftp://ftp.astart.com/pub/LPRng/LPRng/%{name}-%{version}.tgz
  12. Source1: lpd.init
  13. Patch0: LPRng-3.8.4-nonblock.patch
  14. Patch1: LPRng-3.7.4-lpd-perms.patch
  15. Patch2: LPRng-3.8.15-krb5.patch
  16. Patch3: LPRng-3.8.21-config.sub.patch
  17. Patch4: LPRng-3.8.21-lpq.patch
  18. Patch5: LPRng-3.8.21-lpf.patch
  19. # Vine Patch
  20. Patch101: LPRng-3.7.4-negative-check.patch
  21. URL: http://www.astart.com/LPRng.html
  22. Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
  23. Obsoletes: lpr
  24. Provides: lpr
  25. #Prereq: /sbin/chkconfig, %{_initdir}, mktemp, fileutils, textutils, gawk
  26. Prereq: /sbin/chkconfig, mktemp, fileutils, textutils, gawk
  27. BuildPreReq: gettext
  28. %{!?nokerberos:BuildPrereq: krb5-devel}
  29. %{!?nokerberos:Requires: krb5-libs}
  30. %if %use_alternatives
  31. Provides: /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat
  32. Prereq: alternatives
  33. %endif
  34. Vendor: Project Vine
  35. Distribution: Vine Linux
  36. Packager: Daisuke SUZUKI <daisuke@linux.or.jp>
  37. %description
  38. The LPRng software is an enhanced, extended, and portable implementation
  39. of the Berkeley LPR print spooler functionality. While providing the
  40. same interface and meeting RFC1179 requirements, the implementation
  41. is completely new and provides support for the following features:
  42. lightweight (no databases needed) lpr, lpc, and lprm programs; dynamic
  43. redirection of print queues; automatic job holding; highly verbose
  44. diagnostics; multiple printers serving a single queue; client programs
  45. do not need to run SUID root; greatly enhanced security checks; and a
  46. greatly improved permission and authorization mechanism.
  47. The source software compiles and runs on a wide variety of UNIX systems,
  48. and is compatible with other print spoolers and network printers that
  49. use the LPR interface and meet RFC1179 requirements. LPRng provides
  50. emulation packages for the SVR4 lp and lpstat programs, eliminating the
  51. need for another print spooler package. These emulation packages can be
  52. modified according to local requirements, in order to support vintage
  53. printing systems.
  54. For users that require secure and/or authenticated printing support,
  55. LPRng supports Kerberos V, MIT Kerberos IV Print Support, and PGP
  56. authentication. LPRng is being adopted by MIT for use as their Campus
  57. Wide printing support system. Additional authentication support is
  58. extremely simple to add.
  59. %prep
  60. %setup -q
  61. %patch0 -p1 -b .nonblock
  62. %patch1 -p1 -b .lpd-perms
  63. %{!?nokerberos:%patch2 -p1 -b .kerb5}
  64. %patch3 -p1 -b .config.sub
  65. %patch4 -p1 -b .lpq
  66. %patch5 -p1 -b .lpf
  67. %patch101 -p1 -b .negative
  68. # pick up configure.in changes
  69. autoconf
  70. ## set up gettext
  71. #cd po
  72. #rm Makefile.in.in
  73. #ln -s /usr/share/gettext/po/Makefile.in.in .
  74. #cd ..
  75. ##rm -fr intl
  76. %build
  77. CFLAGS="-O2" ; export CFLAGS
  78. %configure \
  79. --enable-nls \
  80. --with-userid=lp \
  81. --with-groupid=lp \
  82. %{!?nokerberos:--enable-kerberos}
  83. make MAKEPACKAGE=YES
  84. %install
  85. rm -rf %{buildroot}
  86. # Installation of locales is broken... Work around it!
  87. perl -pi -e "s,prefix =.*,prefix = %{buildroot}%{_prefix},g" po/Makefile
  88. perl -pi -e "s,datadir =.*,datadir = %{buildroot}%{_prefix}/share,g" po/Makefile
  89. perl -pi -e "s,localedir =.*,localedir = %{buildroot}%{_prefix}/share/locale,g" po/Makefile
  90. perl -pi -e "s,gettextsrcdir =.*,gettextsrcdir = %{buildroot}%{_prefix}/share/gettext/po,g" po/Makefile
  91. make SUID_ROOT_PERMS=" 04755" DESTDIR=%{buildroot} MAKEPACKAGE=YES mandir=%{_mandir} install
  92. %__cp src/monitor %{buildroot}%{_prefix}/sbin/monitor
  93. # install init script
  94. mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
  95. install -m755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/lpd
  96. %if %use_alternatives
  97. cd %{buildroot}%{_bindir}
  98. for i in cancel lp lpq lpr lprm lpstat; do
  99. mv $i $i.lprng
  100. done
  101. cd %{buildroot}%{_sbindir}
  102. mv lpc lpc.lprng
  103. cd %{buildroot}%{_mandir}/man1
  104. for i in cancel lp lpq lpr lprm lpstat; do
  105. mv $i.1 $i-lprng.1
  106. done
  107. cd %{buildroot}%{_mandir}/man8
  108. mv lpc.8 lpc-lprng.8
  109. %endif
  110. mv %{buildroot}%{_sysconfdir}/printcap %{buildroot}%{_sysconfdir}/printcap.sample
  111. %clean
  112. rm -rf %{buildroot}
  113. %post
  114. /sbin/chkconfig --add lpd
  115. if [ -w /etc/printcap ] ; then
  116. TMP1=`mktemp /etc/printcap.XXXXXX`
  117. gawk '
  118. BEGIN { first = 1; cont = 0; last = "" }
  119. /^[:space:]*#/ { if(cont) sub("\\\\$", "", last)}
  120. { if(first == 0) print last }
  121. { first = 0 }
  122. { last = $0 }
  123. { cont = 0 }
  124. /\\$/ { cont = 1 }
  125. END {sub("\\\\$", "", last); print last}
  126. ' /etc/printcap > ${TMP1} && cat ${TMP1} > /etc/printcap && rm -f ${TMP1}
  127. fi
  128. %if %use_alternatives
  129. /sbin/update-alternatives --install %{_bindir}/lpr print %{_bindir}/lpr.lprng 40 \
  130. --slave %{_bindir}/lp print-lp %{_bindir}/lp.lprng \
  131. --slave %{_bindir}/lpq print-lpq %{_bindir}/lpq.lprng \
  132. --slave %{_bindir}/lprm print-lprm %{_bindir}/lprm.lprng \
  133. --slave %{_bindir}/lpstat print-lpstat %{_bindir}/lpstat.lprng \
  134. --slave %{_bindir}/cancel print-cancel %{_bindir}/cancel.lprng \
  135. --slave %{_sbindir}/lpc print-lpc %{_sbindir}/lpc.lprng \
  136. --slave %{_mandir}/man1/cancel.1.gz print-cancelman %{_mandir}/man1/cancel-lprng.1.gz \
  137. --slave %{_mandir}/man1/lp.1.gz print-lpman %{_mandir}/man1/lp-lprng.1.gz \
  138. --slave %{_mandir}/man8/lpc.8.gz print-lpcman %{_mandir}/man8/lpc-lprng.8.gz \
  139. --slave %{_mandir}/man1/lpq.1.gz print-lpqman %{_mandir}/man1/lpq-lprng.1.gz \
  140. --slave %{_mandir}/man1/lpr.1.gz print-lprman %{_mandir}/man1/lpr-lprng.1.gz \
  141. --slave %{_mandir}/man1/lprm.1.gz print-lprmman %{_mandir}/man1/lprm-lprng.1.gz \
  142. --slave %{_mandir}/man1/lpstat.1.gz print-lpstatman %{_mandir}/man1/lpstat-lprng.1.gz
  143. %endif
  144. %preun
  145. if [ "$1" = 0 ]; then
  146. %{_initdir}/lpd stop >/dev/null 2>&1
  147. /sbin/chkconfig --del lpd
  148. %if %use_alternatives
  149. /sbin/update-alternatives --remove print %{_bindir}/lpr.lprng
  150. %endif
  151. fi
  152. %postun
  153. if [ "$1" -ge "1" ]; then
  154. %{_initdir}/lpd condrestart >/dev/null 2>&1
  155. fi
  156. %triggerpostun -- lpr
  157. /sbin/chkconfig --add lpd
  158. %files
  159. %defattr(-,root,root)
  160. %attr(644,root,root) %config(noreplace) %{_sysconfdir}/lpd.conf
  161. %attr(644,root,root) %config(noreplace) %{_sysconfdir}/lpd.perms
  162. %config %{_sysconfdir}/rc.d/init.d/lpd
  163. %{_sysconfdir}/printcap.sample
  164. %{_sysconfdir}/lpd.conf.sample
  165. %{_sysconfdir}/lpd.perms.sample
  166. %ifarch x86_64
  167. %{_libdir}
  168. %else
  169. %{_libdir}/*.so.*
  170. %endif
  171. %attr(755,lp,lp) %{_bindir}/lpq.lprng
  172. %attr(755,lp,lp) %{_bindir}/lprm.lprng
  173. %attr(755,lp,lp) %{_bindir}/lpr.lprng
  174. %attr(755,lp,lp) %{_bindir}/lpstat.lprng
  175. %{_bindir}/lp.lprng
  176. %{_bindir}/cancel.lprng
  177. %attr(755,lp,lp) %{_sbindir}/lpc.lprng
  178. %attr(755,root,root) %{_sbindir}/lpd
  179. %attr(755,root,root) %{_sbindir}/checkpc
  180. %attr(755,root,root) %{_sbindir}/monitor
  181. %attr(755,root,root) /usr/libexec/filters/*
  182. %{_mandir}/*/*
  183. %doc CHANGES CONTRIBUTORS COPYRIGHT INSTALL LICENSE
  184. %doc README* VERSION Y2KCompliance
  185. %doc HOWTO/*.html HOWTO/*.jpg
  186. %changelog
  187. * Sun Sep 14 2008 Shu KONNO <owa@bg.wakwak.com> 3.8.21-1vl5
  188. - applied new versioning policy, spec in utf-8
  189. * Mon Nov 26 2007 Shu KONNO <owa@bg.wakwak.com> 3.8.21-0vl3
  190. - changed source url to ftp://ftp.lprng.com/pub/LPRng/LPRng/LPRng-%%{version}.tgz
  191. - added Patch3: LPRng-3.8.21-config.sub.patch (for x86_64)
  192. - added Patch4: LPRng-3.8.21-lpq.patch
  193. - added Patch5: LPRng-3.8.21-lpf.patch
  194. - added %{_sysconfdir}/{printcap,lpd.conf,lpd.perms}.sample in %%files section
  195. * Fri Oct 31 2003 Tomoya TAKA <taka@vinelinux.org> 3.8.21-0vl2
  196. - remove workaround for gettext in %%prep
  197. * Mon Sep 1 2003 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 3.8.21-0vl1.1
  198. - use alternatives.
  199. * Wed Jun 4 2003 Jun Nishii <jun@vinelinux.org> 3.8.21-0vl1
  200. - ver.up
  201. * Wed Jan 29 2003 Tomoya TAKA <taka@vinelinux.org> 3.8.20-0vl1
  202. - drop LPRng-3.7.4-alpha-direct.patch
  203. - drop HOWTO/*.gif and add HOWTO/*.jpg from/to %%doc
  204. * Mon Jan 23 2003 Satoshi MACHINO <machino@vinelinux.org> 3.8.20-0vl1
  205. - updated to 3.8.20
  206. -- dropped LPRng-3.7.4-lockfile.patch
  207. -- dropped LPRng-3.7.4-nointl.patch
  208. -- dropped LPRng-3.7.4-inet_ntop.patch
  209. -- added /usr/lib/liblpr.so
  210. - imported some patches from LPRng-3.8.19-1
  211. -- added LPRng-3.8.4-nonblock.patch
  212. -- added LPRng-3.7.4-lpd-perms.patch
  213. -- added LPRng-3.8.15-krb5.patch
  214. * Fri Jul 13 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 3.7.4-6vl5
  215. - change CFLAGS in %make from -ggdb to -O2
  216. * Thu Feb 15 2001 Tomoya TAKA <tomoya@olive.plala.or.jp>
  217. - 3.7.4-6vl4
  218. - change type of Direct_DYN on alpha (int -> int64_t)
  219. * Wed Feb 14 2001 Jun Nishii <jun@vinelinux.org>
  220. - 3.7.4-6vl3
  221. - negative solution to avoid changing permision of the filter under spool directory.
  222. * Thu Feb 8 2001 Jun Nishii <jun@vinelinux.org>
  223. - 3.7.4-6vl2
  224. - fix lpd.init
  225. * Tue Feb 6 2001 Jun Nishii <jun@vinelinux.org>
  226. - 3.7.4-6vl1
  227. * Sat Feb 03 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  228. - 3.6.26-1vl2
  229. - remove /etc/rc.d/init.d from Prereq: for better compatibility with apt
  230. - added Japanese summary
  231. - use better macro(s) (%%{_initdir})
  232. * Tue Dec 19 2000 Jun Nishii <jun@vinelinux.org>
  233. - 3.6.26-1vl1
  234. * Sat Oct 21 2000 Bernhard Rosenkraenzer <bero@redhat.com>
  235. - 3.2.26; fixes some security problems (Bug #19518)
  236. * Mon Sep 11 2000 Crutcher Dunnavant <crutcher@redhat.com>
  237. - Added gettext to the BuildPreReq list
  238. * Mon Sep 11 2000 Crutcher Dunnavant <crutcher@redhat.com>
  239. - Fixed lpd.init to use /etc/rc.d/init.d/, instead of /etc/init.d
  240. * Mon Sep 11 2000 Crutcher Dunnavant <crutcher@redhat.com>
  241. - changed the prereq: /etc/init.d to: /etc/rc.d/init.d
  242. - we are not changing that over (yet?)
  243. * Mon Aug 14 2000 Crutcher Dunnavant <crutcher@redhat.com>
  244. - removed the sticky bit from lpc
  245. * Mon Aug 14 2000 Crutcher Dunnavant <crutcher@redhat.com>
  246. - removed the sticky bit from the client programs (LPRng doesn't need them)
  247. * Sat Aug 05 2000 Bill Nottingham <notting@redhat.com>
  248. - condrestart fixes
  249. * Fri Aug 4 2000 Bill Nottingham <notting@redhat.com>
  250. - triggerpostun on lpr
  251. * Sun Jul 30 2000 Bernhard Rosenkraenzer <bero@redhat.com>
  252. - 3.6.22 (some fixes)
  253. * Tue Jul 25 2000 Bill Nottingham <notting@redhat.com>
  254. - fix prereq
  255. * Sat Jul 22 2000 Nalin Dahyabhai <nalin@redhat.com>
  256. - fix bogus checkpc error messages when the lockfile doesn't exist because
  257. init scripts clear /var/run (#14472)
  258. * Tue Jul 18 2000 Nalin Dahyabhai <nalin@redhat.com>
  259. - fix chkconfig comments in the init script
  260. * Mon Jul 17 2000 Nalin Dahyabhai <nalin@redhat.com>
  261. - move the init script to /etc/rc.d/init.d
  262. - fix perms on setuid binaries
  263. * Fri Jul 14 2000 Nalin Dahyabhai <nalin@redhat.com>
  264. - patch checkpc to not complain when filter is executable and in the
  265. spool directory
  266. - remove --disable-force_localhost from configure invocation for better
  267. compatibility with BSD LPR and rhs-printfilters
  268. - change group back to lp, which is what printtool expects
  269. * Thu Jul 13 2000 Nalin Dahyabhai <nalin@redhat.com>
  270. - change default group to 'daemon' to match 6.2
  271. - enable NLS support
  272. - remove Prefix: tag
  273. - break init script out into a separate file
  274. - fix up broken printcaps in post-install
  275. - run checkpc -f at start-time
  276. * Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
  277. - automatic rebuild
  278. * Tue Jul 11 2000 Bernhard Rosenkraenzer <bero@redhat.com>
  279. - 3.6.21
  280. - get rid of the notypedef patch - gcc has been fixed at last.
  281. * Mon Jun 26 2000 Preston Brown <pbrown@redhat.com>
  282. - sample config files removed from /etc.
  283. - initscript moved to /etc/init.d
  284. * Wed Jun 21 2000 Bernhard Rosenkraenzer <bero@redhat.com>
  285. - 3.6.18
  286. * Sat Jun 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
  287. - 3.6.16
  288. - adapt Kerberos and fixmake patches
  289. - get rid of CFLAGS="-O"; gcc has been fixed
  290. - fix build with glibc 2.2
  291. * Mon Jun 05 2000 Preston Brown <pbrown@redhat.com>
  292. - ifdef 0 is illegal, changed to if 0.
  293. - work around compiler typdef bug.
  294. * Thu Jun 01 2000 Preston Brown <pbrown@redhat.com>
  295. - start, stop, and restart are functions not switch statements now.
  296. reduces overhead.
  297. - patch to allow autoconf to choose which user/group to run as
  298. * Wed May 31 2000 Preston Brown <pbrown@redhat.com>
  299. - remove init.d symbolic links.
  300. - remove txt/ps/info versions of the HOWTO from the pkg
  301. - use new fhs paths
  302. * Thu May 25 2000 Nalin Dahyabhai <nalin@redhat.com>
  303. - change free() to krb5_free_data_contents() when patching for Kerberos 5
  304. - detect libcrypto or libk5crypto when looking for Kerberos 5
  305. * Tue May 16 2000 Nalin Dahyabhai <nalin@redhat.com>
  306. - enable Kerberos support
  307. - remove extra defattr in files list
  308. - add --disable-force_localhost to configure invocation
  309. - remove "-o root" at install-time
  310. * Tue May 16 2000 Matt Wilson <msw@redhat.com>
  311. - add Prereq of /sbin/chkconfig
  312. - fix broken conflicting declaration on alpha
  313. * Tue Apr 18 2000 Bernhard Rosenkraenzer <bero@redhat.com>
  314. - initial Red Hat packaging, fix up the spec file
  315. * Mon Sep 13 1999 Patrick Powell <papowell@astart.com>
  316. - resolved problems with symbolic links to /etc/init.d
  317. files - used the chkconfig facility
  318. * Sat Sep 4 1999 Patrick Powell <papowell@astart.com>
  319. - did ugly things to put the script in the spec file
  320. * Sat Aug 28 1999 Giulio Orsero <giulioo@tiscalinet.it>
  321. - 3.6.8
  322. * Fri Aug 27 1999 Giulio Orsero <giulioo@tiscalinet.it>
  323. - 3.6.7 First RPM build.