aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2018-12-15 20:51:08 -0500
committerChris Severance2018-12-15 20:51:08 -0500
commit580a8b4aa9812f2a5c3b4958c2d7f5a427707176 (patch)
treefa029857317440d3e2470a1aa43f6f29153c82c1
downloadaur-580a8b4aa9812f2a5c3b4958c2d7f5a427707176.tar.gz
Initial Import
-rw-r--r--.SRCINFO66
-rw-r--r--0000-lprng-help-website.patch317
-rw-r--r--PKGBUILD335
-rw-r--r--README1
-rwxr-xr-xfoofilter44
-rwxr-xr-xgsfilter52
-rw-r--r--lpd.conf4
-rw-r--r--lpd.perms18
-rw-r--r--lpd.service12
-rw-r--r--lprng.install38
-rw-r--r--printcap_remote9
-rw-r--r--printcap_server17
-rwxr-xr-xpsfilter64
13 files changed, 977 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c3c5fc235acd
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,66 @@
+# Generated by mksrcinfo v8
+# Sun Dec 16 01:50:28 UTC 2018
+pkgbase = lprng-cups
+ pkgdesc = an enhanced, extended, and portable implementation of the Berkeley LPR lpd print spooler functionality that coexists with CUPS
+ pkgver = 3.8.C
+ pkgrel = 1
+ url = http://lprng.sourceforge.net
+ install = lprng.install
+ arch = i686
+ arch = x86_64
+ license = custom:Artistic
+ depends = bash
+ depends = file
+ depends = grep
+ depends = sed
+ depends = openssl-1.0
+ optdepends = poppler: pdf to ps conversion in filters (gsfilter)
+ optdepends = ghostscript: convert ps to device language in filters (gsfilter)
+ optdepends = enscript: text to ps conversion in filters (gsfilter,psfilter)
+ optdepends = foomatic-filters-lprng: foomatic-rip in filters (foofilter)
+ optdepends = hplip: drivers for HP printers
+ optdepends = ifhp: filters for many printers
+ optdepends = cups: standard BSD binaries lp lpr lpq
+ optdepends = lprng: install this instead for standard BSD binaries lp lpr lpq without cups
+ provides = lprng=3.8.C
+ conflicts = lprng
+ options = !strip
+ backup = etc/lprng/lpd/lpd.conf
+ backup = etc/lprng/lpd/lpd.perms
+ backup = etc/lprng/printcap
+ source = http://sourceforge.net/projects/lprng/files/lprng/lprng-3.8.C.tar.gz
+ source = 0000-lprng-help-website.patch
+ source = lpd.service
+ source = gsfilter
+ source = psfilter
+ source = foofilter
+ source = printcap_remote
+ source = printcap_server
+ source = README
+ source = lpd.conf
+ source = lpd.perms
+ md5sums = 5901bed95e61d2bea3ba3056056af432
+ md5sums = c9c774d21fe1304c69a62dfe8c7f77ee
+ md5sums = a59c448b0e37db80422175b7a1a2c304
+ md5sums = 2a45ea95fc86bf9ae61f932aaac9d214
+ md5sums = d6c523f275bb63f68bf17d5ca02e4814
+ md5sums = d8390a6cb0126dabf029fdd2c9dc07c8
+ md5sums = 496dfbb160f2a0308b7847541b03c8db
+ md5sums = 422ad79bda6ae9d2990fdef55240e569
+ md5sums = 1768d2f81d6d14c22686293ca60528c1
+ md5sums = 3ef9f91dc0de273da1f5f1b20d49cd17
+ md5sums = 3f861c75c2d68c0e45b4095ab39ba1c8
+ sha256sums = 694a1747a96385b89e93f43343bf35cee5c8c73353a83814106911c99f09de10
+ sha256sums = dc219daa8dccd6e02039568e54fa15bc0dd993f99eb2a79a1336d1212a831b71
+ sha256sums = 3b546e8dd8f7ef3a1025d7d59ed8187fa21a9b9cf839a9bbda9821733da046e1
+ sha256sums = 78b9b6a30ab53f55407b873cbc23df3a129dcd22a2d55557b9e7ac3dc13b8c19
+ sha256sums = f1a8a318f210cfc3814d234cb98a3de0c7a161c0e0c5671fe1c266ee03e351ec
+ sha256sums = a13fb767cbd142100e8020aac5b0f091f50a42602768665b8e2595f74fa31c4d
+ sha256sums = be383447b74cf9b86666adeaf35f844b394c222abbcda7f5cd7fc64f79373b82
+ sha256sums = fc94245b58b23c9498a10c64aed20b6120595c6c3e1412bb419126ca78123a94
+ sha256sums = a4c261f5754b380ff85c454249a152cb67baf9bbf10dc95cd16026f90bacb620
+ sha256sums = faf52cf982eaa66a475344a5647a80a761d10402ccb9de263c70dc15ccc85c29
+ sha256sums = 47b48ab7fa15ae9226463c98d6c8fce9ee9b602c3a9f96907fcd84e50902b2cc
+
+pkgname = lprng-cups
+
diff --git a/0000-lprng-help-website.patch b/0000-lprng-help-website.patch
new file mode 100644
index 000000000000..a621cf7dd9ba
--- /dev/null
+++ b/0000-lprng-help-website.patch
@@ -0,0 +1,317 @@
+diff -Naru3 lprng-3.8.C.orig/man/checkpc.n lprng-3.8.C/man/checkpc.n
+--- lprng-3.8.C.orig/man/checkpc.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/checkpc.n 2018-12-12 22:52:08.917254556 -0500
+@@ -117,15 +117,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lpbanner.n lprng-3.8.C/man/lpbanner.n
+--- lprng-3.8.C.orig/man/lpbanner.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpbanner.n 2018-12-12 22:53:03.077071032 -0500
+@@ -91,15 +91,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lpc.n lprng-3.8.C/man/lpc.n
+--- lprng-3.8.C.orig/man/lpc.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpc.n 2018-12-12 22:55:17.816586551 -0500
+@@ -437,9 +437,7 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng mailing list is lprng@lprng.com;
+-subscribe by sending mail to lprng-request@lprng.com with
+-the word subscribe in the body.
+-The software is available from ftp://ftp.lprng.com/pub/LPRng.
++The software is available from
++.B http://www.lprng.com/
+ .SH "AUTHOR"
+ Patrick Powell <papowell@lprng.com>.
+diff -Naru3 lprng-3.8.C.orig/man/lpd.conf.n lprng-3.8.C/man/lpd.conf.n
+--- lprng-3.8.C.orig/man/lpd.conf.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpd.conf.n 2018-12-12 22:55:11.406610399 -0500
+@@ -745,9 +745,7 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng mailing list is lprng@lprng.com;
+-subscribe by sending mail to lprng-request@lprng.com with
+-the word subscribe in the body.
+-The software is available from ftp://ftp.lprng.com/pub/LPRng.
++The software is available from
++.B http://www.lprng.com/
+ .SH "AUTHOR"
+ Patrick Powell <papowell@lprng.com>.
+diff -Naru3 lprng-3.8.C.orig/man/lpd.n lprng-3.8.C/man/lpd.n
+--- lprng-3.8.C.orig/man/lpd.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpd.n 2018-12-12 22:54:18.706803592 -0500
+@@ -1864,15 +1864,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lpd.perms.n lprng-3.8.C/man/lpd.perms.n
+--- lprng-3.8.C.orig/man/lpd.perms.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpd.perms.n 2018-12-12 22:54:31.546757008 -0500
+@@ -363,15 +363,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lpf.n lprng-3.8.C/man/lpf.n
+--- lprng-3.8.C.orig/man/lpf.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpf.n 2018-12-12 22:54:45.386706441 -0500
+@@ -135,15 +135,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lp.n lprng-3.8.C/man/lp.n
+--- lprng-3.8.C.orig/man/lp.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lp.n 2018-12-12 22:52:47.987122879 -0500
+@@ -39,18 +39,9 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+ .\" This manpage-stub is written by Bernhard R. Link <brlink@debian.org>
+ .\" and available under GNU GPL v2 and any license LPRng is available under.
+
+diff -Naru3 lprng-3.8.C.orig/man/lpq.n lprng-3.8.C/man/lpq.n
+--- lprng-3.8.C.orig/man/lpq.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpq.n 2018-12-12 22:55:00.376651264 -0500
+@@ -282,16 +282,7 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+
+diff -Naru3 lprng-3.8.C.orig/man/lprm.n lprng-3.8.C/man/lprm.n
+--- lprng-3.8.C.orig/man/lprm.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lprm.n 2018-12-12 22:55:48.686470700 -0500
+@@ -234,15 +234,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lpr.n lprng-3.8.C/man/lpr.n
+--- lprng-3.8.C.orig/man/lpr.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpr.n 2018-12-12 22:55:36.036518373 -0500
+@@ -515,15 +515,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lprng_certs.n lprng-3.8.C/man/lprng_certs.n
+--- lprng-3.8.C.orig/man/lprng_certs.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lprng_certs.n 2018-12-12 22:56:03.806413369 -0500
+@@ -223,15 +223,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lprng_index_certs.n lprng-3.8.C/man/lprng_index_certs.n
+--- lprng-3.8.C.orig/man/lprng_index_certs.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lprng_index_certs.n 2018-12-12 22:56:22.306342720 -0500
+@@ -38,15 +38,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/lpstat.n lprng-3.8.C/man/lpstat.n
+--- lprng-3.8.C.orig/man/lpstat.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/lpstat.n 2018-12-12 22:57:03.476183607 -0500
+@@ -107,18 +107,9 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+ .\" This manpage is written by Bernhard R. Link <brlink@debian.org>
+ .\" and available under GNU GPL v2 and any license LPRng is available under.
+ .\" The descriptions are extracted from lpstat.c from Patrick Powell <papowell@lprng.com>
+diff -Naru3 lprng-3.8.C.orig/man/monitor.n lprng-3.8.C/man/monitor.n
+--- lprng-3.8.C.orig/man/monitor.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/monitor.n 2018-12-12 22:57:19.586120669 -0500
+@@ -51,15 +51,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
+diff -Naru3 lprng-3.8.C.orig/man/printcap.n lprng-3.8.C/man/printcap.n
+--- lprng-3.8.C.orig/man/printcap.n 2012-04-15 06:28:52.000000000 -0400
++++ lprng-3.8.C/man/printcap.n 2018-12-12 22:57:35.926056463 -0500
+@@ -1218,15 +1218,6 @@
+ .SH "HISTORY"
+ LPRng is a enhanced printer spooler system
+ with functionality similar to the Berkeley LPR software.
+-The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
+-subscribe by visiting
+-.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
+-or sending mail to
+-.B lprng-request@lists.sourceforge.net
+-with
+-the word
+-.I subscribe
+-in the body.
+ .br
+ The software is available via
+-.B http://lprng.sourceforge.net
++.B http://www.lprng.com/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e4c00ea00277
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,335 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor: David Raymond <raymond at kestrel dot nmt dot edu>
+# Contributor: Alex Suykov <axs at ukr dot net>
+# Contributor: Frank Thieme <frank at fthieme dot net>
+
+# TODO: Did I miss references or fix too many in man pages.
+# TODO: Fix lpc [lpd|lpq|lprm] and other internal usages? These run the CUPS executables.
+# TODO: Improve instructions for LPR only support for brand name printers.
+# TODO: We shouldn't be the ones to rename the binaries. Upstream should implement EXEEXT.
+# TODO: Are there better versions of these old filters?
+
+_opt_SSL10=1
+
+# Need: Web based printcap editor, LPInfo?
+
+# https://github.com/apple/cups/issues/5269
+
+# CUPS plans to drop '-o raw' support. raw 9100 is the *only* useful
+# way to print for a large swath of industrial printers, Zebra label
+# printers in particular for which the ZPL and EPL print software will never
+# be rewritten to output a CUPS compatible format.
+# CUPS is needed for a large swath of WinPrinters
+# and for automatic printing of PCL, PXL, PostScript and PDF. Neither
+# raw nor CUPS is going away so I fixed lprng to coexist with CUPS.
+
+# Gentoo solves this with a use flag that leaves out the lpr binaries from the cups package
+# https://packages.gentoo.org/useflags/lprng-compat
+# Debian/Ubuntu solves this with the conflicting binaries in a separate cups-bsd package.
+
+# printcap is also a lot easier to manage than CUPS. Text FTW!
+
+# As of Dec 2018 CUPS raw can be considered as already gone.
+# CUPS has two show stopper raw bugs that probably won't be fixed.
+
+# Bug 1:
+# https://github.com/apple/cups/issues/4782
+# Bug reappeared yet again
+# lp -d lp -o raw file1 file2
+# 2 files queued, file1 prints, file2 does not
+
+# Bug 2:
+# Some instances of piping stdin '|lp -o raw' or '|lpr -o raw' crash with
+# lp: Error - unable to queue from stdin - Success.
+# lpr: Error - unable to queue from stdin - Broken pipe.
+# lp and lpr are breaking the pipe, not the source. Capturing
+# stdin to a file and printing with 'lpr -r -o raw file' works.
+
+# This might be a not yet found bug from glib 2.28 breaking filters.
+# https://bugs.archlinux.org/task/60044
+# https://github.com/OpenPrinting/cups-filters/issues/58
+# https://github.com/apple/cups/issues/5396
+
+# cups-lpr cups-lpd also has some faults
+
+# CUPS printers must be shared to be accessed by the locally running cups-lpr.
+# CUPS sharing pollutes the network with unwanted printers.
+
+# -o raw does not work with cups-lpd. It can be tricked into working but
+# eventually it will not work.
+
+# https://lists.cups.org/pipermail/cups/2009-August/047481.html Adam Tauno Williams [cups.general] Remote raw printing via cups-lpd s
+# https://marc.info/?l=cups&m=125084903028064&w=2
+# The solution is to use different switches with systemd or xinetd
+# This can be applied to systemd with
+# systemctl edit org.cups.cups-lpd@.service
+# [Service]
+# ExecStart=
+# ExecStart=-/usr/lib/cups/daemon/cups-lpd -o job-sheets=none -o document-format=application/vnd.cups-raw
+
+_sfx='ng' # sources contain EXEEXT but I couldn't get it to do anything.
+_spooldir='/var/spool/lpd'
+_printcap='/etc/lprng/printcap'
+_service='lpd.service'
+
+set -u
+pkgname='lprng'
+pkgver='3.8.C'
+pkgrel='1'
+pkgdesc='an enhanced, extended, and portable implementation of the Berkeley LPR lpd print spooler functionality'
+if [ ! -z "${_sfx}" ]; then
+ pkgname+='-cups'
+ pkgdesc+=' that coexists with CUPS'
+fi
+arch=('i686' 'x86_64')
+url='http://lprng.sourceforge.net'
+license=('custom:Artistic')
+depends=('bash' 'file' 'grep' 'sed')
+if [ "${_opt_SSL10}" -ne 0 ]; then
+ depends+=('openssl-1.0')
+fi
+optdepends=(
+ 'poppler: pdf to ps conversion in filters (gsfilter)' # formerly xpdf
+ 'ghostscript: convert ps to device language in filters (gsfilter)'
+ 'enscript: text to ps conversion in filters (gsfilter,psfilter)'
+ 'foomatic-filters-lprng: foomatic-rip in filters (foofilter)'
+ 'hplip: drivers for HP printers'
+ 'ifhp: filters for many printers'
+)
+if [ ! -z "${_sfx}" ]; then
+ provides=("lprng=${pkgver}") # a rather specious claim since we don't provide the binaries with the same name
+ conflicts=('lprng')
+ optdepends+=(
+ 'cups: standard BSD binaries lp lpr lpq'
+ 'lprng: install this instead for standard BSD binaries lp lpr lpq without cups'
+ )
+else
+ conflicts=('cups')
+fi
+backup=(
+ 'etc/lprng/lpd/lpd.conf'
+ 'etc/lprng/lpd/lpd.perms'
+ "${_printcap#/}"
+)
+options=('!strip')
+install="${pkgname%%-*}.install"
+_srcdir="lprng-${pkgver}"
+source=(
+ "http://sourceforge.net/projects/lprng/files/lprng/lprng-${pkgver}.tar.gz"
+ '0000-lprng-help-website.patch'
+ 'lpd.service'
+ 'gsfilter'
+ 'psfilter'
+ 'foofilter'
+ 'printcap_remote'
+ 'printcap_server'
+ 'README'
+ 'lpd.conf'
+ 'lpd.perms'
+)
+md5sums=('5901bed95e61d2bea3ba3056056af432'
+ 'c9c774d21fe1304c69a62dfe8c7f77ee'
+ 'a59c448b0e37db80422175b7a1a2c304'
+ '2a45ea95fc86bf9ae61f932aaac9d214'
+ 'd6c523f275bb63f68bf17d5ca02e4814'
+ 'd8390a6cb0126dabf029fdd2c9dc07c8'
+ '496dfbb160f2a0308b7847541b03c8db'
+ '422ad79bda6ae9d2990fdef55240e569'
+ '1768d2f81d6d14c22686293ca60528c1'
+ '3ef9f91dc0de273da1f5f1b20d49cd17'
+ '3f861c75c2d68c0e45b4095ab39ba1c8')
+sha256sums=('694a1747a96385b89e93f43343bf35cee5c8c73353a83814106911c99f09de10'
+ 'dc219daa8dccd6e02039568e54fa15bc0dd993f99eb2a79a1336d1212a831b71'
+ '3b546e8dd8f7ef3a1025d7d59ed8187fa21a9b9cf839a9bbda9821733da046e1'
+ '78b9b6a30ab53f55407b873cbc23df3a129dcd22a2d55557b9e7ac3dc13b8c19'
+ 'f1a8a318f210cfc3814d234cb98a3de0c7a161c0e0c5671fe1c266ee03e351ec'
+ 'a13fb767cbd142100e8020aac5b0f091f50a42602768665b8e2595f74fa31c4d'
+ 'be383447b74cf9b86666adeaf35f844b394c222abbcda7f5cd7fc64f79373b82'
+ 'fc94245b58b23c9498a10c64aed20b6120595c6c3e1412bb419126ca78123a94'
+ 'a4c261f5754b380ff85c454249a152cb67baf9bbf10dc95cd16026f90bacb620'
+ 'faf52cf982eaa66a475344a5647a80a761d10402ccb9de263c70dc15ccc85c29'
+ '47b48ab7fa15ae9226463c98d6c8fce9ee9b602c3a9f96907fcd84e50902b2cc')
+
+# We can't modify .install but we can stop and force the user to fix it.
+_install_check() {
+ local _ckvar
+ local _ckline
+ local _pkgname="${pkgname}"
+ for _ckvar in '_service' '_printcap'; do
+ _ckline="${_ckvar}='${!_ckvar}'"
+ if ! grep -q "^${_ckline}"'$' "${startdir}/${install}"; then
+ msg "${install} must be fixed"
+ echo "${_ckline}"
+ set +u
+ false
+ fi
+ done
+}
+
+prepare() {
+ set -u
+ cd "${_srcdir}"
+
+ # Clean outdated info from help files
+ #cp -rp "../${_srcdir}"{,.orig}; echo "diff -Naru3 ${_srcdir}{.orig,} > 'new-0000-lprng-help-website.patch'"; false
+ patch -Nup1 -i "${srcdir}/0000-lprng-help-website.patch"
+ sed -e 's:/var/spool/LPD:/var/spool/lpd:g' -i 'man/lpd.n'
+
+ # Clean up sbin
+ sed -e 's:/usr/local/sbin/:/usr/bin/:g' -i $(grep -lrFe '/usr/local/sbin/' .)
+ sed -e 's:/usr/sbin/:/usr/bin/:g' -i $(grep -lrFe '/usr/sbin/' .)
+ sed -e '/FILTER_PATH/ s@/usr/sbin:@@g' -i 'src/vars.c'
+
+ # Clean up /usr/local
+ sed -e 's:/usr/local/libexec/:/usr/lib/:g' -i $(grep -lrFe '/usr/local/libexec/' .)
+ sed -e 's:/usr/local/bin:/usr/bin:g' -i $(grep -lrFe '/usr/local/bin' .)
+ sed -e 's:/usr/local/:/usr/:g' -i 'src/pclbanner.in'
+
+ # Fix ifhp path in printcap
+ sed -e 's:/usr/libexec/filters/ifhp:/usr/lib/filters/ifhp:g' -i 'conf/printcap'
+
+ # Check filters
+ local _f
+ for _f in "${srcdir}"/*filter; do
+ bash -n "${_f}"
+ done
+ set +u
+}
+
+build() {
+ set -u
+ _install_check
+ cd "${_srcdir}"
+
+ if [ ! -s 'Makefile' ]; then
+ local _conf=(
+ -q
+ --libexecdir='/usr/lib/lprng'
+ --localstatedir='/var'
+ --mandir='/usr/share/man'
+ --sbindir='/usr/bin'
+ --sysconfdir="${_printcap%/*}"
+ --with-groupid='lp'
+ --with-spooldir="${_spooldir}"
+ --with-userid='daemon'
+ --prefix='/usr'
+ )
+ local _lf=''
+ local _cf=' -Wno-unused-result -s'
+ if [ "${_opt_SSL10}" -ne 0 ]; then
+ _cf+=' -I/usr/include/openssl-1.0'
+ _lf+=' -L/usr/lib/openssl-1.0'
+ _conf+=(--enable-ssl)
+ fi
+ set -x
+ CFLAGS="${CFLAGS}${_cf}" \
+ LDFLAGS="${LDFLAGS}${_lf}" \
+ ./configure "${_conf[@]}"
+ set +x
+ fi
+ set -x
+ make -s
+ set +x
+ set +u
+}
+
+package() {
+ set -u
+ cd "${_srcdir}"
+ make -s -j1 MAKEPACKAGE='YES' DESTDIR="${pkgdir}" install
+ install -Dpm0644 'COPYRIGHT' -t "${pkgdir}/usr/share/licenses/${pkgname}/"
+ cat >> "${pkgdir}${_printcap}.sample" << EOF
+#
+# Printer names are case preserving and case insensitive.
+# Do not make two printers same letters different case.
+# If you do the last one will be used.
+#
+EOF
+ cd "${srcdir}"
+
+ install -d "${pkgdir}${_spooldir}"
+ install -Dpm0644 'lpd.service' "${pkgdir}/usr/lib/systemd/system/${_service}"
+ install -Dpm0755 'foofilter' 'gsfilter' 'psfilter' -t "${pkgdir}/usr/share/doc/${pkgname}/"
+ install -Dpm0644 'printcap_remote' 'printcap_server' 'README' -t "${pkgdir}/usr/share/doc/${pkgname}/"
+ install -Dpm0644 'lpd.conf' 'lpd.perms' -t "${pkgdir}/etc/lprng/lpd/"
+ install -Dpm0644 /dev/null "${pkgdir}${_printcap}"
+
+ # Change spool dir
+ if [ "${_spooldir}" != '/var/spool/lpd' ]; then
+ sed -e "s:/var/spool/lpd:${_spooldir}:g" \
+ -i "${pkgdir}/usr/share/doc/${pkgname}/"{'printcap_remote','printcap_server'} \
+ "${pkgdir}/etc/lprng/printcap.sample" \
+ "${pkgdir}/etc/lprng/lpd"/*.sample \
+ $(grep -lrFe '/var/spool/lpd' "${pkgdir}/usr/share/man")
+ fi
+
+ # Make documentation easy to find
+ ln -s "/usr/share/doc/${pkgname}" "${pkgdir}/etc/lprng/lpd/doc"
+
+ if [ ! -z "${_sfx}" ]; then
+ # lpd doesn't conflict with cups
+ #sed -e '/^ExecStart=/ s:lpd'":&${_sfx}:g" -i "${pkgdir}/usr/lib/systemd/system/${_service}"
+ # Rename programs and change self references in man pages
+ local _moveem=(
+ 'man1/cancel.1'
+ 'man1/lp.1'
+ 'man1/lpq.1'
+ 'man1/lpr.1'
+ 'man1/lprm.1'
+ 'man1/lpstat.1'
+ 'man8/lpc.8'
+ )
+ pushd "${pkgdir}/usr/bin" > /dev/null
+ local _f _fx
+ for _fx in "${_moveem[@]}"; do
+ _f="${_fx##*/}"
+ _f="${_f%%.*}"
+ mv "${_f}" "${_f}ng"
+ sed -e "s:\b${_f}\b:&${_sfx}:g" \
+ -e "1,2 s:\b${_f^^}\b:&${_sfx}:g" \
+ -i "${pkgdir}/usr/share/man/${_fx}"
+ done
+ # Overwrite hard links with soft links
+ ln -sf "lpr${_sfx}" "lp${_sfx}"
+ ln -sf "lprm${_sfx}" "cancel${_sfx}"
+ popd > /dev/null
+ # Rename man pages.
+ pushd "${pkgdir}/usr/share/man" > /dev/null
+ for _f in "${_moveem[@]}"; do
+ mv "${_f}" "${_f/./${_sfx}.}"
+ done
+ # Change references in man pages
+ sed -e "#s:\blpd\( \?\)(:lpd${_sfx}\1(:g" \
+ -e "s:\blpr\( \?\)(:lpr${_sfx}\1(:g" \
+ -e "s:\blprm\( \?\)(:lprm${_sfx}\1(:g" \
+ -e "s:\blpc\( \?\)(:lpc${_sfx}\1(:g" \
+ -e "s:\blp\( \?\)(:lp${_sfx}\1(:g" \
+ -e "s:\blpq\( \?\)(:lpq${_sfx}\1(:g" \
+ -i */*
+ sed -e "s:\blprm\b:&${_sfx}:g" \
+ -e "s:\blpr\([ ,]\):lpr${_sfx}\1:g" \
+ -e "#s:\blpd\([ ,)]\):lpd${_sfx}\1:g" \
+ -e "s:\blpq\b:&${_sfx}:g" \
+ -e "s:\blpc\b:&${_sfx}:g" \
+ -i 'man5/printcap.5' 'man5/lpd.perms.5' 'man8/lpd.8'
+ sed -e "/^\.I/ s:\blprm\b:&${_sfx}:g" \
+ -e "/^\.I/ s:\blpr\([ ,]\):lpr${_sfx}\1:g" \
+ -e "/^\.I/ s:\blpd\([ ,)]\):lpd${_sfx}\1:g" \
+ -e "/^\.I/ s:\blpq\b:&${_sfx}:g" \
+ -e "/^\.I/ s:\blpc\b:&${_sfx}:g" \
+ -i 'man8/lpcng.8'
+ sed -e "s:\blprm\b:&${_sfx}:g" -i 'man1/cancelng.1'
+ popd > /dev/null
+ # Change reference in printcap
+ sed -e "s: checkpc\b: sudo&:g" \
+ -e "s: lpc\b:&${_sfx}:g" \
+ -i "${pkgdir}/etc/lprng/printcap.sample"
+ fi
+
+ # Check for unwanted folders
+ ! grep -lrFe '/sbin' "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /sbin"; false; }
+ ! grep -lrFe '/usr/local' "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /usr/local"; false; }
+ ! grep -lrFe '/libexec/' "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /libexec/"; false; }
+ set +u
+}
+set +u
diff --git a/README b/README
new file mode 100644
index 000000000000..977e190a6dc0
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+See the LPRng page in the Arch Wiki for setup and usage information.
diff --git a/foofilter b/foofilter
new file mode 100755
index 000000000000..9888d2358c05
--- /dev/null
+++ b/foofilter
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# foofilter.sh -- Foomatic-rip-lprng is used as the print filter
+#
+# Requires
+# poppler (xpdf): pdftops
+# foomatic-filters-lprng
+# enscript
+
+set -u
+
+# define temporary files
+infile="/tmp/infile.$$"
+tempfile="/tmp/tempfile.$$"
+
+# replace example.ppd with the appropriate ppd file for your printer
+your_ppd="${example}.ppd"
+
+# choose your paper size
+PAPER='Letter'
+#PAPER='A4'
+
+# send the standard input to a temporary file
+cat > "${infile}"
+
+# figure out what type of file we are trying to print
+fileinfo="$(file -b "${infile}")"
+
+# take various actions depending on the type of file -- send
+# results to a temporary postscript file
+case "${fileinfo}" in
+*ASCII*) enscript -M "${PAPER}" -o - "${infile}" > "${tempfile}" ;;
+*PDF*) pdftops "${infile}" - > "${tempfile}" ;;
+*PostScript*) cat "${infile}" > "${tempfile}" ;;
+*)
+ echo "Cannot print file of type ${fileinfo}" | \
+ enscript -M "${PAPER}" -o - > "${tempfile}"
+ ;;
+esac
+
+# foomatic-rip sends stuff to the standard output
+/usr/bin/foomatic-rip-lprng --lprng "/etc/lprng/lpd/$your_ppd" < "${tempfile}"
+
+rm -f "${infile}" "${tempfile}"
diff --git a/gsfilter b/gsfilter
new file mode 100755
index 000000000000..5c89927fe742
--- /dev/null
+++ b/gsfilter
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# gsfilter.simple -- HP deskjet or similar sample filter
+#
+# Requires
+# poppler (xpdf): pdftops
+# ghostscript
+# enscript
+
+set -u
+
+# define temporary files
+infile="/tmp/infile.$$"
+tempfile="/tmp/tempfile.$$"
+outfile="/tmp/outfile.$$"
+
+# choose your paper size
+GSPAPER='letter'
+#GSPAPER='a4'
+PAPER='Letter'
+#PAPER='A4'
+
+# chose your printer device (run gs -h to see what is available)
+GSDEVICE='cdjcolor'
+
+# send the standard input to a temporary file
+cat > "${infile}"
+
+# figure out what type of file we are trying to print
+fileinfo="$(file -b "${infile}")"
+
+# take various actions depending on the type of file -- send
+# results to a temporary postscript file
+case "${fileinfo}" in
+*ASCII*) enscript -M "${PAPER}" -o - "${infile}" > "${tempfile}" ;;
+*PDF*) pdftops -paper 'match' "${infile}" - > "${tempfile}" ;;
+*PostScript*) cat "${infile}" > "${tempfile}" ;;
+*)
+ echo "Cannot print file of type ${fileinfo}" | \
+ enscript -M "${PAPER}" -o - > "${tempfile}"
+ ;;
+esac
+
+# run the postscript through gs to produce device output in a file
+echo 'quit' | gs -sOutputFile="${outfile}" -q -sPAPERSIZE="$GSPAPER" -dSAFER \
+ -dNOPAUSE -sDEVICE="${GSDEVICE}" "${tempfile}" > /dev/null 2>&1
+
+# send output file to standard out
+cat "${outfile}"
+
+# clean up
+rm -f "${infile}" "${tempfile}" "${outfile}"
diff --git a/lpd.conf b/lpd.conf
new file mode 100644
index 000000000000..d3a572966605
--- /dev/null
+++ b/lpd.conf
@@ -0,0 +1,4 @@
+# lpd.conf file
+# uncomment the line below to make lpd listen on specified port --
+# needed for printing on local printer from remote client
+#lpd_listen_port=515
diff --git a/lpd.perms b/lpd.perms
new file mode 100644
index 000000000000..5908bf88a92c
--- /dev/null
+++ b/lpd.perms
@@ -0,0 +1,18 @@
+# lpd.perms -- Edit for your needs
+#
+# accept printing requests from the localhost -- you always need this
+ACCEPT SERVICE=X REMOTEIP=127.0.0.1
+#
+# accept printing requests from a range of IP addresses --
+# edit for your needs or comment out
+#ACCEPT SERVICE=X REMOTEIP=192.168.100.0/24
+#
+# accept printing requests from particular clients -- not needed if
+# these clients are included in the above REMOTEIP range -- edit for your
+# needs or comment out
+#ACCEPT SERVICE=X REMOTEHOST=merlin.nmt.edu
+#ACCEPT SERVICE=X REMOTEHOST=peregrine.nmt.edu
+# etc.
+#
+# reject all other printing requests
+REJECT SERVICE=X
diff --git a/lpd.service b/lpd.service
new file mode 100644
index 000000000000..e4c0f7c2601a
--- /dev/null
+++ b/lpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Lprng Printer Daemon
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/lpd
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
diff --git a/lprng.install b/lprng.install
new file mode 100644
index 000000000000..a89378066adf
--- /dev/null
+++ b/lprng.install
@@ -0,0 +1,38 @@
+_printcap='/etc/lprng/printcap'
+_service='lpd.service'
+
+_post_ui() {
+ set -u
+ systemctl daemon-reload
+ if systemctl -q is-active 'org.cups.cups-lpd.socket'; then
+ echo 'You may need to disable cups-lpd with'
+ echo " systemctl disable --now 'org.cups.cups-lpd.socket'"
+ fi
+ if ! systemctl -q is-enabled "${_service}"; then
+ echo 'Enable your lpd server with'
+ echo " sudo systemctl enable --now '${_service}'"
+ fi
+ if ! grep -qe '^[a-zA-Z]' "${_printcap}"; then
+ echo "Add some printers to ${_printcap}"
+ fi
+ set +u
+}
+
+post_upgrade() {
+ _post_ui
+}
+
+post_install() {
+ _post_ui
+}
+
+pre_remove() {
+ set -u
+ systemctl stop "${_service}"
+ systemctl disable "${_service}"
+ set +u
+}
+
+post_remove() {
+ systemctl daemon-reload
+}
diff --git a/printcap_remote b/printcap_remote
new file mode 100644
index 000000000000..842c0e9268d7
--- /dev/null
+++ b/printcap_remote
@@ -0,0 +1,9 @@
+# Example printcap file for remote printers
+#
+# Mono
+mono:sd=/var/spool/lpd/mono
+ :lp=mono@kestrel.nmt.edu
+
+# Home
+home:sd=/var/spool/lpd/home
+ :lp=home@192.168.0.2
diff --git a/printcap_server b/printcap_server
new file mode 100644
index 000000000000..7028b55bbc82
--- /dev/null
+++ b/printcap_server
@@ -0,0 +1,17 @@
+# Example printcap file for network postscript printer The "bounce"
+# syntax is needed to make lpd pay attention to the filter (see lprng
+# documentation) when the printer is not connected directly to the
+# server machine, e.g., via a usb port. The user lpr command goes to
+# the first squawk, which then relays it to the second one. The
+# filter "myfilter" is a print filter, perhaps customized from the
+# examples "foofilter", "gsfilter" or "psfilter". Options like
+# specifying the number of copies (mc#...) must be placed in the
+# bounce receiver entry as shown.
+
+# Squawk -- a network printer with IP address 192.168.100.242
+squawk:lp=squawk@localhost:mc#100
+squawk:server
+ :sd=/var/spool/lpd/squawk
+ :lpd_bounce
+ :lp=xx@192.168.100.242
+ :filter=/etc/lprng/lpd/myfilter
diff --git a/psfilter b/psfilter
new file mode 100755
index 000000000000..8efcf17cac48
--- /dev/null
+++ b/psfilter
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# psfilter.simple -- Convert pdf and text to postscript. Control of
+# duplexing for postscript files is via the insertion of a duplexing
+# control line as the second line of the postscript file. This seems
+# to work for pdftops, pdf2ps, and cairo output. It doesn't work for
+# postscript files created by enscript. Instead, enscript duplexing
+# is controlled by a command line option in enscript. Duplex on pdf
+# files is controlled by a pdftops flag.
+#
+# Requires
+# poppler (xpdf): pdftops
+# enscript
+
+set -u
+
+# define temporary files
+infile="/tmp/infile.$$"
+tempfile="/tmp/tempfile.$$"
+headfile="/tmp/headfile.$$"
+tailfile="/tmp/tailfile.$$"
+
+# choose your paper size
+PAPER='Letter'
+#PAPER='A4'
+
+# define whether duplex is desired by uncommenting appropriate lines
+#duplex='false'
+duplex='true'
+#duplexflag=''
+duplexflag='-duplex'
+
+# send the standard input to a temporary file
+cat > "${infile}"
+
+# figure out what type of file we are trying to print
+fileinfo="$(file -b "${infile}")"
+
+# do conversions to postscript based on file type and put in tempfile
+case "${fileinfo}" in
+*ASCII*) enscript -DDuplex:"${duplex}" -M "${PAPER}" -o - "${infile}" ;;
+*PDF*) pdftops -paper 'match' "${duplexflag}" "${infile}" - ;;
+*PostScript*)
+ if [ "${duplex}" = 'true' ]; then
+ # are we doing duplex? if so, insert a special string in postscript file
+ sed -e "1 w ${headfile}" -e "2,$ w ${tailfile}" < "${infile}" > /dev/null
+ cat "${headfile}" > "${tempfile}"
+ echo "<< /Duplex true >> setpagedevice" >> "${tempfile}"
+ cat "${tailfile}" >> "${tempfile}"
+ else
+ # if not duplex, don't do anything
+ cat "${tailfile}" >> "${tempfile}"
+ fi
+ # send the file to standard output
+ cat "${tempfile}"
+ ;;
+*)
+ echo "Cannot print file of type ${fileinfo}" | \
+ enscript -M "${PAPER}" -DDuplex:"${duplex}" -o -
+ ;;
+esac
+
+# clean up
+rm -f "${infile}" "${tempfile}" "${headfile}" "${tailfile}"