Blob Blame History Raw
# Package whose only architecture dependent binary is a library
%global debug_package %{nil}

Name:           cgnslib
Version:        2.5
Release:        5.r2%{?dist}
Summary:        Computational Fluid Dynamics General Notation System

Group:          Development/Libraries
License:        zlib
URL:            http://www.cgns.org/

Source:         http://downloads.sourceforge.net/project/cgns/%{name}_%{version}/Release%204/%{name}_%{version}-5.tar.gz
Source1:        http://www.grc.nasa.gov/WWW/cgns/user/usersguide.pdf
Patch0:         cgnslib-2.5-4-set-so.patch
Patch1:         cgnslib-2.5-5-replace-exit-to-return.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  hdf5-devel >= 1.8
BuildRequires:  zlib-devel
BuildRequires:  gcc-gfortran
BuildRequires:  chrpath
Requires:       hdf5

%description
The Computational Fluid Dynamics General Notation System (CGNS) provides 
a general, portable, and extensible standard for the storage and
retrieval of computational fluid dynamics (CFD) analysis
data. It consists of a collection of conventions, and free
and open software implementing those conventions. It is
self-descriptive, machine-independent, well-documented, and
administered by an international steering committee.


%package devel
Summary:      Header files for %{name} package
Group:        Development/Libraries
Requires:     %{name} = %{version}-%{release}   
Requires:     hdf5-devel

%description devel
The %{name}-devel package contains the header files
for %{name} package.

%prep
%setup -q -n %{name}_%{version}
%patch0 -p1 -b .so
%patch1 -p1 -b .exit

%{__sed} -i -e "s|LIBDIR.*= @LIBDIR@|LIBDIR = \$(DESTDIR)@LIBDIR@|" \
            -e "s|INCLUDEDIR.*= @INCLUDEDIR@|INCLUDEDIR = \$(DESTDIR)@INCLUDEDIR@|" \
            make.defs.in
            
%{__sed} -i "s|dbtest|./dbtest|" tests/rundbtest

%{__cp} %{SOURCE1} %{_builddir}/%{name}_%{version}

%build
%configure --enable-gcc      \
           --enable-shared   \
           --enable-lfs      \
           --with-zlib       \
%ifarch x86_64 ppc64 sparc64
           --enable-64bit    \
%endif
           --with-hdf5 

%{__make} %{?_smp_mflags}


%install
%{__rm} -rf %{buildroot}
%{__mkdir} -p %{buildroot}%{_libdir}
%{__mkdir} -p %{buildroot}%{_includedir}
%{__mkdir} -p %{buildroot}%{_docdir}
%{__make} INSTALL="install -p" install DESTDIR=%{buildroot}

chrpath --delete %{buildroot}%{_libdir}/libcgns.so.1.0
chmod 0755  %{buildroot}%{_libdir}/libcgns.so.1.0


%ifarch x86_64 ppc64 sparc64
%{__cp} -pP LINUX64/libcgns.so %{buildroot}%{_libdir}
%else
%{__cp} -pP LINUX/libcgns.so %{buildroot}%{_libdir}
%endif


%check
cd tests
%{__make}
./rundbtest

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc LICENSE README
%{_libdir}/libcgns.so.1.0

%files devel
%defattr(-,root,root,-)
%doc usersguide.pdf
%{_includedir}/cgnslib.h
%{_includedir}/cgnslib_f.h
%{_includedir}/cgnswin_f.h
%{_libdir}/libcgns.so

%changelog
* Thu Sep 01 2011 Shakthi Kannan <shakthimaan [AT] fedoraproject DOT org> 2.5-5.r2
- Added hdf5 to Requires, and hdf5-devel to devel Requires.

* Thu Feb 17 2011 Shakthi Kannan <shakthimaan [AT] fedoraproject DOT org> 2.5-5.r1
- Updated to 2.5-5 release.

* Sun Jul 18 2010 Shakthi Kannan <shakthimaan [AT] fedoraproject DOT org> 2.5-3.r4
- Use zlib license that supercedes LGPLv2.

* Fri Jul 16 2010 Shakthi Kannan <shakthimaan [AT] fedoraproject DOT org> 2.5-2.r4
- Expanded CFD abbreviation.
- Added -devel sub-package.
- Added global debug_package nil.
- Added patch for creating shared library with soname.
- Added patch to fix library returning exit.
- Added usersguide.pdf to -devel sub-package.
- hdf5 atleast 1.8 is required.
- Added if condition for matching LINUX64 when copying library.

* Sat Aug 15 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 2.5-1.r4
- New Package