diff options
author | Steve Arnold <nerdboy@gentoo.org> | 2011-05-03 05:23:55 +0000 |
---|---|---|
committer | Steve Arnold <nerdboy@gentoo.org> | 2011-05-03 05:23:55 +0000 |
commit | ef229aac657facd4e4f6fc100bdabd392ee3af00 (patch) | |
tree | 32716ff81c299a2f7c0b2f6a10c98555bc75e3f5 /sci-libs/libbufr | |
parent | version bump for baselayout-2 and openrc support (diff) | |
download | gentoo-2-ef229aac657facd4e4f6fc100bdabd392ee3af00.tar.gz gentoo-2-ef229aac657facd4e4f6fc100bdabd392ee3af00.tar.bz2 gentoo-2-ef229aac657facd4e4f6fc100bdabd392ee3af00.zip |
Updated to newer upstream version, including tests.
(Portage version: 2.1.9.46/cvs/Linux x86_64)
Diffstat (limited to 'sci-libs/libbufr')
-rw-r--r-- | sci-libs/libbufr/ChangeLog | 8 | ||||
-rw-r--r-- | sci-libs/libbufr/files/libbufr-makefile.patch | 11 | ||||
-rw-r--r-- | sci-libs/libbufr/libbufr-000387.ebuild | 194 |
3 files changed, 212 insertions, 1 deletions
diff --git a/sci-libs/libbufr/ChangeLog b/sci-libs/libbufr/ChangeLog index aa7f9c2871a3..7c9eab0087dd 100644 --- a/sci-libs/libbufr/ChangeLog +++ b/sci-libs/libbufr/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sci-libs/libbufr # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/libbufr/ChangeLog,v 1.4 2011/03/17 06:20:45 nerdboy Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-libs/libbufr/ChangeLog,v 1.5 2011/05/03 05:23:55 nerdboy Exp $ + +*libbufr-000387 (03 May 2011) + + 03 May 2011; Steve Arnold <nerdboy@gentoo.org> +libbufr-000387.ebuild, + +files/libbufr-makefile.patch: + Updated to newer upstream version, including tests. 17 Mar 2011; Steve Arnold <nerdboy@gentoo.org> libbufr-000360.ebuild: Updated to address static makefiles ignoring flags; see bug 334901. diff --git a/sci-libs/libbufr/files/libbufr-makefile.patch b/sci-libs/libbufr/files/libbufr-makefile.patch new file mode 100644 index 000000000000..bc6196245ee0 --- /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 000000000000..c0021db6c9a4 --- /dev/null +++ b/sci-libs/libbufr/libbufr-000387.ebuild @@ -0,0 +1,194 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/libbufr/libbufr-000387.ebuild,v 1.1 2011/05/03 05:23:55 nerdboy Exp $ + +EAPI="3" + +inherit 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 ~ppc ~ppc64 ~x86" +# needs someone to test on these: ~alpha ~hppa ~ia64 ~sparc etc ... + +IUSE="debug doc examples" + +RDEPEND="" + +DEPEND="sys-apps/findutils" + +S=${WORKDIR}/${MY_P} + +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() { + 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 +} |