Package-Name: hplip
Gentoo-Package: net-print/hplip
Requires: libusb cups python
Rebuild-For: openssl net-snmp sane-backends
Homepage: http://hpinkjet.sourceforge.net/
Source: sourceforge:///hpinkjet/hplip-(\d+(.\d+)+).tar.gz $1
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	cp -pf COPYING "$(PREFIX)/"
	$(MAKE) -f ../Makefile configure CONFIGURE_OPTS="--enable-rpm-install --disable-network-build"
	$(MAKE)
	rm -rf "$(PREFIX)"/share/hplip/data
# FIXME: python setup.py install (in prnt/ and pcard/pcardext/) touches python install directory
	$(MAKE) install foomatichook= cupshook=
	rm -rf "$(PREFIX)"/share/doc "$(PREFIX)"/share/ppd
	mkdir -p "$(PREFIX)"/share/ppd
	cp -p prnt/hpijs/ppd/*.ppd "$(PREFIX)"/share/ppd/
	mkdir -p "$(PREFIX)"/etc
	test -f "$(PREFIX)"/etc/hplip.conf || cp -pf "$(PREFIX)"/share/hplip/hplip.conf "$(PREFIX)"/etc/
	perl -pi -e 's,^HPIODDIR=.*,HPIODDIR="$(PREFIX)/sbin",; s,^HPSSDDIR=.*,HPSSDDIR="$(PREFIX)/share/hplip",;' "$(PREFIX)"/share/hplip/hplip.sh
Install:
	$(MAKE) instbin BIN=hpijs
	$(MAKE) instlib LIB=hpip
	rm -f /usr/share/cups/model/HP*hpijs*.ppd*
	ln -vs "$(PREFIX)"/share/ppd/HP*hpijs*.ppd* /usr/share/cups/model/
	if test -d /usr/lib/sane ; then \
		rm -f /usr/lib/sane/libsane-hpaio* ; \
		ln -vs "$(PREFIX)"/lib/libsane-hpaio.so* /usr/lib/sane/ ; \
	fi
	$(MAKE) instetc DEST=hp ETC=hplip.conf
	$(MAKE) instinit SRC=share/hplip/hplip.sh DEST=hplip S=3/70
NoPatch: <<EOT
######## begin no-SNMP patch
--- io/hpiod/system.cpp.old	2005-09-23 04:40:00 +0900
+++ io/hpiod/system.cpp	2005-10-28 12:57:14 +0900
@@ -826,13 +826,13 @@
 
 #else
 
-int System::SetSnmp(char *ip, int port, char *szoid, int type, unsigned char *buffer, int size, int *pml_result, int *result)
+int System::SetSnmp(char *ip, int port, char *szoid, int type, unsigned char *buffer, unsigned int size, int *pml_result, int *result)
 {
    syslog(LOG_ERR, "no JetDirect support enabled\n");
    return 0;
 }
 
-int System::GetSnmp(char *ip, int port, char *szoid, unsigned char *buffer, int size, int *type, int *pml_result, int *result)
+int System::GetSnmp(char *ip, int port, char *szoid, unsigned char *buffer, unsigned int size, int *type, int *pml_result, int *result)
 {
    syslog(LOG_ERR, "no JetDirect support enabled\n");
    return 0;
######## end no-SNMP patch
EOT
NoPatch: <<EOT
######## begin no icon install patch
--- Makefile.am.old	2005-02-03 03:06:08 +0900
+++ Makefile.am	2005-02-15 03:29:41 +0900
@@ -152,8 +152,10 @@
 	   echo -e "                longtitle=\"HPLIP Device Manager\" \\" >> $(srcdir)/$(ICON_FILE); \
 	   echo -e "                mimetypes=\"\" accept_url=\"false\" multiple_files=\"true\"" >> $(srcdir)/$(ICON_FILE); \
 	fi
-	$(INSTALL_DATA)  $(srcdir)/$(ICON_FILE) $(DESTDIR)$(icondir); \
-	rm -f $(srcdir)/$(ICON_FILE)
+	if [ -f "$(srcdir)/$(ICON_FILE)" ] ; then \
+	   $(INSTALL_DATA)  $(srcdir)/$(ICON_FILE) $(DESTDIR)$(icondir); \
+	   rm -f $(srcdir)/$(ICON_FILE) ; \
+	fi
 #
 #       Do full install if not rpm_install.
 	if [ "$(rpm_install)" = "no" ]; then \
--- Makefile.in.old	2005-02-09 09:14:12 +0900
+++ Makefile.in	2005-02-15 03:29:44 +0900
@@ -1706,8 +1706,10 @@
 	   echo -e "                longtitle=\"HPLIP Device Manager\" \\" >> $(srcdir)/$(ICON_FILE); \
 	   echo -e "                mimetypes=\"\" accept_url=\"false\" multiple_files=\"true\"" >> $(srcdir)/$(ICON_FILE); \
 	fi
-	$(INSTALL_DATA)  $(srcdir)/$(ICON_FILE) $(DESTDIR)$(icondir); \
-	rm -f $(srcdir)/$(ICON_FILE)
+	if [ -f "$(srcdir)/$(ICON_FILE)" ] ; then \
+	   $(INSTALL_DATA)  $(srcdir)/$(ICON_FILE) $(DESTDIR)$(icondir); \
+	   rm -f $(srcdir)/$(ICON_FILE) ; \
+	fi
 #
 #       Do full install if not rpm_install.
 	if [ "$(rpm_install)" = "no" ]; then \
######## end no icon install patch
EOT

-/etc/hp/hplip.conf
/etc/hp/
/etc/rc.d/init.d/hplip
/pkg/hplip/
/pkg/python/lib/python*/site-packages/cupsext.so
/pkg/python/lib/python*/site-packages/pcardext.so
/usr/bin/hpijs
/usr/lib/libhpip.*
/usr/lib/sane/libsane-hpaio.*
/usr/share/cups/model/HP*hpijs*.ppd*
