[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IRAF Deb -- first pass



On Wed, Sep 24, 2003 at 06:31:35PM -0500, Terry Hancock wrote:
> 
> My package installs into /opt/iraf/iraf which seems to make sense
> from the FHS standard, as I read it (because this seems to be the
> most appropriate place for "package-organized" rather than
> "distributed-components" packages to be placed).  The structure is
> the cannonical structure that most IRAF network installations use
> (and indeed is enforced by the newer "install" that comes with IRAF
> 2.12):

    This is only correct for third-party packages.  Packages that are
part of a distribution belong in /usr, and to conform to Debian
policy, IRAF needs to install mostly into /usr/lib/iraf, with
architecture-independent components in /usr/share/iraf and
user-accessible binaries (such as cl) accessable via /usr/bin.  I
previously had it installing in /usr/iraf, pending closer examination
of the assumptions IRAF was making about where files were, but this
(correctly) drew a bug report, and packages altering the contents of
/opt won't be allowed into the distribution at all.
    The /opt and /usr/local areas are for the system administrator to
play around with, and even if he or she has "apt-get dist-upgrade" in
a cron job, nothing that Debian packages do should ever affect the
files stored there.


> /opt/iraf
>   iraf -- here's where most of the package installs
>   irafbin
>       bin.linux -- the binaries
>   extern -- this is empty, but external "iraf-" packages
>                  will go here
> 
> There will also need to be an iraf-x11 that installs into /opt/iraf/x11iraf

    No, x11iraf consists of half a dozen binaries and manpages that
should go in /usr/bin and /usr/share/man/man1 respectively.  The
x11iraf packaging is comparatively easy; the only difficulty is in
stripping out the libraries that were provided and making sure it
works with whatever is in unstable.



> The more important issue is the absence of any preinst or postinst
> scripts.  IRAF *does* require some postinst installation, and there
> are two installation csh scripts: $iraf/unix/hlib/install and
> $iraf/unix/hlib/install.old which are for this purpose. But they
> are not compliant with Debian policy, and are a bit awkward to use
> at present.

    Examine the debconf stuff that I did for my previous IRAF package.
It basically bypasses the installation scripts entirely and replaces
them with debconf questions that can be answered before a bulk
installation takes place.  What the install script does wasn't all
that complex, so it was more tedious than difficult to reimplement
it.  Actually running the install script after you allowed debconf to
handle things would damage the installation, however.


> Furthermore, because of a source-dependency on the TABLES package,
> which comes from a *different* upstream source (STScI) than IRAF
> does (NOAO), I do not included the sources from nor attempt to build
> or install the "noao" layered package for IRAF, even though this is
> against the long-standing convention of bundling it with the base
> IRAF.

    If the stsci is under a free software license, I would suggest
merging it, unless it is useful in its own right.  If it is, then it
can be packaged separately, and the resulting binary package listed as
a Build-Depends entry for the IRAF source packages that need it.


> Also, we have a bit of a "cultural conflict" in that IRAF, following
> long-standind tradition in the astronomical community makes heavy
> use of csh/tcsh for scripting.  But of course, in the free software/
> Debian community, csh is a bit of a pariah for technical reasons
> limiting its effectiveness as a shell-scripting language.  And, well,
> even though I acknowledge that these problems are real, I know csh,
> but not bash, so guess which I've used the most?

    It doesn't really matter that csh is inferior as long as it does
what it needs to do and doesn't compromise security.  Adding a Depends
on csh is only a minor nuisance, and I wouldn't worry about it.


> HOW TO BUILD THE DEB PACKAGE
> Using this archive, you *should* (I hope) be able to rebuild my
> deb file by doing the following 5 steps:

    If you create a properly named orig.tar.gz and use the debian
tools to create a diff and a dsc file, you can cut it down to one
step: dpkg-source -x iraf_2.12-1.dsc.  Check the man pages for
dpkg-source, dpkg-buildpackage, and debuild.  Since one of your later
steps actually uses dpkg-buildpackage, you should have ended up with a
source, diff, and dsc at the end anyway.


> 1) Unpack this archive, and get into the top level of it (I think
> it's called "iraf-2.12-deb_sources").
> 
> 2) source ./UNPACK_IRAF.csh
>    this will set some environment variables and unpack the tarball
>    I've made from the upstream sources.  REPACK_IRAF.csh won't run
>    on your system, but documents how I made the tarball on mine.

    If you require environment variables to be set before running
debian/rules, you're going to get into fairly serious trouble.  Make
sure that whatever you need gets set from there, and that it will
build from an arbitrary environment.


> 3) cd iraf-2.12
>    dh_make -e <your-email-address> --single
>    This does some housekeeping and creates a debian subdirectory
>    (but we're about to clobber that directory, so don't worry about
>    it).

    It will also generate an iraf-2.12.orig directory one level up,
which is going to take a whole lot of space.  Since all that dh_make
does is make that and the debian/ directory, you're better off simply
including the debian/ directory in a patch.


> 5) dpkg-buildpackage -rfakeroot -sgpg
>    This actually builds IRAF, installs it into a subdirectory in
>    debian, and then builds the .deb and associated files. You will
>    be asked to sign the result -- I think you can skip this if
>    you want (see "man dpkg-buildpackage") and if you just press
>    enter a few times it will give up and do it unsigned anyway.

    If you just want it to build the debs, but not generate a diff or
dsc file or bother with signing, you can run "debian/rules binary"
instead.


> HOW TO INSTALL THE RESULTING PACKAGE
> 
> Well, you probably know this, but, get root, then:
> 
> dpkg --install iraf_2.12-1_i386.deb
> 
> It doesn't install cleanly, yet -- I still get the error about the
> doc-base stuff:

    I'm probably going to catch flamage from the dhelp and dwww guys
for this, but I actually recommend that you avoid trying to deal with
doc-base at the moment.  Just make sure the html files get packaged
somewhere under /usr/doc, and don't specify any debian/iraf.doc-base
files or try to call install-docs manually in your postinst.

    Hope this helps you.  I'll see if I can set aside some time to
more closely examine your work sometime either this week or next.  Bug
me if I don't get back to you.

-- 
Zed Pobre <zed@debian.org> a.k.a. Zed Pobre <zed@resonant.org>
PGP key and fingerprint available on finger; encrypted mail welcomed.

Attachment: pgpDvJKN1vjR5.pgp
Description: PGP signature


Reply to: