Index: head/print/hplip-plugin/Makefile =================================================================== --- head/print/hplip-plugin/Makefile (revision 411552) +++ head/print/hplip-plugin/Makefile (revision 411553) @@ -1,82 +1,74 @@ # Created by: amistry@am-productions.biz # $FreeBSD$ PORTNAME= hplip-plugin PORTVERSION= 3.16.2 +PORTREVISION= 1 CATEGORIES= print MASTER_SITES= http://hplipopensource.com/hplip-web/plugin/ DISTNAME= hplip-${DISTVERSION}-plugin EXTRACT_SUFX= .run MAINTAINER= makc@FreeBSD.org COMMENT= Binary plugin for some HP Printers and All-in-One devices +LICENSE= HPLIP_PLUGIN +LICENSE_NAME= HPLIP Driver Plug-in License +LICENSE_PERMS= none +LICENSE_FILE= ${WRKSRC}/license.txt + RUN_DEPENDS= hp-plugin:${PORTSDIR}/print/hplip RESTRICTED= License agreement is required -USES= python -NO_BUILD= yes -WRKSRC= ${WRKDIR}/plugin_tmp -HPLIP_FAKEDIR= ${WRKDIR}/hplip_fakedir +ONLY_FOR_ARCHS= amd64 i386 # arm -ONLY_FOR_ARCHS= amd64 i386 - -PLUGIN_LINKS= fax/plugins/fax_marvell \ +PLUGINS= fax/plugins/fax_marvell \ prnt/plugins/hbpl1 \ prnt/plugins/lj \ scan/plugins/bb_escl \ scan/plugins/bb_marvell \ scan/plugins/bb_soap \ scan/plugins/bb_soapht -PLUGIN_DIRS= data/firmware \ - data/plugins \ - fax/plugins \ - prnt/plugins \ - scan/plugins - PLIST_SUB+= LINARCH="${LINARCH}" .include .if ${ARCH} == "i386" LINARCH= x86_32 .elif ${ARCH} == "amd64" LINARCH= x86_64 .endif do-extract: - @${MKDIR} ${WRKDIR} - @(cd ${WRKDIR} && ${SH} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \ - --keep --noexec --nox11) + @${SH} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \ + --keep --noexec --nox11 --target ${WRKSRC} -post-patch: - @${REINPLACE_CMD} -e 's|ok, ans = tui.enter_yes_no.*|ok, ans = 1, 1|' \ - -e 's|/etc/hp|${HPLIP_FAKEDIR}|' \ - ${WRKSRC}/plugin_install.py \ - ${WRKSRC}/installPlugin.py +do-build: + ${CC} ${CFLAGS} -Wall -fPIC -c ${FILESDIR}/wrap.c -o ${WRKSRC}/wrap.o +.for p in ${PLUGINS} + (cd ${WRKSRC} && ${BRANDELF} -t FreeBSD ${p:T}-${LINARCH}.so && \ + ${CC} ${CFLAGS} ${LDFLAGS} -shared -fPIC -o ${p:T}.so wrap.o \ + ${p:T}-${LINARCH}.so -Wl,-rpath,${PREFIX}/share/hplip/${p:H}) +.endfor do-install: -# fake hplip installation - ${MKDIR} ${HPLIP_FAKEDIR} - ${SED} -e 's,${LOCALBASE}/share/hplip,${HPLIP_FAKEDIR},' \ - ${LOCALBASE}/etc/hp/hplip.conf > ${HPLIP_FAKEDIR}/hplip.conf - ${MKDIR} ${HPLIP_FAKEDIR} - ${LN} -sf ${LOCALBASE}/share/hplip/base ${HPLIP_FAKEDIR} - ${LN} -sf ${LOCALBASE}/share/hplip/prnt ${HPLIP_FAKEDIR} - ${CP} -R ${LOCALBASE}/share/hplip/installer ${HPLIP_FAKEDIR} - ${REINPLACE_CMD} -e 's,HOMEDIR = .*,HOMEDIR = "${STAGEDIR}${PREFIX}/share/hplip",' \ - -e 's,/var/lib/hp/hplip.state,${STAGEDIR}&,' \ - ${HPLIP_FAKEDIR}/installer/pluginhandler.py \ - ${HPLIP_FAKEDIR}/installer/core_install.py - ${MKDIR} ${STAGEDIR}/var/lib/hp -# install hplip-plugin - ${MKDIR} ${PLUGIN_DIRS:S,^,${STAGEDIR}${PREFIX}/share/hplip/,} - (cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} -B \ - plugin_install.py -i) -.for i in ${PLUGIN_LINKS} - ${LN} -sf ${i:T}-${LINARCH}.so ${STAGEDIR}${PREFIX}/share/hplip/${i}.so + ${MKDIR} ${STAGEDIR}${PREFIX}/share/hplip/data/firmware + ${INSTALL_DATA} ${WRKSRC}/*.fw.gz \ + ${STAGEDIR}${PREFIX}/share/hplip/data/firmware + ${MKDIR} ${PLUGINS:H:S,^,${STAGEDIR}${PREFIX}/share/hplip/,} +.for p in ${PLUGINS} + ${INSTALL_LIB} ${WRKSRC}/${p:T}-${LINARCH}.so \ + ${STAGEDIR}${PREFIX}/share/hplip/${p}-${LINARCH}.so + ${INSTALL_LIB} ${WRKSRC}/${p:T}.so \ + ${STAGEDIR}${PREFIX}/share/hplip/${p}.so .endfor + ${INSTALL_DATA} ${WRKSRC}/plugin.spec ${STAGEDIR}${PREFIX}/share/hplip + ${MKDIR} ${STAGEDIR}/var/lib/hp + ${ECHO_CMD} '[plugin]' > ${STAGEDIR}/var/lib/hp/hplip.state + ${ECHO_CMD} 'installed = 1' >> ${STAGEDIR}/var/lib/hp/hplip.state + ${ECHO_CMD} 'eula = 1' >> ${STAGEDIR}/var/lib/hp/hplip.state + ${ECHO_CMD} 'version = ${PORTVERSION}' >> ${STAGEDIR}/var/lib/hp/hplip.state .include Index: head/print/hplip-plugin/files/patch-installPlugin.py =================================================================== --- head/print/hplip-plugin/files/patch-installPlugin.py (revision 411552) +++ head/print/hplip-plugin/files/patch-installPlugin.py (nonexistent) @@ -1,11 +0,0 @@ ---- installPlugin.py.orig 2016-02-08 09:48:27 UTC -+++ installPlugin.py -@@ -52,7 +52,7 @@ pluginObj = pluginhandler.PluginHandle() - - status = False - --if os.geteuid() == 0: -+if True: - status = pluginObj.copyFiles(os.getcwd()) - if status == True: - sys.exit(0) Property changes on: head/print/hplip-plugin/files/patch-installPlugin.py ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/print/hplip-plugin/files/patch-plugin_install.py =================================================================== --- head/print/hplip-plugin/files/patch-plugin_install.py (revision 411552) +++ head/print/hplip-plugin/files/patch-plugin_install.py (nonexistent) @@ -1,14 +0,0 @@ ---- plugin_install.py.orig 2016-02-08 09:48:27 UTC -+++ plugin_install.py -@@ -50,10 +50,8 @@ def startGUIInstall(): - - def installPlugin(): - exec_str = sys.executable -- passwordObj = password.Password(mode) - cmd = "%s installPlugin.py"%exec_str -- cmd = passwordObj.getAuthCmd()%cmd -- status, output = utils.run(cmd, passwordObj) -+ status, output = utils.run(cmd) - if status == 0: - result = True - else: Property changes on: head/print/hplip-plugin/files/patch-plugin_install.py ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/print/hplip-plugin/files/wrap.c =================================================================== --- head/print/hplip-plugin/files/wrap.c (nonexistent) +++ head/print/hplip-plugin/files/wrap.c (revision 411553) @@ -0,0 +1,73 @@ +/* $FreeBSD$ */ + +/* dummy implementation of glibc functions needed by plugins */ + +#include +#include +#include +#include +#include + +void +__assert_fail( const char *msg, const char *file, unsigned int line, + const char *func ) { + fprintf( stderr, "Assertion failed: (%s), function %s, file %s, line %u\n", + msg, func, file, line ); + abort(); +} + +int +__fprintf_chk( FILE *fp, int flag, char const *format, ... ) { + va_list ap; + int res; + + va_start( ap, format ); + res = vfprintf( fp, format, ap ); + va_end( ap ); + return( res ); +} + +int +__printf_chk( int flag, char const *format, ... ) { + va_list ap; + int res; + + va_start( ap, format ); + res = vprintf( format, ap ); + va_end( ap ); + return( res ); +} + +int +__snprintf_chk( char *s, size_t maxlen, int flag, size_t slen, + char const *format, ... ) { + va_list ap; + int res; + + va_start( ap, format ); + res = vsnprintf( s, maxlen, format, ap ); + va_end( ap ); + return( res ); +} + +char * +__strcpy_chk( char *dest, char const *src, size_t destlen ) { + return( strcpy( dest, src )); +} + +void +__syslog_chk( int priority, int flag, char const *format, ... ) { + va_list ap; + + va_start( ap, format ); + vsyslog( priority, format, ap ); + va_end( ap ); +} + +#undef stderr +FILE *stderr; + +static __attribute__(( constructor )) void +init_stderr( void ) { + stderr = __stderrp; +} Property changes on: head/print/hplip-plugin/files/wrap.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/print/hplip-plugin/pkg-descr =================================================================== --- head/print/hplip-plugin/pkg-descr (revision 411552) +++ head/print/hplip-plugin/pkg-descr (revision 411553) @@ -1,3 +1,3 @@ -Firmware and binary drivers from some HPLIP supported printers. +Firmware and binary drivers for some HPLIP supported printers. -WWW: http://hplipopensource.com/hplip-web/index.html +WWW: http://hplipopensource.com/ Index: head/print/hplip-plugin/pkg-plist =================================================================== --- head/print/hplip-plugin/pkg-plist (revision 411552) +++ head/print/hplip-plugin/pkg-plist (revision 411553) @@ -1,32 +1,31 @@ share/hplip/data/firmware/hp_laserjet_1000.fw.gz share/hplip/data/firmware/hp_laserjet_1005_series.fw.gz share/hplip/data/firmware/hp_laserjet_1018.fw.gz share/hplip/data/firmware/hp_laserjet_1020.fw.gz share/hplip/data/firmware/hp_laserjet_p1005.fw.gz share/hplip/data/firmware/hp_laserjet_p1006.fw.gz share/hplip/data/firmware/hp_laserjet_p1007.fw.gz share/hplip/data/firmware/hp_laserjet_p1008.fw.gz share/hplip/data/firmware/hp_laserjet_p1009.fw.gz share/hplip/data/firmware/hp_laserjet_p1505.fw.gz share/hplip/data/firmware/hp_laserjet_professional_p1102.fw.gz share/hplip/data/firmware/hp_laserjet_professional_p1102w.fw.gz share/hplip/data/firmware/hp_laserjet_professional_p1566.fw.gz -share/hplip/data/plugins/license.txt share/hplip/fax/plugins/fax_marvell-%%LINARCH%%.so share/hplip/fax/plugins/fax_marvell.so share/hplip/plugin.spec share/hplip/prnt/plugins/hbpl1-%%LINARCH%%.so share/hplip/prnt/plugins/hbpl1.so share/hplip/prnt/plugins/lj-%%LINARCH%%.so share/hplip/prnt/plugins/lj.so share/hplip/scan/plugins/bb_escl-%%LINARCH%%.so share/hplip/scan/plugins/bb_escl.so share/hplip/scan/plugins/bb_marvell-%%LINARCH%%.so share/hplip/scan/plugins/bb_marvell.so share/hplip/scan/plugins/bb_soap-%%LINARCH%%.so share/hplip/scan/plugins/bb_soap.so share/hplip/scan/plugins/bb_soapht-%%LINARCH%%.so share/hplip/scan/plugins/bb_soapht.so /var/lib/hp/hplip.state @dir /var/lib/hp @dir /var/lib