File f2c.spec of Package f2c

# spec file for package f2c (Version 0.11)
# Copyright (c) 2010 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

# norootforbuild

Name:           f2c
BuildRequires:  tcsh unzip
License:        MIT
Group:          Development/Languages/Fortran
AutoReqProv:    on
# bug437293
%ifarch ppc64
Obsoletes:      f2c-64bit
Version:        0.11
Release:        1197
Summary:        A Fortran-77 to C Translator
Source:         f2c.tgz
Source1:        yaf77-1.6.tgz
Source3:        f2c.h.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

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

    David Gay <>
    Stu Feldman
    Mark Maimone
    Norm Schryer
    Rob Hooft (maintainer for Linux) <Hooft@EMBL-Heidelberg.DE>

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

(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

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/ $RPM_BUILD_ROOT%_libdir
(cd $RPM_BUILD_ROOT%_libdir && ln -s && ln -s
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/f2c
install -m 644 changes disclaimer 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



%docdir %{_defaultdocdir}/f2c
%doc %{_mandir}/man1/f2c.1.gz