Add port entry for the base system LPR sources.

When world is installed w/ WITHOUT_LPR, they will not be present. Like
the compat packages this allows it to be added back in; this also supports
novel uses like using pfSense to build an embedded print server.

FYI: For raw queue use, bsd lpd's footprint is a few 100k on disk; cups
is ~12MB.

Reviewed by:	dougb
This commit is contained in:
Bruce M Simpson 2010-02-08 14:52:39 +00:00
parent 6bce3936a4
commit ae72c70931
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=249430
7 changed files with 252 additions and 0 deletions

View file

@ -36,6 +36,7 @@
SUBDIR += bjfilters600
SUBDIR += bjfilters630
SUBDIR += bjfilters6300
SUBDIR += bsd_lpr
SUBDIR += c2ps-a4
SUBDIR += c2ps-letter
SUBDIR += catdvi

121
print/bsd_lpr/Makefile Normal file
View file

@ -0,0 +1,121 @@
# New ports collection makefile for: bsd_lpr
# Date created: 7th February 2010
# Whom: Bruce M Simpson <bms@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= bsd_lpr
PORTVERSION= 2010020702
CATEGORIES= print
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= bms
DISTNAME= bsd_lpr-${PORTVERSION}
MAINTAINER= bms@FreeBSD.org
COMMENT= BSD lpr suite
CONFLICTS= cups-base-[0-9]* LPRng-[0-9]*
USE_BZIP2= yes
MAKE_JOBS_SAFE= defined
OPTIONS= \
INET6 "Build with IPv6 support" On
USE_RC_SUBR= bsd_lpd
SUB_FILES+= pkg-message
#
# To roll snapshot: as bms: make BOOTSTRAP=defined fetch
#
.if defined(BOOTSTRAP)
FETCH_DEPENDS+= svn:${PORTSDIR}/devel/subversion
SVN_REV= 202921 # svn tip at epoch 2010020702
SVNROOT_URI= svn://svn.freebsd.org/base
SVN_BRANCH= stable/8
SVN_SUBDIR= usr.sbin/lpr
do-fetch:
${MKDIR} ${WRKDIR}
svn export -r ${SVN_REV} ${SVNROOT_URI}/${SVN_BRANCH}/${SVN_SUBDIR} ${WRKSRC}
cd ${WRKDIR}; tar cvfy ${DISTDIR}/${DISTNAME}.tar.bz2 ${DISTNAME}
.if ${USER} == bms
${CHMOD} ugo+r ${DISTDIR}/${DISTNAME}.tar.bz2
scp -p ${DISTDIR}/${DISTNAME}.tar.bz2 \
freefall.freebsd.org:public_distfiles/
.endif
.endif # defined(BOOTSTRAP)
PLIST_FILES=\
sbin/chkprintcap \
sbin/lp \
sbin/lpc \
sbin/lpd \
sbin/lpq \
sbin/lpr \
sbin/lprm \
sbin/lptest \
sbin/pac \
sbin/lpf \
sbin/bjc-240.sh.sample
LPR_SUBST_FILES= ${WRKSRC}/common_source/pathnames.h
.if defined(WITHOUT_INET6)
MAKE_ARGS+= WITHOUT_INET6_SUPPORT=defined
.endif
MAKE_ARGS+=\
BINDIR="${PREFIX}/sbin" \
SHAREDIR="${PREFIX}/share" \
MANDIR="${MANPREFIX}/man/man"
.if !defined(NOPORTDOCS) && !defined(NO_INSTALL_MANPAGES)
MANCOMPRESSED= yes
MAN1= lp.1 lpq.1 lpr.1 lprm.1 lptest.1
MAN5= printcap.5
MAN8= chkprintcap.8 lpc.8 lpd.8 pac.8
LPR_SUBST_FILES+=\
${WRKSRC}/lp/lp.1 \
${WRKSRC}/lpq/lpq.1 \
${WRKSRC}/lpr/lpr.1 \
${WRKSRC}/lprm/lprm.1 \
${WRKSRC}/lptest/lptest.1 \
${WRKSRC}/lpr/printcap.5 \
${WRKSRC}/chkprintcap/chkprintcap.8 \
${WRKSRC}/lpc/lpc.8 \
${WRKSRC}/lpd/lpd.8 \
${WRKSRC}/pac/pac.8
.else
NOMAN= defined
MAKE_ARGS+= WITHOUT_MAN=defined
.endif
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 800107
IGNORE= unsupported on FreeBSD versions prior to 8.0-RELEASE
.endif
# XXX clobbering ETCDIR
ETCDIR= ${PREFIX}/etc
post-patch:
@${TOUCH} ${WRKDIR}/Makefile.inc
@${REINPLACE_CMD} -e \
's!/etc/printcap!${ETCDIR}/printcap!g ; \
s!/usr/sbin!${PREFIX}/sbin!g' \
${LPR_SUBST_FILES}
do-install:
@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
.if !defined(NOPORTDOCS) && !defined(NO_INSTALL_MANPAGES)
@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} maninstall)
.endif
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

3
print/bsd_lpr/distinfo Normal file
View file

@ -0,0 +1,3 @@
MD5 (bsd_lpr-2010020702.tar.bz2) = f22991564bb47d4dba00e6c3acc4cf05
SHA256 (bsd_lpr-2010020702.tar.bz2) = 51681e56f51da12b0cdf0a72bc0954320ccca9acb6b90e35f0521429c77bea03
SIZE (bsd_lpr-2010020702.tar.bz2) = 105394

View file

@ -0,0 +1,27 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: bsd_lpd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
name="bsd_lpd"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/lpd"
required_files="%%PREFIX%%/etc/printcap"
start_precmd="bsd_chkprintcap"
bsd_chkprintcap()
{
if checkyesno bsd_chkprintcap_enable ; then
%%PREFIX%%/sbin/chkprintcap ${chkprintcap_flags}
fi
}
load_rc_config $name
run_rc_command "$1"

View file

@ -0,0 +1,76 @@
--- Makefile.orig 2010-02-07 03:08:55.000000000 +0000
+++ Makefile 2010-02-07 03:09:01.000000000 +0000
@@ -1,7 +1,7 @@
# $FreeBSD: /tmp/pcvs/ports/print/bsd_lpr/files/Attic/patch-lpr-as-port,v 1.1 2010-02-08 14:52:39 bms Exp $
SUBDIR= common_source chkprintcap lp lpc lpd lpq lpr lprm lptest pac \
- filters filters.ru SMM.doc
+ filters filters.ru #SMM.doc
# Questions/ideas for lpr & friends could also be sent to:
# freebsd-print@bostonradio.org
--- SMM.doc/Makefile.orig 2004-10-24 16:33:08.000000000 +0100
+++ SMM.doc/Makefile 2010-02-07 03:08:45.000000000 +0000
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/8/93
# $FreeBSD: /tmp/pcvs/ports/print/bsd_lpr/files/Attic/patch-lpr-as-port,v 1.1 2010-02-08 14:52:39 bms Exp $
-BINDIR= /usr/share/doc
+BINDIR= ${PREFIX}/share/doc
VOLUME= smm/07.lpd
SRCS= 0.t 1.t 2.t 3.t 4.t 5.t 6.t 7.t
MACROS= -ms
--- filters/Makefile.orig 2006-03-09 19:52:44.000000000 +0000
+++ filters/Makefile 2010-02-07 03:08:45.000000000 +0000
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD: /tmp/pcvs/ports/print/bsd_lpr/files/Attic/patch-lpr-as-port,v 1.1 2010-02-08 14:52:39 bms Exp $
-BINDIR= /usr/libexec/lpr
+BINDIR= ${PREFIX}/libexec/lpr
PROG= lpf
NO_MAN=
--- lp/Makefile.orig 2001-07-20 07:20:32.000000000 +0100
+++ lp/Makefile 2010-02-07 03:08:45.000000000 +0000
@@ -1,6 +1,6 @@
# $FreeBSD: /tmp/pcvs/ports/print/bsd_lpr/files/Attic/patch-lpr-as-port,v 1.1 2010-02-08 14:52:39 bms Exp $
-BINDIR= /usr/bin
+BINDIR= ${PREFIX}/bin
SCRIPTS=lp.sh
MAN= lp.1
--- lpq/Makefile.orig 2002-06-23 21:57:18.000000000 +0100
+++ lpq/Makefile 2010-02-07 03:08:45.000000000 +0000
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD: /tmp/pcvs/ports/print/bsd_lpr/files/Attic/patch-lpr-as-port,v 1.1 2010-02-08 14:52:39 bms Exp $
-BINDIR= /usr/bin
+BINDIR= ${PREFIX}/bin
PROG= lpq
BINOWN= root
--- lpr/Makefile.orig 2002-06-23 21:57:18.000000000 +0100
+++ lpr/Makefile 2010-02-07 03:08:45.000000000 +0000
@@ -3,7 +3,7 @@
.PATH: ${.CURDIR}/../common_source
-BINDIR= /usr/bin
+BINDIR= ${PREFIX}/bin
PROG= lpr
MAN= lpr.1 printcap.5
--- lprm/Makefile.orig 2002-06-23 21:57:18.000000000 +0100
+++ lprm/Makefile 2010-02-07 03:08:45.000000000 +0000
@@ -3,7 +3,7 @@
.PATH: ${.CURDIR}/../common_source
-BINDIR= /usr/bin
+BINDIR= ${PREFIX}/bin
PROG= lprm
BINOWN= root

View file

@ -0,0 +1,11 @@
==================================================================
To enable this package, please add the following to /etc/rc.conf,
and create the file %%ETCDIR%%/printcap :-
bsd_lpd_enable="YES"
bsd_chkprintcap_enable="YES"
All knobs documented in rc.conf(5) for lpd(8) should be valid for
this package, however, they must be prefixed with 'bsd_' as above.
==================================================================

13
print/bsd_lpr/pkg-descr Normal file
View file

@ -0,0 +1,13 @@
This is a port of the BSD lpr sources.
Like the compat ports, this allows lpr to be installed as a package,
at a later date, even if the options were not built with the base
FreeBSD system, i.e. when world was built and installed with WITHOUT_LPR
defined in /etc/make.conf.
It may also be of use to folk who are managing embedded systems.
Currently it is used as a testbed for the OpenPrinting API with pfSense,
to build a very tight embedded printing appliance.
Bruce
bms@FreeBSD.org