Hello,

I have not tried to compile SAGE v3.0 yet, nor am I familiar with Arch
or its method of distributing packages. However, I did create the RPM
distributable version of SAGE. Upon reviewing the PKGBUILD file
available on the link you provided, I thought we might be able to
share our knowledge of building SAGE in an environment where it's
being built on one machine and targeted for binary distribution on
another.

The source RPM can be found at
http://rpm.pbone.net/index.php3/stat/4/idpl/6391689/com/sage-2.10.2-1pclos2007.i586.rpm.html
(yes, I know it's a slightly out of date version, but I'm waiting for
the final 3.0 release to roll the new RPM). The SPEC file, which seems
to be equivalent to the PKGBUILD file in functionality, is below. Of
particular interest might be the %install section which is effectively
a shell shell script executed when packaging up everything into the
deliverable RPM. Another section of interest is %post  which is
effectively a shell script that executes on the target system after
all files are extracted from the RPM, but before the user can actually
use their new SAGE installation.

%define name    sage
%define         summary SAGE: Open Source Mathematics Software
%define version 2.10.2
%define release %mkrel 1

%define sagedir %buildroot%{_libdir}
%define dbgap   database_gap-4.4.10

# until this works fully, do NOT set this to 1. Unfortunately, this
means that we will be building A LOT MORE than necessary
# there is actually some debate on sage-devel forums whether or not
building against system libraries is even a good idea
%define use_system_equivalents 0

Summary:        %{summary}
Name:   %{name}
Version:        %{version}
Release:        %{release}
License:        GPLv2
Group:  Sciences/Mathematics
URL:            http://www.sagemath.org/
Source:         http://www.sagemath.org/dist/src/%{name}-%{version}.tar
Source1:        %{name}.png
Source2:        http://www.sagemath.org//packages/optional/%{dbgap}.spkg
Source3:        deps
Source4:        sage-finalconfig.pl
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Packager:       Gri6507
Distribution:   PCLinuxOS

# Do not automatically look for dependencies because this will find a
large number of
# library and perl dependencies that are built as part of SAGE and not
delivered to
# their respective proper target directories. So, it would be unwise
to say that this
# package "provides" those libraries since the provision is only made
for SAGE.
AutoReqProv:    No

BuildRequires:  perl
BuildRequires:  binutils
BuildRequires:  openssh
BuildRequires:  tar
BuildRequires:  tetex-latex
BuildRequires:  latex2html
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  libreadline5-devel
BuildRequires:  kdegraphics-kpdf
BuildRequires:  kash >= 2006.02.05-2
BuildRequires:  macaulay2

%if "%{?use_system_equivalents}" == "1"
BuildRequires:  libpython-devel
BuildRequires:  python
BuildRequires:  python-scons
BuildRequires:  libblas-devel
BuildRequires:  liblapack-devel
BuildRequires:  atlas
BuildRequires:  libgfortran
BuildRequires:  gcc-gfortran
BuildRequires:  libgmp-devel
BuildRequires:  libtermcap-devel
BuildRequires:  libreadline-devel
BuildRequires:  R-base
BuildRequires:  ntl-devel
BuildRequires:  libgd-devel
BuildRequires:  libopencdk-devel
BuildRequires:  libgpg-error-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libgnutls-devel
BuildRequires:  gnutls
BuildRequires:  scons
BuildRequires:  libsqlite3_0-devel
BuildRequires:  mercurial
BuildRequires:  libfac
BuildRequires:  zlib-devel
BuildRequires:  libfreetype-devel
BuildRequires:  libpng-devel
BuildRequires:  clisp
BuildRequires:  python-gd
BuildRequires:  IPython
%else
# the following standand alone packages are replaced by SAGE's version
Obsoletes:      R-base
Obsoletes:      mercurial
Obsoletes:      ipython

Provides:       R-base
Provides:       mercurial
Provides:       ipython
Provides:       maxima
Provides:       singular
%endif

# the following requires are needed because the user may ask SAGE to
install optional pacakges
Requires:       bzip2
Requires:       autoconf
Requires:       automake
Requires:       gcc-c++
Requires:       elfutils
Requires:       gettext
Requires:       libgettextmisc
Requires:       libstdc++6
Requires:       libtool-base
Requires:       wget
Requires:       libpython2.4-devel
Requires:       binutils
Requires:       tetex-latex
Requires:       latex2html
Requires:       bison
Requires:       flex

# These are needed to make SAGE run
Requires:       perl-Expect
Requires:       ImageMagick
Requires:       kdegraphics-kpdf
Requires:       octave
Requires:       kash >= 2006.02.05-2
Requires:       macaulay2
Requires:       desktop-common-data
Requires:       gnuplot
Requires:       python
Requires:       openssh
Requires:  libopenssl0.9.8 >= 0.9.8e

%if "%{?use_system_equivalents}" == "1"
Requires:       libpython
Requires:       python
Requires:       python-scons
Requires:       libblas
Requires:       liblapack
Requires:       atlas
Requires:       libgfortran
Requires:       gcc-gfortran
Requires:       libgmp
Requires:       libtermcap
Requires:       libreadline
Requires:       R-base
Requires:       ntl-devel
Requires:       libgd
Requires:       libopencdk
Requires:       libgpg-error
Requires:       libgcrypt
Requires:       libgnutls
Requires:       gnutls
Requires:       scons
Requires:       libsqlite3_0
Requires:       mercurial
Requires:       libfac
Requires:       zlib
Requires:       libfreetype
Requires:       libpng
Requires:       clisp
Requires:       python-gd
Requires:       ipython
%endif


%description
Use SAGE for studying a huge range of mathematics, including algebra,
calculus, elementary to very advanced number theory, cryptography,
numerical computation, commutative algebra, group theory,
combinatorics, graph theory, and exact linear algebra.
SAGE makes it easy for you to use most mathematics software together.
SAGE includes interfaces to Magma, Maple, Mathematica, MATLAB, and
MuPAD, and the free programs Axiom, GAP, GP/PARI, Macaulay2, Maxima,
Octave, and Singular.
SAGE also provides the following toolsets
* GAP - groups, discrete math
* Singular - polynomial computation
* PARI and GP - number theory
* Maxima - symbolic manipulation
* mwrank, ec, simon, sea - elliptic curves
* R-base - A language for data analysis and graphics
* ipithon
* hg - Mercurial source code management system
* hgmerge - default wrapper to merge files in Mercurial SCM system
* much much more

%package doc
Summary:        %name documentation
Group:  Sciences/Mathematics
Provides:       %name-doc
Requires:       %name = %{version}-%{release}
Requires:       info

%description doc
Documentation for %name

%package devel
Summary:        %name development files
Group:  Sciences/Mathematics
Provides:       %name-devel
Requires:       %name = %{version}-%{release}
AutoReqProv: no

%description devel
Development files for %name

%prep
%setup -q

%if "%{?use_system_equivalents}" == "1"
# Follow the MUCH shorter instructions on building SAGE
%{__cp} %SOURCE3 spkg/standard/

# adjust the few stubborn packages for the build against system
components
pushd .
popd
%endif

# this step will take a VERY LONG TIME (about 3.5 hours on my 3000+
Semptron)
%build
# set some environment variables
%make %{?jobs:-j %jobs}
PATH=$RPM_BUILD_DIR/%{name}-%{version}:$PATH

# the documentation is only generated after the make is complete, so
don't look for this directory before the make
pushd devel/doc
  # making of PDF documentation causes problems, so let's skip that
  #%make pdf

  # Make the HTML documentation causes problems so, let fix it first
  # This is listed under Trac ticket #1984 (oooooooohhhh .. big
brother is watching you)
  %{__sed} -i -e "s/@mathbf/mathbf/g" ../doc-main/ref/ref.toc
  %make html

  # Build the const documentation
  pushd const
      ./build_pdf
  popd
popd


# This step take a good hour or so
%check
PATH=$RPM_BUILD_DIR/%{name}-%{version}:$PATH
%make test


# this step take about a half hour
%install
PATH=$RPM_BUILD_DIR/%{name}-%{version}:$PATH
# install scripts first
%{__mkdir_p} %buildroot%{_bindir}
./%name -c 'install_scripts("%buildroot%{_bindir}")'
# This was submitted under Trac #1753
# when these scripts are created, the kash and M2 executables are
overwritten by sage's ones, but it still points to the original
one :-)
%{__mv} %buildroot%{_bindir}/kash %buildroot%{_bindir}/kash.%{name}
%{__mv} %buildroot%{_bindir}/M2 %buildroot%{_bindir}/M2.%{name}
# install the "strongly suggested" optional package, but do so locally
without downloading it first
%{__mkdir_p} $RPM_BUILD_DIR/%{name}-%{version}/spkg/optional/
%{__cp} %SOURCE2 $RPM_BUILD_DIR/%{name}-%{version}/spkg/optional/
./%name -i %dbgap
# install const documentation
pushd devel/doc/const
    %{__mkdir_p} %buildroot%{_datadir}/doc/%{name}
    %{__cp} const.pdf %buildroot%{_datadir}/doc/%{name}
popd
# finally install everything
DESTDIR=%sagedir %make install
%{__mv} %{sagedir}/bin/%{name} $RPM_BUILD_ROOT/%{_bindir}/%{name}
# Trac ticket #1792
%{__sed} -i -e '[EMAIL PROTECTED]@SAGE_ROOT="%{_libdir}/%{name}"@'
$RPM_BUILD_ROOT/%{_bindir}/%{name}
%{__sed} -i -e '[EMAIL PROTECTED]@SAGE_ROOT="%{_libdir}/%{name}"@'
$RPM_BUILD_ROOT/%{_libdir}/%{name}/%{name}
rmdir %{sagedir}/bin
# The following was reported under Trac ticker #1752 which was marked
repaired for the upcoming 2.10 release
# fix some permissions
%{__chmod} 755 %{sagedir}/%{name}/local/lib/libhistory.so.*
%{__chmod} 755 %{sagedir}/%{name}/local/lib/libreadline.so.*
# The following was reported under Trac #1830
# for the time being, just set it to some bogus value and let SAGE
configure itself properly after install
%{__sed} -i -e '[EMAIL PROTECTED]@unconfigured@' %{sagedir}/%{name}/local/lib/%
{name}-current-location.txt
# make sage's tmp directory's permissions wide open. This is needed
for things like running tests
%{__chmod} -R 777  %{sagedir}/%{name}/tmp
# deliver the perl executable to do the final configuration of sage
%__install -m 700 %SOURCE4 %{sagedir}/%{name}/local/bin/
# trim out the *.pyc and *.pyo files. These will be regenerated at
install time.
find %{sagedir}/%{name} -name *.py[co] | xargs rm $1

# create a desktop file
%{__mkdir_p} %{buildroot}%{_datadir}/icons
%{__cp} %SOURCE1 %{buildroot}%{_datadir}/icons/
%{__mkdir_p} %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/%{name}.desktop  << EOF
[Desktop Entry]
Encoding=UTF-8
Name=%name
Comment=%summary
Exec=%{_bindir}/%name -notebook
Icon=%name
Terminal=true
Type=Application
Categories=Development;Engineering;X-MandrivaLinux-MoreApplications-
Sciences-Mathematics;
EOF


%clean
test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT


%post
# let's clean up the kash and M2 mess created by sage (see above
comments)
%{__mv} %{_bindir}/kash %{_bindir}/kash.kash
%{__mv} %{_bindir}/kash.%{name} %{_bindir}/kash
%{__sed} -i -e '[EMAIL PROTECTED]@Exec=kash.kash@' %{_datadir}/applications/
kash3.desktop
%{__mv} %{_bindir}/M2 %{_bindir}/M2.M2
%{__mv} %{_bindir}/M2.%{name} %{_bindir}/M2
%{__sed} -i -e '[EMAIL PROTECTED]@M2\.M2@' %{_datadir}/applications/
Macaulay2.desktop
# update the menus
%update_menus
%update_desktop_database &> /dev/null ||:

# run sage for the first time to regenerate the python files with the
correct path.
ORIG_SAGEDIR='sage_user_directory_not_present'
if [ -d $HOME/.sage ]
then
    %{__mv} $HOME/.sage $HOME/.sage.$$
    ORIG_SAGEDIR=$HOME/.sage.$$
fi
export ORIG_SAGEDIR

%{_libdir}/%{name}/local/bin/sage-finalconfig.pl  &> /dev/null ||:
%{__rm} -rf $HOME/.sage

if [ -d $ORIG_SAGEDIR ]
then
   %{__mv} $ORIG_SAGEDIR $HOME/.sage
fi

%postun
# let's clean up the kash and M2 mess created by sage (see above
comments)
%{__mv} %{_bindir}/kash %{_bindir}/kash.%{name}
%{__mv} %{_bindir}/kash.kash %{_bindir}/kash
%{__sed} -i -e '[EMAIL PROTECTED]@Exec=kash@' %{_datadir}/applications/
kash3.desktop
%{__mv} %{_bindir}/M2 %{_bindir}/M2.%{name}
%{__mv} %{_bindir}/M2.M2 %{_bindir}/M2
%{__sed} -i -e '[EMAIL PROTECTED]@M2@' %{_datadir}/applications/
Macaulay2.desktop
%update_menus
%update_desktop_database &> /dev/null ||:
%clean_menus
%clean_desktop_database &> /dev/null ||:


%files
%defattr(-,root,root,755)
%{_bindir}/R
%{_bindir}/gap
%{_bindir}/gp
%{_bindir}/hg
%{_bindir}/hgmerge
%{_bindir}/ipython
%{_bindir}/kash.sage
%{_bindir}/M2.sage
%{_bindir}/maxima
%{_bindir}/mwrank
%{_bindir}/sage
%{_bindir}/singular
%{_libdir}/%{name}/COPYING.txt
%{_libdir}/%{name}/README.txt
%{_libdir}/%{name}/HISTORY.txt
%{_libdir}/%{name}/data/
%{_libdir}/%{name}/ipython/
%{_libdir}/%{name}/local/LIB
%{_libdir}/%{name}/local/bin/
%{_libdir}/%{name}/local/d%{name}/
%{_libdir}/%{name}/local/java/
%{_libdir}/%{name}/local/lib/
%{_libdir}/%{name}/local/libexec/
%{_libdir}/%{name}/local/share/
%{_libdir}/%{name}/makefile
%{_libdir}/%{name}/matplotlibrc
%{_libdir}/%{name}/%{name}*
%{_libdir}/%{name}/spkg/
%{_libdir}/%{name}/tmp/
%{_datadir}/applications/%{name}.desktop
%{_iconsdir}/%{name}.png
%{_libdir}/%{name}/devel/%{name}
%{_libdir}/%{name}/devel/%{name}-main/

# Not wanted
%exclude %{_libdir}/%{name}/install.log
%exclude %{_libdir}/%{name}/local/lib/gap-*/doc/
%exclude %{_libdir}/%{name}/local/lib/gap-*/tst/
%exclude %{_libdir}/%{name}/local/lib/gap-*/src/
%exclude %{_libdir}/%{name}/local/share/doc/
%exclude %{_libdir}/%{name}/local/share/info/
%exclude %{_libdir}/%{name}/local/share/man/
%exclude %{_libdir}/%{name}/local/share/maxima/*/doc
%exclude %{_libdir}/%{name}/local/share/pari/doc
%exclude %{_libdir}/%{name}/local/share/polybori/doc
%exclude %{_libdir}/%{name}/data/extcode/.hg/
%exclude %{_libdir}/%{name}/local/bin/.hg/
%exclude %{_libdir}/%{name}/spkg/base/.hg/


%files doc
%defattr(-,root,root,755)
%{_libdir}/%{name}/devel/doc
%{_libdir}/%{name}/devel/doc-main/
%{_libdir}/%{name}/doc
%{_libdir}/%{name}/example.%{name}
%{_libdir}/%{name}/examples/
%{_libdir}/%{name}/local/doc/
%{_libdir}/%{name}/local/info/
%{_libdir}/%{name}/local/lib/gap-*/doc/
%{_libdir}/%{name}/local/man/man*/
%{_datadir}/doc/%{name}/const.pdf
%{_libdir}/%{name}/local/share/doc/
%{_libdir}/%{name}/local/share/info/
%{_libdir}/%{name}/local/share/man/
%{_libdir}/%{name}/local/share/maxima/*/doc
%{_libdir}/%{name}/local/share/pari/doc
%{_libdir}/%{name}/local/share/polybori/doc


%files devel
%defattr(-,root,root,-)
%{_libdir}/%{name}/local/include/
%{_libdir}/%{name}/local/lib/gap-*/src/
%{_libdir}/%{name}/data/extcode/.hg/
%{_libdir}/%{name}/local/bin/.hg/
%{_libdir}/%{name}/spkg/base/.hg/


%changelog
* Fri Feb 22 2008 Paul Grinberg <gri6507 TA yahoo TOD com>
2.10.2-1pclos2007
- Updated to version 2.10.2
- Updated openssl version dependency
- fix the problem with kash desktop file manipulation
- preserve user's personla sage directory when installing
- From Santa's Little Helper on MyPCLinuxOS

* Sun Feb 17 2008 Paul Grinberg <gri6507 TA yahoo TOD com>
2.10.1-2pclos2007
- Do not deliver *.pyc and *.pyo files - generate those at RPM install
time instead by running SAGE for the first time

* Mon Feb 4 2008 Paul Grinberg <gri6507 TA yahoo TOD com>
2.10.1-1pclos2007
- Updated to version 2.10.1

* Tue Jan 29 2008 Paul Grinberg <gri6507 TA yahoo TOD com>
2.10-1pclos2007
- Corrected the Provides: list to include R-base and mercurial
- Updated to version 2.10

* Fri Jan 18 2008 Paul Grinberg <gri6507 TA yahoo TOD com>
2.9.3-3pclos2007
- Initial build for PCLinuxOS 2007


On Apr 14, 3:14 pm, mabshoff <[EMAIL PROTECTED]
dortmund.de> wrote:
> Hi.
>
> I am currently in the finishing stage on getting gcc 4.3 build support
> into Sage 3.0.alpha5. I am doing so on an 64 bit Arch Linux VMWare
> image and am down to the following bug (which is not gcc 4.3 related):
>
> File "/home/mabshoff/sage-3.0.alpha3/tmp/real_double.py", line 546:
>     sage: a = -RDF(1)/RDF(0); a.str()
> Expected:
>     '-inf'
> Got:
>     'inf'
> **********************************************************************
> File "/home/mabshoff/sage-3.0.alpha3/tmp/real_double.py", line 981:
>     sage: a.is_positive_infinity()
> Expected:
>     False
> Got:
>     True
> **********************************************************************
> File "/home/mabshoff/sage-3.0.alpha3/tmp/real_double.py", line 993:
>     sage: a.is_negative_infinity()
> Expected:
>     True
> Got:
>     False
> **********************************************************************
> 3 items had failures:
>    1 of   6 in __main__.example_35
>    1 of   5 in __main__.example_67
>    1 of   5 in __main__.example_68
> ***Test Failed*** 3 failures.
> For whitespace errors, see the file /home/mabshoff/sage-3.0.alpha3/
> tmp/.doctest_real_double.py
>          [17.1 s]
> exit code: 1024
>
> It is an issue in GSL which I have already fixed with OSX 10.5, so it
> will be easy to fix on Arch Linux, too. I am wondering what the exact
> Posix behavior dictates here since the fallback GSL isinf function
> also returns -inf instead of inf.
>
> On another note: Is the packager of Sage on Arch around here? I.e. a/
> the person who is involved with
>
> http://aur.archlinux.org/packages.php?ID=14429
>
> I got a couple notes for Sage 3.0 on Arch Linux and I would prefer to
> have the packagers be aware of the issues before they run into it.
> Probably the most important is that on Arch with gcc 4.3 you *must*
> set SAGE_FORTAN and SAGE_FORTRAN_LIB to use gfortran from gcc 4.3
> instead of using the g95 binary we provide since that seems horribly
> broken on Arch.
>
> Cheers,
>
> Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to