dev-java/openjdk-jre-bin: drop old
[gentoo.git] / dev-java / rxtx / rxtx-2.2_pre2-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 JAVA_PKG_IUSE="doc source"
7
8 inherit toolchain-funcs versionator autotools java-pkg-2
9
10 MY_PV="$(delete_version_separator 2)"
11 MY_P="${PN}-${MY_PV}"
12
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"
16 LICENSE="LGPL-2.1+"
17 SLOT="2"
18 KEYWORDS="~amd64 ~x86"
19 IUSE="lfd"
20
21 RDEPEND=">=virtual/jre-1.6
22         lfd? ( sys-apps/xinetd )"
23
24 DEPEND=">=virtual/jdk-1.6
25         app-arch/unzip"
26
27 S="${WORKDIR}/${MY_P}"
28
29 src_prepare() {
30         sed -i -e "s:\(\$(JAVADOC)\):\1 -d api:g" Makefile.am || die
31         sed -i \
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" \
35                 configure.in || die
36
37         epatch \
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"
42
43         rm acinclude.m4 || die
44         eautoreconf
45 }
46
47 src_configure() {
48         econf \
49                 $(use_enable lfd lockfile_server)
50 }
51
52 src_compile() {
53         emake
54
55         if use lfd ; then
56                 # see INSTALL in src/ldf
57                 $(tc-getCC) ${LDFLAGS} ${CFLAGS} src/lfd/lockdaemon.c -o src/lfd/in.lfd || die
58         fi
59
60         if use doc ; then
61                 emake docs
62         fi
63
64         # Fix for src zip creation
65         if use source ; then
66                 mkdir -p src_with_pkg/gnu || die
67                 ln -s ../../src src_with_pkg/gnu/io || die
68         fi
69 }
70
71 src_install() {
72         java-pkg_dojar RXTXcomm.jar
73         java-pkg_doso ${CHOST}/.libs/*.so
74
75         dodoc AUTHORS ChangeLog INSTALL PORTING TODO SerialPortInstructions.txt
76         docinto html
77         dodoc RMISecurityManager.html
78
79         if use lfd ; then
80                 insinto /etc/xinetd.d
81                 newins "${FILESDIR}/lockfiled.xinetd" lfd
82                 dosbin src/lfd/in.lfd
83                 dodoc src/lfd/LockFileServer.rfc
84         fi
85
86         use doc && java-pkg_dojavadoc api
87         use source && java-pkg_dosrc src_with_pkg/gnu
88 }
89
90 pkg_postinst() {
91         if use lfd ; then
92                 elog "Don't forget to enable the LockFileServer"
93                 elog "daemon (lfd) in /etc/xinetd.d/lfd"
94         else
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:"
98                 elog
99                 elog "    usermod -aG uucp <user>"
100         fi
101 }