/[gentoo-x86]/dev-libs/protobuf/protobuf-2.4.0a.ebuild
Gentoo

Contents of /dev-libs/protobuf/protobuf-2.4.0a.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Fri Jul 15 16:05:13 2011 UTC (3 years, 5 months ago) by xarthisius
Branch: MAIN
Changes since 1.7: +2 -2 lines
ppc64 stable wrt #363403

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

  ViewVC Help
Powered by ViewVC 1.1.20