View | Details | Raw Unified | Return to bug 208142 | Differences between
and this patch

Collapse All | Expand All

(-)print/hplip-plugin/Makefile (-40 / +32 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	hplip-plugin
4
PORTNAME=	hplip-plugin
5
PORTVERSION=	3.16.2
5
PORTVERSION=	3.16.2
6
PORTREVISION=	1
6
CATEGORIES=	print
7
CATEGORIES=	print
7
MASTER_SITES=	http://hplipopensource.com/hplip-web/plugin/
8
MASTER_SITES=	http://hplipopensource.com/hplip-web/plugin/
8
DISTNAME=	hplip-${DISTVERSION}-plugin
9
DISTNAME=	hplip-${DISTVERSION}-plugin
Lines 11-28 EXTRACT_SUFX= .run Link Here
11
MAINTAINER=	makc@FreeBSD.org
12
MAINTAINER=	makc@FreeBSD.org
12
COMMENT=	Binary plugin for some HP Printers and All-in-One devices
13
COMMENT=	Binary plugin for some HP Printers and All-in-One devices
13
14
15
LICENSE=	HPLIP_PLUGIN
16
LICENSE_NAME=	HPLIP Driver Plug-in License
17
LICENSE_PERMS=	none
18
LICENSE_FILE=	${WRKSRC}/license.txt
19
14
RUN_DEPENDS=	hp-plugin:${PORTSDIR}/print/hplip
20
RUN_DEPENDS=	hp-plugin:${PORTSDIR}/print/hplip
15
21
16
RESTRICTED=	License agreement is required
22
RESTRICTED=	License agreement is required
17
23
18
USES=		python
24
ONLY_FOR_ARCHS=	amd64 i386 # arm
19
NO_BUILD=	yes
20
WRKSRC=		${WRKDIR}/plugin_tmp
21
HPLIP_FAKEDIR=	${WRKDIR}/hplip_fakedir
22
23
ONLY_FOR_ARCHS=	amd64 i386
24
25
25
PLUGIN_LINKS=	fax/plugins/fax_marvell \
26
PLUGINS=	fax/plugins/fax_marvell \
26
		prnt/plugins/hbpl1 \
27
		prnt/plugins/hbpl1 \
27
		prnt/plugins/lj \
28
		prnt/plugins/lj \
28
		scan/plugins/bb_escl \
29
		scan/plugins/bb_escl \
Lines 30-41 PLUGIN_LINKS= fax/plugins/fax_marvell \ Link Here
30
		scan/plugins/bb_soap \
31
		scan/plugins/bb_soap \
31
		scan/plugins/bb_soapht
32
		scan/plugins/bb_soapht
32
33
33
PLUGIN_DIRS=	data/firmware \
34
		data/plugins \
35
		fax/plugins \
36
		prnt/plugins \
37
		scan/plugins
38
39
PLIST_SUB+=	LINARCH="${LINARCH}"
34
PLIST_SUB+=	LINARCH="${LINARCH}"
40
35
41
.include <bsd.port.pre.mk>
36
.include <bsd.port.pre.mk>
Lines 47-82 LINARCH= x86_64 Link Here
47
.endif
42
.endif
48
43
49
do-extract:
44
do-extract:
50
	@${MKDIR} ${WRKDIR}
45
	@${SH} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \
51
	@(cd ${WRKDIR} && ${SH} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \
46
		--keep --noexec --nox11 --target ${WRKSRC}
52
		--keep --noexec --nox11)
53
47
54
post-patch:
48
do-build:
55
	@${REINPLACE_CMD} -e 's|ok, ans = tui.enter_yes_no.*|ok, ans = 1, 1|' \
49
	${CC} ${CFLAGS} -Wall -fPIC -c ${FILESDIR}/wrap.c -o ${WRKSRC}/wrap.o
56
		-e 's|/etc/hp|${HPLIP_FAKEDIR}|' \
50
.for p in ${PLUGINS}
57
		${WRKSRC}/plugin_install.py \
51
	(cd ${WRKSRC} && ${BRANDELF} -t FreeBSD ${p:T}-${LINARCH}.so && \
58
		${WRKSRC}/installPlugin.py
52
		${CC} ${CFLAGS} ${LDFLAGS} -shared -fPIC -o ${p:T}.so wrap.o \
53
		${p:T}-${LINARCH}.so -Wl,-rpath,${PREFIX}/share/hplip/${p:H})
54
.endfor
59
55
60
do-install:
56
do-install:
61
# fake hplip installation
57
	${MKDIR} ${STAGEDIR}${PREFIX}/share/hplip/data/firmware
62
	${MKDIR} ${HPLIP_FAKEDIR}
58
	${INSTALL_DATA} ${WRKSRC}/*.fw.gz \
63
	${SED} -e 's,${LOCALBASE}/share/hplip,${HPLIP_FAKEDIR},' \
59
		${STAGEDIR}${PREFIX}/share/hplip/data/firmware
64
		${LOCALBASE}/etc/hp/hplip.conf > ${HPLIP_FAKEDIR}/hplip.conf
60
	${MKDIR} ${PLUGINS:H:S,^,${STAGEDIR}${PREFIX}/share/hplip/,}
65
	${MKDIR} ${HPLIP_FAKEDIR}
61
.for p in ${PLUGINS}
66
	${LN} -sf ${LOCALBASE}/share/hplip/base ${HPLIP_FAKEDIR}
62
	${INSTALL_LIB} ${WRKSRC}/${p:T}-${LINARCH}.so \
67
	${LN} -sf ${LOCALBASE}/share/hplip/prnt ${HPLIP_FAKEDIR}
63
		${STAGEDIR}${PREFIX}/share/hplip/${p}-${LINARCH}.so
68
	${CP} -R ${LOCALBASE}/share/hplip/installer ${HPLIP_FAKEDIR}
64
	${INSTALL_LIB} ${WRKSRC}/${p:T}.so \
69
	${REINPLACE_CMD} -e 's,HOMEDIR = .*,HOMEDIR = "${STAGEDIR}${PREFIX}/share/hplip",' \
65
		${STAGEDIR}${PREFIX}/share/hplip/${p}.so
70
		-e 's,/var/lib/hp/hplip.state,${STAGEDIR}&,' \
71
		${HPLIP_FAKEDIR}/installer/pluginhandler.py \
72
		${HPLIP_FAKEDIR}/installer/core_install.py
73
	${MKDIR} ${STAGEDIR}/var/lib/hp
74
# install hplip-plugin
75
	${MKDIR} ${PLUGIN_DIRS:S,^,${STAGEDIR}${PREFIX}/share/hplip/,}
76
	(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} -B \
77
		plugin_install.py -i)
78
.for i in ${PLUGIN_LINKS}
79
	${LN} -sf ${i:T}-${LINARCH}.so ${STAGEDIR}${PREFIX}/share/hplip/${i}.so
80
.endfor
66
.endfor
67
	${INSTALL_DATA} ${WRKSRC}/plugin.spec ${STAGEDIR}${PREFIX}/share/hplip
68
	${MKDIR} ${STAGEDIR}/var/lib/hp
69
	${ECHO_CMD} '[plugin]' > ${STAGEDIR}/var/lib/hp/hplip.state
70
	${ECHO_CMD} 'installed = 1' >> ${STAGEDIR}/var/lib/hp/hplip.state
71
	${ECHO_CMD} 'eula = 1' >> ${STAGEDIR}/var/lib/hp/hplip.state
72
	${ECHO_CMD} 'version = ${PORTVERSION}' >> ${STAGEDIR}/var/lib/hp/hplip.state
81
73
82
.include <bsd.port.post.mk>
74
.include <bsd.port.post.mk>
(-)print/hplip-plugin/files/patch-installPlugin.py (-11 lines)
Lines 1-11 Link Here
1
--- installPlugin.py.orig	2016-02-08 09:48:27 UTC
2
+++ installPlugin.py
3
@@ -52,7 +52,7 @@ pluginObj = pluginhandler.PluginHandle()
4
  
5
 status = False
6
  
7
-if os.geteuid() == 0:
8
+if True:
9
     status = pluginObj.copyFiles(os.getcwd())
10
     if status == True:
11
         sys.exit(0)
(-)print/hplip-plugin/files/patch-plugin_install.py (-14 lines)
Lines 1-14 Link Here
1
--- plugin_install.py.orig	2016-02-08 09:48:27 UTC
2
+++ plugin_install.py
3
@@ -50,10 +50,8 @@ def startGUIInstall():
4
 
5
 def installPlugin():
6
     exec_str = sys.executable
7
-    passwordObj = password.Password(mode)
8
     cmd = "%s installPlugin.py"%exec_str
9
-    cmd = passwordObj.getAuthCmd()%cmd
10
-    status, output = utils.run(cmd, passwordObj)
11
+    status, output = utils.run(cmd)
12
     if status == 0:
13
         result = True
14
     else:
(-)print/hplip-plugin/files/wrap.c (+73 lines)
Line 0 Link Here
1
/* $FreeBSD$ */
2
3
/* dummy implementation of glibc functions needed by plugins */
4
5
#include <stdarg.h>
6
#include <stdio.h>
7
#include <stdlib.h>
8
#include <string.h>
9
#include <syslog.h>
10
11
void
12
__assert_fail( const char *msg, const char *file, unsigned int line,
13
	       const char *func ) {
14
	fprintf( stderr, "Assertion failed: (%s), function %s, file %s, line %u\n",
15
		 msg, func, file, line );
16
	abort();
17
}
18
19
int
20
__fprintf_chk( FILE *fp, int flag, char const *format, ... ) {
21
	va_list ap;
22
	int res;
23
24
	va_start( ap, format );
25
	res = vfprintf( fp, format, ap );
26
	va_end( ap );
27
	return( res );
28
}
29
30
int
31
__printf_chk( int flag, char const *format, ... ) {
32
	va_list ap;
33
	int res;
34
35
	va_start( ap, format );
36
	res = vprintf( format, ap );
37
	va_end( ap );
38
	return( res );
39
}
40
41
int
42
__snprintf_chk( char *s, size_t maxlen, int flag, size_t slen,
43
		char const *format, ... ) {
44
	va_list ap;
45
	int res;
46
47
	va_start( ap, format );
48
	res = vsnprintf( s, maxlen, format, ap );
49
	va_end( ap );
50
	return( res );
51
}
52
53
char *
54
__strcpy_chk( char *dest, char const *src, size_t destlen ) {
55
	return( strcpy( dest, src ));
56
}
57
58
void
59
__syslog_chk( int priority, int flag, char const *format, ... ) {
60
	va_list ap;
61
62
	va_start( ap, format );
63
	vsyslog( priority, format, ap );
64
	va_end( ap );
65
}
66
67
#undef stderr
68
FILE *stderr;
69
70
static __attribute__(( constructor )) void
71
init_stderr( void ) {
72
	stderr = __stderrp;
73
}
(-)print/hplip-plugin/pkg-descr (-2 / +2 lines)
Lines 1-3 Link Here
1
Firmware and binary drivers from some HPLIP supported printers.
1
Firmware and binary drivers for some HPLIP supported printers.
2
2
3
WWW: http://hplipopensource.com/hplip-web/index.html
3
WWW: http://hplipopensource.com/
(-)print/hplip-plugin/pkg-plist (-1 lines)
Lines 11-17 share/hplip/data/firmware/hp_laserjet_p1 Link Here
11
share/hplip/data/firmware/hp_laserjet_professional_p1102.fw.gz
11
share/hplip/data/firmware/hp_laserjet_professional_p1102.fw.gz
12
share/hplip/data/firmware/hp_laserjet_professional_p1102w.fw.gz
12
share/hplip/data/firmware/hp_laserjet_professional_p1102w.fw.gz
13
share/hplip/data/firmware/hp_laserjet_professional_p1566.fw.gz
13
share/hplip/data/firmware/hp_laserjet_professional_p1566.fw.gz
14
share/hplip/data/plugins/license.txt
15
share/hplip/fax/plugins/fax_marvell-%%LINARCH%%.so
14
share/hplip/fax/plugins/fax_marvell-%%LINARCH%%.so
16
share/hplip/fax/plugins/fax_marvell.so
15
share/hplip/fax/plugins/fax_marvell.so
17
share/hplip/plugin.spec
16
share/hplip/plugin.spec

Return to bug 208142