Rework specfile

This commit is contained in:
Sandro Mani 2014-08-08 16:49:59 +02:00
parent 6c00cad0ad
commit 26b1c55120
3 changed files with 162 additions and 243 deletions

View File

@ -1,24 +1,23 @@
EXE = EXE =
LIB = .so LIB = .so
OBJ = .o OBJ = .o
MAKE = make MAKE = make
AR = gcc AR = gcc
CAT = cat CAT = cat
CCS = gcc CCS = gcc
CCP = mpicc CCP = mpicc
CCD = mpicc CCD = mpicc
CFLAGS = @RPMFLAGS@ \ override CFLAGS += -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_FILE_COMPRESS_BZ2 -DCOMMON_FILE_COMPRESS_LZMA \
-DCOMMON_FILE_COMPRESS_GZ -DCOMMON_FILE_COMPRESS_BZ2 -DCOMMON_FILE_COMPRESS_LZMA \ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD \
-DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD \ -Drestrict=__restrict -DIDXSIZE64
-Drestrict=__restrict -DIDXSIZE64 CLIBFLAGS = -shared -fPIC
CLIBFLAGS = -shared -fPIC override LDFLAGS += -lz -lbz2 -llzmadec -lm -lrt -lpthread
LDFLAGS = -lz -lbz2 -llzmadec -lm -lrt -lpthread ARFLAGS = -shared -Wl,-soname=$@.0 $(LDFLAGS) -o
ARFLAGS = -shared -Wl,-soname=$@.0 $(LDFLAGS) -o CP = cp -av
CP = cp -av LEX = flex
LEX = flex LN = ln
LN = ln MKDIR = mkdir -p
MKDIR = mkdir -p MV = mv
MV = mv RANLIB = echo
RANLIB = echo YACC = bison -y
YACC = bison -y

View File

@ -1,24 +0,0 @@
EXE =
LIB = .a
OBJ = .o
MAKE = make
AR = ar
ARFLAGS = -ruv
CAT = cat
CCS = gcc
CCP = mpicc
CCD = mpicc
CFLAGS = @RPMFLAGS@ \
-DCOMMON_FILE_COMPRESS_GZ -DCOMMON_FILE_COMPRESS_BZ2 -DCOMMON_FILE_COMPRESS_LZMA \
-DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD \
-Drestrict=__restrict -DIDXSIZE64
CLIBFLAGS =
LDFLAGS = -lz -lbz2 -llzmadec -lm -lrt -lpthread
CP = cp -av
LEX = flex
LN = ln
MKDIR = mkdir -p
MV = mv
RANLIB = ranlib
YACC = bison -y

View File

@ -1,241 +1,185 @@
Summary: Graph, mesh and hypergraph partitioning library %global openmpidir %{_builddir}/ptscotch-openmpi-%{version}-%{release}
Name: scotch %global mpichdir %{_builddir}/ptscotch-mpich-%{version}-%{release}
Version: 6.0.0
Release: 7%{?dist} Name: scotch
License: CeCILL-C Summary: Graph, mesh and hypergraph partitioning library
Group: Development/Libraries Version: 6.0.0
URL: http://www.labri.fr/perso/pelegrin/scotch/ Release: 8%{?dist}
Source0: https://gforge.inria.fr/frs/download.php/27583/%{name}_%{version}.tar.gz
Source1: scotch-Makefile.static.inc.in License: CeCILL-C
Source2: scotch-Makefile.shared.inc.in URL: http://www.labri.fr/perso/pelegrin/scotch/
BuildRequires: flex bison zlib-devel bzip2-devel lzma-devel Source0: http://gforge.inria.fr/frs/download.php/file/31831/%{name}_%{version}.tar.gz
Requires: %{name}-doc = %{version}-%{release} Source1: scotch-Makefile.shared.inc.in
BuildRequires: flex
BuildRequires: bison
BuildRequires: zlib-devel
BuildRequires: bzip2-devel
BuildRequires: lzma-devel
%description %description
Scotch is a software package for graph and mesh/hypergraph partitioning and Scotch is a software package for graph and mesh/hypergraph partitioning and
sparse matrix ordering. The parallel scotch lbrariries are packaged in the sparse matrix ordering. The parallel scotch librariries are packaged in the
ptscotch sub-packages. ptscotch sub-packages.
%package devel %package devel
Summary: Development libraries for scotch Summary: Development libraries for scotch
Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name} = %{version}-%{release} Obsoletes: %{name}-static < 6.0.0-8
%description devel %description devel
This package contains development libraries for scotch. This package contains development libraries for scotch.
%package static
Summary: Development libraries for scotch
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%description static
This package contains libscotch static libraries.
%package doc %package doc
Summary: Documentations and example for scotch and ptscotch Summary: Documentations and example for scotch and ptscotch
Group: Documentation BuildArch: noarch
BuildArch: noarch
%description doc %description doc
Contains documentations and example for scotch and ptscotch Contains documentations and example for scotch and ptscotch
###############################################################################
%package -n ptscotch-mpich %package -n ptscotch-mpich
Summary: PT-Scotch libraries compiled against mpich Summary: PT-Scotch libraries compiled against mpich
Group: Development/Libraries BuildRequires: mpich-devel
BuildRequires: mpich-devel Requires: mpich
Requires: environment-modules mpich
Requires: %{name}-doc = %{version}-%{release}
%description -n ptscotch-mpich %description -n ptscotch-mpich
Scotch is a software package for graph and mesh/hypergraph partitioning and Scotch is a software package for graph and mesh/hypergraph partitioning and
sparse matrix ordering. This sub-package provides parallelized scotch libraries sparse matrix ordering. This sub-package provides parallelized scotch libraries
compiled with mpich compiled with mpich.
%package -n ptscotch-mpich-devel %package -n ptscotch-mpich-devel
Summary: Development libraries for PT-Scotch (mpich) Summary: Development libraries for PT-Scotch (mpich)
Group: Development/Libraries Requires: pt%{name}-mpich%{?_isa} = %{version}-%{release}
Requires: pt%{name}-mpich = %{version}-%{release} Obsoletes: ptscotch-mpich-static < 6.0.0-8
%description -n ptscotch-mpich-devel %description -n ptscotch-mpich-devel
This package contains development libraries for PT-Scotch, compiled against This package contains development libraries for PT-Scotch, compiled against
mpich. mpich.
%package -n ptscotch-mpich-static
Summary: Static PT-Scotch libraries compiled against mpich
Group: Development/Libraries
Requires: pt%{name}-mpich-devel = %{version}-%{release}
%description -n ptscotch-mpich-static ###############################################################################
This package contains static libraries for Scotch, compiled against mpich.
%package -n ptscotch-openmpi %package -n ptscotch-openmpi
Summary: PT-Scotch libraries compiled against openmpi Summary: PT-Scotch libraries compiled against openmpi
Group: Development/Libraries BuildRequires: openmpi-devel
BuildRequires: openmpi-devel Requires: openmpi
Requires: environment-modules openmpi
Requires: %{name}-doc = %{version}-%{release}
%description -n ptscotch-openmpi %description -n ptscotch-openmpi
Scotch is a software package for graph and mesh/hypergraph partitioning and Scotch is a software package for graph and mesh/hypergraph partitioning and
sparse matrix ordering. This sub-package provides parallelized scotch libraries sparse matrix ordering. This sub-package provides parallelized scotch libraries
compiled with openmpi compiled with openmpi.
%package -n ptscotch-openmpi-devel %package -n ptscotch-openmpi-devel
Summary: Development libraries for PT-Scotch (openmpi) Summary: Development libraries for PT-Scotch (openmpi)
Group: Development/Libraries Requires: pt%{name}-openmpi%{?_isa} = %{version}-%{release}
Requires: pt%{name}-openmpi = %{version}-%{release} Obsoletes: ptscotch-openmpi-static < 6.0.0-8
%description -n ptscotch-openmpi-devel %description -n ptscotch-openmpi-devel
This package contains development libraries for PT-Scotch, compiled against openmpi. This package contains development libraries for PT-Scotch, compiled against openmpi.
%package -n ptscotch-openmpi-static ###############################################################################
Summary: Static PT-Scotch libraries compiled against openmpi
Group: Development/Libraries
Requires: pt%{name}-openmpi-devel = %{version}-%{release}
%description -n ptscotch-openmpi-static
This package contains static libraries for Scotch, compiled against openmpi.
%prep %prep
%setup -c -q -n scotch_%{version} %setup -q -n scotch_%{version}
pushd scotch_%{version}
sed s/@RPMFLAGS@/'%{optflags} -fPIC'/ < %SOURCE1 > src/Makefile.static.inc
sed s/@RPMFLAGS@/'%{optflags} -fPIC'/ < %SOURCE2 > src/Makefile.shared.inc
popd
cp -ap scotch_%{version} scotch_%{version}_mpich cp -a %{SOURCE1} src/Makefile.inc
cp -ap scotch_%{version} scotch_%{version}_openmpi
%build
module purge
%define dosingle() \
rm -f Makefile.inc; \
ln -s Makefile.static.inc Makefile.inc; \
make %{?_smp_mflags}; \
rm -f Makefile.inc; \
ln -s Makefile.shared.inc Makefile.inc; \
make %{?_smp_mflags}
%define dobuild() \
rm -f Makefile.inc; \
ln -s Makefile.static.inc Makefile.inc; \
make %{?_smp_mflags} ptscotch; \
rm Makefile.inc; \
ln -s Makefile.shared.inc Makefile.inc; \
make %{?_smp_mflags} ptscotch
pushd scotch_%{version}/src/
%dosingle
popd
pushd scotch_%{version}_mpich/src/
%{_mpich_load}
%dobuild
%{_mpich_unload}
popd
module purge
pushd scotch_%{version}_openmpi/src/
%{_openmpi_load}
%dobuild
%{_openmpi_unload}
popd
%install
rm -rf %{buildroot}
module purge
%define doinst() \
pushd src/; \
rm -f Makefile.inc; \
ln -s Makefile.static.inc Makefile.inc; \
make %{?_smp_mflags} install %*; \
rm -f Makefile.inc; \
ln -s Makefile.shared.inc Makefile.inc; \
make %{?_smp_mflags} install %*; \
popd \
pushd $libdir; \
for lib in *.so; do \
mv $lib $lib.0.0; \
ln -s $lib.0.0 $lib; \
ln -s $lib.0.0 $lib.0; \
done; \
popd
pushd scotch_%{version}/
export libdir=%{buildroot}%{_libdir}
%doinst prefix=%{buildroot}%{_prefix} libdir=%{buildroot}%{_libdir}
pushd %{buildroot}%{_bindir}/
for prog in *; do
mv $prog scotch_$prog
done
popd
pushd %{buildroot}%{_mandir}/man1/
rm -f d*
for prog in *; do
mv $prog scotch_$prog
done
popd
pushd %{buildroot}%{_bindir}
rm -f scotch_gpart && ln -s ./scotch_gmap scotch_gpart
popd
# Convert the license files to utf8 # Convert the license files to utf8
pushd doc for file in doc/CeCILL-C_V1-en.txt doc/CeCILL-C_V1-fr.txt; do
iconv -f iso8859-1 -t utf-8 < CeCILL-C_V1-en.txt > CeCILL-C_V1-en.txt.conv iconv -f iso8859-1 -t utf-8 $file > $file.conv && mv -f $file.conv $file
iconv -f iso8859-1 -t utf-8 < CeCILL-C_V1-fr.txt > CeCILL-C_V1-fr.txt.conv done
mv -f CeCILL-C_V1-en.txt.conv CeCILL-C_V1-en.txt
mv -f CeCILL-C_V1-fr.txt.conv CeCILL-C_V1-fr.txt cp -a . %{openmpidir}
cp -a . %{mpichdir}
%build
pushd src/
make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
popd popd
popd
pushd scotch_%{version}_mpich
%{_mpich_load} %{_mpich_load}
export libdir=%{buildroot}/${MPI_LIB} pushd %{mpichdir}/src/
%doinst prefix=%{buildroot}/${MPI_HOME} libdir=%{buildroot}/${MPI_LIB} includedir=%{buildroot}/${MPI_INCLUDE} mandir=%{buildroot}/${MPI_MAN} bindir=%{buildroot}/${MPI_BIN} make %{?_smp_mflags} ptscotch CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
pushd bin
for prog in *; do
mv $prog %{buildroot}/${MPI_BIN}/scotch_${prog}
done
popd
pushd %{buildroot}/${MPI_MAN}/man1/
rm -f {a,g,m}*
for man in *; do
mv ${man} scotch_${man}
done
popd popd
%{_mpich_unload} %{_mpich_unload}
popd
module purge
pushd scotch_%{version}_openmpi
%{_openmpi_load} %{_openmpi_load}
export libdir=%{buildroot}/${MPI_LIB} pushd %{openmpidir}/src/
%doinst prefix=%{buildroot}/${MPI_HOME} libdir=%{buildroot}/${MPI_LIB} includedir=%{buildroot}/${MPI_INCLUDE} mandir=%{buildroot}/${MPI_MAN} bindir=%{buildroot}/${MPI_BIN} make %{?_smp_mflags} ptscotch CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
pushd bin
for prog in *; do
mv $prog %{buildroot}/${MPI_BIN}/scotch_${prog}
done
popd
pushd %{buildroot}/${MPI_MAN}/man1/
rm -f {a,g,m}*
for man in *; do
mv ${man} scotch_${man}
done
popd popd
%{_openmpi_unload} %{_openmpi_unload}
%install
%define doinstall() \
make install prefix=%{buildroot}${MPI_HOME} libdir=%{buildroot}${MPI_LIB} includedir=%{buildroot}${MPI_INCLUDE} mandir=%{buildroot}${MPI_MAN} bindir=%{buildroot}${MPI_BIN} \
# Fix debuginfo packages not finding sources (See libscotch/Makefile) \
ln -s parser_ll.c libscotch/lex.yy.c \
ln -s parser_yy.c libscotch/y.tab.c \
ln -s parser_ly.h libscotch/y.tab.h \
\
pushd %{buildroot}${MPI_LIB}; \
for lib in *.so; do \
chmod 755 $lib \
mv $lib $lib.0.0 && ln -s $lib.0.0 $lib && ln -s $lib.0.0 $lib.0 \
done \
popd \
\
pushd %{buildroot}${MPI_BIN} \
for prog in *; do \
mv $prog scotch_${prog} \
chmod 755 scotch_$prog \
done \
popd \
\
pushd %{buildroot}${MPI_MAN}/man1/ \
for man in *; do \
mv ${man} scotch_${man} \
done \
# Cleanup man pages (some pages are only relevant for ptscotch packages, and vice versa) \
for man in *; do \
if [ ! -f %{buildroot}${MPI_BIN}/${man/.1/} ]; then \
rm -f $man \
fi \
done \
popd popd
###############################################################################
export MPI_HOME=%{_prefix}
export MPI_LIB=%{_libdir}
export MPI_INCLUDE=%{_includedir}
export MPI_MAN=%{_mandir}
export MPI_BIN=%{_bindir}
pushd src
%doinstall
popd
###############################################################################
%{_mpich_load}
pushd %{mpichdir}/src
%doinstall
popd
%{_mpich_unload}
###############################################################################
%{_openmpi_load}
pushd %{openmpidir}/src
%doinstall
popd
%{_openmpi_unload}
###############################################################################
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
@ -248,7 +192,9 @@ popd
%postun -n ptscotch-openmpi -p /sbin/ldconfig %postun -n ptscotch-openmpi -p /sbin/ldconfig
%files %files
%doc doc/CeCILL-C_V1-en.txt
%{_bindir}/* %{_bindir}/*
%{_libdir}/libscotch*.so.* %{_libdir}/libscotch*.so.*
%{_mandir}/man1/* %{_mandir}/man1/*
@ -257,37 +203,35 @@ popd
%{_libdir}/libscotch*.so %{_libdir}/libscotch*.so
%{_includedir}/*scotch*.h %{_includedir}/*scotch*.h
%files static
%{_libdir}/libscotch*.a
%files -n ptscotch-mpich %files -n ptscotch-mpich
%doc doc/CeCILL-C_V1-en.txt
%{_libdir}/mpich/lib/lib*.so.* %{_libdir}/mpich/lib/lib*.so.*
%{_libdir}/mpich/bin/* %{_libdir}/mpich/bin/*
%{_mandir}/mpich/* %{_mandir}/mpich/*
%files -n ptscotch-openmpi
%{_libdir}/openmpi/lib/lib*.so.*
%{_libdir}/openmpi/bin/*
%{_mandir}/openmpi*/*
%files -n ptscotch-mpich-devel %files -n ptscotch-mpich-devel
%{_includedir}/mpich*/*scotch*.h %{_includedir}/mpich*/*scotch*.h
%{_libdir}/mpich/lib/lib*.so %{_libdir}/mpich/lib/lib*.so
%files -n ptscotch-openmpi
%doc doc/CeCILL-C_V1-en.txt
%{_libdir}/openmpi/lib/lib*.so.*
%{_libdir}/openmpi/bin/*
%{_mandir}/openmpi*/*
%files -n ptscotch-openmpi-devel %files -n ptscotch-openmpi-devel
%{_includedir}/openmpi*/*scotch*.h %{_includedir}/openmpi*/*scotch*.h
%{_libdir}/openmpi/lib/lib*.so %{_libdir}/openmpi/lib/lib*.so
%files -n ptscotch-mpich-static
%{_libdir}/mpich/lib/lib*.a
%files -n ptscotch-openmpi-static
%{_libdir}/openmpi/lib/lib*.a
%files doc %files doc
%doc scotch_%{version}/README.txt scotch_%{version}/doc/* %doc doc/CeCILL-C_V1-en.txt
%doc doc/*.pdf
%doc doc/scotch_example.f
%changelog %changelog
* Fri Aug 08 2014 Sandro Mani <manisandro@gmail.com> - 6.0.0-8
- Rework specfile
* Sat Jul 05 2014 Sandro Mani <manisandro@gmail.com> - 6.0.0-7 * Sat Jul 05 2014 Sandro Mani <manisandro@gmail.com> - 6.0.0-7
- Fix under-linked libraries (#1098680) - Fix under-linked libraries (#1098680)