summaryrefslogtreecommitdiff
path: root/print/hplip3/files
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2006-05-05 08:35:30 +0000
committerPav Lucistnik <pav@FreeBSD.org>2006-05-05 08:35:30 +0000
commit90cd7e494b898b37f552addf952a4ebe5926c62b (patch)
treeff9ac5019a3e4ea132b20a070134401b4de2ccd6 /print/hplip3/files
parentThe port uses -msse compiler option, which I've disabled by ports/95552 to make (diff)
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://hplip.sourceforge.net/ PR: ports/96271 Submitted by: Anish Mistry <amistry@am-productions.biz>
Notes
Notes: svn path=/head/; revision=161391
Diffstat (limited to 'print/hplip3/files')
-rw-r--r--print/hplip3/files/hpiod.sh.in32
-rw-r--r--print/hplip3/files/hpssd.sh.in35
-rw-r--r--print/hplip3/files/patch-Makefile.in79
-rw-r--r--print/hplip3/files/patch-configure34
-rw-r--r--print/hplip3/files/patch-io_hpiod24
-rw-r--r--print/hplip3/files/patch-io_hpiod_device.cpp276
-rw-r--r--print/hplip3/files/patch-io_hpiod_device.h12
-rw-r--r--print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp13
8 files changed, 505 insertions, 0 deletions
diff --git a/print/hplip3/files/hpiod.sh.in b/print/hplip3/files/hpiod.sh.in
new file mode 100644
index 000000000000..8e2bee4637e9
--- /dev/null
+++ b/print/hplip3/files/hpiod.sh.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PROVIDE: hpiod
+# REQUIRE: NETWORKING
+# KEYWORD: FreeBSD shutdown
+
+[ -z "${hpiod_enable}" ] && hpiod_enable="NO"
+
+. /etc/rc.subr
+
+prefix=%%PREFIX%%
+
+name=hpiod
+pidfile="/var/run/${name}.pid"
+portfile="/var/run/${name}.port"
+hpiod_user=hplip
+command="${prefix}/sbin/${name}"
+start_precmd="hpiod_prestart"
+
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+hpiod_prestart()
+{
+ touch ${pidfile}
+ touch ${portfile}
+ chown ${hpiod_user} ${pidfile}
+ chown ${hpiod_user} ${portfile}
+}
+
+run_rc_command $*
diff --git a/print/hplip3/files/hpssd.sh.in b/print/hplip3/files/hpssd.sh.in
new file mode 100644
index 000000000000..4e7dc15f11b0
--- /dev/null
+++ b/print/hplip3/files/hpssd.sh.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# PROVIDE: hpssd
+# REQUIRE: hpiod
+# BEFORE: cupsd
+# KEYWORD: FreeBSD shutdown
+
+[ -z "${hpssd_enable}" ] && hpssd_enable="NO"
+
+. /etc/rc.subr
+
+prefix=%%PREFIX%%
+
+name=hpssd
+pidfile="/var/run/${name}.pid"
+portfile="/var/run/${name}.port"
+hpssd_user=nobody
+command="${prefix}/sbin/${name}"
+command_interpreter="$prefix/bin/python"
+command_args=">/dev/null"
+start_precmd="hpssd_prestart"
+
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+hpssd_prestart()
+{
+ touch ${pidfile}
+ touch ${portfile}
+ chown ${hpssd_user} ${pidfile}
+ chown ${hpssd_user} ${portfile}
+}
+
+run_rc_command $*
diff --git a/print/hplip3/files/patch-Makefile.in b/print/hplip3/files/patch-Makefile.in
new file mode 100644
index 000000000000..b96eda6ffb3e
--- /dev/null
+++ b/print/hplip3/files/patch-Makefile.in
@@ -0,0 +1,79 @@
+--- Makefile.in.orig Thu Mar 23 22:35:33 2006
++++ Makefile.in Mon Apr 24 09:15:54 2006
+@@ -1973,15 +1973,9 @@
+ #
+ # Do full install if not rpm_install.
+ if [ "$(rpm_install)" = "no" ]; then \
+- ln -sf ../$(SOLONG) $(DESTDIR)$(sanedir)/$(SONOVER); \
+- ln -sf ../$(SOLONG) $(DESTDIR)$(sanedir)/$(SOSHORT); \
+- ln -sf ../$(SOLONG) $(DESTDIR)$(sanedir)/$(SOLONG); \
+- if [ -f $(DESTDIR)/etc/sane.d/dll.conf ]; then \
+- if ! grep ^hpaio $(DESTDIR)/etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \
+- echo "Adding hpaio entry to /etc/sane.d/dll.conf." ; \
+- echo hpaio >>$(DESTDIR)/etc/sane.d/dll.conf ; \
+- fi \
+- fi \
++ ln -sf $(prefix)/lib/$(SOSHORT) $(DESTDIR)$(sanedir)/$(SONOVER); \
++ ln -sf $(prefix)/lib/$(SOSHORT) $(DESTDIR)$(sanedir)/$(SOSHORT); \
++ ln -sf $(prefix)/lib/$(SOSHORT) $(DESTDIR)$(sanedir)/$(SOLONG); \
+ fi
+
+ install-data-hook: test-destdir
+@@ -2039,30 +2033,31 @@
+ newname=$${i%.*}; \
+ mv $(DESTDIR)$(hplipdir)/$$i $(DESTDIR)$(hplipdir)/$$newname; \
+ if [ "$(rpm_install)" = "no" ]; then \
+- ln -sf ../share/$(PACKAGE)/$$newname $(DESTDIR)$(bindir)/hp-$$newname; \
++ ln -sf $(prefix)/share/$(PACKAGE)/$$newname $(DESTDIR)$(bindir)/hp-$$newname; \
+ fi \
+ done
+ #
+ # Edit hpiod.conf in destdir.
+ echo -e "\n[$(PACKAGE)]\nversion=$(VERSION)\njdprobe=0\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf
+ echo -e "[dirs]\nhome=$(hplipdir)\nrun=$(rundir)\nppd=$(hpppddir)\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf
+- echo -ne "# Following values are determined at configure time and cannot be changed.\n[configure]\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf
++ echo "# Following values are determined at configure time and cannot be changed." >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf
++ echo "[configure]" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf
+ if [ "$(rpm_install)" = "yes" ]; then \
+- echo -ne "rpm-install=1\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
++ echo "rpm-install=1" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
+ else \
+- echo -ne "rpm-install=0\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
++ echo "rpm-install=0" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
+ fi
+ if [ "$(network_build)" = "yes" ]; then \
+- echo -ne "network-build=1\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
++ echo "network-build=1" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
+ else \
+- echo -ne "network-build=0\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
++ echo "network-build=0" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
+ fi
+ if [ "$(pp_build)" = "yes" ]; then \
+- echo -ne "pp-build=1\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
++ echo "pp-build=1" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
+ else \
+- echo -ne "pp-build=0\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
++ echo "pp-build=0" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf; \
+ fi
+- echo -ne "internal-tag=$(PACKAGE_BUGREPORT)\n" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf;
++ echo "internal-tag=$(PACKAGE_BUGREPORT)" >> $(DESTDIR)$(hplipdir)/$(PACKAGE).conf;
+
+ #
+ # Edit hpiod.sh in destdir.
+@@ -2074,16 +2069,6 @@
+ if [ "$(rpm_install)" = "no" ]; then \
+ $(mkinstalldirs) $(DESTDIR)/etc/hp; \
+ $(INSTALL_DATA) $(DESTDIR)$(hplipdir)/$(PACKAGE).conf $(DESTDIR)/etc/hp; \
+- if [ -d $(DESTDIR)/etc/init.d ]; then \
+- $(INSTALL_SCRIPT) $(DESTDIR)$(hplipdir)/$(PACKAGE) $(DESTDIR)/etc/init.d; \
+- if [ "$(DESTDIR)" = "" ]; then \
+- if [ "$(INSTALLINITD)" != "" ]; then \
+- $(INSTALLINITD) $(PACKAGE); \
+- else \
+- $(CHKCONFIG) $(PACKAGE) reset; \
+- fi \
+- fi \
+- fi \
+ fi
+ #
+ # For internal testing.
diff --git a/print/hplip3/files/patch-configure b/print/hplip3/files/patch-configure
new file mode 100644
index 000000000000..22f040c1d5c1
--- /dev/null
+++ b/print/hplip3/files/patch-configure
@@ -0,0 +1,34 @@
+--- configure.bak Fri May 5 10:01:57 2006
++++ configure Fri May 5 10:03:39 2006
+@@ -22100,29 +22100,9 @@
+ echo "$as_me:$LINENO: result: \"using $CUPS_BACKEND_PATH\"" >&5
+ echo "${ECHO_T}\"using $CUPS_BACKEND_PATH\"" >&6
+
+-ICONSEARCHPATH="/usr/lib/menu /usr/share/applications"
+-ICON="hplip hplip.desktop"
++ICON_PATH="/usr/share/applications"
++ICON_FILE="hplip.desktop"
+
+-echo "$as_me:$LINENO: checking \"for icon directory\"" >&5
+-echo $ECHO_N "checking \"for icon directory\"... $ECHO_C" >&6
+-ICON_PATH=""
+-ICON_FILE=""
+-idx=1
+-for i in $ICONSEARCHPATH; do
+- if test -d "$i"; then
+- ICON_PATH="$i"
+- jdx=1
+- for j in $ICON; do
+- if test "$jdx" = "$idx"; then
+- break
+- fi
+- jdx=$jdx+1
+- done
+- ICON_FILE="$j"
+- break
+- fi
+- idx=$idx+1
+-done
+ if test "$ICON_PATH" != ""; then
+ echo "$as_me:$LINENO: result: \"using $ICON_PATH/$ICON_FILE\"" >&5
+ echo "${ECHO_T}\"using $ICON_PATH/$ICON_FILE\"" >&6
diff --git a/print/hplip3/files/patch-io_hpiod b/print/hplip3/files/patch-io_hpiod
new file mode 100644
index 000000000000..eea8422eed52
--- /dev/null
+++ b/print/hplip3/files/patch-io_hpiod
@@ -0,0 +1,24 @@
+diff -ruN io/hpiod.orig/usbext.c io/hpiod/usbext.c
+--- io/hpiod.orig/usbext.c Sat Apr 1 16:11:45 2006
++++ io/hpiod/usbext.c Sat Apr 1 16:10:29 2006
+@@ -33,7 +33,7 @@
+ int fd;
+ };
+
+-#if defined(__APPLE__) && defined(__MACH__)
++#if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__)
+
+ #else
+
+diff -ruN io/hpiod.orig/usbext.h io/hpiod/usbext.h
+--- io/hpiod.orig/usbext.h Sat Apr 1 16:11:45 2006
++++ io/hpiod/usbext.h Sat Apr 1 16:05:57 2006
+@@ -32,7 +32,7 @@
+ #include <sys/time.h>
+ #include <usb.h>
+
+-#if defined(__APPLE__) && defined(__MACH__)
++#if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__)
+ #else
+ #include <linux/usbdevice_fs.h>
+
diff --git a/print/hplip3/files/patch-io_hpiod_device.cpp b/print/hplip3/files/patch-io_hpiod_device.cpp
new file mode 100644
index 000000000000..1a9b2ead672d
--- /dev/null
+++ b/print/hplip3/files/patch-io_hpiod_device.cpp
@@ -0,0 +1,276 @@
+--- io/hpiod/device.cpp.orig Fri Mar 3 00:07:26 2006
++++ io/hpiod/device.cpp Wed Apr 5 02:57:32 2006
+@@ -25,6 +25,9 @@
+ \*****************************************************************************/
+
+ #include "hpiod.h"
++#ifdef __FreeBSD__
++#include <dev/usb/usb.h>
++#endif
+
+ const unsigned char Venice_Power_On[] = {0x1b, '%','P','u','i','f','p','.',
+ 'p','o','w','e','r',' ','1',';',
+@@ -109,6 +112,244 @@
+ return -2;
+ }
+
++#elif defined(__FreeBSD__)
++
++int Device::Write(int fd, const void *buf, int size)
++{
++ int nwrote, total, write_len, r, ep, endpoint_fd;
++ void *tmp_buf = (void *)buf;
++ fd_set ready;
++ char *pEndPoint = NULL;
++
++ if (FD[fd].pHD == NULL)
++ {
++ syslog(LOG_ERR, "invalid Device::Write state: %s %s %d\n", URI,__FILE__, __LINE__);
++ return -1;
++ }
++
++ if ((ep = GetOutEP(dev, FD[fd].Config, FD[fd].Interface, FD[fd].AltSetting, USB_ENDPOINT_TYPE_BULK)) < 0)
++ {
++ syslog(LOG_ERR, "invalid bulk out endpoint %s %s %d\n", URI, __FILE__, __LINE__);
++ return -1;
++ }
++
++ /* We only want the address, so mask out the direction bits */
++ ep = (ep & USB_ENDPOINT_ADDRESS_MASK);
++ /* open endpoint */
++ /* allocate data for the usb endpoint string */
++ pEndPoint = (char *)malloc(strlen(dev->filename)+20);
++ if(!pEndPoint)
++ return -1;
++ /* create device endpoint name string */
++ sprintf(pEndPoint, "%s.%d", dev->filename, ep);
++
++ /* open the endpoint with read write access */
++ endpoint_fd = open(pEndPoint, O_WRONLY, 0);
++ free(pEndPoint);
++ if(endpoint_fd < 0)
++ {
++ /* we failed to open the endpoint */
++ return -1;
++ }
++
++ total = size;
++ write_len = size;
++
++ while (total > 0)
++ {
++ FD_ZERO(&ready);
++ FD_SET(endpoint_fd, &ready);
++
++ if (!FD_ISSET(endpoint_fd, &ready))
++ {
++ close(endpoint_fd);
++ return -1;
++ }
++ nwrote = write(endpoint_fd, tmp_buf, write_len);
++
++ if (nwrote < 0)
++ {
++ close(endpoint_fd);
++ return -1;
++ }
++
++ write_len -= nwrote;
++ tmp_buf = (void *)((long)tmp_buf + nwrote);
++ total -= nwrote;
++ }
++
++ close(endpoint_fd);
++ return size;
++}
++
++int Device::Read(int fd, void *buf, int size, int usec)
++{
++ int nwrote, total, r, ep=0, endpoint_fd, i;
++ struct timeval t1, t2;
++ fd_set ready;
++ char *pEndPoint = NULL;
++ int bytes_want = 0;
++ int rlen = 0;
++ int bytes_read = 0;
++ int mili_timeout = usec/10;
++ unsigned char *pbuf_pos = NULL;
++ int total_usec, tmo_usec = usec;
++
++ if (FD[fd].pHD == NULL)
++ {
++ syslog(LOG_ERR, "invalid Device::Read state: %s %s %d\n", URI,__FILE__, __LINE__);
++ return -1;
++ }
++
++ if ((ep = GetInEP(dev, FD[fd].Config, FD[fd].Interface, FD[fd].AltSetting, USB_ENDPOINT_TYPE_BULK)) < 0)
++ {
++ syslog(LOG_ERR, "invalid bulk in endpoint %s %s %d\n", URI, __FILE__, __LINE__);
++ return -1;
++ }
++
++ /* We only want the address, so mask out the direction bits */
++ ep = (ep & USB_ENDPOINT_ADDRESS_MASK);
++ /* open endpoint */
++ /* allocate data for the usb endpoint string */
++ pEndPoint = (char *)malloc(strlen(dev->filename)+20);
++ if(!pEndPoint)
++ return -1;
++ /* create device endpoint name string */
++ sprintf(pEndPoint, "%s.%d", dev->filename, ep);
++
++ /* open the endpoint with read write access */
++ endpoint_fd = open(pEndPoint, O_RDONLY, 0);
++ if(endpoint_fd < 0)
++ {
++ /* we failed to open the endpoint */
++ syslog(LOG_ERR, "unable to open bulk in endpoint (%s) %s %s %d\n", pEndPoint, URI, __FILE__, __LINE__);
++ free(pEndPoint);
++ return -1;
++ }
++ free(pEndPoint);
++
++ /* set short transfer so that we can allow "short" reads since we
++ will don't know exactly
++ what is coming so we can't specify exact byte amounts */
++ i = 1;
++ if (ioctl(endpoint_fd, USB_SET_SHORT_XFER, &i) < 0)
++ {
++ syslog(LOG_ERR, "USB_SET_SHORT_XFER set failed Device::Read : %s %s %d\n", URI,__FILE__, __LINE__);
++ }
++
++ /* 0 timeout value will cause us the wait until the device has data
++ available or is disconnected */
++ if (ioctl(endpoint_fd, USB_SET_TIMEOUT, &mili_timeout) < 0)
++ {
++ syslog(LOG_ERR, "USB_SET_TIMEOUT set failed Device::Read : %s %s %d\n", URI,__FILE__, __LINE__);
++ }
++
++ gettimeofday (&t1, NULL); /* get start time */
++
++ if (FD[fd].ucnt > 0)
++ {
++ /* copy buffered data to storage */
++ if (size <= FD[fd].ucnt)
++ {
++ memcpy(buf, FD[fd].ubuf, size);
++ FD[fd].uindex += size;
++ FD[fd].ucnt -= size;
++ bytes_read = size;
++ }
++ else
++ {
++ memcpy(buf, FD[fd].ubuf, FD[fd].ucnt);
++ bytes_read += FD[fd].ucnt;
++ FD[fd].ucnt = 0;
++ }
++ }
++ else if (FD[fd].ucnt == 0 && bytes_read < size)
++ {
++ /* reset data buffer */
++ FD[fd].uindex = 0;
++ /* offset storage to not overwrite data copied from the buffer */
++ pbuf_pos = (unsigned char *)((long)buf + bytes_read);
++ bytes_want = size - bytes_read;
++ do
++ {
++ if (bytes_want >= BUFFER_SIZE)
++ {
++ /* check to see if the device is ready for a read */
++ FD_ZERO(&ready);
++ FD_SET(endpoint_fd, &ready);
++ if (!FD_ISSET(endpoint_fd, &ready))
++ {
++ syslog(LOG_ERR, "timeout Device::Read : %s %s %d\n", URI,__FILE__, __LINE__);
++ errno = ETIMEDOUT;
++ return -1;
++ }
++ /* read directly into storage */
++ rlen = read(endpoint_fd, pbuf_pos, BUFFER_SIZE);
++ if (rlen < 0)
++ {
++ syslog(LOG_ERR, "error Device::Read : %s %s %d\n", URI,__FILE__, __LINE__);
++ return -1;
++ }
++ bytes_read += rlen;
++ bytes_want -= rlen;
++ pbuf_pos += rlen;
++ }
++ else if (bytes_want < BUFFER_SIZE)
++ {
++ /* check to see if the device is ready for a read */
++ FD_ZERO(&ready);
++ FD_SET(endpoint_fd, &ready);
++ if (!FD_ISSET(endpoint_fd, &ready))
++ {
++ syslog(LOG_ERR, "timeout Device::Read : %s %s %d\n", URI,__FILE__, __LINE__);
++ errno = ETIMEDOUT;
++ return -1;
++ }
++ /* read to buffer */
++ rlen = read(endpoint_fd, FD[fd].ubuf, BUFFER_SIZE);
++ if (rlen < 0)
++ {
++ syslog(LOG_ERR, "error Device::Read : %s %s %d\n", URI,__FILE__, __LINE__);
++ return -1;
++ }
++ if (rlen >= bytes_want)
++ {
++ memcpy(pbuf_pos, FD[fd].ubuf,
++ bytes_want);
++ FD[fd].uindex += bytes_want;
++ FD[fd].ucnt = rlen - bytes_want;
++ bytes_read += bytes_want;
++ bytes_want = 0;
++ }
++ else
++ {
++ memcpy(pbuf_pos, FD[fd].ubuf, rlen);
++ bytes_want -= rlen;
++ bytes_read += rlen;
++ pbuf_pos += rlen;
++ }
++ }
++ /* Bulk_read has a timeout, but bulk_read can return zero byte packet(s), so we must use our own timeout here. */
++ gettimeofday(&t2, NULL); /* get current time */
++
++ total_usec = (t2.tv_sec - t1.tv_sec)*1000000;
++ total_usec += (t2.tv_usec > t1.tv_usec) ? t2.tv_usec - t1.tv_usec : t1.tv_usec - t2.tv_usec;
++ if (total_usec > usec)
++ {
++ size = -1; /* timeout */
++ errno = ETIMEDOUT;
++ break;
++ }
++ tmo_usec = usec - total_usec; /* decrease timeout */
++ continue;
++ }
++ while (bytes_want > 0);
++ }
++
++ close(endpoint_fd);
++ return size;
++}
++
+ #else
+
+ /*
+@@ -589,7 +830,8 @@
+
+ if (FD[fd].urb_write_active)
+ {
+-#if defined(__APPLE__) && defined(__MACH__)
++#if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__)
++ syslog(LOG_ERR, "danger! Device::ReleaseInterface, releasing an interface with an active write %s: %s %d\n", URI, __FILE__, __LINE__);
+ #else
+ usb_reap_urb_ex(FD[fd].pHD, &FD[fd].urb_write);
+ #endif
+@@ -913,7 +1155,7 @@
+ /* Make sure uri model still matches device id model. */
+ pSys->GetURIModel(URI, uriModel, sizeof(uriModel));
+ pSys->GetModel(ID, model, sizeof(model));
+- if (strcmp(uriModel, model) != 0)
++ if (strcasecmp(uriModel, model) != 0)
+ {
+ *result = R_INVALID_DEVICE_NODE; /* found different device plugged in */
+ syslog(LOG_ERR, "invalid model %s != %s Device::Open %s %d\n", uriModel, model, __FILE__, __LINE__);
diff --git a/print/hplip3/files/patch-io_hpiod_device.h b/print/hplip3/files/patch-io_hpiod_device.h
new file mode 100644
index 000000000000..de0796b353ee
--- /dev/null
+++ b/print/hplip3/files/patch-io_hpiod_device.h
@@ -0,0 +1,12 @@
+--- io/hpiod/device.h.orig Tue Feb 28 19:40:55 2006
++++ io/hpiod/device.h Sun Apr 2 23:38:58 2006
+@@ -72,6 +72,9 @@
+ int AltSetting;
+ int urb_write_active; /* 0=no, 1=yes */
+ #if defined(__APPLE__) && defined(__MACH__)
++
++#elif defined(__FreeBSD__)
++
+ #else
+ struct usbdevfs_urb urb_write; /* host to device */
+ struct usbdevfs_urb urb_read; /* device to host */
diff --git a/print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp b/print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp
new file mode 100644
index 000000000000..60453cb6c9a3
--- /dev/null
+++ b/print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp
@@ -0,0 +1,13 @@
+--- prnt/hpijs/hpijsfax.cpp.orig Sat Apr 1 16:35:53 2006
++++ prnt/hpijs/hpijsfax.cpp Sat Apr 1 16:37:36 2006
+@@ -297,8 +297,8 @@
+
+ memset (&tv, 0, sizeof (tv));
+ gettimeofday (&tv, NULL);
+- cur_time = localtime (&tv.tv_sec);
+- memset (hpFileName, 0, 256);
++ cur_time = localtime ((const time_t *)&tv.tv_sec);
++ memset (hpFileName, 0, 256);
+ sprintf (hpFileName, "%s/hplipfax%d%d%d%d%d%d.g3", getenv ("TMPDIR"),
+ cur_time->tm_year+1900, cur_time->tm_mon+1, cur_time->tm_mday,
+ cur_time->tm_hour, cur_time->tm_min, cur_time->tm_sec);