Request for discussion: gap (computer algebra system)
Jason L Tibbitts III
tibbs at math.uh.edu
Fri Jun 3 15:15:53 UTC 2005
I have to package several things locally and I figured that it would
be nice to at least get the packages to Extras-quality. Here is the
GAP computer algebra system. The package was originally made by Rex
Dieter but I've been hacking on it here a bit. I'm not proposing it
for submission unless others are interested and I can get assent from
Rex.
Building GAP is mildly complicated. It consists of a base system plus
various included packages or modules, each of which needs separate
treatment. Each module has its own configure script, but many of
these are not related to autoconf. This causes complaints from
rpmlint about not specifying libdir, which must be ignored.
The package also includes a desktop file and icon; I have probably
screwed something up there but it seems to work.
Outside of no-signature and bogus configure-without-libdir-spec
complaints, rpmlint is quiet. The spec is below; packages are at
http://www.math.uh.edu/~tibbs/rpms/gap/
- J<
%define major 4
%define minor 4
%define patchlevel 5
# This package has way too many version strings
%define bver %{major}%{minor}
%define sver %{major}r%{minor}
%define lver %{major}r%{minor}p%{patchlevel}
%define ver %{major}.%{minor}.%{patchlevel}
%define rel 0.1%{?dist}
%define pkgver 2005_05_30-14_47_UTC
%define gapdir %{_libdir}/%{name}-%{ver}
%define gapdoc %{_docdir}/%{name}-%{ver}
%define docpkg 1
Name: gap
Summary: Groups, Algorithms and Programming
Group: Applications/Engineering
Version: %{ver}
Release: %{rel}
URL: http://turnbull.mcs.st-and.ac.uk/~gap/
Source0: ftp://ftp.gap-system.org/pub/gap/gap%{bver}/tar.bz2/gap%{lver}.tar.bz2
Source1: ftp://ftp-gap.dcs.st-and.ac.uk/pub/gap/gap%{bver}/tar.bz2/packages-%{pkgver}.tar.bz2
Source2: gap4-32.png
License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-%(id -u -n)-root
BuildRequires: autoconf
BuildRequires: desktop-file-utils glibc-devel gmp-devel
#Patch1: %{name}-%{lver}-xgapfix.patch
%description
GAP (Groups, Algorithms and Programming) is a system for computational
discrete algebra with particular emphasis on, but not restricted to
computational group theory.
%if "%{docpkg}" == "1"
%package doc
Group: Documentation
Requires: %{name} = %{version}-%{release}
# Requires: htmlview
Summary: %{name} documentation
%description doc
%{name} documentation.
%else
Obsoletes: %{name}-doc < %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
%endif
%package gac
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
Summary: %{name} compiler
Requires: gcc
%description gac
%{name} compiler and friends.
%package xgap
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
Summary: %{name} graphical interface
%description xgap
%{name} graphical interface
%{?!_icondir:%define _icondir %{_datadir}/pixmaps}
%prep
## Easy setup with tar files
%setup -q -n %{name}%{sver}
%setup -q -n %{name}%{sver}/pkg -T -D -a 1
%build
cd ..
# Main package
%configure
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
#xgap
pushd pkg/xgap
%configure
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
popd
# Other packages, taken from InstPackages.sh script
pushd pkg/ace
./configure ../..
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
popd
pushd pkg/anupq
./configure ../..
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
popd
# skip atlasrep datagens, dataword chmods
# skip carat
pushd pkg/cohomolo
./configure
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
popd
# skip edim; need to unset LANG, LC_ALL
pushd pkg/example
./configure ../..
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
popd
pushd pkg/fplsa
./configure ../..
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
popd
pushd pkg/grape
./configure ../..
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" linux-gcc
popd
pushd pkg/guava*
./configure ../..
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
popd
pushd pkg/kbmag
#make clean
./configure ../..
make
#make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" COPTS="-O2 -g"
popd
# Seems to be busted on 64-bit linux
#pushd pkg/nq
#./configure
#make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
#popd
# Seems to be busted
#pushd pkg/pargap
#./configure ../..
#make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
#cp bin/pargap.sh ../../bin/
#popd
#rm -f ALLPKG
# Cleanup unneeded crud
rm -f Makefile* config* pkg/xgap/config* pkg/xgap/bin/*/config*
rm -f pkg/xgap/bin/*/*.o
rm -rf src pkg/xgap/src
rm bin/*.dll bin/*.bat bin/*.pif bin/*.exe
%install
cd ..
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_bindir},%{gapdoc},%{gapdir}}
# Should probably use install here.
cp -a [a-c,f-z]* \
$RPM_BUILD_ROOT%{gapdir}
rm $RPM_BUILD_ROOT%{gapdir}/pkg/PKGDIR
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
mkdir -p $RPM_BUILD_ROOT%{_datadir}/application-registry
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime-info
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp -a etc $RPM_BUILD_ROOT%{gapdoc}
cp -a doc/* $RPM_BUILD_ROOT%{gapdoc}
cp -a README $RPM_BUILD_ROOT%{gapdoc}
# fixup gap shell wrapper
perl -pi -e"s@^GAP_DIR=.*@GAP_DIR=%{gapdir}@" \
$RPM_BUILD_ROOT%{gapdir}/bin/%{name}.sh
ln $RPM_BUILD_ROOT%{gapdir}/bin/%{name}.sh \
$RPM_BUILD_ROOT%{_bindir}/%{name}
# fixup xgap shell wrapper
perl -pi -e"s@^GAP_DIR=.*@GAP_DIR=%{gapdir}@" \
$RPM_BUILD_ROOT%{gapdir}/pkg/xgap/bin/x%{name}.sh
ln $RPM_BUILD_ROOT%{gapdir}/pkg/xgap/bin/x%{name}.sh \
$RPM_BUILD_ROOT%{_bindir}/x%{name}
# applnk/icon for xgap
cat > xgap.desktop << EOF
[Desktop Entry]
Type=Application
Exec=xgap --stay
Icon=%{_datadir}/pixmaps/gap4.png
Name=xgap
StartupWMClass=xgap
Terminal=false
Comment=The GAP computer algebra system (v%{version})
Encoding=UTF-8
EOF
desktop-file-install --vendor Fedora \
--add-category X-UH \
--add-category X-Fedora \
--add-category Application \
--add-category Math \
--add-category Algebra \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
xgap.desktop
install -D -m644 %SOURCE2 $RPM_BUILD_ROOT%{_icondir}/gap4.png
%files
%defattr(-, root, root)
%doc %{gapdir}/pkg/README.[a-w,y-z]*
%doc %{gapdir}/pkg/README.xmod
%{_bindir}/gap
%dir %{gapdir}
# Grab everything *except* doc,pkg
%{gapdir}/[a,c,e-o,q-z]*
%{gapdir}/prim
# And in pkg, everything except xgap
%{gapdir}/pkg/[a-w,y-q]*
%{gapdir}/pkg/xmod
#%{_libdir}/%{name}%{lver}/x[a-f,h-z]*
%{gapdir}/bin/gap*
%{gapdir}/bin/*/gap
%if "%{docpkg}" == "1"
%files doc
%defattr(-,root,root)
%endif
%doc %{gapdoc}
%files gac
%defattr(-,root,root)
%{gapdir}/bin/*/*.o
%{gapdir}/bin/*/config*
%{gapdir}/bin/*/gac
%{gapdir}/bin/*/Makefile
%files xgap
%defattr(-,root,root)
%{_bindir}/xgap
%{gapdir}/pkg/xgap
%{_datadir}/applications/*
%{_icondir}/*
%doc %{gapdir}/pkg/README.xgap
%clean
rm -rf "$RPM_BUILD_ROOT"
%changelog
* Fri Jun 3 2005 Jason L Tibbitts III <tibbs at math.uh.edu> - 4.4.5-0.1
- Update to 4.4.5.
- Beginnings of cleanup for Fedora Extras.
* Fri Sep 10 2004 Jason Tibbitts <tibbs at math.uh.edu> 4.4.3-2
- Add transparency to icon.
- Fix warnings from desktop-file-install.
* Fri Jun 11 2004 Jason Tibbitts <tibbs at math.uh.edu> 4.4.3-1
- Update to 4.4.3.
* Fri Nov 15 2002 Rex Dieter <rdieter at unl.edu> 4.3.3-0
- 4r3, fix3
- merge -doc subpkg into main (for now).
* Mon Jan 14 2002 Rex Dieter <rdieter at unl.edu> 4.2.8-1
- version: 4r2 -> 4.2
- doc subpkg (only html docs, for now)
- gac subpkg
- specfile cosmetics
- at least pretend to be relocatable
* Tue Jun 26 2001 Rex Dieter <rdieter at unl.edu>
- First try, gap4r2 (+fixes 1-8)
- convert zoo archives to tar.gz
- bundle fixes 1-8 into one file.
- TODO: Split into multiple smaller rpms.
More information about the fedora-extras-list
mailing list