- Move print/hplip3 to print/hplip

Approved by:	Anish Mistry <amistry@am-productions.biz> (old maintainer)
This commit is contained in:
Pav Lucistnik 2010-05-17 11:51:26 +00:00
parent 56419cc5ff
commit 84946ab584
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=254487
28 changed files with 1152 additions and 3193 deletions

1
MOVED
View file

@ -4394,3 +4394,4 @@ www/mod_extract_forwarded2||2010-05-12|Use www/mod_extract_forwarded instead
misc/ldconfig_compat||2010-05-14|Supported releases don't need the port anymore
devel/nx||2010-05-14|Remove due math/py-networkx be the same port and with more appropriated name
math/libranlib|math/librandlib|2010-05-17|Project renamed
print/hplip3|print/hplip|2010-05-17|hplip port updated to 3.X version

View file

@ -120,7 +120,6 @@
SUBDIR += hp2xx
SUBDIR += hpijs
SUBDIR += hplip
SUBDIR += hplip3
SUBDIR += hs-hscolour
SUBDIR += hs-hscolour-docs
SUBDIR += html2latex

View file

@ -6,128 +6,145 @@
#
PORTNAME= hplip
PORTVERSION= 2.8.2
PORTREVISION= 8
PORTVERSION= 3.10.2
PORTREVISION= 2
CATEGORIES= print
MASTER_SITES= SF
MAINTAINER= amistry@am-productions.biz
MAINTAINER= chris@officialunix.com
COMMENT= Drivers and utilities for HP Printers and All-in-One devices
LIB_DEPENDS= jpeg.11:${PORTSDIR}/graphics/jpeg \
sane.1:${PORTSDIR}/graphics/sane-backends \
cups.2:${PORTSDIR}/print/cups-base \
netsnmp.16:${PORTSDIR}/net-mgmt/net-snmp
cups.2:${PORTSDIR}/print/cups-base
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/reportlab/__init__.py:${PORTSDIR}/print/py-reportlab2 \
foomatic-rip:${PORTSDIR}/print/foomatic-filters
espgs:${PORTSDIR}/print/cups-pstoraster \
foomatic-rip:${PORTSDIR}/print/foomatic-filters \
mDNSClientPosix:${PORTSDIR}/net/mDNSResponder
CONFLICTS= hpijs-[0-9]* hplip-[3-9]*
LATEST_LINK= ${PORTNAME}3
CONFLICTS= hpijs-[0-9]* hplip-2*
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-dependency-tracking \
--disable-pp-build \
--enable-foomatic-ppd-install \
--enable-foomatic-rip-hplip-install \
--enable-hpijs-install \
--with-icondir=${LOCALBASE}/share/applications \
--with-cupsbackenddir=${LOCALBASE}/libexec/cups/backend \
--with-cupsfilterdir=${LOCALBASE}/libexec/cups/filter \
--with-drvdir=${LOCALBASE}/libexec/cups/driver
--with-drvdir=${LOCALBASE}/libexec/cups/driver \
--with-hpppddir=${LOCALBASE}/share/ppd/HP \
--with-mimedir=${LOCALBASE}/etc/cups \
--with-docdir=${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
USE_LDCONFIG= yes
USE_GHOSTSCRIPT_RUN= yes
USE_PYTHON= yes
USE_RC_SUBR= hpssd.sh
USE_PYTHON= 25+
USE_RC_SUBR= hpssd
MAKE_JOBS_SAFE= yes
SUB_FILES= pkg-message
USE_DOS2UNIX= yes
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib ${PTHREAD_LIBS} -lcompat
MAKE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
PKGDEINSTALL= ${PKGINSTALL}
OPTIONS= QT "Build QT4 gui" off \
DBUS "D-Bus support (required for fax tools)" off \
XSANE "Scanning support via XSane" off \
SNMP "Support for Simple Network Management Protocol" off
OPTIONS= GUI "build with Python QT" on
PLIST_SUB+= PORTVERSION=${PORTVERSION} IJSVER=2.7.4
.include <bsd.port.pre.mk>
.include <bsd.port.options.mk>
.if ${OSVERSION} < 800069
LIB_DEPENDS+= usb:${PORTSDIR}/devel/libusb
.endif
.if !defined(WITHOUT_GUI) || exists(${LOCALBASE}/bin/pylupdate)
RUN_DEPENDS+= pylupdate:${PORTSDIR}/x11-toolkits/py-qt
CONFIGURE_ARGS+= --enable-gui-build
.if defined(WITH_SNMP) && (${ARCH} == i386)
BROKEN= can't link with libsnmp, net-mgmt/net-snmp should be fixed first
.endif
post-extract:
@${RM} -r ${WRKSRC}/data/images/CVS
.if !defined(WITHOUT_QT)
USE_QT_VER= 4
QT_COMPONENTS= gui
CONFIGURE_ARGS+= --enable-qt4
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/PyQt4/QtGui.so:${PORTSDIR}/x11-toolkits/py-qt4-gui
LIB_DEPENDS+= pyglib-2.0:${PORTSDIR}/devel/py-gobject
.endif
.if !defined(WITHOUT_DBUS)
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/dbus/_dbus.py:${PORTSDIR}/devel/py-dbus \
${PYTHON_SITELIBDIR}/dbus/mainloop/qt.so:${PORTSDIR}/devel/py-qt4-dbus
LIB_DEPENDS+= dbus-1.3:${PORTSDIR}/devel/dbus
# fax added as, no dbus no fax
CONFIGURE_ARGS+= --enable-dbus-build \
--enable-fax-build
PLIST_SUB+= FAX=""
.else
CONFIGURE_ARGS+= --disable-dbus-build \
--disable-fax-build
PLIST_SUB+= FAX="@comment "
.endif
.if !defined(WITHOUT_XSANE)
RUN_DEPENDS+= xsane:${PORTSDIR}/graphics/xsane
.endif
.if defined(WITH_SNMP)
LIB_DEPENDS+= netsnmp.16:${PORTSDIR}/net-mgmt/net-snmp
CONFIGURE_ARGS+= --enable-network-build
.else
CONFIGURE_ARGS+= --disable-network-build
.endif
.if defined(NOPORTDOCS)
CONFIGURE_ARGS+= --enable-doc-build=no
.endif
post-patch:
@${REINPLACE_CMD} -e 's|/etc/hp|${LOCALBASE}/etc/hp|g ; \
s|/etc/sane.d|${LOCALBASE}/etc/sane.d|g' \
${WRKSRC}/Makefile.am \
s|/etc/sane.d|${LOCALBASE}/etc/sane.d|g' \
${WRKSRC}/Makefile.in \
${WRKSRC}/check.py \
${WRKSRC}/hpssd.py \
${WRKSRC}/base/g.py \
${WRKSRC}/doc/release_notes.html \
${WRKSRC}/doc/tech_docs/man_pages/hpssd.html \
${WRKSRC}/fax/backend/hpfax.py \
${WRKSRC}/check.py ${WRKSRC}/hpssd.py \
${WRKSRC}/base/g.py ${WRKSRC}/fax/backend/hpfax.py \
${WRKSRC}/installer/distros.dat \
${WRKSRC}/installer/core_install.py \
${WRKSRC}/prnt/hpijs/ljzjs.cpp
@${REINPLACE_CMD} 's|-lpthread|${PTHREAD_LIBS}|g' \
${WRKSRC}/configure \
${WRKSRC}/configure.in
.if defined(NOPORTDOCS)
@${REINPLACE_CMD} -e 's|install-dist_www7DATA install-docDATA|install-dist_www7DATA|g ; \
s|install-dist_unrelDATA install-dist_www0DATA|install-dist_unrelDATA|g ; \
s|install-dist_www1DATA install-dist_www21DATA||g ; \
s|install-dist_www22DATA install-dist_www23DATA||g ; \
s|install-dist_www241DATA install-dist_www242DATA||g ; \
s|install-dist_www243DATA install-dist_www24DATA||g ; \
s|install-dist_www251DATA install-dist_www252DATA||g ; \
s|install-dist_www261DATA install-dist_www2DATA||g ; \
s|install-dist_www3DATA install-dist_www4DATA||g ; \
s|install-dist_www5DATA install-dist_www61DATA||g ; \
s|install-dist_www6DATA install-dist_www7DATA||g' \
${WRKSRC}/prnt/hpijs/ljzjs.cpp \
${WRKSRC}/prnt/hpijs/globals.cpp \
${WRKSRC}/ui/devmgr4.py \
${WRKSRC}/ui4/devmgr5.py
@${REINPLACE_CMD} -e 's|/etc/dbus-1/system.d|${LOCALBASE}/etc/dbus-1/system.d|g ; \
s|/usr/share/dbus-1/system-services|${LOCALBASE}/share/dbus-1/system-services|g' \
${WRKSRC}/Makefile.in
.endif
@${REINPLACE_CMD} 's|/etc/xdg|${PREFIX}&|g; s|-lpthread|${PTHREAD_LIBS}|g' \
${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|install-dist_prntSCRIPTS install-dist_rulesDATA|install-dist_prntSCRIPTS|g ; \
s|install-hpPROGRAMS install-hplip_confDATA|install-hpPROGRAMS|g' \
s|install-hpPROGRAMS install-hplip_confDATA|install-hpPROGRAMS|g' \
${WRKSRC}/Makefile.in
# @${REINPLACE_CMD} -e 's|install-dist_www7DATA install-docDATA|install-dist_www7DATA|g' \
# ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|-ldld||g ; \
s|-ldl||g ; \
s|-dld||g' \
@${REINPLACE_CMD} -e 's|-ldld||g; s|-ldl||g; s|-dld||g' \
${WRKSRC}/configure \
${WRKSRC}/configure.in \
${WRKSRC}/Makefile.in \
${WRKSRC}/Makefile.am \
${WRKSRC}/aclocal.m4
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|/usr/bin/env python|${LOCALBASE}/bin/python|g' \
${WRKSRC}/hpssd.py
pre-su-install:
@${MKDIR} ${PREFIX}/share/applications
.if defined(NOPORTDOCS)
@${REINPLACE_CMD} -e '/[[:space:]]install-docDATA/ s|install-docDATA||' \
${WRKSRC}/Makefile.in
.endif
post-install:
.if !defined(PACKAGE_BUILDING)
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.endif
@${LN} -sf ${PREFIX}/share/hplip/hpssd.py ${PREFIX}/sbin/hpssd
@${MKDIR} ${PREFIX}/etc/hp
# Auto-generate sample configuration file
@${INSTALL_DATA} ${WRKSRC}/hplip.conf ${PREFIX}/etc/hp/hplip.conf.sample
.if !exists(${PREFIX}/etc/hp/hplip.conf)
@${INSTALL_DATA} ${WRKSRC}/hplip.conf ${PREFIX}/etc/hp/hplip.conf
.endif
@${SED} -e "s|%%PREFIX%%|${PREFIX}|" ${PKGMESSAGE}
${LN} -sf ${PREFIX}/share/hplip/hpssd.py ${PREFIX}/sbin/hpssd
${INSTALL_DATA} ${WRKSRC}/hplip-systray.desktop ${PREFIX}/etc/xdg/autostart/hplip-systray.desktop
${MKDIR} ${PREFIX}/etc/hp
${INSTALL_DATA} ${WRKSRC}/hplip.conf ${PREFIX}/etc/hp/hplip.conf.sample
if [ ! -f ${PREFIX}/etc/hp/hplip.conf ]; then \
${INSTALL_DATA} ${PREFIX}/etc/hp/hplip.conf.sample \
${PREFIX}/etc/hp/hplip.conf; \
fi
${ECHO_CMD} hpaio >> ${PREFIX}/etc/sane.d/dll.conf
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -1,3 +1,3 @@
MD5 (hplip-2.8.2.tar.gz) = ea57b92483622d3eae359994c5fd3dc3
SHA256 (hplip-2.8.2.tar.gz) = 2135f2e02077cf5388c4b9b8214f0fd56f24f8bb2ccfa564a80402520e2d5aa8
SIZE (hplip-2.8.2.tar.gz) = 14195737
MD5 (hplip-3.10.2.tar.gz) = 4df6f16c47ae7edd015bf2cf5155f26f
SHA256 (hplip-3.10.2.tar.gz) = bb9a3aeda9a8d31f0cc790e629f14d2122f9bff111b0d3cc97ac19a8607d7956
SIZE (hplip-3.10.2.tar.gz) = 21446275

View file

@ -1,30 +0,0 @@
#!/bin/sh
# PROVIDE: hpssd
# BEFORE: cupsd
# KEYWORD: shutdown
. /etc/rc.subr
name=hpssd
rcvar=${name}_enable
command="%%PREFIX%%/sbin/${name}"
command_interpreter="%%PREFIX%%/bin/python"
pidfile="/var/run/${name}.pid"
hpssd_user=nobody
command_args=">/dev/null"
start_precmd="hpssd_prestart"
load_rc_config $name
: ${hpssd_enable="NO"}
hpssd_prestart()
{
touch ${pidfile}
chown ${hpssd_user} ${pidfile}
}
run_rc_command $*

View file

@ -1,74 +0,0 @@
Patch for CVE-2008-2940
Please note that alerts are now system-wide and they live in
/etc/hp/alerts.conf
See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-2940
Obtained from: https://bugzilla.redhat.com/attachment.cgi?id=312878
Obtained from: https://bugzilla.redhat.com/attachment.cgi?id=312880
diff -up hplip-1.6.7/hpssd.py.validate-uri hplip-1.6.7/hpssd.py
--- hpssd.py.validate-uri 2008-07-29 12:48:28.000000000 +0100
+++ hpssd.py 2008-07-29 13:41:29.000000000 +0100
@@ -1021,6 +1021,9 @@ class hpssd_handler(dispatcher):
event_type = self.fields.get('event-type', 'event')
event_code = self.fields.get('event-code', 0)
device_uri = self.fields.get('device-uri', '').replace('hpfax:', 'hp:')
+ result_code = self.__checkdevice(device_uri)
+ if result_code != ERROR_SUCCESS:
+ return
log.debug("Device URI: %s" % device_uri)
try:
diff -up hplip-1.6.7/base/g.py.static-alerts-table hplip-1.6.7/base/g.py
--- base/g.py.orig 2008-01-18 02:10:29.000000000 +0300
+++ base/g.py 2008-11-23 22:39:11.000000000 +0300
@@ -134,6 +134,7 @@
# Config file: directories and ports
prop.sys_config_file = '/etc/hp/hplip.conf'
prop.user_dir = os.path.expanduser('~/.hplip')
+prop.alerts_config_file = '/etc/hp/alerts.conf'
os.umask(0037)
try:
@@ -154,6 +155,7 @@
sys_cfg = Config(prop.sys_config_file, True)
user_cfg = Config(prop.user_config_file)
+alerts_cfg = Config(prop.alerts_config_file)
# Language settings
diff -up hplip-1.6.7/hpssd.py.static-alerts-table hplip-1.6.7/hpssd.py
--- hpssd.py.static-alerts-table 2008-07-29 14:57:04.000000000 +0100
+++ hpssd.py 2008-07-29 15:22:15.000000000 +0100
@@ -71,6 +71,12 @@ from prnt import cups
# Per user alert settings
alerts = {}
+for user, cfg in alerts_cfg.iteritems ():
+ entry = {}
+ entry['email-alerts'] = utils.to_bool (cfg.get('email-alerts', 0))
+ entry['email-from-address'] = cfg.get('email-from-address', '')
+ entry['email-to-addresses'] = cfg.get('email-to-addresses', '')
+ alerts[user] = entry
# Fax temp files
fax_file = {}
@@ -803,15 +809,10 @@ class hpssd_handler(dispatcher):
self.out_buffer = buildResultMessage('InjectValueResult', None, result_code)
- # TODO: Need to load alerts at start-up
def handle_setalerts(self):
result_code = ERROR_SUCCESS
- username = self.fields.get('username', '')
- alerts[username] = {'email-alerts' : utils.to_bool(self.fields.get('email-alerts', '0')),
- 'email-from-address' : self.fields.get('email-from-address', ''),
- 'email-to-addresses' : self.fields.get('email-to-addresses', ''),
- }
+ # Do nothing. We use the alerts table in /etc/hp/alerts.conf.
self.out_buffer = buildResultMessage('SetAlertsResult', None, result_code)

View file

@ -1,210 +0,0 @@
Patch for CVE-2008-2941
Fixes parser fragility: original code expects only strings or numbers as
the input values, but not both. And hpssd client has the full control
on the input data, so when number is tried to be transformed as string
(by calling lower() method, for example) the unhandled exception
terminates the daemon.
Based on: https://bugzilla.redhat.com/attachment.cgi?id=312881
--- hpssd.py.orig 2008-11-23 22:41:08.000000000 +0300
+++ hpssd.py 2008-11-23 22:57:51.000000000 +0300
@@ -203,7 +203,7 @@
log.debug(self.out_buffer)
return True
- msg_type = self.fields.get('msg', 'unknown').lower()
+ msg_type = str(self.fields.get('msg', 'unknown')).lower()
log.debug("Handling: %s %s %s" % ("*"*20, msg_type, "*"*20))
log.debug(repr(self.in_buffer))
@@ -260,9 +260,9 @@
def handle_getvalue(self):
- device_uri = self.fields.get('device-uri', '').replace('hpfax:', 'hp:')
+ device_uri = str(self.fields.get('device-uri', '')).replace('hpfax:', 'hp:')
value = ''
- key = self.fields.get('key', '')
+ key = str(self.fields.get('key', ''))
result_code = self.__checkdevice(device_uri)
if result_code == ERROR_SUCCESS:
@@ -274,9 +274,9 @@
self.out_buffer = buildResultMessage('GetValueResult', value, result_code)
def handle_setvalue(self):
- device_uri = self.fields.get('device-uri', '').replace('hpfax:', 'hp:')
- key = self.fields.get('key', '')
- value = self.fields.get('value', '')
+ device_uri = str(self.fields.get('device-uri', '')).replace('hpfax:', 'hp:')
+ key = str(self.fields.get('key', ''))
+ value = str(self.fields.get('value', ''))
result_code = self.__checkdevice(device_uri)
if result_code == ERROR_SUCCESS:
@@ -285,7 +285,7 @@
self.out_buffer = buildResultMessage('SetValueResult', None, ERROR_SUCCESS)
def handle_queryhistory(self):
- device_uri = self.fields.get('device-uri', '').replace('hpfax:', 'hp:')
+ device_uri = str(self.fields.get('device-uri', '')).replace('hpfax:', 'hp:')
payload = ''
result_code = self.__checkdevice(device_uri)
@@ -305,8 +305,8 @@
# EVENT
def handle_registerguievent(self):
- username = self.fields.get('username', '')
- typ = self.fields.get('type', 'unknown')
+ username = str(self.fields.get('username', ''))
+ typ = str(self.fields.get('type', 'unknown'))
self.typ = typ
self.username = username
self.send_events = True
@@ -314,13 +314,13 @@
# EVENT
def handle_unregisterguievent(self):
- username = self.fields.get('username', '')
+ username = str(self.fields.get('username', ''))
self.send_events = False
def handle_test_email(self):
result_code = ERROR_SUCCESS
- username = self.fields.get('username', prop.username)
+ username = str(self.fields.get('username', prop.username))
message = device.queryString('email_test_message')
subject = device.queryString('email_test_subject')
result_code = self.sendEmail(username, subject, message, True)
@@ -343,11 +343,14 @@
# sent by hpfax: to indicate the start of a complete fax rendering job
def handle_hpfaxbegin(self):
- username = self.fields.get('username', prop.username)
- job_id = self.fields.get('job-id', 0)
- printer_name = self.fields.get('printer', '')
- device_uri = self.fields.get('device-uri', '').replace('hp:', 'hpfax:')
- title = self.fields.get('title', '')
+ username = str(self.fields.get('username', prop.username))
+ try:
+ job_id = int(self.fields.get('job-id', 0))
+ except ValueError:
+ job_id = 0
+ printer_name = str(self.fields.get('printer', ''))
+ device_uri = str(self.fields.get('device-uri', '')).replace('hp:', 'hpfax:')
+ title = str(self.fields.get('title', ''))
log.debug("Creating data store for %s:%d" % (username, job_id))
fax_file[(username, job_id)] = tempfile.NamedTemporaryFile(prefix="hpfax")
@@ -360,8 +363,11 @@
# sent by hpfax: to transfer completed fax rendering data
def handle_hpfaxdata(self):
- username = self.fields.get('username', prop.username)
- job_id = self.fields.get('job-id', 0)
+ username = str(self.fields.get('username', prop.username))
+ try:
+ job_id = int(self.fields.get('job-id', 0))
+ except ValueError:
+ job_id = 0
if self.payload and (username, job_id) in fax_file and \
not fax_file_ready[(username, job_id)]:
@@ -373,12 +379,18 @@
# sent by hpfax: to indicate the end of a complete fax rendering job
def handle_hpfaxend(self):
- username = self.fields.get('username', '')
- job_id = self.fields.get('job-id', 0)
- printer_name = self.fields.get('printer', '')
- device_uri = self.fields.get('device-uri', '').replace('hp:', 'hpfax:')
- title = self.fields.get('title', '')
- job_size = self.fields.get('job-size', 0)
+ username = str(self.fields.get('username', ''))
+ try:
+ job_id = int(self.fields.get('job-id', 0))
+ except ValueError:
+ job_id = 0
+ printer_name = str(self.fields.get('printer', ''))
+ device_uri = str(self.fields.get('device-uri', '')).replace('hp:', 'hpfax:')
+ title = str(self.fields.get('title', ''))
+ try:
+ job_size = int(self.fields.get('job-size', 0))
+ except ValueError:
+ job_size = 0
fax_file[(username, job_id)].seek(0)
fax_file_ready[(username, job_id)] = True
@@ -389,7 +401,7 @@
# sent by hp-sendfax to see if any faxes have been printed and need to be picked up
def handle_faxcheck(self):
- username = self.fields.get('username', '')
+ username = str(self.fields.get('username', ''))
result_code = ERROR_NO_DATA_AVAILABLE
other_fields = {}
@@ -413,8 +425,11 @@
# after being run with --job param, both after a hpfaxend message
def handle_faxgetdata(self):
result_code = ERROR_SUCCESS
- username = self.fields.get('username', '')
- job_id = self.fields.get('job-id', 0)
+ username = str(self.fields.get('username', ''))
+ try:
+ job_id = int(self.fields.get('job-id', 0))
+ except ValueError:
+ job_id = 0
try:
fax_file[(username, job_id)]
@@ -442,15 +457,18 @@
# EVENT
def handle_event(self):
gui_port, gui_host = None, None
- event_type = self.fields.get('event-type', 'event')
+ event_type = str(self.fields.get('event-type', 'event'))
- event_code = self.fields.get('event-code', STATUS_PRINTER_IDLE)
+ try:
+ event_code = int(self.fields.get('event-code', STATUS_PRINTER_IDLE))
+ except ValueError:
+ event_code = STATUS_PRINTER_IDLE
# If event-code > 10001, its a PJL error code, so convert it
if event_code > EVENT_MAX_EVENT:
event_code = status.MapPJLErrorCode(event_code)
- device_uri = self.fields.get('device-uri', '').replace('hpfax:', 'hp:')
+ device_uri = str(self.fields.get('device-uri', '')).replace('hpfax:', 'hp:')
result_code = self.__checkdevice(device_uri)
if result_code != ERROR_SUCCESS:
return
@@ -461,7 +479,10 @@
log.debug("Short/Long: %s/%s" % (error_string_short, error_string_long))
- job_id = self.fields.get('job-id', 0)
+ try:
+ job_id = int(self.fields.get('job-id', 0))
+ except ValueError:
+ job_id = 0
try:
username = self.fields['username']
@@ -480,7 +501,10 @@
no_fwd = utils.to_bool(self.fields.get('no-fwd', '0'))
log.debug("Username (jobid): %s (%d)" % (username, job_id))
- retry_timeout = self.fields.get('retry-timeout', 0)
+ try:
+ retry_timeout = int(self.fields.get('retry-timeout', 0))
+ except ValueError:
+ retry_timeout = 0
user_alerts = alerts.get(username, {})
dup_event = False

View file

@ -1,37 +0,0 @@
--- Makefile.am.orig Fri Sep 21 15:36:07 2007
+++ Makefile.am Tue Oct 9 19:31:35 2007
@@ -45,7 +45,7 @@
www243dir = $(docdir)/install/step4/suse
dist_www243_DATA = $(wwwsrc)/install/step4/suse/*
www251dir = $(docdir)/install/manual
-dist_www251_DATA = $(wwwsrc)/install/manual/*
+dist_www251_DATA = $(wwwsrc)/install/manual/*.html
www252dir = $(docdir)/install/manual/distros
dist_www252_DATA = $(wwwsrc)/install/manual/distros/*
www261dir = $(docdir)/install/install
@@ -53,13 +53,13 @@
www3dir = $(docdir)/styles
dist_www3_DATA = $(wwwsrc)/styles/*
www4dir = $(docdir)/images
-dist_www4_DATA = $(wwwsrc)/images/*
+dist_www4_DATA = $(wwwsrc)/images/*.png
www5dir = $(docdir)/supported_devices
dist_www5_DATA = $(wwwsrc)/supported_devices/*
www6dir = $(docdir)/tech_docs
-dist_www6_DATA = $(wwwsrc)/tech_docs/*
+dist_www6_DATA = $(wwwsrc)/tech_docs/*.html
www61dir = $(docdir)/tech_docs/man_pages
-dist_www61_DATA = $(wwwsrc)/tech_docs/man_pages/*
+dist_www61_DATA = $(wwwsrc)/tech_docs/man_pages/*.html
www7dir = $(docdir)/troubleshooting
dist_www7_DATA = $(wwwsrc)/troubleshooting/*
endif
@@ -131,7 +131,7 @@
dist_postscript_DATA = data/ps/testpage.ps.gz data/ps/clean_page.pdf.gz
dist_models_DATA = data/models/models.dat
if GUI_BUILD
-dist_images_DATA = data/images/*
+dist_images_DATA = data/images/*.png
endif
dist_pcl_DATA = data/pcl/align1_8xx.pcl.gz data/pcl/align1_9xx.pcl.gz data/pcl/align2_8xx.pcl.gz data/pcl/align3_8xx.pcl.gz data/pcl/align4_8xx.pcl.gz \
data/pcl/align5_8xx.pcl.gz data/pcl/align2_9xx.pcl.gz data/pcl/align3_9xx.pcl.gz data/pcl/align4_450.pcl.gz data/pcl/align6_450.pcl.gz \

View file

@ -1,99 +1,41 @@
--- Makefile.in.orig 2008-02-09 10:06:41.000000000 +0800
+++ Makefile.in 2008-03-16 01:24:58.000000000 +0800
@@ -697,7 +697,7 @@
dist_faxppdDATA_INSTALL = $(INSTALL_DATA)
am__dist_hplip_DATA_DIST = scan/sane/hpaio.desc
dist_hplipDATA_INSTALL = $(INSTALL_DATA)
-am__dist_images_DATA_DIST = data/images/*
+am__dist_images_DATA_DIST = data/images/*.png
dist_imagesDATA_INSTALL = $(INSTALL_DATA)
am__dist_ldl_DATA_DIST = data/ldl/cb2pcal.ldl.gz \
data/ldl/cb2pcal_done.ldl.gz data/ldl/cbbcal.ldl.gz \
@@ -1190,7 +1190,7 @@
dist_www242DATA_INSTALL = $(INSTALL_DATA)
am__dist_www243_DATA_DIST = $(wwwsrc)/install/step4/suse/*
dist_www243DATA_INSTALL = $(INSTALL_DATA)
-am__dist_www251_DATA_DIST = $(wwwsrc)/install/manual/*
+am__dist_www251_DATA_DIST = $(wwwsrc)/install/manual/*.html
dist_www251DATA_INSTALL = $(INSTALL_DATA)
am__dist_www252_DATA_DIST = $(wwwsrc)/install/manual/distros/*
dist_www252DATA_INSTALL = $(INSTALL_DATA)
@@ -1198,13 +1198,13 @@
dist_www261DATA_INSTALL = $(INSTALL_DATA)
am__dist_www3_DATA_DIST = $(wwwsrc)/styles/*
dist_www3DATA_INSTALL = $(INSTALL_DATA)
-am__dist_www4_DATA_DIST = $(wwwsrc)/images/*
+am__dist_www4_DATA_DIST = $(wwwsrc)/images/*.png
dist_www4DATA_INSTALL = $(INSTALL_DATA)
am__dist_www5_DATA_DIST = $(wwwsrc)/supported_devices/*
dist_www5DATA_INSTALL = $(INSTALL_DATA)
-am__dist_www6_DATA_DIST = $(wwwsrc)/tech_docs/*
+am__dist_www6_DATA_DIST = $(wwwsrc)/tech_docs/*.html
dist_www6DATA_INSTALL = $(INSTALL_DATA)
-am__dist_www61_DATA_DIST = $(wwwsrc)/tech_docs/man_pages/*
+am__dist_www61_DATA_DIST = $(wwwsrc)/tech_docs/man_pages/*.html
dist_www61DATA_INSTALL = $(INSTALL_DATA)
am__dist_www7_DATA_DIST = $(wwwsrc)/troubleshooting/*
dist_www7DATA_INSTALL = $(INSTALL_DATA)
@@ -1425,7 +1425,7 @@
@DOC_BUILD_TRUE@www243dir = $(docdir)/install/step4/suse
@DOC_BUILD_TRUE@dist_www243_DATA = $(wwwsrc)/install/step4/suse/*
@DOC_BUILD_TRUE@www251dir = $(docdir)/install/manual
-@DOC_BUILD_TRUE@dist_www251_DATA = $(wwwsrc)/install/manual/*
+@DOC_BUILD_TRUE@dist_www251_DATA = $(wwwsrc)/install/manual/*.html
@DOC_BUILD_TRUE@www252dir = $(docdir)/install/manual/distros
@DOC_BUILD_TRUE@dist_www252_DATA = $(wwwsrc)/install/manual/distros/*
@DOC_BUILD_TRUE@www261dir = $(docdir)/install/install
@@ -1433,13 +1433,13 @@
@DOC_BUILD_TRUE@www3dir = $(docdir)/styles
@DOC_BUILD_TRUE@dist_www3_DATA = $(wwwsrc)/styles/*
@DOC_BUILD_TRUE@www4dir = $(docdir)/images
-@DOC_BUILD_TRUE@dist_www4_DATA = $(wwwsrc)/images/*
+@DOC_BUILD_TRUE@dist_www4_DATA = $(wwwsrc)/images/*.png
@DOC_BUILD_TRUE@www5dir = $(docdir)/supported_devices
@DOC_BUILD_TRUE@dist_www5_DATA = $(wwwsrc)/supported_devices/*
@DOC_BUILD_TRUE@www6dir = $(docdir)/tech_docs
-@DOC_BUILD_TRUE@dist_www6_DATA = $(wwwsrc)/tech_docs/*
+@DOC_BUILD_TRUE@dist_www6_DATA = $(wwwsrc)/tech_docs/*.html
@DOC_BUILD_TRUE@www61dir = $(docdir)/tech_docs/man_pages
-@DOC_BUILD_TRUE@dist_www61_DATA = $(wwwsrc)/tech_docs/man_pages/*
+@DOC_BUILD_TRUE@dist_www61_DATA = $(wwwsrc)/tech_docs/man_pages/*.html
@DOC_BUILD_TRUE@www7dir = $(docdir)/troubleshooting
@DOC_BUILD_TRUE@dist_www7_DATA = $(wwwsrc)/troubleshooting/*
@HPLIP_BUILD_TRUE@dist_hplip_DATA = scan/sane/hpaio.desc
@@ -1489,7 +1489,7 @@
@HPLIP_BUILD_TRUE@localzdir = $(hplipdir)/data/localization
@HPLIP_BUILD_TRUE@dist_postscript_DATA = data/ps/testpage.ps.gz data/ps/clean_page.pdf.gz
@HPLIP_BUILD_TRUE@dist_models_DATA = data/models/models.dat
-@GUI_BUILD_TRUE@@HPLIP_BUILD_TRUE@dist_images_DATA = data/images/*
+@GUI_BUILD_TRUE@@HPLIP_BUILD_TRUE@dist_images_DATA = data/images/*.png
@HPLIP_BUILD_TRUE@dist_pcl_DATA = data/pcl/align1_8xx.pcl.gz data/pcl/align1_9xx.pcl.gz data/pcl/align2_8xx.pcl.gz data/pcl/align3_8xx.pcl.gz data/pcl/align4_8xx.pcl.gz \
@HPLIP_BUILD_TRUE@ data/pcl/align5_8xx.pcl.gz data/pcl/align2_9xx.pcl.gz data/pcl/align3_9xx.pcl.gz data/pcl/align4_450.pcl.gz data/pcl/align6_450.pcl.gz \
@HPLIP_BUILD_TRUE@ data/pcl/colorcal1_450.pcl.gz data/pcl/colorcal2_450.pcl.gz data/pcl/crbcal.pcl.gz data/pcl/crcaldone.pcl.gz data/pcl/crcbcal.pcl.gz data/pcl/crccal.pcl.gz \
@@ -2170,7 +2170,7 @@
.SUFFIXES: .c .cpp .lo .o .obj
am--refresh:
@:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/unreleased.inc $(srcdir)/foomatic_drv.inc $(am__configure_deps)
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/unreleased.inc $(srcdir)/foomatic_drv.inc
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -2197,7 +2197,7 @@
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
--- Makefile.in.old 2010-03-28 15:07:10.000000000 -0600
+++ Makefile.in 2010-03-28 15:08:01.000000000 -0600
@@ -89,8 +89,8 @@
# ip library
@HPLIP_BUILD_TRUE@am__append_1 = libhpmud.la libhpip.la
@HPLIP_BUILD_TRUE@hp_mkuri_PROGRAMS = hp-mkuri$(EXEEXT)
-@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_TRUE@am__append_2 = data/rules/40-hplip.rules
-@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_FALSE@am__append_3 = data/rules/55-hpmud.rules
+#@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_TRUE@am__append_2 = data/rules/40-hplip.rules
+#@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_FALSE@am__append_3 = data/rules/55-hpmud.rules
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@am__append_4 = \
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@ scan/sane/hpaio.desc \
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@ prnt/drv/hpijs.drv.in.template \
@@ -2041,8 +2041,8 @@
ppd/hpcups/hp-psc_950vr.ppd.gz ppd/hpcups/hp-psc_950xi.ppd.gz
am__dist_prnt_DATA_DIST = prnt/cups.py prnt/__init__.py prnt/ldl.py \
prnt/pcl.py prnt/colorcal.py
-am__dist_rules_DATA_DIST = data/rules/56-hpmud_support.rules \
- data/rules/40-hplip.rules data/rules/55-hpmud.rules
+#am__dist_rules_DATA_DIST = data/rules/56-hpmud_support.rules \
+# data/rules/40-hplip.rules data/rules/55-hpmud.rules
am__dist_scan_DATA_DIST = scan/__init__.py scan/sane.py
am__dist_ui_DATA_DIST = ui/alignform.py ui/colorcalform_base.py \
ui/colorcalform.py ui/coloradjform_base.py ui/coloradjform.py \
@@ -3777,11 +3777,11 @@
@HPLIP_BUILD_TRUE@hp_mkuri_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\"
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure:
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
@@ -6210,7 +6210,7 @@
install-dist_pcardSCRIPTS install-dist_pclDATA \
install-dist_pluginsSCRIPTS install-dist_postscriptDATA \
install-dist_prntSCRIPTS install-dist_ripSCRIPTS \
- install-dist_rulesDATA install-dist_scanSCRIPTS \
+ install-dist_scanSCRIPTS \
install-dist_uiSCRIPTS install-dist_unrelDATA \
install-dist_www0DATA install-dist_www1DATA \
install-dist_www21DATA install-dist_www22DATA \
# hpmud.rules
-@HPLIP_BUILD_TRUE@rulesdir = /etc/udev/rules.d
-@HPLIP_BUILD_TRUE@dist_rules_DATA = data/rules/56-hpmud_support.rules \
-@HPLIP_BUILD_TRUE@ $(am__append_2) $(am__append_3)
-@HPLIP_BUILD_TRUE@halpredir = /usr/share/hal/fdi/preprobe/10osvendor
-@HPLIP_BUILD_TRUE@dist_halpre_DATA = data/rules/20-hplip-devices.fdi
+#@HPLIP_BUILD_TRUE@rulesdir = /etc/udev/rules.d
+#@HPLIP_BUILD_TRUE@dist_rules_DATA = data/rules/56-hpmud_support.rules \
+#@HPLIP_BUILD_TRUE@ $(am__append_2) $(am__append_3)
+#@HPLIP_BUILD_TRUE@halpredir = /usr/share/hal/fdi/preprobe/10osvendor
+#@HPLIP_BUILD_TRUE@dist_halpre_DATA = data/rules/20-hplip-devices.fdi
# hplip.conf
@HPLIP_BUILD_TRUE@hplip_confdir = /etc/hp

View file

@ -1,53 +0,0 @@
--- base/utils.py.orig Wed Oct 10 00:23:07 2007
+++ base/utils.py Wed Oct 10 00:27:04 2007
@@ -54,6 +54,50 @@
return callable
+# For pidfile locking (must be "static" and global to the whole app)
+prv_pidfile = None
+prv_pidfile_name = ""
+
+def get_pidfile_lock (a_pidfile_name=""):
+ """ Call this to either lock the pidfile, or to update it after a fork()
+ Credit: Henrique M. Holschuh <hmh@debian.org>
+ """
+ global prv_pidfile
+ global prv_pidfile_name
+ if prv_pidfile_name == "":
+ try:
+ prv_pidfile_name = a_pidfile_name
+ prv_pidfile = os.fdopen(os.open(prv_pidfile_name, os.O_RDWR | os.O_CREAT, 0644), 'r+')
+ fcntl.fcntl(prv_pidfile.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
+ while 1:
+ try:
+ fcntl.flock(prv_pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+ except (OSError, IOError), e:
+ if e.errno == errno.EINTR:
+ continue
+ elif e.errno == errno.EWOULDBLOCK:
+ try:
+ prv_pidfile.seek(0)
+ otherpid = int(prv_pidfile.readline(), 10)
+ sys.stderr.write ("can't lock %s, running daemon's pid may be %d\n" % (prv_pidfile_name, otherpid))
+ except (OSError, IOError), e:
+ sys.stderr.write ("error reading pidfile %s: (%d) %s\n" % (prv_pidfile_name, e.errno, e.strerror))
+
+ sys.exit(1)
+ sys.stderr.write ("can't lock %s: (%d) %s\n" % (prv_pidfile_name, e.errno, e.strerror))
+ sys.exit(1)
+ break
+ except (OSError, IOError), e:
+ sys.stderr.write ("can't open pidfile %s: (%d) %s\n" % (prv_pidfile_name, e.errno, e.strerror))
+ sys.exit(1)
+ try:
+ prv_pidfile.seek(0)
+ prv_pidfile.write("%d\n" % (os.getpid()))
+ prv_pidfile.flush()
+ prv_pidfile.truncate()
+ except (OSError, IOError), e:
+ log.error("can't update pidfile %s: (%d) %s\n" % (prv_pidfile_name, e.errno, e.strerror))
+
def daemonize (stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
"""
Credit: Jürgen Hermann, Andy Gimblett, and Noah Spurrier

View file

@ -1,21 +0,0 @@
--- hpssd.py Fri Oct 12 19:42:15 2007
+++ /usr/local/sbin/hpssd Fri Oct 12 23:59:31 2007
@@ -664,6 +664,10 @@
if prop.daemonize:
utils.daemonize()
+ # Lock pidfile before we muck around with system state
+ # Patch by Henrique M. Holschuh <hmh@debian.org>
+ utils.get_pidfile_lock(os.path.join(sys_cfg.dirs.run, 'hpssd.pid'))
+
# hpssd server dispatcher object
try:
server = hpssd_server(prop.hpssd_host, prop.hpssd_port)
@@ -688,6 +692,7 @@
log.debug("Cleaning up...")
finally:
+ os.remove(os.path.join(sys_cfg.dirs.run, 'hpssd.pid'))
server.close()
return 0

View file

@ -1,12 +1,18 @@
--- io/hpmud/musb.c.orig 2008-01-23 01:27:15.000000000 +0100
+++ io/hpmud/musb.c 2009-03-25 17:01:30.000000000 +0100
@@ -123,8 +123,10 @@
Index: io/hpmud/musb.c
@@ -122,10 +122,16 @@
{
ret = usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, (USB_DT_STRING << 8) + index,
0x409, tbuf, sizeof(tbuf), LIBUSB_CONTROL_REQ_TIMEOUT);
if (ret==0)
- if (ret==0)
+ if (ret==0
+#ifdef __FreeBSD__
+ || ret == -EIO
+#endif
+ )
{
- /* This retry is necessary for lj1000 and lj1005. des 12/12/07 */
- BUG("get_string_descriptor zero result, retrying...");
+ /* This retry is necessary for lj1000 and lj1005. des 12/12/07
+ /* This retry is necessary for lj1000 and lj1005. des 12/12/07
+ Also HP Photosmart 42xx seems to suffer transient errors with serial id */
+ BUG("get_string_descriptor error result %d, retrying in 2 secs...", ret);
+ sleep(2);

View file

@ -1,19 +0,0 @@
#!/bin/sh
USER=hplip
GROUP=operator
UID=116
DLLFILE=${PKG_PREFIX}/etc/sane.d/dll.conf
case $2 in
POST-INSTALL)
echo "hpaio" >> ${DLLFILE}
;;
POST-DEINSTALL)
cp ${DLLFILE} ${DLLFILE}.orig
cat ${DLLFILE}.orig | grep -v hpaio > ${DLLFILE}
rm ${DLLFILE}.orig
;;
esac

View file

@ -1,54 +0,0 @@
**********************************************************
**************** UPGRADE FROM 1.X NOTICE *****************
NOTE: If you are upgrading from 1.x you will need to
change your devfs ruleset as hpiod is now gone, so remove
it from you rc.conf. The printer communication now runs
through cupsd. You will need to make the devfs ruleset
changes to allow cups to access the usb bus and ugen
devices so that it can enumerate the printers. You will
also need to update your hplip.conf. See the instructions
below.
**************** UPGRADE FROM 1.X NOTICE *****************
Add the following to your rc.conf:
hpssd_enable="YES"
So all you have to do if you have a custom ruleset setup
is add the following to that ruleset in devfs.rules:
add path 'usb*' group cups
add path 'usb*' mode 0660
add path 'ugen*' group cups
add path 'ugen*' mode 0660
If you have never setup devfs.rules please read the
manpage and see:
http://am-productions.biz/docs/devfs.rules.php
The printer MUST attach as a ugen(4) device. This means
that you must NOT have "device ulpt" in your kernel and
ulpt must NOT be loaded as a kernel module.
If you are seeing device connection errors restart the
printing chain with the following command. NOTE: It MUST
be restarted in the stated order.
%%PREFIX%%/etc/rc.d/hpssd restart && \
%%PREFIX%%/etc/rc.d/cupsd restart
If upgrading from a version < 2.7.9 copy the new
hplip.conf.sample config.
cp %%PREFIX%%/etc/hp/hplip.conf.sample \
%%PREFIX%%/etc/hp/hplip.conf
If you are still having problems check:
http://am-productions.biz/docs/hplip.php
If you are still having problems send the relevant part
of your /var/log/messages, console output from the hp-*
utility that you are trying to run, and your rc.conf +
devfs.rules files and the output of "ls -l /dev" to the
maintainer.
**********************************************************

File diff suppressed because it is too large Load diff

View file

@ -1,150 +0,0 @@
# New ports collection makefile for: hplip
# Date created: 1 April 2006
# Whom: amistry@am-productions.biz
#
# $FreeBSD$
#
PORTNAME= hplip
PORTVERSION= 3.10.2
PORTREVISION= 2
CATEGORIES= print
MASTER_SITES= SF
MAINTAINER= chris@officialunix.com
COMMENT= Drivers and utilities for HP Printers and All-in-One devices
LIB_DEPENDS= jpeg.11:${PORTSDIR}/graphics/jpeg \
sane.1:${PORTSDIR}/graphics/sane-backends \
cups.2:${PORTSDIR}/print/cups-base
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/reportlab/__init__.py:${PORTSDIR}/print/py-reportlab2 \
espgs:${PORTSDIR}/print/cups-pstoraster \
foomatic-rip:${PORTSDIR}/print/foomatic-filters \
mDNSClientPosix:${PORTSDIR}/net/mDNSResponder
LATEST_LINK= ${PORTNAME}3
CONFLICTS= hpijs-[0-9]* hplip-2*
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-dependency-tracking \
--disable-pp-build \
--enable-foomatic-ppd-install \
--enable-foomatic-rip-hplip-install \
--enable-hpijs-install \
--with-icondir=${LOCALBASE}/share/applications \
--with-cupsbackenddir=${LOCALBASE}/libexec/cups/backend \
--with-cupsfilterdir=${LOCALBASE}/libexec/cups/filter \
--with-drvdir=${LOCALBASE}/libexec/cups/driver \
--with-hpppddir=${LOCALBASE}/share/ppd/HP \
--with-mimedir=${LOCALBASE}/etc/cups \
--with-docdir=${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
USE_LDCONFIG= yes
USE_GHOSTSCRIPT_RUN= yes
USE_PYTHON= 25+
USE_RC_SUBR= hpssd
MAKE_JOBS_SAFE= yes
SUB_FILES= pkg-message
USE_DOS2UNIX= yes
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib ${PTHREAD_LIBS} -lcompat
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
OPTIONS= QT "Build QT4 gui" off \
DBUS "D-Bus support (required for fax tools)" off \
XSANE "Scanning support via XSane" off \
SNMP "Support for Simple Network Management Protocol" off
.include <bsd.port.options.mk>
.if ${OSVERSION} < 800069
LIB_DEPENDS+= usb:${PORTSDIR}/devel/libusb
.endif
.if defined(WITH_SNMP) && (${ARCH} == i386)
BROKEN= can't link with libsnmp, net-mgmt/net-snmp should be fixed first
.endif
.if !defined(WITHOUT_QT)
USE_QT_VER= 4
QT_COMPONENTS= gui
CONFIGURE_ARGS+= --enable-qt4
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/PyQt4/QtGui.so:${PORTSDIR}/x11-toolkits/py-qt4-gui
LIB_DEPENDS+= pyglib-2.0:${PORTSDIR}/devel/py-gobject
.endif
.if !defined(WITHOUT_DBUS)
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/dbus/_dbus.py:${PORTSDIR}/devel/py-dbus \
${PYTHON_SITELIBDIR}/dbus/mainloop/qt.so:${PORTSDIR}/devel/py-qt4-dbus
LIB_DEPENDS+= dbus-1.3:${PORTSDIR}/devel/dbus
# fax added as, no dbus no fax
CONFIGURE_ARGS+= --enable-dbus-build \
--enable-fax-build
PLIST_SUB+= FAX=""
.else
CONFIGURE_ARGS+= --disable-dbus-build \
--disable-fax-build
PLIST_SUB+= FAX="@comment "
.endif
.if !defined(WITHOUT_XSANE)
RUN_DEPENDS+= xsane:${PORTSDIR}/graphics/xsane
.endif
.if defined(WITH_SNMP)
LIB_DEPENDS+= netsnmp.16:${PORTSDIR}/net-mgmt/net-snmp
CONFIGURE_ARGS+= --enable-network-build
.else
CONFIGURE_ARGS+= --disable-network-build
.endif
.if defined(NOPORTDOCS)
CONFIGURE_ARGS+= --enable-doc-build=no
.endif
post-patch:
@${REINPLACE_CMD} -e 's|/etc/hp|${LOCALBASE}/etc/hp|g ; \
s|/etc/sane.d|${LOCALBASE}/etc/sane.d|g' \
${WRKSRC}/Makefile.in \
${WRKSRC}/check.py ${WRKSRC}/hpssd.py \
${WRKSRC}/base/g.py ${WRKSRC}/fax/backend/hpfax.py \
${WRKSRC}/installer/distros.dat \
${WRKSRC}/installer/core_install.py \
${WRKSRC}/prnt/hpijs/ljzjs.cpp \
${WRKSRC}/prnt/hpijs/globals.cpp \
${WRKSRC}/ui/devmgr4.py \
${WRKSRC}/ui4/devmgr5.py
@${REINPLACE_CMD} -e 's|/etc/dbus-1/system.d|${LOCALBASE}/etc/dbus-1/system.d|g ; \
s|/usr/share/dbus-1/system-services|${LOCALBASE}/share/dbus-1/system-services|g' \
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} 's|/etc/xdg|${PREFIX}&|g; s|-lpthread|${PTHREAD_LIBS}|g' \
${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|install-dist_prntSCRIPTS install-dist_rulesDATA|install-dist_prntSCRIPTS|g ; \
s|install-hpPROGRAMS install-hplip_confDATA|install-hpPROGRAMS|g' \
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|-ldld||g; s|-ldl||g; s|-dld||g' \
${WRKSRC}/configure \
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|/usr/bin/env python|${LOCALBASE}/bin/python|g' \
${WRKSRC}/hpssd.py
.if defined(NOPORTDOCS)
@${REINPLACE_CMD} -e '/[[:space:]]install-docDATA/ s|install-docDATA||' \
${WRKSRC}/Makefile.in
.endif
post-install:
${LN} -sf ${PREFIX}/share/hplip/hpssd.py ${PREFIX}/sbin/hpssd
${INSTALL_DATA} ${WRKSRC}/hplip-systray.desktop ${PREFIX}/etc/xdg/autostart/hplip-systray.desktop
${MKDIR} ${PREFIX}/etc/hp
${INSTALL_DATA} ${WRKSRC}/hplip.conf ${PREFIX}/etc/hp/hplip.conf.sample
if [ ! -f ${PREFIX}/etc/hp/hplip.conf ]; then \
${INSTALL_DATA} ${PREFIX}/etc/hp/hplip.conf.sample \
${PREFIX}/etc/hp/hplip.conf; \
fi
${ECHO_CMD} hpaio >> ${PREFIX}/etc/sane.d/dll.conf
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View file

@ -1,3 +0,0 @@
MD5 (hplip-3.10.2.tar.gz) = 4df6f16c47ae7edd015bf2cf5155f26f
SHA256 (hplip-3.10.2.tar.gz) = bb9a3aeda9a8d31f0cc790e629f14d2122f9bff111b0d3cc97ac19a8607d7956
SIZE (hplip-3.10.2.tar.gz) = 21446275

View file

@ -1,41 +0,0 @@
--- Makefile.in.old 2010-03-28 15:07:10.000000000 -0600
+++ Makefile.in 2010-03-28 15:08:01.000000000 -0600
@@ -89,8 +89,8 @@
# ip library
@HPLIP_BUILD_TRUE@am__append_1 = libhpmud.la libhpip.la
@HPLIP_BUILD_TRUE@hp_mkuri_PROGRAMS = hp-mkuri$(EXEEXT)
-@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_TRUE@am__append_2 = data/rules/40-hplip.rules
-@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_FALSE@am__append_3 = data/rules/55-hpmud.rules
+#@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_TRUE@am__append_2 = data/rules/40-hplip.rules
+#@HPLIP_BUILD_TRUE@@UDEV_ACL_RULES_FALSE@am__append_3 = data/rules/55-hpmud.rules
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@am__append_4 = \
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@ scan/sane/hpaio.desc \
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@ prnt/drv/hpijs.drv.in.template \
@@ -2041,8 +2041,8 @@
ppd/hpcups/hp-psc_950vr.ppd.gz ppd/hpcups/hp-psc_950xi.ppd.gz
am__dist_prnt_DATA_DIST = prnt/cups.py prnt/__init__.py prnt/ldl.py \
prnt/pcl.py prnt/colorcal.py
-am__dist_rules_DATA_DIST = data/rules/56-hpmud_support.rules \
- data/rules/40-hplip.rules data/rules/55-hpmud.rules
+#am__dist_rules_DATA_DIST = data/rules/56-hpmud_support.rules \
+# data/rules/40-hplip.rules data/rules/55-hpmud.rules
am__dist_scan_DATA_DIST = scan/__init__.py scan/sane.py
am__dist_ui_DATA_DIST = ui/alignform.py ui/colorcalform_base.py \
ui/colorcalform.py ui/coloradjform_base.py ui/coloradjform.py \
@@ -3777,11 +3777,11 @@
@HPLIP_BUILD_TRUE@hp_mkuri_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\"
# hpmud.rules
-@HPLIP_BUILD_TRUE@rulesdir = /etc/udev/rules.d
-@HPLIP_BUILD_TRUE@dist_rules_DATA = data/rules/56-hpmud_support.rules \
-@HPLIP_BUILD_TRUE@ $(am__append_2) $(am__append_3)
-@HPLIP_BUILD_TRUE@halpredir = /usr/share/hal/fdi/preprobe/10osvendor
-@HPLIP_BUILD_TRUE@dist_halpre_DATA = data/rules/20-hplip-devices.fdi
+#@HPLIP_BUILD_TRUE@rulesdir = /etc/udev/rules.d
+#@HPLIP_BUILD_TRUE@dist_rules_DATA = data/rules/56-hpmud_support.rules \
+#@HPLIP_BUILD_TRUE@ $(am__append_2) $(am__append_3)
+#@HPLIP_BUILD_TRUE@halpredir = /usr/share/hal/fdi/preprobe/10osvendor
+#@HPLIP_BUILD_TRUE@dist_halpre_DATA = data/rules/20-hplip-devices.fdi
# hplip.conf
@HPLIP_BUILD_TRUE@hplip_confdir = /etc/hp

View file

@ -1,21 +0,0 @@
Index: io/hpmud/musb.c
@@ -122,10 +122,16 @@
{
ret = usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, (USB_DT_STRING << 8) + index,
0x409, tbuf, sizeof(tbuf), LIBUSB_CONTROL_REQ_TIMEOUT);
- if (ret==0)
+ if (ret==0
+#ifdef __FreeBSD__
+ || ret == -EIO
+#endif
+ )
{
- /* This retry is necessary for lj1000 and lj1005. des 12/12/07 */
- BUG("get_string_descriptor zero result, retrying...");
+ /* This retry is necessary for lj1000 and lj1005. des 12/12/07
+ Also HP Photosmart 42xx seems to suffer transient errors with serial id */
+ BUG("get_string_descriptor error result %d, retrying in 2 secs...", ret);
+ sleep(2);
continue;
}
break;

View file

@ -1,8 +0,0 @@
HPLIP is an HP developed solution for printing, scanning,
and faxing with HP inkjet and laser based printers in Linux.
The HP driver project provides printing support for nearly
1000 printer models, including Deskjet, Officejet, Photosmart,
PSC (Print Scan Copy), Business Inkjet, LaserJet, and LaserJet MFP.
WWW: http://hplipopensource.com/hplip-web/index.html

File diff suppressed because it is too large Load diff