Blob Blame History Raw
%if "%fedora" > "6"
%bcond_without gfortran
%else
%bcond_with gfortran
%endif

# compiler is used to disambiguate package names and executables
%if %{with gfortran}
%else
%define compiler -g77
%endif
# verdir is the directory used for libraries and replaces the version 
# in some files and file names
%define verdir %{version}%{?compiler}
# data files should be the same and therefore parallel installable

Name:          cernlib%{?compiler}
Version:       2006
Release:       7%{?dist}
Summary:       General purpose CERN library and associated binaries
Group:         Development/Libraries
# As explained in the cernlib on debian FAQ, cfortran can be considered LGPL.
# http://borex.princeton.edu/~kmccarty/faq.html#44
License:       GPL/LGPL
URL:           http://cernlib.web.cern.ch/cernlib/
# mandrake
#BuildRequires: libxorg-x11-devel lesstif-devel libblas3-devel liblapack3-devel
#BuildRequires: gcc-g77
#Requires:      libxorg-x11-devel lesstif-devel libblas3-devel liblapack3-devel
# fedora core
%if "%fedora" > "5"
BuildRequires: lesstif-devel
%else
BuildRequires: openmotif-devel
%endif

%if "%fedora" <= "3"
BuildRequires: lapack blas
%else
BuildRequires: lapack-devel blas-devel
%endif

%if "%fedora" <= "4"
BuildRequires: xorg-x11-devel 
%else
BuildRequires: imake 
# workaround #173530
BuildRequires: libXau-devel
%endif

BuildRequires: xbae-devel libXaw-devel

# for patchy build scripts
BuildRequires: tcsh
BuildRequires: gawk

BuildRequires: desktop-file-utils

%if %{with gfortran}
BuildRequires: gcc-gfortran
%else
BuildRequires: /usr/bin/g77
%endif
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# these sources are different from the upstream sources as files with 
# GPL incompatible licences are removed. You can use cernlib-remove-deadpool
# and cernlib-deadpool.txt to recreate them from the upstream
# In a directory with the cernlib sources, issue 
# sh cernlib-remove-deadpool 

# source is now monolithic
#Source0: http://wwwasd.web.cern.ch/wwwasd/cernlib/download/2006_source/tar/2006_src.tar.gz
Source0: 2006_src-free.tar.gz

# The patchy version 4 sources. Mattias Ellert gave it so me in a mail.
Source17: patchy.tar.gz
# this is modified with regard with what Mattias gave me. Indeed the file
# containing some other files (p4inceta) was in fortran unformatted format, 
# I believe it is what caused a segfault of rceta on the ppc platform.
# I have recreated the patchy.tar.gz from Mattias tarball by running
# sh patchy-unpack-rceta
Source203: patchy-unpack-rceta 

# Shell scripts that go in /etc/profile.d
Source100: cernlib.sh.in
Source105: cernlib.csh.in
# m4 macros for autoconf
Source101: cernlib.m4
# README file for paw slightly modified from the debian
Source102: paw.README
# README file that lists the changes done in the package
Source103: cernlib.README
# mkdirhier is used to create directories. Taken from xorg-x11
Source104: mkdirhier
# Files that can be used in the SOURCE directory to remove files with
# GPL incompatible licences from upstream sources
Source200: cernlib-remove-deadpool
Source201: cernlib-deadpool.txt
# copyright.in from the non split debian patchset
Source203: cernlib-debian-copyright.in

# debian patchsets
Patch100001: http://ftp.debian.org/debian/pool/main/c/cernlib/cernlib_2006.dfsg-1.diff.gz
Patch100002: http://ftp.debian.org/debian/pool/main/p/paw/paw_2.14.04.dfsg-1.diff.gz
Patch100003: http://ftp.debian.org/debian/pool/main/m/mclibs/mclibs_2006.dfsg-1.diff.gz
Patch100004: http://ftp.debian.org/debian/pool/main/g/geant321/geant321_3.21.14.dfsg-4.diff.gz
# change file to directory to DATADIR
Patch1100: cernlib-enforce-FHS.diff
Patch1: geant321-001-fix-missing-fluka.dpatch
# mclibs debian split also remove other packages from LIBDIRS
Patch2: 002-fix-missing-mclibs.dpatch
Patch3: geant321-003-geant-dummy-functions.dpatch
Patch100: mclibs-100-fix-isajet-manual-corruption.dpatch
Patch101: mclibs-101-undefine-PPC.dpatch
Patch10201: cernlib-102-dont-optimize-some-code.dpatch
Patch10202: paw-102-dont-optimize-some-code.dpatch
Patch10203: mclibs-102-dont-optimize-some-code.dpatch
Patch103: cernlib-103-ignore-overly-long-macro-in-gen.h.dpatch
Patch104: cernlib-104-fix-undefined-insertchar-warning.dpatch
Patch10501: cernlib-105-fix-obsolete-xmfontlistcreate-warning.dpatch 
Patch10502: paw-105-fix-obsolete-xmfontlistcreate-warning.dpatch 
Patch106: cernlib-106-fix-paw++-menus-in-lesstif.dpatch
Patch107: cernlib-107-define-strdup-macro-safely.dpatch
Patch108: paw-108-quote-protect-comis-script.dpatch
# use xsneut95.dat from the archive
Patch109: geant321-109-fix-broken-xsneut95.dat-link.dpatch
Patch110: cernlib-110-ignore-included-lapack-rule.dpatch
Patch111: cernlib-111-fix-kuesvr-install-location.dpatch
Patch112: cernlib-112-remove-nonexistent-prototypes-from-gen.h.dpatch
# a workaround for cups. Applied in doubt.
# removed in 2006
#Patch113: cernlib-113-cups-postscript-fix.dpatch
# it is the same in all source packages...
Patch114: 114-install-scripts-properly.dpatch
Patch115: cernlib-115-rsrtnt64-goto-outer-block.dpatch
Patch116: cernlib-116-fix-fconc64-spaghetti-code.dpatch
Patch117: geant321-117-fix-optimizer-bug-in-gphot.dpatch
Patch118: cernlib-118-rename-mathlib-common-blocks.dpatch
Patch11901: cernlib-119-fix-compiler-warnings.dpatch
Patch11902: paw-119-fix-compiler-warnings.dpatch
Patch12001: cernlib-120-fix-gets-usage-in-kuipc.dpatch 
Patch12002: paw-120-fix-mlp-cdf-file.dpatch
Patch12101: cernlib-121-fix-mathlib-test-case-c209m.dpatch
Patch12102: paw-121-call-gfortran-in-cscrexec.dpatch
Patch200: paw-200-comis-allow-special-chars-in-path.dpatch
Patch201: cernlib-201-update-kuip-helper-apps.dpatch
Patch202: cernlib-202-fix-includes-in-minuit-example.dpatch
Patch203: geant321-203-compile-geant-with-ertrak.dpatch
Patch204: mclibs-204-compile-isajet-with-isasrt.dpatch
Patch205: cernlib-205-max-path-length-to-256.dpatch
Patch206: mclibs-206-herwig-uses-DBLE-not-REAL.dpatch
Patch207: paw-207-compile-temp-libs-with-fPIC.dpatch
# without that patch the binaries are linked with something like
# libzftplib.a /builddir/build/BUILD/cernlib-2005/2005/build/packlib/cspack/programs/zftp/libzftplib.a
Patch208: cernlib-208-fix-redundant-packlib-dependencies.dpatch
Patch209: cernlib-209-ignore-unneeded-headers-in-kmutil.c.dpatch
# in debian split the patches are specific for paw geant and mclibs but
# not cernlib. Here we keeep the cernlib one since it contains all the others
Patch210: 210-improve-cfortran-header-files.dpatch
# split in newer debian patchset
# in debian split there is a common part at the beginning of the patch
# 
# obsolete in 2006:
# 211-support-amd64-and-itanium corresponds with a merge of
# cernlib-211-support-amd64-and-itanium.dpatch
# paw-211-support-amd64-and-itanium.dpatch
# 
# in 2006
# paw-211-support-amd64-and-itanium.dpatch has the common part removed
Patch21101: cernlib-211-support-amd64-and-itanium.dpatch
Patch21102: paw-211-support-amd64-and-itanium.dpatch
Patch2111: cernlib-211-support-digital-alpha.dpatch
Patch300: cernlib-300-skip-duplicate-lenocc.dpatch
# Use another approach, see cernlib-enforce-FHS
# Patch33: 301-datafiles-comply-with-FHS.dpatch
# use cernlib-gxint-script.diff instead and sed for paw and dzedit.script
# Patch34: 302-scripts-comply-with-FHS.dpatch
Patch303: cernlib-303-shadow-passwords-supported.dpatch
Patch304: cernlib-304-update-Imake-config-files.dpatch
Patch30501: paw-305-use-POWERPC-not-PPC-as-test.dpatch
Patch30502: mclibs-305-use-POWERPC-not-PPC-as-test.dpatch
# the bug in /usr/include/assert.h seems to be present in FC-4. So a local
# version is provided in that patch. Will have to look at newer glibc-headers
# packages
# it is the same in all packages in cernlib split
Patch306: 306-patch-assert.h-for-makedepend.dpatch
# it is the same in all packages in cernlib split
Patch307: 307-use-canonical-cfortran.dpatch
Patch30801: cernlib-308-use-canonical-cfortran-location.dpatch
Patch30802: paw-308-use-canonical-cfortran-location.dpatch
Patch309: mclibs-309-define-dummy-herwig-routines.dpatch
Patch310: mclibs-310-define-dummy-fowl-routines.dpatch
# The zebra qnexte is a fake, removing it remove an unneeded dependency.
# the other qnext don't seem to be the same code? They are duplicate symbols
# anyway so one must be removed
Patch311: cernlib-311-skip-duplicate-qnext.dpatch
Patch312: mclibs-312-skip-duplicate-gamma.dpatch
# It is a departure from upstream. Apply, but may revert if not agreed.  
Patch31301: cernlib-313-comis-preserves-filename-case.dpatch
Patch31302: paw-313-comis-preserves-filename-case.dpatch
# fixed in 2006
#Patch314: cernlib-314-permit-using-regcomp-for-re_comp.dpatch
# first chunk of the patches are the same in the split cernlib
Patch315: 315-fixes-for-MacOSX.dpatch

Patch318: cernlib-318-additional-gcc-3.4-fixes.dpatch
# certainly not needed, but who knows?
Patch319: cernlib-319-work-around-imake-segfaults.dpatch
Patch32001: cernlib-320-support-ifort.dpatch
Patch32002: paw-320-support-ifort-and-gfortran.dpatch
Patch32101: cernlib-321-support-gfortran.dpatch
Patch32102: mclibs-321-support-gfortran.dpatch

# use host.def for gfortran 
Patch600: cernlib-600-use-host.def-config-file.dpatch
# in cernlib debian split also remove other packages from LIBDIRS
Patch700: 700-remove-kernlib-from-packlib-Imakefile.dpatch
Patch70101: cernlib-701-patch-hbook-comis-Imakefiles.dpatch
Patch70102: paw-701-patch-hbook-comis-Imakefiles.dpatch
Patch702: 702-patch-Imakefiles-for-packlib-mathlib.dpatch
# I would have preferred not to move the motif code to toplevel...
# in cernlib debian split also remove other packages from LIBDIRS
Patch703: 703-patch-code_motif-packlib-Imakefiles.dpatch
Patch704: cernlib-704-patch-code_kuip-higzcc-Imakefiles.dpatch
# I would have preferred not to move the motif code to toplevel...
# in paw debian split also remove other packages from LIBDIRS
Patch705: 705-patch-paw_motif-paw-Imakefiles.dpatch
Patch706: paw-706-use-external-xbae-and-xaw.dpatch

Patch800: cernlib-800-implement-shared-library-rules-in-Imake.dpatch
Patch80101: cernlib-801-non-optimized-rule-uses-fPIC-g.dpatch
Patch80102: paw-801-non-optimized-rule-uses-fPIC-g.dpatch
# in cernlib debian split also remove other packages from LIBDIRS
# otherwise patches are cleanly split
Patch802: 802-create-shared-libraries.dpatch
# in the original cernlib kxterm is built with the C compiler, which cause
# a failure if compiled with the cernlib debian script as -lg2c isn't found. 
# It is corrected in
Patch80301: cernlib-803-link-binaries-dynamically.dpatch
Patch80302: paw-803-link-binaries-dynamically.dpatch
# 803 depends on 
# 208-fix-redundant-packlib-dependencies.dpatch

# no idea about what this does
Patch804: paw-804-workaround-for-comis-mdpool-struct-location.dpatch
Patch805: cernlib-805-expunge-missing-mathlib-kernlib-symbols.dpatch 
# not needed but keep sync with debian, that'll avoid bumping sonames
Patch80601: cernlib-806-bump-mathlib-and-dependents-sonames.dpatch
Patch80602: paw-806-bump-mathlib-and-dependents-sonames.dpatch
Patch80603: geant321-806-bump-mathlib-and-dependents-sonames.dpatch
Patch80604: mclibs-806-bump-mathlib-and-dependents-sonames.dpatch

# not applied in new debian patchset (around 2005)
Patch3006: 022-no-assign-string-literals
# fixed upstream (in 2005)
Patch3007: 027-use-tmpfile-not-mktemp
# not applied in the new debian patchset
Patch3008: 031-fix-varargs-use
# fixed upstream (in 2005)
Patch3009: 048-log-to-var-log-not-tmp
# fixed upstream (in 2005)
Patch3010: 049-fix-kuesvr-security-hole
# fixed upstream (in 2005)
Patch3011: 050-make-secure-comis-tmpdir
# fixed upstream (in 2005)
Patch3012: 051-fix-miscellaneous-tmp-uses

# change the cernlib script such that -llapack -lblas is used instead of 
# cernlib lapack
# depend explicitely on libkernlib now that it is out of packlib
# use lesstif-pawlib and lesstif-packlib
# use external Xbae and Xaw
# the modified script is renamed cernlib-static later and the debian cernlib
# script is used instead.
Patch1200: cernlib-script.patch
# don't stop if the CERN variable isn't defined
Patch1201: cernlib-gxint-script.diff
# not needed in 2006
#Patch1203: cernlib-hwuli2_use_dimag.diff 
#Patch1204: cernlib-hwhiga_use_dimag.diff
# don't add prototypes if allready defined as a macro
Patch1205: cernlib-fortify.patch
# modify the cernlib man page to fit with the distribution
Patch1206: cernlib-man_static.patch
# modify the debian cernlib paw desktop file icon name
Patch1207: cernlib-fedora_desktop.patch
# fix tests Imakefiles
Patch1208: cernlib-test.patch
# don't recurse in eurodec for tests because the testcase segfaults
Patch1210: cernlib-segf_eudtest.patch
# add a tool name in soname to distinguish g77 and gfortran builds
Patch1209: cernlib-soname.patch
# kernnum test error on 64 bit
Patch1211: cernlib-64test.patch
# debian cernlib script supposes that libs are in %%_prefix, it is 
# not the case on fedora
Patch1212: cernlib-fedora_script.patch

# patchy 4
# not applied as it has allready been done by the sed one-liner in 
# patchy-unpack-rceta
Patch1500: patchy-rceta.patch

Patch1501: patchy-insecure_tmp_use.diff
#Patch1502: patchy-fcasplit.patch
# build fixes
Patch1503: patchy-p4comp.patch
# use the flags in the the p4boot.sh script and have fcasplit handle
# enough command line arguments (this fcasplit is not shipped)
Patch1507: patchy-use_OPT.patch

# patchy 5 (included in cernlib)
# correct build, use optflags and have fcasplit handle
# enough command line arguments (this fcasplit is shipped)
Patch1504: npatchy-np_flags.patch
#Patch1505: patchy-perror.patch
# in yexpand don't put temporary files in HOME, but in current directory
Patch1506: npatchy-curdir.patch

%description
CERN program library is a large collection of general purpose libraries
and modules maintained and offered on the CERN. Most of these programs 
were developed at CERN and are therefore oriented towards the needs of a 
physics research laboratory that is general mathematics, data analysis, 
detectors simulation, data-handling etc... applicable to a wide range 
of problems.

The main and devel packages are parallel installable, but not the helper
scripts from the utils subpackage.

%package devel
Summary:       General purpose CERN library static libraries and headers
%if "%fedora" <= "3"
Requires:       lapack blas
%else
Requires:       lapack-devel blas-devel
%endif
Requires: xbae-devel libXaw-devel

%if "%fedora" > "4"
# workaround #173530
Requires:      libXau-devel
%endif
Requires:      %{name} = %{version}-%{release}
Group:         Development/Libraries

# for the m4 macro directory ownership
Requires: automake

%description devel
CERN program library is a large collection of general purpose libraries
and modules maintained and offered on the CERN. Most of these programs 
were developed at CERN and are therefore oriented towards the needs of a 
physics research laboratory that is general mathematics, data analysis, 
detectors simulation, data-handling etc... applicable to a wide range 
of problems.

The cernlib-devel package contains the header files and libraries needed  
to develop programs that use the CERN library.  

%package utils
Summary:   CERN library compilation and environment setting scripts
Group:     Applications/System
Requires:  %{name}-devel = %{version}-%{release}

%description utils
CERN library compilation and environment setting scripts.

This package will conflict with other versions, therefore if you 
want to have different compile script and different environments for 
different versions of the library you have to set them by hand.

%package -n paw%{?compiler}
Group: Applications/Engineering
Summary: A program for the analysis and presentation of data

%description -n paw%{?compiler}
PAW is conceived as an instrument to assist physicists in the analysis and 
presentation of their data. It provides interactive graphical presentation 
and statistical or mathematical analysis, working on objects familiar to 
physicists like histograms, event files (Ntuples), vectors, etc. PAW is 
based on several components of the CERN Program Library.

%package -n geant321%{?compiler}
Summary:  Particle detector description and simulation tool
Group:    Applications/Engineering
Requires: cernlib-devel cernlib-utils
%description -n geant321%{?compiler}
Geant simulates the passage of subatomic particles through matter, for 
instance, particle detectors. For maximum flexibility, Geant simulations 
are performed by linking Fortran code supplied by the user with the Geant 
libraries, then running the resulting executable.

This package includes gxint, the script used to perform this linking step. 

%package -n kuipc%{?compiler}
Summary:  Cernlib's Kit for a User Interface Package (KUIP) compiler
Group:    Development/Languages
Requires: cernlib-devel

%description -n kuipc%{?compiler}
KUIPC, the Kit for a User Interface Package Compiler, is a tool to simplify 
the writing of a program's user interface code. It takes as input a Command 
Definition File (CDF) that describes the commands to be understood by the 
program, and outputs C or FORTRAN code that makes the appropriate function 
calls to set up the user interface. This code can then be compiled and linked 
with the rest of the program. Since the generated code uses KUIP routines, 
the program must also be linked against the Packlib library that contains them.

%package packlib
Group: Applications/Archiving
Summary: I/O, network and other utilities from the cernlib

%description packlib
I/O, network and miscalleneous utilities based on the CERN Program 
Library. 
According to the responsible of the cernlib debian package, some
of these utilities may have security flaws.

%package -n patchy%{?compiler}
Group: Applications/Archiving
Summary: The patchy utilities

%description -n patchy%{?compiler}
Utilities for extracting sources from patchy cards and cradles.


%prep

echo 'Building cernlib %{verdir}'

%setup -q -c 
# patchy4
%setup -q -T -D -a 17

# patch patchy 4 installer fortran generator script
# actually it is unusefull, because the unpacking has been done
# offline, see comment above.
#%patch -P 1500

%patch -P 1501

# unpack the patchy version 4 sources is done offline,
# see comment above
#pushd patchy
#        ./rceta.sh
#popd

#%patch -P 1502 -b .use_OPT
%patch -P 1503
%patch -P 1507 -p1 -b .use_OPT

# patches for FORTIFY_SOURCE, cernlib-static script and man page
%patch -P 1205 -p1 -b .fortify
%patch -P 1200 -p1 -b .script
%patch -P 1206 -p1 -b .man_static

# debian patchesets
%patch -P 100001 -p0
%patch -P 100002 -p0
%patch -P 100003 -p0
%patch -P 100004 -p0 
%patch -P 1207 -p1 -b .fedora_desktop

cp -p cernlib-2006.dfsg/debian/add-ons/bin/cernlib.in .

%patch -P 1212 -p1 -b .fedora_script

cd %{version}
%patch -P 1100 -p2
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 100 -p1
%patch -P 101 -p1
# miscompilation and ICE with optimized code should be fixed with gfortran
# there is still some code with -O0 from upstream, they are kept as-is
%if ! %{with gfortran}
%patch -P 10201 -p1
%patch -P 10202 -p1
%patch -P 10203 -p1
%endif
%patch -P 103 -p1
%patch -P 104 -p1
%patch -P 10501 -p1
%patch -P 10502 -p1
%patch -P 106 -p1
%patch -P 107 -p1
%patch -P 108 -p1
%patch -P 109 -p1
%patch -P 110 -p1
%patch -P 111 -p1
%patch -P 112 -p1
#%patch -P 113 -p1
%patch -P 114 -p1
%patch -P 115 -p1
%patch -P 116 -p1
%patch -P 117 -p1
%patch -P 118 -p1
%patch -P 11901 -p1
%patch -P 11902 -p1
%patch -P 12001 -p1
%patch -P 12002 -p1
%patch -P 12101 -p1
%patch -P 12102 -p1
%patch -P 200 -p1
%patch -P 201 -p1
%patch -P 202 -p1
%patch -P 203 -p1
%patch -P 204 -p1
%patch -P 205 -p1
%patch -P 206 -p1
%patch -P 207 -p1
%patch -P 208 -p1
%patch -P 209 -p1
%patch -P 210 -p1
%patch -P 21101 -p1
%patch -P 21102 -p1
%patch -P 2111 -p1
%patch -P 300 -p1
#%patch -P 301 -p1
#%patch -P 302 -p1
%patch -P 303 -p1
%patch -P 304 -p1
%patch -P 30501 -p1
%patch -P 30502 -p1
%patch -P 306 -p1
%patch -P 307 -p1
%patch -P 30801 -p1
%patch -P 30802 -p1
%patch -P 309 -p1
%patch -P 310 -p1
%patch -P 311 -p1
%patch -P 312 -p1
%patch -P 31301 -p1
%patch -P 31302 -p1
#%patch -P 314 -p1
%patch -P 315 -p1

# copy a paw include file to include directory (debian
# 317-copy-converter.h-to-installed-headers-dir.sh.dpatch)
# not in 2006
#cp src/pawlib/paw/tree/converter.h src/pawlib/paw/paw/

%patch -P 318 -p1
%patch -P 319 -p1
%patch -P 32001 -p1
%patch -P 32002 -p1
%patch -P 32101 -p1
%patch -P 32102 -p1

%patch -P 600 -p1

# move kernlib out of packlib (debian 700-move-kernlib-to-top-level.sh.dpatch)
mv src/packlib/kernlib src/kernlib

%patch -P 700 -p1

# move hkf1q.F and hkfill.F out of packlib/hbook and into
# pawlib/comis where they obviously belong (it even says so in the files!)
# (debian 701-move-packlib-hkfill-to-comis.sh.dpatch)
pushd src
                mv packlib/hbook/code/hkf1q.F  pawlib/comis/code/
                mv packlib/hbook/code/hkfill.F pawlib/comis/code/
                # these files also need some headers to go with them:
                mkdir pawlib/comis/hbook
                cp -p packlib/hbook/hbook/pilot.h    pawlib/comis/hbook/
                cp -p packlib/hbook/hbook/hcbook.inc pawlib/comis/hbook/
                cp -p packlib/hbook/hbook/hcbits.inc pawlib/comis/hbook/
                cp -p packlib/hbook/hbook/hcfast.inc pawlib/comis/hbook/
popd

%patch -P 70101 -p1
%patch -P 70102 -p1

# Must create dirs before applying following patch. 
# Corresponds with 702-fix-packlib-mathlib-circular-mess.sh.dpatch

pushd src
                # Hdiff depends upon a bunch of mathlib files; move it into
                # mathlib.
                mkdir mathlib/hbook
                mv packlib/hbook/hdiff mathlib/hbook/
                cp -r packlib/hbook/hbook mathlib/hbook/

                # Meanwhile, other packlib files depend upon these mathlib
                # files which are easily moved:
                mkdir packlib/hbook/d
                mv mathlib/gen/d/rgmlt*.F packlib/hbook/d/
                mv mathlib/gen/n          packlib/hbook/
                cp -r mathlib/gen/gen     packlib/hbook/
popd

%patch -P 702 -p1

# Script to move packlib/kuip/code_motif to top level, splitting it out
# from packlib.  But keep kmutil.c in packlib, it's otherwise used.
# debian 703-move-code_motif-to-top-level.sh.dpatch

pushd src
                mv packlib/kuip/code_motif/kmutil.c packlib/kuip/code_kuip/
                mv packlib/kuip/code_motif          ./
                cp -r packlib/kuip/kuip             code_motif/
popd

%patch -P 703 -p1

# Script to move the file kuwhag.c from packlib/kuip/code_kuip/kuwhag.c
# into graflib/higz/higzcc.  It appears to be the only file in code_kuip
# that depends upon grafX11 and libX11, so it fits in better here.
# debian 704-move-kuwhag.c-to-grafX11.sh.dpatch

pushd src
                mv packlib/kuip/code_kuip/kuwhag.c graflib/higz/higzcc/
                cp -r packlib/kuip/kuip            graflib/higz/
popd

%patch -P 704 -p1

# Script to move Lesstif-dependent Paw code into its own library.
# debian 705-move-paw++-code-to-top-level.sh.dpatch

pushd src
                mkdir paw_motif
                mv pawlib/paw/?motif pawlib/paw/fpanels? paw_motif/
                mv pawlib/paw/tree pawlib/paw/uimx pawlib/paw/xbae* paw_motif/
                cp -p pawlib/paw/Imakefile paw_motif/
                
                mkdir paw_motif/code
                mv pawlib/paw/code/pawpp.F   paw_motif/code/
                mv pawlib/paw/code/pawintm.F paw_motif/code/

                mkdir paw_motif/cdf
                mv pawlib/paw/cdf/pamcdf.cdf paw_motif/cdf/

                cp -pr pawlib/paw/paw paw_motif/
                cp -pr pawlib/paw/hpaw paw_motif/
popd

%patch -P 705 -p1
%patch -P 706 -p1

%patch -P 800 -p1
%patch -P 80101 -p1
%patch -P 80102 -p1
%patch -P 802 -p1
%patch -P 80301 -p1
%patch -P 80302 -p1

# Shell script to link pawlib/comis/comis into the top-level include directory.
# debian 804-link-to-comis-includes.sh.dpatch
pushd src
                ln -s ../pawlib/comis/comis include/comis
popd

%patch -P 804 -p1
%patch -P 805 -p1
%patch -P 80601 -p1
%patch -P 80602 -p1
%patch -P 80603 -p1
%patch -P 80604 -p1

%patch -P 1504 -p2 -b .np_flags
#%patch -P 1505 -p1
%patch -P 1506 -p2 -b .curdir

%patch -P 1201
#%patch -P 1203
#%patch -P 1204
%patch -P 1208 -p2 -b .test
%patch -P 1210 -p2 -b .segf_eudtest
%patch -P 1209 -p2 -b .soname

%ifarch x86_64
%patch -P 1211 -p2 -b .64test
%endif

# remove CVS directories
find . -depth -type d -name CVS -exec rm -rf {} ';' 

# unset executable bit on source files
chmod a-x src/kernlib/kerngen/ccgencf/cfstati.c \
  src/cfortran/cfortran.*

# remove empty header file not needed anywhere to shut up rpmlint
rm src/pawlib/paw/ntuple/dbmalloc.h

%build

CERN=$RPM_BUILD_DIR/%{name}-%{version}
CERN_LEVEL=%{version}
CERN_ROOT=$CERN/$CERN_LEVEL
CVSCOSRC=$CERN/$CERN_LEVEL/src
PATH=$CERN_ROOT/bin:$PATH

export CERN
export CERN_LEVEL
export CERN_ROOT 
export CVSCOSRC
export PATH

LIB_SONAME=1
export LIB_SONAME

# add something in the soname to avoid binaries linked against g77-compiled
# library to be linked against gfortran-compiled libraries, as the ABI is 
# incompatible for functions.
%if %{with gfortran}
TOOL_SONAME=_gfortran
export TOOL_SONAME
%endif

# set the CERN and CERN_LEVEL environment variables in shell scripts
# meant to go to /etc/profile.d
sed -e 's/==CERN_LEVEL==/%{verdir}/' -e 's:==CERN==:%{_libdir}/cernlib:' %{SOURCE100} > cernlib-%{verdir}.sh
sed -e 's/==CERN_LEVEL==/%{verdir}/' -e 's:==CERN==:%{_libdir}/cernlib:' %{SOURCE105} > cernlib-%{verdir}.csh

cp -p %{SOURCE101} .
cp -p %{SOURCE102} .
cp -p %{SOURCE103} .

# Regenerate the copyright file (from non split debian/rules)
grep -v DEADPOOL_LIST_GOES_HERE %{SOURCE203} > debian-copyright
sed -e 's/#.*//g' -e '/^[[:space:]]*$$/d' %{SOURCE201} | \
    sort | uniq >> debian-copyright

cd $CERN_ROOT

# substitude the right defaults in the scripts
sed -i -e 's:"/cern":"%{_libdir}/cernlib/":' -e 's:"pro":"%{verdir}":' \
   src/scripts/paw src/scripts/cernlib src/graflib/dzdoc/dzedit/dzedit.script \
   ../patchy/ylist ../patchy/yindex

# substitute version in gxint with the right version
# substitute includedir in gxint to conform to FHS, and gxint.o to gxint.f
sed -i -e 's/"pro"/%{version}/' -e 's:\${CERN}/\${ver}/lib/gxint\${gvs}\.\$_o:%{_includedir}/cernlib/\${ver}/gxint.f:' src/scripts/gxint 

# substitute DATADIR in source files to conform to FHS
sed -i -e 's:DATADIR:%{_datadir}/cernlib/%{version}:' \
  src/geant321/miface/gmorin.F 
# don't correct datadir in test files or header used in tests
#src/mclibs/cojets/test/test.F src/mclibs/eurodec/eurodec/eufiles.inc src/mclibs/isajet/test/isajett.F

# substitute bindir in ylist and yindex to conform to FHS
sed -i -e 's:\$CERN/patchy/\$PATCHY_VERSION/bin:%{_bindir}:' ../patchy/ylist ../patchy/yindex

# Create the build directory structure
mkdir -p build bin lib shlib

# rename the cernlib script cernlib-static and use the debian cernlib
# script for dynamic libraries support
# remove -lg2c to the link commands, because libg2c.so isn't available, 
# it is found by g77/gfortran if needed
mv src/scripts/cernlib src/scripts/cernlib-static
%{__install} -p -m755 src/scripts/cernlib-static bin/cernlib-static
sed -e 's:@PREFIX@:%{_prefix}:g' \
  -e 's:@CERN@:%{_libdir}/cernlib:g' \
  -e 's:@VERSION@:%{verdir}:g' \
  -e 's:@LIBPREFIX@:%{_libdir}:g' \
  -e 's/-lg2c//' \
  ../cernlib.in > src/scripts/cernlib
chmod 0755 src/scripts/cernlib

# install mkdirhier which is needed to make directories
%{__install} -p -m755 %{SOURCE104} bin/

# set FC_OPTFLAGS and FC_COMPILER based on compiler used
%if %{with gfortran}
FC_OPTFLAGS="%{optflags}"
FC_COMPILER=gfortran
%else
# optflags are different for g77, so we remove problematic flags
FC_OPTFLAGS=`echo "%optflags" | sed -e 's/-mtune=[^ ]\+//' -e 's/-fstack-protector//' -e 's/--param=ssp-buffer-size=[^ ]\+//'`
FC_COMPILER=g77
%endif

PATHSAVE=$PATH
# Build patchy version 4
pushd ../patchy
%if %{with gfortran}
        sed -i.gfortran -e 's/f77/gfortran/' fcasplit.f p4boot.sh
%endif
        sed -i.optflags -e 's/FOPT \+=.*/FOPT = "'"$FC_OPTFLAGS"'"/' \
                 -e 's/COPT  \+=.*/COPT = "%{optflags}"/' p4boot.sh
#        export PATH="$CERN/patchy:$CERN/patchy/p4sub:$PATH" 
        export PATH=".:..:$PATH" 
        p4boot.sh 0
popd
export PATH=$PATHSAVE

# pass informations to the build system through host.def
echo '#define DefaultCDebugFlags %{optflags}' >> ${CVSCOSRC}/config/host.def

%if %{with gfortran}
echo '#define Hasgfortran YES' >> ${CVSCOSRC}/config/host.def
%endif
echo "#define FortranDebugFlags $FC_OPTFLAGS" >> ${CVSCOSRC}/config/host.def
# keep timestamps
echo "#define InstallCmd %{__install} -p" >> ${CVSCOSRC}/config/host.def
# don't strip executables
echo "#define InstPgmFlags -m 0755" >> ${CVSCOSRC}/config/host.def

# Create the top level Makefile with imake
cd $CERN_ROOT/build
$CVSCOSRC/config/imake_boot

# Install kuipc and the scripts (cernlib, paw and gxint) in $CERN_ROOT/bin

make %{?_smp_mflags} bin/kuipc
make scripts/Makefile
cd scripts
make install.bin

# Install the libraries

cd $CERN_ROOT/build
#  %{?_smp_mflags} breaks the build
make
make install.shlib
chmod a+x ../shlib/*.so.*

# Build dynamic paw
cd $CERN_ROOT/build/pawlib
make %{?_smp_mflags} install.bin
cd $CERN_ROOT/
mv bin/pawX11 bin/pawX11.dynamic
mv bin/paw++ bin/paw++.dynamic

# Build static paw
$FC_COMPILER $FC_OPTFLAGS $CERN_ROOT/build/pawlib/paw/programs/0pamain.o \
  `cernlib -G X11 pawlib` -Wl,-E -o bin/pawX11
$FC_COMPILER $FC_OPTFLAGS $CERN_ROOT/build/pawlib/paw/programs/0pamainm.o \
  `cernlib -G Motif pawlib` -Wl,-E -o bin/paw++

# Build packlib
cd $CERN_ROOT/build/packlib
make %{?_smp_mflags} install.bin

# bootstrap npatchy
mkdir -p $CERN_ROOT/build/p5boot
cd $CERN_ROOT/build/p5boot
cp -p -r $CERN_ROOT/src/p5boot/* .
# there is a main program in this file, so the file is removed.
rm p5lib/nsynopt.f
$FC_COMPILER $FC_OPTFLAGS -o nypatchy nypatchy.f p5lib/*.f  $CERN_ROOT/lib/libkernlib.a
ln -s $CERN_ROOT/build/p5boot/nypatchy $CERN_ROOT/bin/ypatchy

# Build npatchy
%if %{with gfortran}
        sed -i.gfortran -e 's/g77/gfortran/' $CERN_ROOT/src/patchy/fcasplit.F
%endif
cd $CERN_ROOT/build
make patchy/Makefile
cd patchy
# we cannot use %%{?_smp_mflags} because fcasplit is used after being
# built, and during the fcasplit installation (which is done in parallel 
# with the build) it is removed and replaced by a symlink, and if it 
# takes time the link may not be there on time. 
# At least that's my understanding of the failure.
make install.bin

# it is not completly obvious that it is better to use patchy 4 for 
# ypatchy, but that's what we do. In any case it should be replaced by a
# link to the final npatchy
rm $CERN_ROOT/bin/ypatchy

%install

rm -rf %{buildroot}

%{__install} -d -m755 %{buildroot}%{_sysconfdir}/profile.d
%{__install} -p -m644 cernlib-%{verdir}.sh %{buildroot}%{_sysconfdir}/profile.d
%{__install} -p -m644 cernlib-%{verdir}.csh %{buildroot}%{_sysconfdir}/profile.d

%{__install} -d -m755 cfortran/Examples
%{__install} -p -m644 %{version}/src/cfortran/Examples/*.c cfortran/Examples/

%{__install} -d -m755 %{buildroot}%{_datadir}/aclocal
%{__install} -p -m644 cernlib.m4 %{buildroot}%{_datadir}/aclocal/cernlib.m4

# copy patchy executables in bin. Keep the timestamps for the scripts.
%{__install} -d -m755 %{buildroot}%{_bindir}/
find patchy -name y* -a -perm -755 -exec %{__install} -p -m755 {} %{buildroot}%{_bindir} ';'

cd %{version}
%{__install} -d -m755 %{buildroot}%{_libdir}/cernlib/%{verdir}/lib
%{__install} -d -m755 %{buildroot}%{_datadir}/cernlib/%{version}
%{__install} -d -m755 %{buildroot}%{_includedir}/cernlib/%{version}
%{__install} -d -m755 %{buildroot}%{_includedir}/cernlib/%{version}/cfortran

%{__install} -p -m644 lib/*.dat %{buildroot}%{_datadir}/cernlib/%{version}
%{__install} -p -m644 lib/gxint321.f %{buildroot}%{_includedir}/cernlib/%{version}
%{__install} -p -m644 src/cfortran/*.h %{buildroot}%{_includedir}/cernlib/%{version}/

%{__install} -p -m755 bin/* %{buildroot}%{_bindir}/


# avoid name conflicts for files in bin
if [ 'z%{?compiler}' != 'z' ]; then
   for file in %{buildroot}%{_bindir}/*; do
      mv $file ${file}%{compiler}
   done
fi


# add a link to pawX11 from %{_libdir}/cernlib/%{verdir}/bin
%{__install} -d -m755 %{buildroot}%{_libdir}/cernlib/%{verdir}/bin/
%{__ln_s} %{_bindir}/pawX11%{?compiler} %{buildroot}%{_libdir}/cernlib/%{verdir}/bin/pawX11

# to preserve symlinks and timestamps
(cd lib && tar cf - *.a) | (cd %{buildroot}%{_libdir}/cernlib/%{verdir}/lib && tar xf -)
(cd shlib && tar cf - *.so*) | (cd %{buildroot}%{_libdir}/cernlib/%{verdir}/lib && tar xf -)

rm %{buildroot}%{_bindir}/mkdirhier*

# add links for cfortran header files in the top include directory
pushd %{buildroot}%{_includedir}/cernlib/%{version}
for file in *.h; do
   %{__ln_s} ../$file cfortran/$file
done
%{__ln_s} gxint321.f gxint.f
popd

cd src
# install include directories for the cernlib libraries
base_include=%{buildroot}%{_includedir}/cernlib/%{version}
for dir in `cat ../../*/debian/add-ons/includelist.txt`; do
   basedir=`basename $dir`
   rm -rf $base_include/$basedir
   cp -Rp $dir $base_include/
done

# substitute the path in installed eufiles.inc, not in in-source
# file, because in-source the relative path is required for test
sed -i -e 's:eurodec.dat:%{_datadir}/cernlib/%{version}/eurodec.dat:' \
  %{buildroot}%{_includedir}/cernlib/%{version}/eurodec/eufiles.inc

# install the tree.h and converter.h include files redirecting to 
# system headers
%{__install} -p -m644 ../../paw-2.14.04.dfsg/debian/add-ons/paw/*.h %{buildroot}%{_includedir}/cernlib/%{version}/paw

# remove the patch backup files
rm %{buildroot}%{_includedir}/cernlib/%{version}/kuip/kstring.h.*

%{__install} -d -m755 %{buildroot}/etc/ld.so.conf.d
echo %{_libdir}/cernlib/%{verdir}/lib > %{buildroot}/etc/ld.so.conf.d/cernlib-%{verdir}-%{_arch}.conf

%{__install} -d -m755 %{buildroot}/%{_mandir}/man1
%{__install} -p -m644 man/man1/cernlib.1 %{buildroot}/%{_mandir}/man1/cernlib-static.1
for cernlib_manpage in cernlib.1 kxterm.1 dzedit.1 dzeX11.1 kuipc.1 kuesvr.1 zftp.1 gxint.1 paw.1 paw++.1 pawX11.1; do
	%{__install} -p -m644 ../../*/debian/add-ons/manpages/$cernlib_manpage %{buildroot}/%{_mandir}/man1/
done

%{__install} -d -m755 %{buildroot}/%{_mandir}/man8
for cernlib_manpage in pawserv.8 zserv.8; do
	%{__install} -p -m644 ../../*/debian/add-ons/manpages/$cernlib_manpage %{buildroot}/%{_mandir}/man8/
done

%{__install} -d -m755 %{buildroot}/%{_datadir}/X11/app-defaults
%{__install} -p -m644 ../../*/debian/add-ons/app-defaults/* %{buildroot}/%{_datadir}/X11/app-defaults/

sed -e 's/Exec=paw++/Exec=paw++%{?compiler}/' -e 's/PAW++/PAW++%{?compiler}/' \
 ../../paw*/debian/add-ons/misc/paw++.desktop > paw++%{?compiler}.desktop
desktop-file-install --vendor="fedora"               \
  --dir=%{buildroot}/%{_datadir}/applications         \
  paw++%{?compiler}.desktop


%{__install} -d -m755 %{buildroot}/%{_datadir}/pixmaps
%{__install} -d -m755 %{buildroot}/%{_datadir}/icons/hicolor/{48x48,32x32}/apps/
%{__install} -p -m644 ../../*/debian/add-ons/icons/*.xpm %{buildroot}/%{_datadir}/pixmaps/
%{__install} -p -m644 ../../paw*/debian/add-ons/icons/paw32x32.xpm %{buildroot}/%{_datadir}/icons/hicolor/32x32/apps/paw.xpm
%{__install} -p -m644 ../../paw*/debian/add-ons/icons/paw48x48.xpm %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/paw.xpm

find %{buildroot}%{_includedir}/cernlib/%{version} -name Imakefile -exec rm -f \{\} \;
rm %{buildroot}%{_includedir}/cernlib/%{version}/ntuple/*.c


%check
CERN=$RPM_BUILD_DIR/%{name}-%{version}
CERN_LEVEL=%{version}
CERN_ROOT=$CERN/$CERN_LEVEL
CVSCOSRC=$CERN/$CERN_LEVEL/src
PATH=$CERN_ROOT/bin:$PATH

export CERN
export CERN_LEVEL
export CERN_ROOT
export CVSCOSRC
export PATH

export LD_LIBRARY_PATH=$CERN_ROOT/shlib/

# cannot make out-of build test because of the data files
cd $CERN_ROOT/build

# no test in code_motif paw_motif scripts patchy pawlib
test_dirs='graflib mclibs kernlib mathlib packlib phtools'

%ifnarch x86_64
test_dirs="$test_dirs geant321"
%endif

for dir in $test_dirs; do
make -C $dir test
done


%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n paw%{?compiler}
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%postun -n paw%{?compiler}
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%files
%defattr(-,root,root,-)
%doc cernlib.README debian-copyright
%doc geant321-3.21.14.dfsg/debian/debhelper/geant321.README.debian 
%doc mclibs-2006.dfsg/debian/debhelper/libpdflib804-2-dev.README.debian
%doc mclibs-2006.dfsg/debian/debhelper/montecarlo-base.README.debian
%doc cernlib-2006.dfsg/debian/add-ons/vim/
/etc/ld.so.conf.d/*
%dir %{_libdir}/cernlib/
%dir %{_libdir}/cernlib/%{verdir}
%dir %{_libdir}/cernlib/%{verdir}/lib
%dir %{_libdir}/cernlib/%{verdir}/bin
%{_libdir}/cernlib/%{verdir}/lib/*.so.*
%{_datadir}/cernlib/

# the utils and devel are separated to have the possibility to install
# parallel versions of the library
%files devel
%defattr(-,root,root,-)
%doc cfortran paw-*/debian/add-ons/misc/comis-64bit-example.F
# it is not necessary to put the static libs in a subpackage, since the
# utils package would require it anyway. Moreover cernlib users expect
# static libs to be present.
%{_libdir}/cernlib/%{verdir}/lib/*.a
%{_libdir}/cernlib/%{verdir}/lib/*.so
%{_includedir}/cernlib/
%{_datadir}/aclocal/cernlib.m4

%files utils
%defattr(-,root,root,-)
%{_bindir}/cernlib*%{?compiler}
%{_sysconfdir}/profile.d/cernlib-%{verdir}.sh
%{_sysconfdir}/profile.d/cernlib-%{verdir}.csh
%{_mandir}/man1/cernlib*.1*

%files -n paw%{?compiler}
%defattr(-,root,root,-)
%doc paw.README
%{_bindir}/paw++%{?compiler}
%{_bindir}/paw%{?compiler}
%{_bindir}/pawX11%{?compiler}
%{_bindir}/pawX11.dynamic%{?compiler}
%{_bindir}/paw++.dynamic%{?compiler}
# paw doesn't depend on the main package, so it must own the dirs
%dir %{_libdir}/cernlib/%{verdir}
%dir %{_libdir}/cernlib/%{verdir}/bin
%{_libdir}/cernlib/%{verdir}/bin/pawX11
%{_datadir}/X11/app-defaults/*Paw++
%{_datadir}/icons/hicolor/
%{_mandir}/man1/paw*.1*
%{_datadir}/applications/*paw*.desktop
%{_datadir}/pixmaps/paw*.xpm

%files -n geant321%{?compiler}
%defattr(-,root,root,-)
%{_bindir}/gxint%{?compiler}
%{_datadir}/X11/app-defaults/*Geant++
%{_mandir}/man1/gxint.1*

%files -n kuipc%{?compiler}
%defattr(-,root,root,-)
%{_bindir}/kuipc%{?compiler}
%{_mandir}/man1/kuipc.1*

%files packlib
%defattr(-,root,root,-)
%doc cernlib-2006.dfsg/debian/debhelper/zftp.README.debian
%{_bindir}/cdbackup%{?compiler}
%{_bindir}/cdserv%{?compiler}
%{_bindir}/fatmen%{?compiler}
%{_bindir}/fatsrv%{?compiler}
%{_bindir}/kuesvr%{?compiler}
%{_bindir}/zserv%{?compiler}
%{_bindir}/cdmake%{?compiler}
%{_bindir}/fatnew%{?compiler}
%{_bindir}/pawserv%{?compiler}
%{_bindir}/cdmove%{?compiler}
%{_bindir}/fatback%{?compiler}
%{_bindir}/fatsend%{?compiler}
%{_bindir}/hepdb%{?compiler}
%{_bindir}/kxterm%{?compiler}
%{_bindir}/zftp%{?compiler}
%{_datadir}/X11/app-defaults/KXterm
%{_datadir}/pixmaps/kxterm*.xpm
%{_mandir}/man1/kxterm.1* 
%{_mandir}/man1/dze*.1*
%{_mandir}/man1/kuesvr.1* 
%{_mandir}/man1/zftp.1*
%{_mandir}/man8/*.8*

%files -n patchy%{?compiler}
%defattr(-,root,root,-)
%{_bindir}/fcasplit%{?compiler}
%{_bindir}/nycheck%{?compiler}
%{_bindir}/nydiff%{?compiler}
%{_bindir}/nyindex%{?compiler}
%{_bindir}/nylist%{?compiler}
%{_bindir}/nymerge%{?compiler}
%{_bindir}/nypatchy%{?compiler}
%{_bindir}/nyshell%{?compiler}
%{_bindir}/nysynopt%{?compiler}
%{_bindir}/nytidy%{?compiler}
%{_bindir}/yexpand%{?compiler}
%{_bindir}/ycompar%{?compiler}
%{_bindir}/yedit%{?compiler}
%{_bindir}/yfrceta%{?compiler}
%{_bindir}/yindex%{?compiler}
%{_bindir}/yindexb%{?compiler}
%{_bindir}/ylist%{?compiler}
%{_bindir}/ylistb%{?compiler}
%{_bindir}/ypatchy%{?compiler}
%{_bindir}/ysearch%{?compiler}
%{_bindir}/yshift%{?compiler}
%{_bindir}/ytobcd%{?compiler}
%{_bindir}/ytobin%{?compiler}
%{_bindir}/ytoceta%{?compiler}


%changelog
* Tue Apr 24 2007 Patrice Dumas <pertusus at free.fr> 2006-7
- use real cernlib lib location in cernlib debian script, don't assume
  that they are in %%_prefix, it is not the case on fedora

* Mon Apr 23 2007 Patrice Dumas <pertusus at free.fr> 2006-6
- package compiled with g77 is parallel installable with gfortran 
  compiled package

* Sun Apr 22 2007 Patrice Dumas <pertusus at free.fr> 2006-5.4
- packlib/ffread, packlib/hbook, packlib/kuip, packlib/zbook, packlib/zebra 
  tests fail on x86_64, exclude the tests on this arch
- kernbit/kernnum test fails on x86_64, exclude the test on this arch

* Sun Apr 22 2007 Patrice Dumas <pertusus at free.fr> 2006-3
- geant321 test fails on x86_64, exclude the test on this arch

* Sun Apr 22 2007 Patrice Dumas <pertusus at free.fr> 2006-2
- don't do a parallel build for npatchy

* Fri Apr 13 2007 Patrice Dumas <pertusus at free.fr> 2006-1
- update to cernlib 2006
- build with gfortran
- use system Xbae and Xaw
- ship man pages, app-defaults, icons and paw++ desktop file (from debian)
- run tests
- use optflags in patchy4
- bootstrap npatchy with p5boot (instead of using patchy4)
- fix npatchy build

* Tue Dec 19 2006 Patrice Dumas <pertusus at free.fr> 2005-27
- add support for gfortran (not enabled, lshift missing in fedora gfortran)
- use fedora compiler flags when possible
- use %%{optflags} and %%{buildroot}

* Mon Sep 11 2006 Patrice Dumas <pertusus at free.fr> 2005-26
- update to newer debian patchsets (paw and cernlib)
- remove gfortran related patches integrated in the debian 
  patchsets

* Fri Sep  1 2006 Patrice Dumas <pertusus at free.fr> 2005-25
- update to newer source split debian patchsets
- don't set the exec bits on file installed in /etc/profile.d/

* Thu Aug 31 2006 Patrice Dumas <pertusus at free.fr> - 2005-22
- add -q to %%setup
- rebuild against lesstif for FC6

* Wed May 24 2006 Patrice Dumas <pertusus at free.fr> - 2005-21
- compile paw statically against the cernlib (paw binaries dynamically 
  compiled against the cernlib are still shiped). Fix 192866

* Wed May 17 2006 Patrice Dumas <pertusus at free.fr> - 2005-20
- use new debian patchset. Fix 191631

* Tue Apr 13 2006 Patrice Dumas <pertusus at free.fr> - 2005-19
- add a patch to yexpand, to avoid using $HOME.

* Tue Apr 13 2006 Patrice Dumas <pertusus at free.fr> - 2005-17
- npatchy don't build on ppc.

* Wed Apr 12 2006 Patrice Dumas <pertusus at free.fr> - 2005-16
- unpack patchy offline because the files are within an unformatted
  fortran file which won't be right on all the arches.

* Tue Apr 11 2006 Patrice Dumas <pertusus at free.fr> - 2005-15.1
- add conditionals in spec to have only one for all fedora versions.

* Tue Apr 11 2006 Patrice Dumas <pertusus at free.fr> - 2005-14
- add patchy version 4 and build cernlib patchy. From Mattias Ellert.
- update to newer debian patchset

* Thu Feb 16 2006 Patrice Dumas <pertusus at free.fr> - 2005-13
- rebuild for fc5

* Tue Jan 17 2006 Patrice Dumas <pertusus at free.fr> - 2005-12.1
- attempt a rebuild against newer openmotif

* Tue Dec 20 2005 Patrice Dumas <pertusus at free.fr> - 2005-11.4
- add a symlink from /usr/lib/cernlib/2005/bin/pawX11 to /usr/bin/pawX11
- fix gxint

* Tue Dec 20 2005 Patrice Dumas <pertusus at free.fr> - 2005-10
- add file in /etc/ld.so.conf.d required for dynamic linking

* Wed Dec 14 2005 Patrice Dumas <pertusus at free.fr> - 2005-9.1
- use new debian patchset

* Fri Dec  9 2005 Patrice Dumas <pertusus at free.fr> - 2005-8.1
- use new debian patchset
- enable 64 bit fixes patch

* Fri Dec  2 2005 Patrice Dumas <pertusus at free.fr> - 2005-7
- use updated beta debian patchset
- remove the BSD in the licence because there is no library nor binary
  under a BSD licence and someone could get the idea that there is 
  some dual BSD/GPL licenced binaries or libraries. The LGPL is kept
  because of cfortran

* Tue Nov 29 2005 Patrice Dumas <pertusus at free.fr> - 2005-6.1
- update with newer debian patchset for cernlib, fix licence issues
- don't use the include.tar.gz source, instead get include files from
  the source files
- build shared libraries
- simplify the scripts modifications
- add BuildRequires: libXau-devel to workaround #173530

* Tue Nov 15 2005 Patrice Dumas <pertusus at free.fr> - 2005-4
- add a .csh file
- correct defaults in cernlib scripts

* Sun Sep 11 2005 Patrice Dumas <pertusus at free.fr> - 2005-3
- add rm -rf %%{buildroot}

* Thu Sep  1 2005 Patrice Dumas <pertusus at free.fr> - 2005-2
- minor update of cernlib.README
- modify the cernlib script patch to use /usr/X11R6/lib64 if existing

* Tue Jun 09 2005 Patrice Dumas <pertusus at free.fr> - 2005-1
- full rewrite of the spec file from Scientific Linux
- use some ideas and many patches from debian cernlib