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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Mar 16 09:23:37 2013 UTC (21 months ago) by blueness
Branch: MAIN
Version bump

(Portage version: 2.1.11.52/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.2.13.ebuild,v 1.5 2013/03/13 11:27:15 ago 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 if use java; then
52 sed \
53 -e 's/$(JAVAC)/$(JAVAC) $(JAVACFLAGS)/' \
54 -i java{/,/org/xapian/errors/,/org/xapian/}Makefile.in || die "sed failed"
55 fi
56
57 if use python; then
58 sed \
59 -e 's:\(^pkgpylib_DATA = xapian/__init__.py\).*:\1:' \
60 -e 's|\(^xapian/__init__.py: modern/xapian.py\)|\1 xapian/_xapian$(PYTHON_SO)|' \
61 -i python/Makefile.in || die "sed failed"
62 fi
63 }
64
65 src_configure() {
66 if use java; then
67 CXXFLAGS="${CXXFLAGS} $(java-pkg_get-jni-cflags)"
68 fi
69
70 if use perl; then
71 export PERL_ARCH="$(perl -MConfig -e 'print $Config{installvendorarch}')"
72 export PERL_LIB="$(perl -MConfig -e 'print $Config{installvendorlib}')"
73 fi
74
75 if use lua; then
76 export LUA_LIB="$(pkg-config --variable=INSTALL_CMOD lua)"
77 fi
78
79 econf \
80 $(use_with java) \
81 $(use_with lua) \
82 $(use_with mono csharp) \
83 $(use_with perl) \
84 $(use_with php) \
85 $(use_with python) \
86 $(use_with ruby) \
87 $(use_with tcl)
88
89 # Python bindings are built/tested/installed manually.
90 sed -e "/SUBDIRS =/s/ python//" -i Makefile || die "sed Makefile"
91 }
92
93 src_compile() {
94 default
95
96 if use python; then
97 python_copy_sources python
98 building() {
99 emake \
100 PYTHON="$(PYTHON)" \
101 PYTHON_INC="$(python_get_includedir)" \
102 PYTHON_LIB="$(python_get_libdir)" \
103 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
104 pkgpylibdir="$(python_get_sitedir)/xapian"
105 }
106 python_execute_function -s --source-dir python building
107 fi
108 }
109
110 src_test() {
111 default
112
113 if use python; then
114 testing() {
115 emake \
116 PYTHON="$(PYTHON)" \
117 PYTHON_INC="$(python_get_includedir)" \
118 PYTHON_LIB="$(python_get_libdir)" \
119 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
120 pkgpylibdir="$(python_get_sitedir)/xapian" \
121 VERBOSE="1" \
122 check
123 }
124 python_execute_function -s --source-dir python testing
125 fi
126 }
127
128 src_install () {
129 emake DESTDIR="${D}" install || die "emake install failed"
130
131 if use java; then
132 java-pkg_dojar java/built/xapian_jni.jar
133 # TODO: make the build system not install this...
134 java-pkg_doso "${D}/${S}/java/built/libxapian_jni.so"
135 rm "${D}/${S}/java/built/libxapian_jni.so"
136 rmdir -p "${D}/${S}/java/built"
137 rmdir -p "${D}/${S}/java/native"
138 fi
139
140 if use python; then
141 installation() {
142 emake \
143 DESTDIR="${D}" \
144 PYTHON="$(PYTHON)" \
145 PYTHON_INC="$(python_get_includedir)" \
146 PYTHON_LIB="$(python_get_libdir)" \
147 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
148 pkgpylibdir="$(python_get_sitedir)/xapian" \
149 install
150 }
151 python_execute_function -s --source-dir python installation
152 fi
153
154 if use php; then
155 php-ext-source-r2_createinifiles
156 fi
157
158 # For some USE combinations this directory is not created
159 if [[ -d "${D}/usr/share/doc/xapian-bindings" ]]; then
160 mv "${D}/usr/share/doc/xapian-bindings" "${D}/usr/share/doc/${PF}"
161 fi
162
163 dodoc AUTHORS HACKING NEWS TODO README || die "dodoc failed"
164 }
165
166 pkg_postinst() {
167 if use python; then
168 python_mod_optimize xapian
169 fi
170
171 if use php_targets_php5-4; then
172 ewarn "Note: subclassing Xapian classes in PHP currently doesn't work with PHP 5.4"
173 fi
174 }
175
176 pkg_postrm() {
177 if use python; then
178 python_mod_cleanup xapian
179 fi
180 }

  ViewVC Help
Powered by ViewVC 1.1.20