> When I look at the instructions for creating a spkg:
>
> http://www.sagemath.org/doc/html/prog/node24.html
>
> The first thing that catches my eye is
>
> "(b)
>     Put your files in that directory."
>
> So where do the files come from?  I took a spkg at random (readline),

Yes, for the sympy spkg I created a simple script:

http://hg.sympy.org/sympy-spkg/file/fbd2fdc46122/get-orig-sources

that will download the corret source and put it to the right place.

> extracted it, and tried to find out where to obtain its source code
> from.  Here is all the documentation that the readline spkg contained:
>
> "$ cat SPKG.txt
> Deleted some files from the doc directory from the standard distro,
> since it took tons of space;
> didn't delete anything else."
>
> I am not sure who last worked on readline because it does not say.  If
> someone gave me the task of updating this spkg, I guess I would start
> googling to find out were to obtain the source code.

Yes, see my suggestion before in this thread to fix the changelog problem.

> In contrast to this, a portage package contains a script (called an
> ebuild) that automatically downloads the source code needed to build
> an application from wherever it lives on the Internet, checks the
> archive's integrity, unarchives it, applies patches, builds it, tests
> it, and installs it.  Beyond this, all packages that the package
> depends on are checked to make sure they are present and if they are
> not, each one is installed first using the same mechanism.

It's a question, whether Sage needs this dependency machinery (which
requires some kind of database etc). I think not (yet).

> Here is the ebuild script for readline:
>
> ==== readline-5.2_p7.ebuild ====
> # Copyright 1999-2007 Gentoo Foundation
> # Distributed under the terms of the GNU General Public License v2
> # $Header: /var/cvsroot/gentoo-x86/sys-libs/readline/readline-5.2_p7.ebuild,v
> 1.9 2007/12/11 23:59:41 vapier Exp $
>
> inherit eutils multilib toolchain-funcs flag-o-matic
>
> # Official patches
> # See ftp://ftp.cwru.edu/pub/bash/readline-5.1-patches/
> PLEVEL=${PV##*_p}
> MY_PV=${PV/_p*}
> MY_P=${PN}-${MY_PV}
>
> DESCRIPTION="Another cute console display library"
> HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html";
> SRC_URI="mirror://gnu/readline/${MY_P}.tar.gz
>         $(for ((i=1; i<=PLEVEL; i++)); do
>                 printf
> 'ftp://ftp.cwru.edu/pub/bash/readline-%s-patches/readline%s-%03d\n' \
>                         ${MY_PV} ${MY_PV/\.} ${i}
>                 printf
> 'mirror://gnu/bash/readline-%s-patches/readline%s-%03d\n' \
>             ${MY_PV} ${MY_PV/\.} ${i}
>         done)"
>
> LICENSE="GPL-2"
> SLOT="0"
> KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc
> ~sparc-fbsd x86 ~x86-fbsd"
> IUSE=""
>
> # We must be certain that we have a bash that is linked
> # to its internal readline, else we may get problems.
> RDEPEND=">=sys-libs/ncurses-5.2-r2"
> DEPEND="${RDEPEND}
>         >=app-shells/bash-2.05b-r2"
>
> S=${WORKDIR}/${MY_P}
>
> src_unpack() {
>         unpack ${MY_P}.tar.gz
>
>         cd "${S}"
>         # Official patches
>         local i
>         for ((i=1; i<=PLEVEL; i++)); do
>                 epatch "${DISTDIR}"/${PN}${MY_PV/\.}-$(printf '%03d' ${i})
>         done
>         epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
>         epatch "${FILESDIR}"/${PN}-5.2-rlfe-build.patch #151174
>         epatch "${FILESDIR}"/${PN}-5.1-rlfe-uclibc.patch
>         epatch "${FILESDIR}"/${PN}-5.1-fbsd-pic.patch
>
>         ln -s ../.. examples/rlfe/readline
>
>         # force ncurses linking #71420
>         sed -i -e 's:^SHLIB_LIBS=:SHLIB_LIBS=-lncurses:'
> support/shobj-conf || die "sed"
> }
>
> src_compile() {
>         append-flags -D_GNU_SOURCE
>
>         # the --libdir= is needed because if lib64 is a directory, it
> will default        # to using that... even if CONF_LIBDIR isnt set or
> we're using a version
>         # of portage without CONF_LIBDIR support.
>         econf --with-curses --libdir=/usr/$(get_libdir) || die
>         emake || die
>
>         if ! tc-is-cross-compiler; then
>                 cd examples/rlfe
>                 econf || die
>                 emake || die "make rlfe failed"
>         fi
> }
>
> src_install() {
>         emake DESTDIR="${D}" install || die
>         dodir /$(get_libdir)
>
>         mv "${D}"/usr/$(get_libdir)/*.so* "${D}"/$(get_libdir)
>         chmod a+rx "${D}"/$(get_libdir)/*.so*
>
>         # Bug #4411
>         gen_usr_ldscript libreadline.so
>         gen_usr_ldscript libhistory.so
>
>         if ! tc-is-cross-compiler; then
>                 dobin examples/rlfe/rlfe || die
>         fi
>
>         dodoc CHANGELOG CHANGES README USAGE NEWS
>         docinto ps
>         dodoc doc/*.ps
>         dohtml -r doc
> }
>
> pkg_preinst() {
>         preserve_old_lib /$(get_libdir)/lib{history,readline}.so.4 #29865
> }
>
> pkg_postinst() {
>         preserve_old_lib_notify /$(get_libdir)/lib{history,readline}.so.4
> }

I find this very difficult to understand (compare to my simple script
for doing the same for sympy above).
To be fair, the Debian script, which does the same as above, has 446
lines and is probably even more ugly than the above ebuild.


> ====
>
> All ebuild scripts adhere to a well-defined specification
> (http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=1)
> so a developer can look at any ebuild script in the portage tree and
> see the exact same format.  For example, a short description of the
> package is present along with the homepage of the project, the URI
> from where the source can be downloaded, and flags which indicate
> which architectures the package will work with.

Yep, the same in Debian. Plus a link to the VCS repository
(subversion, git, ...) of the debian package,
so that anyone can easily contribute patches to fix the packaging.

> Beyond this, all portage packages have a ChangeLog file which contains
> all of the work that has been done on the package since it was first
> put in the tree, who did the work, and when it was done:
>
> ==== /usr/portage/sys-libs/readline/ChangeLog ===
> # ChangeLog for sys-libs/readline
> # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
> # $Header: /var/cvsroot/gentoo-x86/sys-libs/readline/ChangeLog,v 1.108
> 2007/09/29 05:03:43 jer Exp $
>
>   29 Sep 2007; Jeroen Roovers <[EMAIL PROTECTED]> readline-5.2_p7.ebuild:
>   Stable for HPPA (bug #194013).
>
>   28 Sep 2007; nixnut <[EMAIL PROTECTED]> readline-5.2_p7.ebuild:
>   Stable on ppc wrt bug 194013
>
>   28 Sep 2007; Ra��l Porcel <[EMAIL PROTECTED]> readline-5.2_p7.ebuild:
>   alpha/ia64/x86 stable wrt #194013
>
>   28 Sep 2007; Ferris McCormick <[EMAIL PROTECTED]> readline-5.2_p7.ebuild:
>   Sparc stable --- Bug #194013
>
>   28 Sep 2007; Christoph Mende <[EMAIL PROTECTED]> readline-5.2_p7.ebuild:
>   Stable on amd64 wrt bug #194013
>
>   28 Sep 2007; Joshua Kinard <[EMAIL PROTECTED]> readline-5.2_p7.ebuild:
>   Stable on mips, per #194013.
> <snip>
> ----

Yep, the Debian changelog is even more verbose, it also says what
exactly was changed:

http://packages.debian.org/changelogs/pool/main/r/readline5/readline5_5.2-3/changelog

> If someone gave me the task of updating this portage-based package to
> the latest version, I would have a good idea of where to start even if
> I had never seen this package before.
>
> Anyway, the main thing I like about the portage approach is that it is
> very systematic.  If a Debian approach is systematic like this, that
> would be great too.

Very systematic indeed. And also a very strict policy what is free and
what is not. That's also very important.

> From my point of view, simple = a well thought out system :-)

I have no doubt that both Gentoo and Debian are well thought, but for
the purposes of Sage, I think
it's an overkill, but that's just my opinion.

From the social point of view, also a very important view is how many
people are developing the distribution and how
many people are maintaining important packages, like python, numpy,
scipy, ipython, etc.
If you want some flamebate, please read the last paragraph of:

http://ondrejcertik.blogspot.com/2007/12/mrida-wrap-up.html

And argue with me. :)

Ondrej

--~--~---------~--~----~------------~-------~--~----~
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to