File babel.spec of Package babel

#
# spec file for package babel
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           babel
Version:        2.0.0
Release:        0
Summary:        A high-performance language interoperability tool
License:        LGPL-2.1
Group:          System/Libraries
Url:            https://computation.llnl.gov/casc/components/
Source0:        %{name}-%{version}.tar.xz
Patch0:         %{name}-2.0.0-64bit-portability.patch
Patch1:         %{name}-2.0.0-babel-config-no-rpath.patch
%if 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
Requires:       %{name}-libs = %{version}
Requires:       %{name}-java = %{version}
# openbabel package contains /usr/bin/babel binary
Conflicts:      openbabel
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gcc-fortran
BuildRequires:  java-devel
BuildRequires:  jpackage-utils
BuildRequires:  libparsifal-devel
%if 0%{?suse_version} >= 1220
BuildRequires:  libtool
%endif
BuildRequires:  libxml2-devel
BuildRequires:  pkgconfig
BuildRequires:  python-numpy-devel
BuildRequires:  xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Babel is a high-performance language interoperability tool. The project
is mainly developed at the Center for Applied Scientific Computing (CASC)
at Lawrence Livermore National Laboratory (LLNL). Babel started as an
internal Lab Directed Research and Development (LDRD) project in 2000
and has been under constant development since then. It is now funded
mainly under the U.S. Department of Energy (DOE) Office of Science's
SciDAC program.

Babel currently fully supports C, C++, FORTRAN 77, Fortran 90/95,
Fortran 2003/2008, Python, and Java.

%package        libs
Summary:        A high-performance language interoperability tool
Group:          System/Libraries
Provides:       libchasmlite-2_0_0 = %{version}
Provides:       libsidl-2_0_0 = %{version}
Provides:       libsidlstub_cxx-2_0_0 = %{version}
Provides:       libsidlstub_f77-2_0_0 = %{version}
Provides:       libsidlstub_f90-2_0_0 = %{version}
Provides:       libsidlstub_java-2_0_0 = %{version}
Provides:       libsidlx-2_0_0 = %{version}
Requires:       java >= 1.5.0

%description    libs
Babel is a high-performance language interoperability tool. The project
is mainly developed at the Center for Applied Scientific Computing (CASC)
at Lawrence Livermore National Laboratory (LLNL). Babel started as an
internal Lab Directed Research and Development (LDRD) project in 2000
and has been under constant development since then. It is now funded
mainly under the U.S. Department of Energy (DOE) Office of Science's
SciDAC program.

Babel currently fully supports C, C++, FORTRAN 77, Fortran 90/95,
Fortran 2003/2008, Python, and Java.


%package        devel
Summary:        Developments and headers files for babel
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       %{name}-java = %{version}
Requires:       gcc-c++
Requires:       gcc-fortran
Requires:       java-devel
Requires:       %{name}-libs = %{version}
Requires:       python-llnl_babel-devel = %{version}
Requires:       python-llnl_babel_sidl_sidlx-devel = %{version}

%description    devel
This package contains the developments and headers files for the babel
high-performance language interoperability tool.

%package        devel-static
Summary:        Developments and headers files for babel
Group:          Development/Libraries/C and C++
Requires:       %{name}-devel = %{version}

%description    devel-static
This package contains the developments and headers files for the babel
high-performance language interoperability tool.

%package        java
Summary:        Babel java packages
Group:          Development/Libraries/Java
Requires:       java >= 1.5.0
Requires:       jpackage-utils
Requires:       %{name}-libs = %{version}

%description    java
Babel is a language interoperability tool intended for use by
the high-performance scientific computing community.  Developed
by the Components project (http://www.llnl.gov/CASC/components)
at Lawrence Livermore National Laboratory, Babel supports the
Scientific Interface Definition Language (SIDL) for the language-
independent declaration of interfaces associated with scientific
software packages.

This package contains Babel java packages.

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Libraries/Java

%description    javadoc
This package contains a javadoc for babel.


%package     -n python-llnl_babel
Summary:        A high-performance language interoperability tool
Group:          Development/Languages/Python
Requires:       python-numpy

%description -n python-llnl_babel
Babel is a high-performance language interoperability tool.

This package contains python support experimental extension modules
for sidl.


%package     -n python-llnl_babel-devel
Summary:        A high-performance language interoperability tool
Group:          Development/Languages/Python
Requires:       python-devel
Requires:       python-llnl_babel
Requires:       python-numpy

%description -n python-llnl_babel-devel
Babel is a high-performance language interoperability tool.


%package     -n python-llnl_babel_sidl_sidlx
Summary:        A high-performance language interoperability tool
Group:          Development/Languages/Python
Requires:       python-llnl_babel
Requires:       python-numpy

%description -n python-llnl_babel_sidl_sidlx
Babel is a high-performance language interoperability tool. 

This package contains python support experimental extension modules
for sidlx.


%package     -n python-llnl_babel_sidl_sidlx-devel
Summary:        A high-performance language interoperability tool
Group:          Development/Languages/Python
Requires:       python-devel
Requires:       python-llnl_babel
Requires:       python-llnl_babel_sidl_sidlx
Requires:       python-numpy-devel

%description -n python-llnl_babel_sidl_sidlx-devel
Babel is a high-performance language interoperability tool. The project
is mainly developed at the Center for Applied Scientific Computing (CASC)


%package        doc
Summary:        A high-performance language interoperability tool
Group:          Documentation/HTML

%description    doc
Babel is a high-performance language interoperability tool. The project
is mainly developed at the Center for Applied Scientific Computing (CASC)

This package contains the pdf and html documentation  files for babel.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

# remove all binary libs
#find -type f -name "*.jar" | xargs -t rm

%build
export JAVAPREFIX="%{_libdir}/jvm/java"
export JNI_INCLUDES="%{_libdir}/jvm/java/include"
%configure \
          --includedir=/usr/include/%{name} \
          --with-libxml2=%{_prefix} \
          --with-libparsifal=%{_prefix} \
          --with-ltdl-lib=%{_libdir} \
          --with-ltdl-include=%{_includedir}
make %{?_smp_mflags}

%install
%makeinstall

# move jar files into jar directory
mkdir -p %{buildroot}%{_javadir}/%{name}
mv %{buildroot}%{_prefix}/lib/*.jar %{buildroot}%{_javadir}/%{name}
rm %{buildroot}%{_prefix}/lib/*.INFO
rm %{buildroot}%{_prefix}/lib/*.NOTICE
rm %{buildroot}%{_prefix}/lib/*.LICENSE
rm %{buildroot}%{_prefix}/lib/LICENSE-SAX.html

# fix jar directory in binary
sed -i 's|\${prefix}/lib|%{_javadir}/%{name}|g' %{buildroot}%{_bindir}/babel*

# remove unwanted files
find %{buildroot}%{_libdir} -type f -name *.la -exec rm {} \;

# rename conflicted files
mv %{buildroot}%{_datadir}/aclocal/libtool.m4 \
        %{buildroot}%{_datadir}/aclocal/libtool-%{name}.m4
mv %{buildroot}%{_datadir}/aclocal/ltdl.m4 \
        %{buildroot}%{_datadir}/aclocal/ltdl-%{name}.m4

# remove trace of buildroot
sed -i 's|%{buildroot}||' %{buildroot}%{_libdir}/libsidl*.scl

# javadoc
install -d -m 755 %{buildroot}/%{_javadocdir}/%{name}-%{version}
mv %{buildroot}%{_datadir}/doc/%{name}-%{version}/compiler-javadoc \
        %{buildroot}%{_javadocdir}/%{name}-%{version}/

# will be in doc package
rm -rf %{buildroot}%{_datadir}/doc/%{name}-%{version}

%fdupes -s %{buildroot}

# Fix python-bytecode-inconsistent-mtime
pushd %{buildroot}%{python_sitearch}
%py_compile .
popd

%clean
rm -rf %{buildroot}

%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc ANNOUNCE BUGS CHANGES README LICENSE COPYRIGHT THANKS
%{_bindir}/babel*
%{_datadir}/%{name}-%{version}
%{_datadir}/%{name}-runtime-%{version}
%{_datadir}/sgml/%{name}-%{version}
%{_mandir}/man1/%{name}.*
%{_datadir}/sidl*

%files libs
%defattr(-,root,root,-)
%{_libdir}/*-%{version}.so

%files devel
%defattr(-,root,root,-)
%{_datadir}/aclocal/*
%{_libdir}/*.scl
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}_config.h
%{_includedir}/%{name}
%exclude %{_libdir}/*-%{version}.so

%files devel-static
%defattr(-,root,root,-)
%{_libdir}/*.a

%files java
%defattr(-,root,root,-)
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/*.jar

%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}-%{version}/

%files -n python-llnl_babel
%defattr(-,root,root,-)
%{python_sitearch}/llnl_babel-1.5.0-py%{py_ver}.egg-info
%{python_sitearch}/sidl
%{python_sitearch}/sidl*.so
%{python_sitearch}/sidl*.py*

%files -n python-llnl_babel-devel
%defattr(-,root,root,-)
%{_includedir}/python%{py_ver}/llnl_babel

%files -n python-llnl_babel_sidl_sidlx
%defattr(-,root,root,-)
%{python_sitearch}/llnl_babel_sidl_sidlx-0.0.0-py%{py_ver}.egg-info
%{python_sitearch}/sidlx

%files -n python-llnl_babel_sidl_sidlx-devel
%defattr(-,root,root,-)
%{_includedir}/python%{py_ver}/llnl_babel_sidl_sidlx

%files doc
%defattr(-,root,root,-)
%doc doc/manuals/html/users_guide doc/manuals/users_guide.pdf

%changelog
openSUSE Build Service is sponsored by