1 # Created by: luigi@FreeBSD.org
4 # Maintainers: Luigi Rizzo <luigi@FreeBSD.org>
6 # This port builds version 2.11.0 of the sane-epkowa driver for SANE.
7 # (more recent versions do not work - read details below).
9 # The source for sane-epkowa is accessible through
11 # http://www.avasys.jp/lx-bin2/linux_e/spc/DL1.do#download
13 # Note that the download interface above requests to fill a form,
14 # and returns only the most recent version of the software.
15 # However the license of the software is GPL-like, and the documentation
16 # coming with the code (README, non-free/AVASYSPL.en.txt) explicitly
17 # mentions that source redistribution is allowed with no other conditions.
19 # Given that there is no other way for us to get version 2.11.0,
20 # and since this is allowed by the license, we go straight at the
21 # URL for the .tar.gz we need.
22 # The various versions of the code are at:
24 # http://lx1.avasys.jp/iscan/2.7.0/iscan-2.7.0-1.c2.tar.gz
25 # http://lx1.avasys.jp/iscan/2.8.0/iscan-2.8.0-1.c2.tar.gz
26 # -- unknown URL for version 2.9.0
27 # http://lx1.avasys.jp/iscan/2.10.0/iscan_2.10.0-1.tar.gz
28 # http://lx1.avasys.jp/iscan/2.11.0/iscan_2.11.0-1.tar.gz
29 # http://lx1.avasys.jp/iscan/2.12.0/iscan_2.12.0-4.tar.gz
30 # --- version 2.13 never released
31 # http://lx1.avasys.jp/iscan/2.14.0/iscan_2.14.0-3.tar.gz
32 # http://linux.avasys.jp/drivers/iscan/2.15.0/iscan_2.15.0-3.tar.gz
34 # Version 2.7.0 to 2.11.0 build on FreeBSD without any patch.
35 # This port builds version 2.11.0, which is enough to detect the new
36 # multifunction SX400 scanner/printer that is not supported by the 'epson'
37 # backend coming with sane-backends.
39 # Version 2.15.0 builds with the patches included with this port,
40 # but does not work at runtime due to various issues not solved yet.
46 MASTER_SITES= http://lx1.avasys.jp/iscan/${PORTVERSION}/
47 DISTNAME= iscan_${PORTVERSION}-1
49 MAINTAINER= cy@FreeBSD.org
50 COMMENT= The sane-epkowa driver for FreeBSD
52 # use the following two lines for 2.15.0
53 # MASTER_SITES=http://linux.avasys.jp/drivers/iscan/${PORTVERSION}/
54 # DISTNAME= iscan_${PORTVERSION}-3
56 WRKSRC=${WRKDIR}/iscan-${PORTVERSION}
58 # We use LIB_DEPENDS, but the dependency is also at build time
59 LIB_DEPENDS+= libltdl.so:devel/libltdl
60 LIB_DEPENDS+= libgetline.so:devel/libgetline
61 LIB_DEPENDS+= libsane.so:graphics/sane-backends
63 #BUILD_DEPENDS+= ${LOCALBASE}/lib/libltdl.so:devel/libltdl
65 # gtk libraries are used by the frontend, which we do not build, however
66 # the configure script relies on that and fails if not present, so as
67 # a quick fix we set USE_GNOME
70 # The original uses gmake and ./configure
71 # Also pass appropriate flags to configure to use FreeBSD locations.
74 CONFIGURE_ARGS+=--prefix=${PREFIX} LDFLAGS="-L${PREFIX}/lib -lgetline" CPPFLAGS=-I${PREFIX}/include
76 .include <bsd.port.pre.mk>
78 .if ${PORTVERSION} != "2.15.0"
79 do-patch: # nothing to do
82 ( cd ${WRKSRC}/libltdl ; ${MAKE_CMD} )
83 ( cd ${WRKSRC}/sanei ; ${MAKE_CMD} )
84 ( cd ${WRKSRC}/backend ; ${MAKE_CMD} )
85 ( cd ${WRKSRC}/doc ; ${MAKE_CMD} )
86 @${GZIP_CMD} ${WRKSRC}/doc/sane-epkowa.5
88 .warning version 2.15.0 not working yet
89 # Remove versioned symbols to link with FreeBSD's [g]libc
91 ( cd ${WRKSRC}/non-free; ${CP} -p libesmod-i386.so x.so; \
92 ${OBJCOPY} -R .gnu.version x.so libesmod-i386.so )
94 # only build the backend part
96 ( cd ${WRKSRC}/backend ; ${MAKE_CMD} )
97 ( cd ${WRKSRC}/doc ; ${MAKE_CMD} )
98 @${GZIP_CMD} ${WRKSRC}/doc/sane-epkowa.5
102 @${INSTALL_MAN} ${WRKSRC}/doc/sane-epkowa.5.gz ${STAGEDIR}${PREFIX}/man/man5
103 @${MKDIR} ${STAGEDIR}${PREFIX}/lib/sane ${STAGEDIR}${PREFIX}/etc/sane.d
104 @${INSTALL_DATA} ${WRKSRC}/backend/.libs/libsane-epkowa.so.1 \
105 ${STAGEDIR}${PREFIX}/lib/sane/
106 @(cd ${STAGEDIR}${PREFIX}/lib/sane; ${LN} -s libsane-epkowa.so.1 libsane-epkowa.so )
107 @echo "usb /dev/uscanner0" > ${STAGEDIR}${PREFIX}/etc/sane.d/epkowa.conf.sample
109 .include <bsd.port.post.mk>