@dholbachHello everybody! We'll move on to  Packaging 101  now. If you have any questions, can you PLEASE move them to #ubuntu-classroom-chat and add "QUESTION:  " to them, to make them easier readable
@dholbachI'll have a look every now and then and answer them, if they refer to what I'm currently talking about, if not we can deal with them later.
@dholbachIf you want to become part of the MOTU team, or help out with packaging in general, apart from knowing how to write or debug code, it's good to know the tools the distribution uses.
Adri2000hi :)
@dholbachThis session won't make you a packaging expert, but afterwards you will have heard of some things, which will make it easier to find your way around. There'll be a MOTU session on Wednesday, 15.00 UTC and Saturday on 16.00 UTC, which will cover what the MOTU team does in more detail.
xerunowhy isn't this channel moderated?
@dholbachPlease run the following command, it will take some time to work in the background.
@dholbach    sudo apt-get install pbuilder; sudo pbuilder create
_txhi
@dholbachrmjb: MOTUs are the "Master of the Universe", the team of maintainers that takes care of the package in Universe and Multiverse - that's where you start as a package maintainer.
@dholbachrmjb: http://wiki.ubuntu.com/MOTU
@dholbachPackaging - what does that involve?
@dholbach * adding enough information to the Upstream source, to make it buildable on a minimal system.
@dholbach * split the installed files up into separate packages depending on the target audience
xerunodholbach, could you please moderate this channel?
@dholbach     ^- example everybody uses libgtk2.0-0, but not everybody has an interest in libgtk2.0-dev
apokryphoswith +z would be better
@dholbachcome on guys, that's not necessary at the moment
@dholbachmove chatter and discussion to #ubuntu-classroom-chat please
jpetsoxeruno: it worked before, i think it's ok to trust everyone on being quiet
@dholbach * make the packages work out of the box
@dholbach * add copyright information, nice description, documentation, etc.
@dholbachPackage maintenance involves far more than that, Jordan Mantha (Laser_away) will give a talk about that later today at 21.00 UTC and Thursday at 20.00 UTC.
@dholbachFirst we'll install some tools we'll need for the session:
@dholbach   sudo apt-get install devscripts dpkg-dev build-essential
_txwhat about complying programs in Ubuntu to be able to work on all the platforms (ppc, x86, and x86_64)
@dholbachI also prepared an example package we'll use also:
@dholbach   mkdir 101; cd 101; wget http://daniel.holba.ch/temp/packaging101.tar.gz
jonh_wendelldholbach: what does pbuilder create do?
@dholbachjonh_wendell, _tx: #ubuntu-classroom-chat please and add "QUESTION:" to your questions
giskard_tx, we have autotools for this kind of stuff (if i understand correctly your question)(btw, question on -chat)
nmsaC(01:06) <@dholbach>    mkdir 101; cd 101; wget http://daniel.holba.ch/temp/packaging101.tar.gz
nmsasorry :)
@dholbachI learned most from looking at existing packages and trying to fix them, so let's take a look at the libsexy package. It's the one in feisty, I broke a bit to illustrate a few common problems you'll face in the daily work as a package maintainer or Ubuntu developer.
@dholbachIf you untar the packaging101 tarball, you'll find the following files:
@dholbach  libsexy_0.1.10-1ubuntu1.diff.gz  libsexy_0.1.10-1ubuntu1.dsc  libsexy_0.1.10.orig.tar.gz
_txSome things I write don't work well with ppc or x86 but work well on the x86_64 namely my system.
@dholbachTogether they make the source package. The .orig.tar.gz is called the 'original upstream tarball', the '.diff.gz' file is the changes we need to do to make the package buildable and working correctly in Ubuntu. The .dsc provides meta information like checksums, etc.
@dholbachTo unpack the source package run
@dholbach  dpkg-source -x libsexy_0.1.10-1ubuntu1.dsc
@dholbachIf you change into the directory and have a look into it, you'll find a debian/ directory, which contains the packaging information.
@dholbachLet's try to build the package now. You can use dpkg-buildpackage, but running debuild is easier mostly. So to run a build, simply type
@dholbach  debuild
@dholbach  
@dholbachin the directory.
_txQuestion:How well do users give you feedback here?
@dholbachThe friendly build script might now ask you to install some build dependencies, after you did that, it should be spitting out some interesting messages.
@dholbach_tx: in #ubuntu-classroom-chat
mattljono: all set?
@dholbachin my case the build is complaining (among other things) about the following:
@dholbachsexy-tooltip.c: In function 'sexy_tooltip_new_with_label':
@dholbachsexy-tooltip.c:143: warning: implicit declaration of function 'gtk_label_new'
@dholbachsexy-tooltip.c:143: warning: assignment makes pointer from integer without a cast
@dholbachsexy-tooltip.c:144: warning: implicit declaration of function 'gtk_label_set_markup'
@dholbachsexy-tooltip.c:144: warning: implicit declaration of function 'GTK_LABEL'
@dholbachIt's a problem I added myself. :-)
jonh_wendell:)
@dholbachWe will need to patch the source to make it build again.
@dholbachIf you have a look at debian/rules you will see that it mentions /usr/share/cdbs/1/rules/simple-patchsys.mk - after working with packages for a while that it means you can use cdbs-edit-patch to add a patch. Martin Pitt (pitti) will give a separate session on how to patch packages on Thursday, 18:00 UTC.
@dholbachFirst we run     fakeroot debian/rules clean      to clean up our existing build again.
@dholbachnext we run       cdbs-edit-patch 01-fix-gtk-breakage
@dholbachas I said before, pitti will explain what happens then :-)
pitticorrection: patching source packages will be Tuesday 18:00 and Thursday 17:00 UTC
@dholbachthanks pitti
@dholbach(Note:  cdbs-edit-patch  needs  cdbs  installed.)
@dholbachOnce we're presented with a subshell, in a directory like /tmp/cdbs-new-patch.R29983/libsexy-0.1.10.new , we edit  libsexy/sexy-tooltip.c  with our editor of choice
@dholbachand add a missing     #include <gtk/gtk.h>
@dholbachjust below the existing   #include
@dholbachnow save the file, and hit Ctrl-D
@dholbachls debian/patches/       should show our shiny new patch
@dholbachNow we run         debuild       again and see if we fixed the package.
@dholbachIt looks like our attempt succeeded.
@dholbachls ../*.deb    will show us the packages we made
@dholbachI'll answer a bunch of questions after the next step.
@dholbachAs I explained above, part of the packaging work is trying to make sure that a package builds in a minimal environment also. Why?
@dholbachBecause on our build daemons, a minimal system will be created for each package build to make sure it works in every, even a fresh, scenario.
@dholbachWe will now generate a new source package with the changes we made earlier.
@dholbachfakeroot debian/rules clean
@dholbachdebuild -S -sa
@dholbachshould take us there.
@dholbachcd ..; sudo pbuilder build libsexy_0.1.10-1ubuntu1.dsc      should give the pbuilder some work and we can take a look at a few questions.
guebayWhat is the diff between debuild and dpkg-buildpackage?
@dholbach<xeruno> QUESTION: what's  cdbs
@dholbachcdbs is a collection of scripts that make packaging, especially writing debian/rules (a Makefile to automate the package build) a lot easier, by simplifiying common tasks.
@dholbach<TLE> QUESTION: Will the script disregard temporary editor files when it does the patch ?
@dholbachTLE: I'm not sure what you mean with editor files
giskardxeruno, and.. you can read the package Description: (apt-cache show cdbs)
giskarddholbach, i guess .swp or file~
@dholbachIt's better to get rid of them. They will show up in the .diff.gz and in case of binary files make the build fail.
@dholbach<DraxNS> QUESTION: is there a short manual on how to make simple packages? like to create package for krusader from source?
@dholbachI will later post some links to help with packaging, but I fear that packaging will always be a bit tough in the beginning.
@dholbach<amarillion> QUESTIION: Will debuild automagically add all patches in the debian/patches directory
@dholbachamarillion: the rules in debian/rules (namely simple-patchsys.mk) takes care of that
@dholbach<bettsp> QUESTION/ASSERTION: It only succeeds if my name is Daniel Holback
giskardahah
@dholbachbettsp: I'm sorry, yes you're right. Either disregard the message or run    debuild   with  -k<your keyid>
@dholbach<proppy> QUESTION: you refer to 'our build daemon' is that kind of pbuilderd ?
@seb128(it works too when it can't sign the package)
@seb128(that's just a warning)
bettspdholbach: You forgot to run the S-expression I added in the next line to fix my misspelling of your name :)
@dholbachproppy:  the build daemons ( https://launchpad.net/+builds ) use sbuild, which is very similar
@dholbachbettsp: yes, I should have said "please add"
@dholbachOk, my pbuilder is 'finished' now - we'll get back to questions later again.
@dholbachfunnily enough the build fails with:
@dholbachchecking for PACKAGE... configure: error: Package requirements (pango >= 1.4.0, glib-2.0 >= 2.4.0, gtk+-2.0 >= 2.4.0, libxml-2.0) were not met:
@dholbachNo package 'gtk+-2.0' found
@dholbachThis is because libgtk2.0-dev is not installed in the minimal environment I was talking about, but how does pbuilder know what to install?
@dholbachif you edit   debian/control   you will find the line    Build-Depends
@dholbachThis line indicates the packages that need to be installed to build the package correctly. We'll just add  libgtk2.0-dev
@dholbachafter that we'll run   debuild -S  again
@dholbachplease note that this time we don't need to run   fakeroot debian/rules clean   why?
proppy(cause we build using pbuilder)
@dholbachbecause the build happened in that clean environment, not in the source dir - another good point about using pbuilder
@dholbachlet's run      sudo pbuilder build libsexy_0.1.10-1ubuntu1.dsc         again and see if we get it working now
@dholbach<levander> QUESTION: What all does fakeroot debian/rules clean do?
@dholbachlevander: it runs the   clean   target of the upstream source (so whatever the upstream maintainer thought should be cleaned), plus   dh_clean  and rules you set up yourself
@dholbach<TLE> QUESTION UPDATE, if I edit the source with emacs, emacs creates a temp file, will the script disregard that when it makes the diff for the patch ?
@dholbachTLE: I'm not sure which file you're referring to. I'm emacs illiterate - sombody else please answer. :-)
@dholbach<daxelrod> QUESTION: How would we know from the error message mentioning 'gtk+-2.0' that the package we need is 'libgtk2.0-dev'? Is there a convention for figuring this out?
nmsaj #ubuntu-classroom-chat
@dholbachdaxelrod: excellent question.
englaEmacs will create a sexy-tooltip.c~ backup file, and that will be included in the diff if you don't remove it
englalikewise will gedit by default
@dholbachOne answer to that is: experience with packaging. But there are also some indicators of where to look:
jordiTLE: if you mean backup files, yes, the "debhelper" system is smartyt enough to not ignore them, but get rid of them when you "clean" the package.
@dholbachIn the configure script it failed, because it tried to look up in /usr/lib/pkgconfig
@dholbachso if the build fails for you in pbuilder, but works if you run on your system, you can easily check that directory and find out, where and why it went wrong
@dholbachapt-cache search <...>   or   apt-file search <...>  can help also
@dholbachThe pbuilder build worked for me right now, but there are still some things that are weird:
giskardcheck configure.ac is another solution ;)
@dholbachIf you run    dpkg -c /var/cache/pbuilder/result/libsexy-doc_*.deb  (which displays the contents of the package), you will find it's nearly empty
@dholbachit merely contains a couple of changelogs and copyright notices - what went wrong?
@dholbachIf we look into the debian/ directory, you will see that it contains a couple of *.install files
@dholbachthese files mention which directories and files are supposed to be installed into which package
@dholbachdebian/libsexy-doc.install is empty
@dholbachif you run         debuild     (to build the package again) and     dh_install --list-missing   afterwards, it will present you with a list of files that were not installed into any package
@dholbachonce we add    debian/tmp/usr/share/gtk-doc/html   to    debian/libsexy-doc.install   it will contain something
@dholbachnow we can run     debuild binary   to not have to go through the whole procedure again, but only rebuild the packages
@dholbachYou will find that if you run       dpkg -c libsexy-doc*.deb     again, it will contain the documentation
@dholbachI introduced some more bugs into the package, but given that we only have 19 minutes left, we should probably move on to some more questions.
@dholbach<proppy> QUESTION: debian/libsexy-doc.install doesn't exist
@dholbachhum, it existed for me - anyway, it was supposed to be an empty file.
@dholbach<nmsa> Q: install pbuilder is still on, slow connection, will it install a new env. will get all packages from net? is doing validation on retrieved packages ... 'thnx
@dholbachnmsa: it's not installing all packages, but only a very minimal set, needed to build packages - cjwatson: which packages are considered by debootstrap?
@dholbachbuild-essential   will be contained in any case.
@dholbach<Florob> QUESTION: Are *.install files cdbs specific?
@dholbachFlorob: no, they're not. They're scanned by dh_install.
@dholbach<amarillion> QUESTION: which is the preferred format for documentation? Should you provide docs in a certain format if they aren't provided upstream?
@dholbachmanpages are a good example of documentation that sometimes does not exist.
@dholbachIt's always good to push it back to the upstream developers afterwards again.
@dholbachI don't have a link on manpages handy, but I could find you one. I have a template I always use to get started on them.
at2000which packages are considered by debootstrap? the list is in the script /usr/lib/debootstrap/scripts/<version>
@dholbach<rmjb> QUESTION: is the *.install file method the correct way for one source package to have multiple binary targets? like a lib, lib-dev, -doc and so on?
@dholbachrmjb: some people use *.dirs files or run dh_install to debian/<binary package name> on their own, I personally prefer the .install file method
@dholbach<xhaker> QUESTION: how about policy on packages. I read executables on /usr/bin must have manpages.
@dholbachmanpages are not a strict must have, but they come in very handy and users are gratefule for manpages
@dholbach<somerville32> QUESTION: Is it possible to have pbuilder setup to work in multiple releases concurrently?
@dholbachsomerville32: there's a page on the MOTU wiki about that - if nobody finds it out in the next minutes, I can try after the talk
@dholbach<xhaker> QUESTION: can i build for any version deboostrap supports?
solShould all packages install to /usr? What's the use of /usr/local?
solShould all packages install to /usr? What's the use of /usr/local?
@dholbachxhaker: you can either set up a chroot for yourself (I think that's what most developers do), because that way you can test the resulting binary packages yourself, or you can have multiple differently configured pbuilders
gnomefreaksomerville32: https://wiki.ubuntu.com/PbuilderHowto?highlight=%28pbuilder%29
@dholbachsol: /usr/local is for software you install yourself (like if you use ./configure && make && sudo make install)
@dholbach<xhaker> QUESTION: pbuilder extracts the minimal system and then downloads additional dependencies.. does it cache them? for how long? where?
@dholbachxhaker: yes, it does in /var/cache/pbuilder/aptcache/
xhaker;)
@dholbachI think it stores the packages until they're superseded by a newer version
@dholbachare there any other questions?
gnomefreakdholbach: i grabbed the page for somerville32
@dholbachIf you run into any other packaging related trouble and don't know where to look in the documentation, your first check could be similar packages, then ask the people on #ubuntu-motu or on ubuntu-motu@lists.ubuntu.com
rmjbthanks for a great session dholbach
proppydholbach: 18:50 <proppy> <proppy> QUESTION(bis): can i chroot inside a pbuilder
proppy               environment to debug a packaging failure ?
jonh_wendelldo we have to do a clean before every debuild? even if we change just 1 char in some file?
englathanks, I learnt a lot (even though I built debs before)
@dholbachproppy: yes, you can       sudo pbuilder login    can help with that
proppydholbach: thx
cjwatsondebuild cleans for you unless you use the -nc option
guebaydholbach: thumbs up :)
@jonook five min  break
@jonotill the next session
Jucatoyay!
@dholbachjonh_wendell: no you don't - you can run   debuild binary   to benefit from a previous build and just restart from wherever the build failed
@dholbachthanks everybody
amnesiadholbach: thanks for the session, good job!
@dholbachsee you in #ubuntu-motu or on ubuntu-motu@lists.ubuntu.com
Florobjono: great, now it really feels like school ;)
@dholbachthanks a lot
solthanks :-)
fernandodholbach: thanks
amarillionThanks dholbach. That is certainly a lot of information to absorb
nmsadholbach: thank you
ifmydholbach: thanks
scottno thank you dholbach
xhakersee you in motu
DraxNSnice class dholbach
somerville32Thanks :)
amarillionFlorob, not unless you get homework
thekornthanks dholbach
@jono:P
alfmatosdholbach, nice, thanks a bunch.
somerville32The PBuilderHowto page is kind of confusing.
@dholbachsorry, I forgot:          https://wiki.ubuntu.com/MOTU/Documentation      <========0
berndla question which has partly to do with packaging: are there plans on creating a community driven repository (with really up to date packages) like arch-linux has?
englait would be nice with not only a log, but a cleaned-up summary on the wiki pages (with links). But you know, we could all help out with that if we get to start with the log
englathat way this week could be saved in a box for all
@jonoengla, I am going to encourage people to summarise the sessions too
@jonowould be useful
LaserJockberndl: that would be the Universe and Multiverse repository
siretartberndl: sort of. I have plans to make REVU, a reviewing platform doing something similar
englajono: I'm thinking we could link the schedule items to subpages
@jonoright
englaI'll help
@jono:)
naliothengla: jono if you like, you can use w.u.c/ClassroomTranscripts
@jonothe sessions so far have been awesome
@jononalioth, :)
berndllaserjock: yeah, sort of :) but i think it is much easier to get into packaging for everyone in arch than in ubuntu. but perhaps this is the reason we're here to make things easier... :)
elvstonephew.
elvstone..and sneaks away for some nicotine.
berndlsiretart: do you have any specs online for revu?
@jonook, we all set?
SmiffehWonder if Ask Mark tomorrow will end up being productive, or just an excuse for people to quiz him on his openSuSE post.
naliothprobably be a +mz kind of day

Generated by irclog2html.pl 2.1 by Jeff Waugh - find it at freshmeat.net!