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

Re: [MoM] Packaging fis-get



On Tue, Jan 24, 2012 at 06:40:21PM -0500, Luis Ibanez wrote:
> >  $ mkdir /tmp/fis-gtm-initial_build
> >  $ cp -a fis-gtm-initial_54002B.orig.tar.gz /tmp/fis-gtm-initial_build
> >  $ cd /tmp/fis-gtm-initial_build
> >  $ tar -xzf fis-gtm-initial_54002B.orig.tar.gz

I missed a
  $ cd fis-gtm-initial
here, sorry (it was a bit late).

> >  $ cp -a
> > /home/ibanez/src/debian-med/trunk/packages/fis-gtm/fis-gtm-initial/trunk/debian
> > .
> >  $ find . -name .svn -type d -exec rm -rf \{\} \;
> 
> -exec rm -rf \{\} \;
> find: `./debian/.svn': No such file or directory
> find: `./debian/po/.svn': No such file or directory
> find: `./debian/source/.svn': No such file or directory

Yep, that's noise - it is just better to get rid of all .svn dirs and
they are gone anyway.  A

   rm -rf `find . -name .svn -type d`

or using xargs would have been less noisy.
 
> being stubborn, I copy the debian directory here:
> 
>                      cp -a ../debian/ .

Ahhh, thanks for beeing stubborn.  That's the key to success in these
cases. ;-)

There might be some pedagogical advises to inject some errors here and
there and let students find them.  So while I did not intentionally did
so I might be a specifically talented mentor in doing this by accident.
In any case you found the clue.  Most probably it migth be a good idea
if you put new maintainers guide[1] as well as the other essential
readings mentioned in Debian Med policy[2] under your pillow.  This will
help you detecting my mistakes in advises easier. ;-)
 
> and try "debuild" again,
> and then some sort of Happiness follows     :-)
> 
>  dpkg-buildpackage -rfakeroot -D -us -uc
> dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g
> -O2
> dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor):
> dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor):
> -g -O2
> dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g
> -O2
> dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor):
> dpkg-buildpackage: source package fis-gtm-initial
                                    ^^^^^^^^^^^^^^^
Here it is correct now.

> dpkg-buildpackage: source version 54002B-1
> dpkg-buildpackage: source changed by Andreas Tille <tille@debian.org>
> ...
> Now signing changes and any dsc files...
>  signfile fis-gtm-initial_54002B-1.dsc Andreas Tille <tille@debian.org>
> gpg: keyring `/home/ibanez/.gnupg/secring.gpg' created
> gpg: keyring `/home/ibanez/.gnupg/pubring.gpg' created
> gpg: skipped "Andreas Tille <tille@debian.org>": secret key not available
> gpg: /tmp/debsign.MBn96VZG/fis-gtm-initial_54002B-1.dsc: clearsign failed:
> secret key not available
> debsign: gpg error occurred!  Aborting....
> debuild: fatal error at line 1246:
> running debsign failed

The failure of debsign is expected.  You can prevent this by making the
changelog your own:

  $ dch
  :wq

(assumed vim is your editor) would be the most simple way to fix this.
To avoid this oversimplification which will force dch to assume a NMU
because  your ID is not mentioned as Uploader I would advise to edit

   debian/control

first and add your ID (Name <email> as specified in your GPG key) in the
comma separated list of Uploaders.  This tells dch that you are not
doing a NMU (NonMaintainer Upload).  After having done so you can even
sign the package with your key.  Because you are asked for signing
source and binary package by debsign you will be asked for the pass
phrase twice - that's normal.

> I guess that all these messages are good news,
> and that the error at the end is simply due to
> some specific keys being required for that step.

Yes, correct.  Congratulations, you builded your first package! \o/
 
> Now running lintian...

Here you get a message from lintian.  Lintian is one of the packagers
greatest friends.  Sometimes friends can be boring if they are too picky
- but it is a friend anyway.

> W: fis-gtm-initial source: newer-standards-version 3.9.2 (current is 3.9.1)

This warning is a consequence of building on a stable machine.  New packages
are targeting at Debian unstable and you should build for the latest standards
version which is currently 3.9.2 (and this in your control file is the line

   Standards-Version: 3.9.2

However, the lintian on your system does not yet know this latest standards
version.  So it is a good idea to do the following (untested, but you will
find it out)

  $ su
  # cd /etc/apt
  # echo 'deb http://ftp.debian.org/debian/ unstable main non-free contrib' >> sources.list
  # cat >> preferences <<EOT
Package: *
Pin: release a=stable
Pin-Priority: 501

Package: *
Pin: release a=unstable
Pin-Priority: 50
EOT
  # cat >preferences.d/01-linitan.pref <<EOT
Package: lintian
Pin: release a=unstable
Pin-Priority: 605
EOT

This does the following:

  1. Add unstable to your sources.list
  2. /etc/apt/preferences makes sure you will not simply upgrade your system
     to unstable but stable has preference (well, probably it might not harm
     to upgrade your whole machine to unstable anyway, but I'm running my
     machine on testing and not on unstable and you should learn the means
     how to enable using unstable components on a stable / testing system)
  3. /etc/apt/preferences.d/01-linitan.pref injects an exception of the
     preferences for lintian which should be from unstable

Please check this via

  $ sudo apt-get update
  $ apt-cache policy lintian

The version from unstable should be marked as installation candidate and an

  $ sudo apt-get dist-upgrade
or
  $ sudo apt-get install lintian

should make the lintian warning from above vanish.  You do not need to
rebuild the package.  You can call lintian manually either for source and
binary package via

  $ lintian *.dsc *.deb

or separately for every *.dsc and *.deb.  If you wonder what the warnings
are meaning try the '-i' argument.  If you love really picky warnings you
can also turn on '-I'.  So I usually do

  $ lintian -i -I *.dsc *.deb

Please play around with this a bit.

> Finished running lintian.
> Now signing changes and any dsc files...
>  signfile fis-gtm-initial_54002B-1.dsc Andreas Tille <tille@debian.org>
> gpg: skipped "Andreas Tille <tille@debian.org>": secret key not available
> gpg: /tmp/debsign.elh7rtXS/fis-gtm-initial_54002B-1.dsc: clearsign failed:
> secret key not available
> debsign: gpg error occurred!  Aborting....
> debuild: fatal error at line 1246:
> running debsign failed
> 
>  I hope this is not too verbose for a report.

No.  It is part of the agreement.  What is the next step.  Well, installing
your freshly created *.deb package, right?  The basic way you can go is

   $ sudo dpkg -i *.deb

However, dpkg is not able to install dependencies and thus you need to do
this afterwards (in case some are needed) via

   $ sudo apt-get -f install

I'm a friend of the wrapper 'wajig'.  However, I think you also need a
more recent version than the one in stable to profit from the feature of
automatically installing dependencies.  So in case you like wajig you
could try

   $ sudo apt-get -t unstable install wajig

(but this has quite some Dependencies like python3 and will spoil your
system with several packages fro unstable - just a warning).
Wajig has some nice features like calling sudo if needed - I like it,
others don't.

BTW, if we are talking about prefered tools:  I'm a really big fan of
mc.  Far back in my DOS days a computer was pronounced as a real
computer (not just a brick) after installing Norton Commander.  So NC
and its clones always are on my machines and for some tasks this is
really comfortable.  Regarding Debian packaging it is quite comfortable
to browse *.deb files and *.tar files, compare directory tries etc.

For Instance you now have a copy of your debian/ dir outside of your
SVN tree (please try to find out what went wrong with your first attempt
to build the package).  If you now change something here and want to
have it back into SVN dir just do the following in mc:

   navigate in panel A to SVN dir
     (you can switch panels using <tab>)
   navigate in panel B to changed debian/ dir
     (you can use usual cd commands for navigation if prefered,
      tab extension works via <Esc><tab>
   compare directories via:  F9-c-c
      this marks those files that are changed
   copy files over using F5
   go into SVN dir (via <tab>)
   type "svn diff" in the command line
   the output vanished fast but <Ctrl-O> to switch to the output
     console; you can perfectly type other commands at this shell
   another <Ctrl-O> brings you back (and forward again if needed) to
     mc panels

Not everybody likes mc - but I'm sure it increases my productivity a
lot.

What now.  When you are installing the just created package via dpkg or
wajig you will notice that the postinst script will fail with an error.
And now we reached a point where we dive into upstream land and its your
turn to fix this error (for sure we can continue discussion here).

As a hint:  The package installs postinst (and the other post/pre
installation files to)

   /var/lib/dpkg/info/<pkgname>.postinst

So if you want to go a shortcut instead of

   $ vim debian/postinst
   $ debuild

you can also try

   /var/lib/dpkg/info/fis-gtm-initial.postinst

and than calling

   # sudo /var/lib/dpkg/info/fis-gtm-initial.postinst

However, sometimes this is dangerous and complex - just try what
happens and if this is helpful.

Your turn is now to make sure fis-gtm will install correctly on the
machine.  And I admit, I'm afraid we are now changing the roles that I
will be the fis-gtm student and you become the mentor ...

Good luck and keep on with the reports

    Andreas.

[1] http://www.debian.org/doc/manuals/maint-guide/
[2] http://debian-med.alioth.debian.org/docs/policy.html#readings

-- 
http://fam-tille.de


Reply to: