1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 JAVA_PKG_IUSE="doc source"
8 inherit toolchain-funcs versionator autotools java-pkg-2
10 MY_PV="$(delete_version_separator 2)"
13 DESCRIPTION="Native lib providing serial and parallel communication for Java"
14 HOMEPAGE="http://rxtx.qbang.org/"
15 SRC_URI="ftp://ftp.qbang.org/pub/rxtx/${MY_P}.zip"
18 KEYWORDS="~amd64 ~x86"
21 RDEPEND=">=virtual/jre-1.6
22 lfd? ( sys-apps/xinetd )"
24 DEPEND=">=virtual/jdk-1.6
27 S="${WORKDIR}/${MY_P}"
30 sed -i -e "s:\(\$(JAVADOC)\):\1 -d api:g" Makefile.am || die
32 -e "s:UTS_RELEASE::g" \
33 -e "s:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:g" \
34 -e "s:-source ... -target ...:$(java-pkg_javac-args):g" \
38 "${FILESDIR}/${PN}-2.1-7r2-lfd.diff" \
39 "${FILESDIR}/${PN}-2.1-7r2-nouts.diff" \
40 "${FILESDIR}/${P}-add-ttyACM.patch" \
41 "${FILESDIR}/${P}-limits.patch"
43 rm acinclude.m4 || die
49 $(use_enable lfd lockfile_server)
56 # see INSTALL in src/ldf
57 $(tc-getCC) ${LDFLAGS} ${CFLAGS} src/lfd/lockdaemon.c -o src/lfd/in.lfd || die
64 # Fix for src zip creation
66 mkdir -p src_with_pkg/gnu || die
67 ln -s ../../src src_with_pkg/gnu/io || die
72 java-pkg_dojar RXTXcomm.jar
73 java-pkg_doso ${CHOST}/.libs/*.so
75 dodoc AUTHORS ChangeLog INSTALL PORTING TODO SerialPortInstructions.txt
77 dodoc RMISecurityManager.html
81 newins "${FILESDIR}/lockfiled.xinetd" lfd
83 dodoc src/lfd/LockFileServer.rfc
86 use doc && java-pkg_dojavadoc api
87 use source && java-pkg_dosrc src_with_pkg/gnu
92 elog "Don't forget to enable the LockFileServer"
93 elog "daemon (lfd) in /etc/xinetd.d/lfd"
95 elog "RXTX uses UUCP style device-locks. You should"
96 elog "add every user who needs to access serial ports"
97 elog "to the 'uucp' group:"
99 elog " usermod -aG uucp <user>"