ports/90780: [PATCH] print/cups-base: provide rc.d compatible script and varia fixes

Ion-Mihai IOnut Tetcu itetcu at people.tecnik93.com
Thu Dec 22 01:50:05 UTC 2005


>Number:         90780
>Category:       ports
>Synopsis:       [PATCH] print/cups-base: provide rc.d compatible script and varia fixes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 22 01:50:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Ion-Mihai "IOnut" Tetcu
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
Tecnik'93 
>Environment:


System: FreeBSD 6.0-STABLE #4: Wed Dec 21 19:58:26 EET 2005


>Description:


With the new rc.d cups fails to start during boot with:
 Usage: cups {reload|restart|start|status|stop}

cups.sh[.sample] contains rc keywords (from NetBSD)

Attached cups.in is a new rc script for cups

Attached diffs:
USE_RC_SUBR= cups and related changes
fix a hardcoded PREFIX while I'm here

Also move pkg-message to files/pkg-message.in (asd s^PREFIX^%%PREFIX%%^g) and add it to SUB_LIST - this way it is displayed correctly when installed from packeges too

Please note that this is a quick fix, the correct way is to patch the distributed Makefile not to install the upstream cups.sh. 

CUPS_RCDIR and --with-rcdir=CUPS_RCDIR can be removed probably from print/cups/Makefile.common.


>How-To-Repeat:


Boot a system with the new rc.d code (-HEAD or 6-STABLE).


>Fix:


--- Makefile.diff begins here ---
--- Makefile.orig	Thu Dec 22 02:04:25 2005
+++ Makefile	Thu Dec 22 03:27:18 2005
@@ -19,6 +19,8 @@
 
 USE_REINPLACE=	yes
 INSTALLS_SHLIB=	yes
+USE_RC_SUBR=	cups
+SUB_FILES=	pkg-message
 
 MANLANG=	"" es fr
 
@@ -29,12 +31,10 @@
 		${WRKSRC}/man/Makefile ${WRKSRC}/man/es/Makefile
 	@${REINPLACE_CMD} -e '/LN/d' -e '/cat/d' \
 		${WRKSRC}/man/Makefile ${WRKSRC}/man/fr/Makefile
-	@${REINPLACE_CMD} -e 's|/etc/cups|/usr/local/etc/cups|g' \
+	@${REINPLACE_CMD} -e "s#/etc/cups#${CUPS_ETCDIR}#g" \
 		${WRKSRC}/man/*.man
 	@${REINPLACE_CMD} -e 's|CXX="$$CC"||g' \
 		${WRKSRC}/${CONFIGURE_SCRIPT}
-	@${CP} ${WRKSRC}/cups.sh.in ${WRKSRC}/cups.sh.in.presed
-	@${SED} 40d ${WRKSRC}/cups.sh.in.presed > ${WRKSRC}/cups.sh.in
 
 pre-install:
 	@${ECHO_MSG} "===>" Stopping cupsd ...
@@ -47,12 +47,13 @@
 	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${CUPS_ETCDIR}/${f}.N
 	cd ${CUPS_ETCDIR}; if test ! -f ${f}; then ${CP} -p ${f}.N ${f}; fi
 .endfor # classes.conf client.conf cupsd.conf printers.conf
-	cd ${CUPS_RCDIR}; ${MV} cups cups.sh.sample
+	${RM} ${PREFIX}/etc/rc.d/cups
 	${FIND} ${PREFIX}/man/cat* -type l -name '*.0' -delete
 	${MKDIR} ${CUPS_SPOOLDIR} ${CUPS_SPOOLDIR}/tmp
 	${CHOWN} -R ${CUPSOWN}:${CUPSGRP} ${CUPS_SPOOLDIR}
 	${CHMOD} -R g+w ${CUPS_SPOOLDIR}
-	@${SED} -e 's#PREFIX#${PREFIX}#' ${PKGMESSAGE}
+#	@${SED} -e 's#PREFIX#${PREFIX}#' ${PKGMESSAGE}
+	@${CAT} ${PKGMESSAGE}
 
 .include "${.CURDIR}/../../print/cups/Makefile.common"
 .include <bsd.port.pre.mk>
--- Makefile.diff ends here ---
--- pkg-plist.diff begins here ---
--- pkg-plist.orig	Thu Dec 22 02:43:16 2005
+++ pkg-plist	Thu Dec 22 02:44:01 2005
@@ -20,7 +20,6 @@
 @unexec if cmp -s %D/etc/cups/printers.conf.N %D/etc/cups/printers.conf; then rm -f %D/etc/cups/printers.conf; fi
 etc/cups/printers.conf.N
 @exec if test ! -f %D/etc/cups/printers.conf; then cp -p %D/etc/cups/printers.conf.N %D/etc/cups/printers.conf; fi
-etc/rc.d/cups.sh.sample
 include/cups/cups.h
 include/cups/http.h
 include/cups/image.h
--- pkg-plist.diff ends here ---
--- cups.in begins here ---
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: cups
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# cups_enable="YES"
#

. /etc/rc.subr

name=cups
rcvar=`set_rcvar`

#command=%%PREFIX%%/sbin/cupsd
command=/usr/local/sbin/cupsd

load_rc_config ${name}
run_rc_command "$1"

--- cups.in ends here ---
--- pkg-message.in begins here ---
======================================================================

CUPS is now installed.

Please read the documentation in %%PREFIX%%/share/doc/cups/ for information
on how to set up your printer to use CUPS. Basic template configuration files
have been installed in %%PREFIX%%/etc/cups/

To install the BSD and System V compatibility binaries look to the port
print/cups-lpr. These are no longer installed as part of the base cups port
because they have conflicting names with the native print binaries, and with
other ports such as lprNG.

NOTE: IF YOU USE A NON-POSTSCRIPT PRINTER:

You will need to install the cups-pstoraster port in order to print to
your printer. If you installed via the "cups" port, it will be installed
automatically. Otherwise, you will need to install the port or the package
yourself.

======================================================================

**********************************************************************
PLEASE NOTE:
============

To enable printing under Gimp do the following:
1) Uncomment application/octet-stream line in
%%PREFIX%%/etc/cups/mime.types
2) Uncomment application/octet-stream line in
%%PREFIX%%/etc/cups/mime.convs
3) Restart cupsd

**********************************************************************
--- pkg-message.in ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list