/[gentoo-x86]/dev-libs/xapian-bindings/xapian-bindings-1.3.1.ebuild
Gentoo

Contents of /dev-libs/xapian-bindings/xapian-bindings-1.3.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Aug 11 00:58:20 2013 UTC (11 months, 2 weeks ago) by blueness
Branch: MAIN
Changes since 1.1: +1 -6 lines
Remove useless sed, thanks Arfrever

(Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/xapian-bindings/xapian-bindings-1.3.1.ebuild,v 1.1 2013/08/10 15:15:55 blueness Exp $
4
5 EAPI="5"
6
7 PYTHON_DEPEND="python? 2"
8 PYTHON_USE_WITH="threads"
9 SUPPORT_PYTHON_ABIS="1"
10 RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
11
12 USE_PHP="php5-3 php5-4"
13
14 PHP_EXT_NAME="xapian"
15 PHP_EXT_INI="yes"
16 PHP_EXT_OPTIONAL_USE="php"
17
18 inherit java-pkg-opt-2 mono php-ext-source-r2 python
19
20 DESCRIPTION="SWIG and JNI bindings for Xapian"
21 HOMEPAGE="http://www.xapian.org/"
22 SRC_URI="http://oligarchy.co.uk/xapian/${PV}/${P}.tar.gz"
23
24 LICENSE="GPL-2"
25 SLOT="0"
26 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
27 IUSE="java lua mono perl php python ruby tcl"
28 REQUIRED_USE="|| ( java lua mono perl php python ruby tcl )"
29
30 COMMONDEPEND="=dev-libs/xapian-${PV}*
31 lua? ( >=dev-lang/lua-5.1 )
32 mono? ( >=dev-lang/mono-1.0.8 )
33 perl? ( dev-lang/perl )
34 ruby? ( dev-lang/ruby )
35 tcl? ( >=dev-lang/tcl-8.1 )"
36 DEPEND="${COMMONDEPEND}
37 java? ( >=virtual/jdk-1.3 )"
38 RDEPEND="${COMMONDEPEND}
39 java? ( >=virtual/jre-1.3 )"
40
41 pkg_setup() {
42 java-pkg-opt-2_pkg_setup
43
44 if use python; then
45 python_pkg_setup
46 fi
47 }
48
49 src_prepare() {
50 java-pkg-opt-2_src_prepare
51
52 if use python; then
53 sed \
54 -e 's:\(^pkgpylib_DATA = xapian/__init__.py\).*:\1:' \
55 -e 's|\(^xapian/__init__.py: modern/xapian.py\)|\1 xapian/_xapian$(PYTHON_SO)|' \
56 -i python/Makefile.in || die "sed failed"
57 fi
58 }
59
60 src_configure() {
61 if use java; then
62 CXXFLAGS="${CXXFLAGS} $(java-pkg_get-jni-cflags)"
63 fi
64
65 if use perl; then
66 export PERL_ARCH="$(perl -MConfig -e 'print $Config{installvendorarch}')"
67 export PERL_LIB="$(perl -MConfig -e 'print $Config{installvendorlib}')"
68 fi
69
70 if use lua; then
71 export LUA_LIB="$(pkg-config --variable=INSTALL_CMOD lua)"
72 fi
73
74 econf \
75 $(use_with java) \
76 $(use_with lua) \
77 $(use_with mono csharp) \
78 $(use_with perl) \
79 $(use_with php) \
80 $(use_with python) \
81 $(use_with ruby) \
82 $(use_with tcl)
83
84 # Python bindings are built/tested/installed manually.
85 sed -e "/SUBDIRS =/s/ python//" -i Makefile || die "sed Makefile"
86 }
87
88 src_compile() {
89 default
90
91 if use python; then
92 python_copy_sources python
93 building() {
94 emake \
95 PYTHON="$(PYTHON)" \
96 PYTHON_INC="$(python_get_includedir)" \
97 PYTHON_LIB="$(python_get_libdir)" \
98 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
99 pkgpylibdir="$(python_get_sitedir)/xapian"
100 }
101 python_execute_function -s --source-dir python building
102 fi
103 }
104
105 src_test() {
106 default
107
108 if use python; then
109 testing() {
110 emake \
111 PYTHON="$(PYTHON)" \
112 PYTHON_INC="$(python_get_includedir)" \
113 PYTHON_LIB="$(python_get_libdir)" \
114 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
115 pkgpylibdir="$(python_get_sitedir)/xapian" \
116 VERBOSE="1" \
117 check
118 }
119 python_execute_function -s --source-dir python testing
120 fi
121 }
122
123 src_install () {
124 emake DESTDIR="${D}" install || die "emake install failed"
125
126 if use java; then
127 java-pkg_dojar java/built/xapian_jni.jar
128 # TODO: make the build system not install this...
129 java-pkg_doso "${D}/${S}/java/built/libxapian_jni.so"
130 rm "${D}/${S}/java/built/libxapian_jni.so"
131 rmdir -p "${D}/${S}/java/built"
132 rmdir -p "${D}/${S}/java/native"
133 fi
134
135 if use python; then
136 installation() {
137 emake \
138 DESTDIR="${D}" \
139 PYTHON="$(PYTHON)" \
140 PYTHON_INC="$(python_get_includedir)" \
141 PYTHON_LIB="$(python_get_libdir)" \
142 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
143 pkgpylibdir="$(python_get_sitedir)/xapian" \
144 install
145 }
146 python_execute_function -s --source-dir python installation
147 fi
148
149 if use php; then
150 php-ext-source-r2_createinifiles
151 fi
152
153 # For some USE combinations this directory is not created
154 if [[ -d "${D}/usr/share/doc/xapian-bindings" ]]; then
155 mv "${D}/usr/share/doc/xapian-bindings" "${D}/usr/share/doc/${PF}"
156 fi
157
158 dodoc AUTHORS HACKING NEWS TODO README || die "dodoc failed"
159 }
160
161 pkg_postinst() {
162 if use python; then
163 python_mod_optimize xapian
164 fi
165
166 if use php_targets_php5-4; then
167 ewarn "Note: subclassing Xapian classes in PHP currently doesn't work with PHP 5.4"
168 fi
169 }
170
171 pkg_postrm() {
172 if use python; then
173 python_mod_cleanup xapian
174 fi
175 }

  ViewVC Help
Powered by ViewVC 1.1.20