/[gentoo-x86]/dev-libs/protobuf/protobuf-2.3.0-r1.ebuild
Gentoo

Contents of /dev-libs/protobuf/protobuf-2.3.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Wed Mar 16 18:00:10 2011 UTC (3 years, 6 months ago) by xarthisius
Branch: MAIN
Changes since 1.4: +2 -2 lines
ppc/ppc64 stable wrt #348574

(Portage version: 2.2.0_alpha27/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/protobuf/protobuf-2.3.0-r1.ebuild,v 1.4 2011/01/12 20:47:56 arfrever Exp $
4
5 EAPI="3"
6
7 JAVA_PKG_IUSE="source"
8 PYTHON_DEPEND="python? 2"
9
10 inherit autotools eutils distutils python java-pkg-opt-2 elisp-common
11
12 DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
13 HOMEPAGE="http://code.google.com/p/protobuf/"
14 SRC_URI="http://protobuf.googlecode.com/files/${P}.tar.bz2"
15
16 LICENSE="Apache-2.0"
17 SLOT="0"
18 KEYWORDS="amd64 ppc ppc64 x86 ~x64-macos"
19 IUSE="emacs examples java python static-libs vim-syntax"
20
21 DEPEND="${DEPEND} java? ( >=virtual/jdk-1.5 )
22 python? ( dev-python/setuptools )
23 emacs? ( virtual/emacs )"
24 RDEPEND="${RDEPEND} java? ( >=virtual/jre-1.5 )
25 emacs? ( virtual/emacs )"
26
27 PYTHON_MODNAME="google/protobuf"
28 DISTUTILS_SRC_TEST="setup.py"
29
30 pkg_setup() {
31 if use python; then
32 python_set_active_version 2
33 python_pkg_setup
34 fi
35 }
36
37 src_prepare() {
38 epatch "${FILESDIR}"/${P}-asneeded-2.patch
39 eautoreconf
40
41 if use python; then
42 python_convert_shebangs -r 2 .
43 distutils_src_prepare
44 fi
45 }
46
47 src_configure() {
48 econf \
49 $(use_enable static-libs static)
50 }
51
52 src_compile() {
53 emake || die "emake failed"
54
55 if use python; then
56 einfo "Compiling Python library ..."
57 pushd python
58 distutils_src_compile
59 popd
60 fi
61
62 if use java; then
63 einfo "Compiling Java library ..."
64 src/protoc --java_out=java/src/main/java --proto_path=src src/google/protobuf/descriptor.proto
65 mkdir java/build
66 pushd java/src/main/java
67 ejavac -d ../../../build $(find . -name '*.java') || die "java compilation failed"
68 popd
69 jar cf "${PN}.jar" -C java/build . || die "jar failed"
70 fi
71
72 if use emacs; then
73 elisp-compile "${S}/editors/protobuf-mode.el" || die "elisp-compile failed!"
74 fi
75 }
76
77 src_test() {
78 emake check || die "emake check failed"
79
80 if use python; then
81 pushd python
82 distutils_src_test
83 popd
84 fi
85 }
86
87 src_install() {
88 emake DESTDIR="${D}" install || die "emake install failed"
89 dodoc CHANGES.txt CONTRIBUTORS.txt README.txt
90
91 use static-libs || rm -rf "${D}"/usr/lib*/*.la
92
93 if use python; then
94 pushd python
95 distutils_src_install
96 popd
97 fi
98
99 if use java; then
100 java-pkg_dojar ${PN}.jar
101 use source && java-pkg_dosrc java/src/main/java/*
102 fi
103
104 if use vim-syntax; then
105 insinto /usr/share/vim/vimfiles/syntax
106 doins editors/proto.vim
107 fi
108
109 if use emacs; then
110 elisp-install ${PN} editors/protobuf-mode.el* || die "elisp-install failed!"
111 elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
112 fi
113
114 if use examples; then
115 insinto /usr/share/doc/${PF}/examples
116 doins -r examples/* || die "doins examples failed"
117 fi
118 }
119
120 pkg_postinst() {
121 use emacs && elisp-site-regen
122 use python && distutils_pkg_postinst
123 }
124
125 pkg_postrm() {
126 use emacs && elisp-site-regen
127 use python && distutils_pkg_postrm
128 }

  ViewVC Help
Powered by ViewVC 1.1.20