File exodusii.spec of Package exodusii

#
# exodusii.spec
#
# Copyright (c) 2016 Christoph Junghans <junghans@votca.org>
#
# Licensed under the Apache Software License (ASL 2.0)
#

Name:           exodusii
Version:        6.02
%define libver	5.14.0
%define libusc	5_14_0
Release:        0
Summary:        Library to store and retrieve transient finite element data
Group:          Productivity/Scientific/Math
License:        BSD-3-Clause
Url:            http://sourceforge.net/projects/exodusii/
Source:         http://distfiles.gentoo.org/distfiles/exodus-%{version}.tar.gz
Patch1:         sovers.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  gcc-c++
BuildRequires:  gcc-fortran
BuildRequires:  cmake
BuildRequires:  netcdf-devel
BuildRequires:  zlib-devel

%description
EXODUS II is a model developed to store and retrieve data for finite element
analyses. It is used for preprocessing (problem definition), postprocessing
(results visualization), as well as code to code data transfer. An EXODUS II
data file is a random access, machine independent, binary file that is written
and read via C, C++, or Fortran library routines which comprise the
Application Programming Interface (API).

%package -n libexoIIv2c-%libusc
Summary:        ExodusII C library
Group:          Productivity/Scientific/Math

%description -n libexoIIv2c-%libusc
EXODUS II is a model developed to store and retrieve data for finite element
analyses. It is used for preprocessing (problem definition), postprocessing
(results visualization), as well as code to code data transfer. An EXODUS II
data file is a random access, machine independent, binary file that is written
and read via C, C++, or Fortran library routines which comprise the
Application Programming Interface (API).

This package contains the C library for exodusII.

%package -n libexoIIv2for-%libusc
Summary:        ExodusII Fortran library
Group:          Productivity/Scientific/Math

%description -n libexoIIv2for-%libusc
EXODUS II is a model developed to store and retrieve data for finite element
analyses. It is used for preprocessing (problem definition), postprocessing
(results visualization), as well as code to code data transfer. An EXODUS II
data file is a random access, machine independent, binary file that is written
and read via C, C++, or Fortran library routines which comprise the
Application Programming Interface (API).

This package contains the Fortran library for exodusII.

%package devel
Summary:    Development headers and libraries for exodusII
Group:      Development/Libraries/C and C++
Requires:   libexoIIv2c-%libusc = %{version}
Requires:   libexoIIv2for-%libusc = %{version}

%description devel
EXODUS II is a model developed to store and retrieve data for finite element
analyses. It is used for preprocessing (problem definition), postprocessing
(results visualization), as well as code to code data transfer. An EXODUS II
data file is a random access, machine independent, binary file that is written
and read via C, C++, or Fortran library routines which comprise the
Application Programming Interface (API).

This package contains development headers and libraries for exodusII.

%prep
%setup -n exodus-%{version} -q
%patch -P 1 -p1

%build
cd exodus
%if %{undefined cmake}
%define cmake cmake
mkdir build
cd build
%endif
%{cmake} \
 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
 -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
 -DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_SKIP_RPATH:BOOL=ON \
 -DBUILD_SHARED=ON \
 ..
make %{?_smp_mflags}

%install
cd exodus
cd build
make install DESTDIR=%{buildroot}
[[ %{_lib} = lib ]] || mv %{buildroot}/%{_prefix}/{lib,%{_lib}}
ln -s libexoIIv2c-%version.so "%buildroot/%_libdir/libexoIIv2c.so"
ln -s libexoIIv2for-%version.so "%buildroot/%_libdir/libexoIIv2for.so"
find %buildroot
 
%post -n libexoIIv2c-%libusc -p /sbin/ldconfig
%post -n libexoIIv2for-%libusc -p /sbin/ldconfig
%postun -n libexoIIv2c-%libusc -p /sbin/ldconfig
%postun -n libexoIIv2for-%libusc -p /sbin/ldconfig

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/libexoIIv2c.so
%{_libdir}/libexoIIv2for.so

%files -n libexoIIv2c-%libusc
%defattr(-,root,root)
%{_libdir}/libexoIIv2c-%libver.so

%files -n libexoIIv2for-%libusc
%defattr(-,root,root)
%{_libdir}/libexoIIv2for-%libver.so
 
%changelog
openSUSE Build Service is sponsored by