File f2c.spec of Package f2c

#
# spec file for package f2c
#
# Copyright (c) 2011 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:           f2c
BuildRequires:  tcsh unzip
License:        MIT
Group:          Development/Languages/Fortran
# bug437293
%ifarch ppc64
Obsoletes:      f2c-64bit
%endif
#
Version:        0.11
Release:        1197
Summary:        A Fortran-77 to C Translator
Source:         f2c.tgz
Source1:        yaf77-1.6.tgz
Source2:        libf2c.zip
Source3:        f2c.h.gz
Source4:        f2c.ps.gz
Source5:        permission.gz
Source6:        readme.gz
Source7:        disclaimer.gz
Source8:        changes.gz
Source9:        f2c.1t.gz
Source10:       fc.gz
Source11:       baselibs.conf
Patch:          f2c.dif
Patch1:         tmpfile-fix.patch
Patch2:         f2c-optflags.patch
Patch3:         yyparse.patch
Patch4:         f2c-integer.diff
Patch5:         f2c-malloccheck.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Contains libf2c.so.0.11, ported by Rob Hooft. This package uses an
'f77' script that hides the C translation process from the user.

%prep
%setup -c 
unzip $RPM_SOURCE_DIR/libf2c.zip
tar xvpfz $RPM_SOURCE_DIR/yaf77-1.6.tgz
cp -av $RPM_SOURCE_DIR/*.gz .
gunzip *.gz
mv f2c.h libf2c/f2c.h0
%patch
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4
%patch5

%build
(cd src && make CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing")
(cd libf2c && sh ./make.elf)
(cd libf2c && make -f makefile.u CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing")
pushd yaf77-1.6/F77ext
F2C=../../src/f2c make FFLAGS=-I../../libf2c CFLAGS=-I../../libf2c %{?_smp_mflags}
popd

%install
mkdir -p $RPM_BUILD_ROOT/usr/{bin,include,%_lib}
install -m 755 src/f2c f77-f2c $RPM_BUILD_ROOT/usr/bin
install -m 644 libf2c/f2c.h $RPM_BUILD_ROOT/usr/include
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
install -m 644 f2c.1t $RPM_BUILD_ROOT%{_mandir}/man1/f2c.1
install -m 644 libf2c/libf2c.a $RPM_BUILD_ROOT%_libdir
install -m 755 libf2c/libf2c.so.0.11 $RPM_BUILD_ROOT%_libdir
(cd $RPM_BUILD_ROOT%_libdir && ln -s libf2c.so.0.11 libf2c.so && ln -s libf2c.so.0.11 libf2c.so.0)
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/f2c
install -m 644 changes disclaimer f2c.ps permission fc $RPM_BUILD_ROOT%{_defaultdocdir}/f2c
install -m 644 libf2c/hello.f Changelog.SuSE $RPM_BUILD_ROOT%{_defaultdocdir}/f2c
install -m 755 yaf77-1.6/f77 $RPM_BUILD_ROOT/usr/bin/yaf77
install -m 644 yaf77-1.6/README $RPM_BUILD_ROOT%{_defaultdocdir}/f2c/README.yaf77
install -m 644 yaf77-1.6/F77ext/libF77ext.a $RPM_BUILD_ROOT%_libdir

%post
%run_ldconfig

%postun
%run_ldconfig

%files
%defattr(-,root,root)
%docdir %{_defaultdocdir}/f2c
%{_defaultdocdir}/f2c
/usr/bin/f2c
/usr/bin/f77-f2c
/usr/bin/yaf77
/usr/include/f2c.h
%_libdir/libF77ext.a
%_libdir/libf2c.a
%_libdir/libf2c.so
%_libdir/libf2c.so.0
%_libdir/libf2c.so.0.11
%doc %{_mandir}/man1/f2c.1.gz

%changelog
openSUSE Build Service is sponsored by