/srv/irclogs.ubuntu.com/2009/07/09/#ubuntu-classroom.txt

=== sysman is now known as MTecknology
=== MTecknology is now known as \MT
=== \MT is now known as MT-
=== MobileMyles6o7 is now known as TwoToneSpirit
=== dk__ is now known as DKcross
=== clive is now known as Guest69076
=== Wajih is now known as MaWaLe
rohitkgcan anyone explain me,how to configure  the rules file12:12
james_whello everyone12:59
james_wwho is here for the packaging training session?12:59
bacgood morning james_w12:59
* Rail is13:00
mr_spot_i am13:00
james_wwe'll give it a couple of minutes for others to roll in13:01
james_wbut everyone should check that they have debhelper installed13:01
james_wwe are going to be looking at manpages and examples from the package13:02
james_walso, you should check that you have debhelper >= 7 :-)13:02
james_wif you are still on hardy then you will need to grab it from backports13:03
james_wright, let's get started13:07
james_whello everyone13:07
james_wmy names is James Westby and I will be your host today13:07
james_wplease feel free to shout out questions at any time13:07
maxpaguruhello!13:07
james_wwe'll try and stay on topic to start with, and hopefully we'll have some time at the end for general questions13:07
james_wbut there's always lots of helpful people in #ubuntu-motu13:08
james_wso feel free to jump in there with general questions13:08
james_wso, debhelper, what is it?13:08
james_wif you open /usr/share/doc/debhelper/examples/rules.arch you can see an example debian/rules using debhelper13:09
james_wit is a Makefile that is used to build the package13:09
james_wall of the dh_* commands are provided by debhelper to do common tasks13:09
james_we.g., to clean the build tree it does:13:10
james_wclean:13:10
james_w        dh_testdir13:10
james_w        dh_testroot13:10
james_w        rm -f build-stamp13:10
james_w        # Add here commands to clean up after the build process.13:10
james_w        #$(MAKE) clean13:10
james_w        #$(MAKE) distclean13:10
james_w        dh_clean13:10
james_wso it calls dh_testdir, which checks this is an unpacked Debian source package13:10
james_wdh_testroot which checks the command is being run as root13:10
james_wthen runs any clean target for the thing being packaged13:11
james_wand finally calls dh_clean that does some standard cleaning stuff13:11
james_wthere are lots of dh_* commands that do lots of useful things13:11
james_wall are designed to do nothing if they don't apply though, the idea being that running one shouldn't do any damage if it doesn't apply to your package13:12
james_w.13:12
james_w.13:12
james_wlots of packages have rules files that look fairly similar to the above13:12
james_wwith just small changes for the package13:12
james_wthis means that they can be fairly repetitive13:13
james_walso, because there are lots of commands listed it's hard to see what the unusual things are, which makes review and learning harder13:13
james_wtherefore debhelper v7 was invented, to help with some of these issues13:14
james_w.13:14
james_w..13:14
james_wthe basic idea behind debhelper v7 is that you say "give me a default package", and then make tweaks where you need to13:14
james_wthis leads to the example rules file being like /usr/share/doc/debhelper/examples/rules.tiny13:15
james_wI'll paste it here as it is so small13:15
james_w#!/usr/bin/make -f13:15
james_w%:13:15
james_w        dh $@13:15
james_w.13:15
james_w.13:15
james_wquite a bit simpler isn't it?13:16
* weboide agrees13:16
binarymutantvery simple13:16
maxpagurusimple13:17
james_wbut...13:17
james_wit's also not very clear what is happening13:17
james_wwhen you see this you should think "simple, default, boring package"13:17
james_wdoes nothing special13:17
james_wthe "%:" means whatever target13:18
james_wand the "dh $@" means just have "dh" do its default thing for that target13:18
james_wwith "dh" being a new command in debhelper v713:19
james_w.13:19
james_w.13:19
james_wwhat dh does is run through a list of commands for the specific target and execute each in turn13:20
james_wso for the clean example above it will first run "dh_testdir", then "dh_testroot" etc.13:20
james_wwhere it will try everything that makes sense in that target13:21
james_wmaking use of the fact that debhelper commands do nothing if they don't apply to the package13:21
james_w.13:21
james_w.13:21
james_wbut, we have a bit of a problem13:21
james_wwhat does it do in the clean target for running the clean target of the thing being packaged?13:22
james_wthat could in theory be anything13:22
james_w.13:22
james_w.13:22
james_wwhat it does is run a command called "dh_auto_clean"13:22
james_wquoting from its manpage:13:23
james_w       dh_auto_clean is a debhelper program that tries to automatically clean up after a package build. If there’s a Makefile and it contains a13:23
james_w       "distclean", "realclean", or "clean" target, then this is  done by running make (or MAKE, if the environment variable is set). If there is a13:23
james_w       setup.py or Build.PL, it is run to clean the package.13:23
james_w.13:23
james_w.13:23
james_wso it knows what to do for the most common systems13:23
james_wif there's a common system that isn't covered then you can propose a patch to that command to add it13:24
james_wthere is similarly and dh_auto_build and dh_auto_install13:24
james_wplus dh_auto_configure and dh_auto_test13:24
james_wthey all work in a similar manner13:24
james_w.13:24
james_w.13:25
james_wwhat do you do if your package isn't common though?13:25
james_win that case you need to run a custom command instead of the dh_auto_ command13:25
james_whow do you tell debhelper to do that?13:25
james_w.13:25
james_w.13:25
james_where's where you use a bit of magic :-)13:26
james_wif you define a new target in debian/rules with a special name then you can run what you like instead13:27
james_wif you add13:27
james_woverride_dh_auto_clean:13:27
james_wthen debhelper will run that target instead of dh_auto_clean13:27
james_wso, to run a "./clean" script instead of "$(MAKE) clean" then you can put13:28
james_w.13:28
james_woverride_dh_auto_clean:13:28
james_w        ./clean13:28
james_w.13:28
james_win debian/rules13:28
james_wso, when you open the debian/rules file you can see "default package, except that it does something special for clean"13:30
james_wthis works for all dh_* commands as well, so if you need to do something special when installing manpages you could write13:31
james_woverride_dh_installman:13:31
james_w        dh_installman13:31
james_w         ln -s debian/tmp/usr/share/man/foo.1 debian/tmp/usr/share/man/do_foo.113:32
james_w.13:32
james_wor similar13:32
james_w(and with correct indentation :-)13:32
james_wany questions so far?13:33
bacjames_w: so there is a default target which we can override for all of the dh_* tools?13:34
james_wyep, to override dh_foo, add a target "override_dh_foo:"13:35
james_wand if you have really obscure needs you can still add a "clean:" target and run all the commands you need there13:36
=== clive is now known as Guest54207
james_wif you want to look at some real packages then you can run13:41
james_wgrep-dctrl "debhelper (>= 7" -F Build-Depends < /var/lib/apt/lists/*_Sources13:41
james_wfor a likely list13:41
james_wanything else anyone would like to know about the new debhelper?13:42
weboidejames_w: How can we upgrade packages to dh 7 ?13:43
james_wgood question13:43
maxbWhat about needing to override phases differently for binary-arch and binary-indep targets?13:43
james_wthe first thing to do is increase the build-dependency on debhelper13:43
james_wthen you need to edit your rules file, find anything that is not just running and dh_* command13:44
james_wyou can convert them to override_ rules13:44
james_wthen delete the rest and add the "dh" calls13:45
james_wmake sense?13:45
weboideit does, thanks13:45
james_wmaxb: could you give an example of what you mean?13:46
maxbuh, sure, whilst I hunt for it: How about mentioning --with quilt ? :-)13:46
james_wmaxb: what does that do?13:48
weboidejames_w: I think he wants to know how to integrate quilt/dpatch into a dh7 rules file. (or Im wrong)13:48
maxbAh.... the short version is that it enables various additional handling for a quilt-based package built into the dh7 lifecycle - but I don't know more than that, and was hoping you could tell me! :-)13:49
james_w:-)13:50
macothere's also dh_quilt_patch and dh_unquilt_patch13:51
james_wok, got it :-)13:52
james_w"dh --with quilt" means use the quilt "addon"13:52
james_wso if you do this and build-depend on a recent enough version of quilt, then debhelper will load the quilt "addon"13:52
Laney%:13:53
Laney  dh --with quilt $@13:53
Laneyeasy!13:53
james_wyou can find this addon in /usr/share/perl5/Debian/Debhelper/Sequence/quilt.pm13:53
james_w(if you are on Jaunty or later I think)13:53
weboideneat, thanks :)13:53
maco(quilt 0.46-7 or newer)13:53
LaneyI think that's only in karmic13:53
james_wwhich pretty much says run "dh_quilt_unpatch" before clean, and "dh_quilt_patch" before configure13:53
james_wso it will automatically do the quilt things at the right time13:54
macoLaney: dh7 is only in karmic too, though isn't it?13:54
Laneynah, that's in Jaunty (maybe not the override stuff?)13:54
james_wI'm not sure if there are dpatch of simple-patchsys addons as well13:54
weboidemaco: I have debhelper >= 7 in jaunty, but don't have the dh_quilt stuff13:54
james_wintrepid has 713:54
james_wbut as Laney says, the override stuff is slightly newer than the first release of 713:54
Laneymaco: rmadison debhelper13:55
maxboverride is present as of 7.0.50, requiring karmic13:55
james_wyou can read more in "man dh"13:56
james_wand http://kitenet.net/~joey/blog/entry/cdbs_killer___40__design_phase__41__/13:56
james_w(which shows the original way of doing overrides, which was not nearly as nice)13:57
james_whttp://kitenet.net/~joey/blog/entry/debhelper_dh_overrides/13:57
james_wso, get using it! :-)13:58
* weboide likes dh7!13:59
james_wwe're out of time for today13:59
james_wif you have any questions then head on over to #ubuntu-motu13:59
maxbTo rephrase my previous question - how do you run conditional logic that must be run only when building the arch-indep packages - i.e. not on the non-i386 buildds - example, a Python module that splits its arch-specific and arch-indep files13:59
james_wah, yeah, sorry maxb13:59
james_wI'm not sure to be honest :-)14:00
maxbNot a problem, and I'm happy to take this to after-session discussion in #ubuntu-motu :-)14:00
james_wyeah, let's head there14:01
james_wthanks everyone14:01
=== txwikinger2 is now known as txwikinger_work
stvothx14:02
maxpaguruThanks. bye :-)14:02
mr_spot_thanks james :D14:03
weboidethank you for this session james_w14:03
james_wnp14:04
=== dholbach_ is now known as dholbach
=== pleia2 changed the topic of #ubuntu-classroom to: Ubuntu Classroom || https://wiki.ubuntu.com/Classroom || https://wiki.ubuntu.com/Packaging/Training || Upcoming: July 16 @ 18:00 UTC: Mono packaging: quick, easy, and awesome; July 23 @ 00:00 UTC: Packaging Perl Modules || Run 'date -u' in a terminal to find out the UTC time
=== RoboNuggie is now known as RoboNuggie|Away
* marienjoanny marienjoanny 19:19
rohitkgcan anyone suggest how to modify the rules file,while creating a debian package19:38
nhandlerrohitkg: Try #ubuntu-motu19:39
rohitkgok19:40
LiraNuna[04:59] <james_w> who is here for the packaging training session?20:35
LiraNunadamn, why are all the fun stuff on 5AM :(20:35
* LiraNuna reads log20:36
nhandlerLiraNuna: Logs are available on the wiki. The times also alternate each week20:36
=== thekorn_ is now known as thekorn

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!