summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <nerdboy@gentoo.org>2008-12-07 02:48:14 +0000
committerSteve Arnold <nerdboy@gentoo.org>2008-12-07 02:48:14 +0000
commit5068bbf94e368775a70fd3c0254d98a968f375b5 (patch)
treede7135b632d1000d6ce36a6bb968b5ce1dc020bf /sci-libs
parentVersion bump. (diff)
downloadgentoo-2-5068bbf94e368775a70fd3c0254d98a968f375b5.tar.gz
gentoo-2-5068bbf94e368775a70fd3c0254d98a968f375b5.tar.bz2
gentoo-2-5068bbf94e368775a70fd3c0254d98a968f375b5.zip
New ebuild for the open source BUFR library from ECMWF (needs Fortran).
(Portage version: 2.2_rc16/cvs/Linux 2.6.27.7 x86_64)
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/libbufr/ChangeLog13
-rw-r--r--sci-libs/libbufr/libbufr-000360.ebuild164
-rw-r--r--sci-libs/libbufr/metadata.xml13
3 files changed, 190 insertions, 0 deletions
diff --git a/sci-libs/libbufr/ChangeLog b/sci-libs/libbufr/ChangeLog
new file mode 100644
index 000000000000..eeee420b7fbe
--- /dev/null
+++ b/sci-libs/libbufr/ChangeLog
@@ -0,0 +1,13 @@
+# ChangeLog for sci-libs/libbufr
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/libbufr/ChangeLog,v 1.1 2008/12/07 02:48:14 nerdboy Exp $
+
+*libbufr-000360 (07 Dec 2008)
+
+ 07 Dec 2008; Steve Arnold <nerdboy@gentoo.org> +metadata.xml,
+ +libbufr-000360.ebuild:
+ New ebuild for the open source BUFR library from ECMWF (requires at least
+ one supported Fortran compiler). Tested on amd64 and x86 with one of the
+ included test files, but I haven't tested with local tables yet. Needs
+ some arch luv...
+
diff --git a/sci-libs/libbufr/libbufr-000360.ebuild b/sci-libs/libbufr/libbufr-000360.ebuild
new file mode 100644
index 000000000000..ba2960ff8c5b
--- /dev/null
+++ b/sci-libs/libbufr/libbufr-000360.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/libbufr/libbufr-000360.ebuild,v 1.1 2008/12/07 02:48:14 nerdboy Exp $
+
+inherit fortran eutils flag-o-matic toolchain-funcs
+
+MY_P="${PN/lib/}_${PV}"
+
+DESCRIPTION="ECMWF BUFR library - includes both C and Fortran example utilities."
+HOMEPAGE="http://www.ecmwf.int/products/data/software/bufr.html"
+SRC_URI="http://www.ecmwf.int/products/data/software/download/software_files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# needs someone to test on these: ~alpha ~hppa ~ia64 ~ppc ~ppc64 ~sparc etc ...
+
+IUSE="doc examples"
+
+RDEPEND=""
+
+DEPEND="sys-apps/findutils"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ FORTRAN="gfortran g77 ifc ifort pgf77 pgf90"
+ fortran_pkg_setup
+ case "${FORTRANC}" in
+ gfortran)
+ export CNAME="_gfortran"
+ ;;
+ g77)
+ export CNAME="_gnu"
+ ;;
+ pgf90|pgf77)
+ export CNAME="_linux"
+ ;;
+ ifc|ifort)
+ export CNAME="_intel"
+ ;;
+ esac
+
+ export target="linux"
+ case "${ARCH}" in
+ amd64|ppc64)
+ export A64="A64"
+ export R64="R64"
+ ;;
+ ia64)
+ export A64=""
+ export R64="R64"
+ export target="itanium"
+ ;;
+ hppa)
+ export target="hppa"
+ export R64=""
+ ;;
+ *)
+ export A64=""
+ export R64=""
+ ;;
+ esac
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ find . -type f | xargs chmod -x
+ chmod +x bufrtables/links.sh
+ if use debug ; then
+ sed -i -e "s:-O2:-g ${CFLAGS}:g" \
+ config/config.$target$CNAME$R64$A64
+ else
+ sed -i -e "s:-O2:${CFLAGS}:g" \
+ config/config.$target$CNAME$R64$A64
+ fi
+}
+
+src_compile() {
+ EBUILD_ARCH="${ARCH}"
+ EBUILD_CFLAGS="${CFLAGS}"
+ unset ARCH CFLAGS
+ tc-export
+ append-flags -DTABLE_PATH="/usr/share/bufrtables"
+
+ make ARCH=linux || die "make failed"
+
+ ARCH="${EBUILD_ARCH}"
+ CFLAGS="${EBUILD_CFLAGS}"
+
+ generate_files
+
+ cd "${S}"/examples
+ make ARCH=linux decode_bufr bufr_decode create_bufr \
+ decode_bufr_image tdexp || die "make examples failed"
+}
+
+src_test() {
+ cd "${S}"/examples
+ BUFR_TABLES="${S}/bufrtables/" ./decode_bufr -i \
+ ../data/ISMD01_OKPR.bufr < ../response_file
+}
+
+src_install() {
+ dolib.a libbufrR64.a
+ dosbin bufrtables/{bufr2txt_tables,bufr_split_tables,txt2bufr_tables}
+ dobin examples/{create_bufr,decode_bufr,decode_bufr_image}
+
+ keepdir /usr/share/bufrtables
+ insinto /usr/share/bufrtables
+ doins bufrtables/*000*
+
+ # files generated above
+ doenvd 20${PN}
+
+ dodoc README
+ if use doc ; then
+ insinto /usr/share/doc/${P}
+ doins doc/*.pdf
+ fi
+
+ if use examples ; then
+ newdoc examples/README README.examples
+ insinto /usr/share/doc/${P}/examples
+ doins examples/{*.F,*.c,Makefile}
+ fi
+}
+
+pkg_postinst() {
+ elog
+ elog "This is the only GPL'd BUFR decoder library written in C/Fortran"
+ elog "but the build system is an old kluge that pre-dates the discovery"
+ elog "of fire. File bugs as usual if you have build/runtime problems."
+ elog ""
+ elog "The default BUFR tables are stored in /usr/share/bufrtables, so"
+ elog "add your local tables there if needed. Only a static lib is"
+ elog "installed currently, as shared lib support is incomplete (feel"
+ elog "free to submit a patch :)"
+ elog ""
+ elog "The installed user-land bufr utilities are just the examples;"
+ elog "the main library is really all there is (and there are no man"
+ elog "pages either). Install the examples and use the source, Luke..."
+ elog
+}
+
+generate_files() {
+ cat <<-EOF > 20${PN}
+ BUFR_TABLES="/usr/share/bufrtables"
+ CONFIG_PROTECT="/usr/share/bufrtables"
+ EOF
+
+ cat <<-EOF > response_file
+ N
+ N
+ N
+
+
+
+
+
+ Y
+ EOF
+}
diff --git a/sci-libs/libbufr/metadata.xml b/sci-libs/libbufr/metadata.xml
new file mode 100644
index 000000000000..288727a8762a
--- /dev/null
+++ b/sci-libs/libbufr/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-geosciences</herd>
+<maintainer>
+ <email>nerdboy@gentoo.org</email>
+ <name>Steve Arnold</name>
+ <description>Primary Maintainer</description>
+</maintainer>
+<longdescription>This is mainly just an open source BUFR library from ECMWF
+ that comes with a few example toolss (some of which are built and installed).
+</longdescription>
+</pkgmetadata>