summaryrefslogtreecommitdiff
path: root/sci-libs/libbufr
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sci-libs/libbufr
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sci-libs/libbufr')
-rw-r--r--sci-libs/libbufr/Manifest1
-rw-r--r--sci-libs/libbufr/files/libbufr-000360-gcc-includes.patch15
-rw-r--r--sci-libs/libbufr/files/libbufr-makefile.patch11
-rw-r--r--sci-libs/libbufr/libbufr-000387.ebuild190
-rw-r--r--sci-libs/libbufr/metadata.xml8
5 files changed, 225 insertions, 0 deletions
diff --git a/sci-libs/libbufr/Manifest b/sci-libs/libbufr/Manifest
new file mode 100644
index 00000000000..da7f5f55941
--- /dev/null
+++ b/sci-libs/libbufr/Manifest
@@ -0,0 +1 @@
+DIST bufr_000387.tar.gz 3673816 SHA256 bb8c39f15b2d1661ef2d66de8ee1fcaaa195e8cb80023fc3112d3dd816c97745 SHA512 906129809c92b22bd0a73524048128e4a44335eaf8c978bb4d0c3c5f5be7d01ce530e3248eec681b4662840e4ed0270089ddc801dca8f022e7d6cfbc5e4c2967 WHIRLPOOL 43af1997618c1f73fbd8ee6120c4ad8329f648d1bbb09165b5f750e30cd5d49e246cabb4a6b82341e8408ffb042cbd58cb82ed29e0c234a27fa44a684b89c169
diff --git a/sci-libs/libbufr/files/libbufr-000360-gcc-includes.patch b/sci-libs/libbufr/files/libbufr-000360-gcc-includes.patch
new file mode 100644
index 00000000000..8b0ac1ce9a6
--- /dev/null
+++ b/sci-libs/libbufr/files/libbufr-000360-gcc-includes.patch
@@ -0,0 +1,15 @@
+--- examples/bufr_decode.c.orig 2008-09-17 03:02:39.000000000 -0700
++++ examples/bufr_decode.c 2010-12-27 19:03:57.000000000 -0800
+@@ -7,9 +7,9 @@
+ * See LICENSE and gpl-3.0.txt for details.
+ */
+
+-#include "stdio.h"
+-#include "stdlib.h"
+-
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+
+
+ int main(int argc, char *argv[])
diff --git a/sci-libs/libbufr/files/libbufr-makefile.patch b/sci-libs/libbufr/files/libbufr-makefile.patch
new file mode 100644
index 00000000000..bc6196245ee
--- /dev/null
+++ b/sci-libs/libbufr/files/libbufr-makefile.patch
@@ -0,0 +1,11 @@
+--- Makefile.orig 2011-03-16 22:05:18.000000000 -0700
++++ Makefile 2011-03-16 22:05:40.000000000 -0700
+@@ -10,7 +10,7 @@
+ ( echo "*************************"; \
+ echo "*** Make in $$name "; \
+ echo "*************************"; \
+- cd $$name ; make LIB=bufr ; ) done
++ $(MAKE) -C $$name LIB=bufr ; ) done
+
+ clean :
+ @for name in $(SUBDIRS); do\
diff --git a/sci-libs/libbufr/libbufr-000387.ebuild b/sci-libs/libbufr/libbufr-000387.ebuild
new file mode 100644
index 00000000000..0b274be76ff
--- /dev/null
+++ b/sci-libs/libbufr/libbufr-000387.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils fortran-2 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 ~ppc ~ppc64 ~x86"
+IUSE="debug doc examples"
+
+RDEPEND=""
+DEPEND="sys-apps/findutils"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ case "$(tc-getFC)" in
+ *gfortran)
+ export CNAME="_gfortran"
+ ;;
+ *g77)
+ export CNAME="_gnu"
+ ;;
+ *pgf90|*pgf77)
+ export CNAME=""
+ ;;
+ ifc|ifort)
+ export CNAME="_intel"
+ ;;
+ esac
+
+ elog "Note non-GNU compilers are not currently supported on non-x86"
+ elog "architectures. If you need it, please subit a patch..."
+
+ export target="linux"
+ export A64=""
+ export R64=""
+ case "${ARCH}" in
+ amd64)
+ export R64="R64"
+ export A64="A64"
+ ;;
+ ppc64)
+ export target="ppc_G5"
+ ;;
+ ppc)
+ export target="ppc"
+ ;;
+ *)
+ ;;
+ esac
+}
+
+src_prepare() {
+ update_configs
+ epatch "${FILESDIR}"/${PN}-makefile.patch
+
+ local config="config/config.$target$CNAME$R64$A64"
+
+ if [[ "${ARCH}" == "ppc" ]] ; then
+ sed -i -e "s|= -mcpu=G4 -mtune=G4|= |" $config
+ elif [[ "${ARCH}" == "ppc64" ]] ; then
+ sed -i -e "s|= -mcpu=G5 -mtune=G5|= |" $config
+ fi
+
+ sed -i -e "s:DEBUG = -O2:DEBUG = -g:g" $config
+
+ # add local CFLAGS to and build flags
+ use debug || sed -i -e "s|\$(DEBUG)|${CFLAGS}|" $config
+
+ # add local LDFLAGS to link commands
+ sed -i \
+ -e "s|-o|${LDFLAGS} -o|" \
+ examples/Makefile \
+ bufrtables/Makefile
+}
+
+src_compile() {
+ EBUILD_ARCH="${ARCH}"
+ EBUILD_CFLAGS="${CFLAGS}"
+ unset ARCH CFLAGS
+ tc-export CC
+ append-flags -DTABLE_PATH="/usr/share/bufrtables"
+
+ # emake won't work with this fossil...
+ make ARCH=$target || die "make failed"
+
+ pushd examples > /dev/null
+ make ARCH=$target decode_bufr bufr_decode \
+ create_bufr decode_bufr_image tdexp \
+ || die "make examples failed"
+ popd > /dev/null
+
+ generate_files
+
+ ARCH="${EBUILD_ARCH}"
+ CFLAGS="${EBUILD_CFLAGS}"
+}
+
+src_test() {
+ cd "${S}"/examples
+ BUFR_TABLES="${S}/bufrtables/" ./decode_bufr -i \
+ ../data/ISMD01_OKPR.bufr < ../response_file
+}
+
+src_install() {
+ # install library
+ dolib.a libbufr$R64.a
+
+ dosbin bufrtables/{bufr2txt_tables,bufr_split_tables,txt2bufr_tables}
+ dobin examples/{create_bufr,decode_bufr,decode_bufr_image,tdexp}
+
+ 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() {
+ ## Do not remove blank lines from the response file
+ cat <<-EOF > 20${PN}
+ BUFR_TABLES="/usr/share/bufrtables"
+ CONFIG_PROTECT="/usr/share/bufrtables"
+ EOF
+
+ cat <<-EOF > response_file
+ N
+ N
+ N
+ 1
+
+ N
+ EOF
+}
+
+update_configs() {
+ find . -type f | xargs chmod -x
+ chmod +x bufrtables/links.sh
+ cp options/options_linux options/options_ppc
+ cp options/options_linux options/options_ppc_G5
+ cp pbio/sources.linux pbio/sources.ppc
+ cp pbio/sources.linux pbio/sources.ppc_G5
+ pushd config > /dev/null
+ cp config.ppc config.ppc_gfortran
+ cp config.ppcR64 config.ppc_gfortranR64
+ cp config.ppc_G5 config.ppc_G5_gfortran
+ cp config.ppcR64_G5 config.ppc_G5_gfortranR64
+ popd > /dev/null
+}
diff --git a/sci-libs/libbufr/metadata.xml b/sci-libs/libbufr/metadata.xml
new file mode 100644
index 00000000000..69b4f2ff140
--- /dev/null
+++ b/sci-libs/libbufr/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-geosciences</herd>
+ <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>