/srv/irclogs.ubuntu.com/2010/11/23/#ubuntu-classroom.txt

=== virtuald is now known as leagris
=== leagris is now known as virtuald
=== BlackZ_ is now known as BlackZ
=== yofel_ is now known as yofel
c2tarunanyone here?? how much time is left in today's class13:54
c2tarun??13:54
bilalakhtarc2tarun: 5 mins13:55
c2tarunthanks13:55
skfin:)13:56
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Packaging Training Session - Current Session: Tutorial on Debian/Ubuntu Packaging - Instructors: bilalakhtar
bilalakhtarHello people, and welcome to the Packaging tutorial session!14:01
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2010/11/23/%23ubuntu-classroom.html following the conclusion of the session.14:01
bilalakhtarBefore we move ahead, I would like to tell you people how to ask questions and the like14:02
bilalakhtarThe session will go on here14:02
bilalakhtarthis channel is moderated14:02
bilalakhtaryou will have to ask the questions in #ubuntu-classroom-chat , prefixed with QUESTION: , like this:14:03
bilalakhtarQUESTION: What does a deb file do?14:03
bilalakhtarNew, let's begin!14:03
bilalakhtar*now14:03
bilalakhtarI would like everyone to install these packages:14:03
bilalakhtarbuild-essential dpkg-dev fakeroot devscripts autotools-dev debhelper dh-make14:03
bilalakhtarTo install them, run this in a terminal:14:04
bilalakhtarsudo apt-get install build-essential dpkg-dev fakeroot devscripts autotools-dev debhelper dh-make14:04
bilalakhtar(let it install in the background)14:04
bilalakhtarNow, make an empty directory called ubuntu-packaging14:05
bilalakhtarand cd into it from a terminal14:07
bilalakhtarThen, download the source code of a very simple programme which we would package (in this case, GNU hello) Download it my typing this in a terminal:14:07
bilalakhtarwget http://ftp.gnu.org/gnu/hello/hello-2.6.tar.gz14:07
bilalakhtarThen, rename it by typing this:14:07
bilalakhtarmv hello-2.6.tar.gz hello_2.6.orig.tar.gz14:08
bilalakhtarThen, extract the archive:14:08
bilalakhtartar xzf hello_2.6.orig.tar.gz14:08
bilalakhtarNow, you will have a directory hello-2.6, cd into it14:09
bilalakhtarIf you don't have a GPG key already, run this command:14:09
bilalakhtargpg --gen-key14:09
bilalakhtarand follow the steps14:09
bilalakhtarNow, set your full name and e-mail env variables in your system for use by the packaging tools, like this:14:11
bilalakhtarecho "export DEBFULLNAME=\"YOUR FULL NAME HERE\"" >> ~/.bashrc14:12
bilalakhtarecho "export DEBEMAIL=\"youremail@something.com\"" >> ~/.bashrc14:12
bilalakhtarAfter that, run these commands to set the vars in the current session as well:14:13
bilalakhtarexport DEBFULLNAME="YOUR FULL NAME HERE"14:13
bilalakhtarexport DEBEMAIL="youremail@something.com"14:13
bilalakhtarI hope you replaced YOUR FULL NAME HERE and youremail@something.com with your name and e-mail address14:13
bilalakhtarnow, let us move ahead with the packaging!14:14
bilalakhtarI hope you are in the hello-2.6 folder14:14
bilalakhtarthen run this command:14:14
bilalakhtardh_make -c gpl3 -s14:14
bilalakhtarHit enter if every information is correct14:15
bilalakhtarIf not, then say 'NO' in #ubuntu-classroom-chat14:15
bilalakhtarI assume it worked for everyone14:16
bilalakhtarnow, cd into the newly-created debian subdirectory in the hello-2.6 folder14:16
bilalakhtarThen run these commands to clear the unnecessary files in the folder14:16
bilalakhtarrm *ex *EX14:17
bilalakhtarrm docs info README.*14:17
bilalakhtarNow, let us analyse the files remaining in the directory14:18
bilalakhtarIgnore the compat file and the source folder, they are parts of the source which are never touched14:18
bilalakhtar(not never, but not touched usually)14:19
bilalakhtarOpen the control file in your favourite text editor14:19
bilalakhtarSet the Section: field from unknown to misc14:19
bilalakhtarDelete the two #Vcs-* lines14:19
ClassBotc2tarun asked: what is misc?14:20
bilalakhtarmisc -> Miscellaneous14:20
bilalakhtarThere are many debian sections that can be written there14:21
bilalakhtarexamples are video, net, etc14:21
bilalakhtarlet me give you a list14:22
bilalakhtarThe possible sections are:14:22
bilalakhtaradmin, cli-mono, comm, database, devel, debug, doc, editors, electronics, embedded, fonts, games, gnome, graphics, gnu-r, gnustep, hamradio, haskell, httpd, interpreters, java, kde, kernel, libs, libdevel, lisp, localization, mail, math, misc, net, news, ocaml, oldlibs, otherosfs, perl, php, python, ruby, science, shells, sound, tex, text, utils, vcs, video, web, x11, xfce, zope.14:22
bilalakhtarFYI: perl, php, python, lisp sections are for language modules, not apps made in that language14:23
bilalakhtarokay, so let us move ahead14:23
bilalakhtarIn the Homepage: field replace <insert the upstream URL, if relevant>14:23
bilalakhtarwith http://www.gnu.org/software/hello/14:23
bilalakhtarNow, the package description14:24
bilalakhtarReplace <insert up to 60 chars description>14:24
bilalakhtarwith a short description of the package14:24
bilalakhtarIn this case: Hello program that prints out Hello World!14:25
bilalakhtarReplace the <insert long description, indented with spaces> thing with this:14:25
bilalakhtar GNU Hello prints out Hello World! and is translateable.14:26
bilalakhtar It is a good example of how an application should be made and14:26
bilalakhtar follow the GNU coding standards14:26
bilalakhtarIMPORTANT: There should be a space before every line in the long description14:27
bilalakhtarCorrection: Please change the short description to: Program that prints out Hello World!14:28
bilalakhtarAccording to Debian policy we should not have the package name at the beginning of the short description14:28
bilalakhtarNow, open the copyright file14:28
bilalakhtarReplace the placeholders there with the appropriate information14:29
bilalakhtar(this file is very important in actual packaging, but in a tutorial it makes little sense to add info there)14:30
bilalakhtarNow, the rules file14:30
bilalakhtarSince our package is a pure C program that uses autotools, we don't need to edit the rules file14:31
bilalakhtarbut in the case of python apps/modules, perl scripts, or anything that doesn't use makefiles and autotools, you will need to edit the rules file as well14:31
bilalakhtarlet me give you link to documentation on that14:32
bilalakhtarhttps://wiki.ubuntu.com/PackagingGuide/Basic has good info14:33
ClassBottarora asked: how to find package dependencies?14:33
bilalakhtarSince our package uses autotools, the packaging tools will automatically provide a list of package dependencies when we build the package14:33
bilalakhtarBut in other cases, like python modules and other non-autotools packages14:34
bilalakhtaryou will need to replace the ${shlibs:Depends} in the Depends: field of the control file with a comma-separated list of dependencies14:35
bilalakhtarbut always leave ${misc:Depends} there14:35
ClassBotongolaBoy asked: where do we find a complete reference of debian section ?14:36
bilalakhtarThe most comprehensive information you would find would be the Debian policy manual http://www.debian.org/doc/debian-policy/14:36
bilalakhtarIt is the base of all other documentation14:37
bilalakhtarHowever, if you want tutorial-style docs, you would like https://wiki.ubuntu.com/PackagingGuide14:37
ClassBotc2tarun asked: what is the function of rules file??14:37
bilalakhtarThe rules file is like a makefile14:38
bilalakhtarit contains information for the packaging tools to build the package14:38
ClassBotc2tarun asked: what are  ${shlibs:Depends}, ${misc:Depends}14:38
bilalakhtarThe former gets replaced automatically by a list of package dependencies that are unique to the package14:39
bilalakhtarIf the package would be a rhythmbox plugin (for example), this would be replaced by rhythmbox, and other deps14:39
bilalakhtarin this case, it would be replaced by libc6 and other basic things, since this is a very basic package14:40
bilalakhtar${misc:Depends} gets replaced by a list of dependencies common to every package14:40
bilalakhtarlike: glibc, linux, and things without which the system would be unusable14:41
ClassBotboulabiar asked: is there any GUI for all of this?14:41
bilalakhtarnot at the moment :)14:41
bilalakhtarIf you want to develop stuff, and want to get your feet wet in packaging, you have to sacrifice the luxury of a GUI14:41
ClassBotc2tarun asked: when will this replacement occur??14:42
bilalakhtarWhen we build the package14:42
bilalakhtar(which is the next step14:42
bilalakhtar)14:42
bilalakhtarNow, let us build the package, to do that, type this:14:42
bilalakhtardebuild14:42
bilalakhtarThat would do it all14:42
bilalakhtarSome stuff will be printed on the screen14:43
bilalakhtarWhen it asks you for the gpg passwords, enter the password of your gpg key14:44
bilalakhtarOnce that is done, you shall have a deb file in the ubuntu-packaging directory14:44
bilalakhtarOkay, I forgot to mention about the changelog file14:45
bilalakhtarThe package should build properly nevertheless14:46
bilalakhtarThe very first line of the file should be like this:14:46
bilalakhtarhello (2.6-1) unstable; urgency=low14:46
bilalakhtarhello -> package name14:46
bilalakhtar2.6-1 -> package version number14:46
bilalakhtarIf you are packaging a new package for Ubuntu it would rather be 2.6-0ubuntu114:47
bilalakhtar0 is the debian revision, 0ubuntu1 means this package isn't in Debian yet14:47
bilalakhtar2.6 is upstream version number14:47
bilalakhtarThe second line onwards contains the changes made:14:48
bilalakhtarand the rest is not important for discussion ATM14:48
bilalakhtarDid the package build well?14:48
ClassBotc2tarun asked: what about the Makefile?? dont we have to create it??14:49
bilalakhtarthe configure script creates it when we run debuild14:49
ClassBotc2tarun asked: can u explain what exactly debuild did??14:49
bilalakhtarDebuild did nothing but executed the debian/rules file with a different set of arguments14:49
bilalakhtarwhich built the package14:50
bilalakhtarman debuild will tell you what it did14:50
bilalakhtarIt basically runs dpkg-buildpackage, then lintian, then debsign14:50
bilalakhtardpkg-buildpackage does the main work14:51
bilalakhtarman dpkg-buildpackage will tell you about it14:51
ClassBotThere are 10 minutes remaining in the current session.14:51
ClassBotc2tarun asked: where is the configure script??14:51
bilalakhtarIn the hello-2.6 directory14:51
bilalakhtarit is supplied by upstream14:51
bilalakhtarQuestions, please!14:52
bilalakhtarOkay, about PPAs14:52
bilalakhtardebuild must have created many files apart from a deb14:52
bilalakhtarIf you want to upload the package to a PPA14:53
bilalakhtarmake sure that you replace 'unstable' in the changelog file with 'maverick' or 'lucid' or the version of ubuntu you want to upload for14:53
bilalakhtarBy version I mean codename of the release (hardy, jaunty, intrepid, etc) not numbers (8.04, 9.04, etc)14:54
bilalakhtarthen run debuild -S14:54
bilalakhtarthen install package dput14:54
bilalakhtarhttps://help.launchpad.net/Packaging/PPA/Uploading will help you then14:55
ClassBotc2tarun asked: i can see four configure files here? which one is the one guiding for Makefile14:55
bilalakhtarThe one that is named 'configure'14:55
bilalakhtarthat one14:55
bilalakhtarnot configure.ac or something14:55
ClassBotThere are 5 minutes remaining in the current session.14:56
ClassBotc2tarun asked: there is a file name configure.ac . can u please explain that file??14:56
bilalakhtarBeyond scope, but I will explain briefly14:56
bilalakhtarDevelopers use it to create 'configure' using autoconf14:56
bilalakhtarit is a helper file in reality14:57
bilalakhtarbut of no use to the user or packager14:57
bilalakhtar< maxpaguro> where to learn more about correct libs and howto correct handle?14:57
bilalakhtarYOu mean correct dependencies?14:57
bilalakhtarthey are usually listed in the README file in the upstream tarball14:58
bilalakhtar2 minutes remaining, might answer 2 more Qs14:58
bilalakhtarquick!14:58
ClassBotmaxpaguro asked: dependencies and libraries if updating a package14:59
bilalakhtarIf you are updating a package14:59
bilalakhtarusually the deps remain the same14:59
bilalakhtarIn autotools packages the deps are taken care of automatically15:00
bilalakhtarbut in non-autotools packages, check the upstream changelog (not debian/changelog)15:00
bilalakhtarAlmost time up!15:00
bilalakhtarThanks for everyone who attended15:00
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2010/11/23/%23ubuntu-classroom.html15:01
* bilalakhtar waits for the bot to call off15:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
c2taruntoday was my first class. it was good :) where can i get logs of previous classes15:02
leoquant http://irclogs.ubuntu.com/2010/11/23/%23ubuntu-classroom.html15:02
c2tarunleoquant: at ur link i saw the log of todays class...  what about previous classes??15:03
=== nhandler_ is now known as nhandler
=== pleia2_ is now known as pleia2
=== rbniknej is now known as jenkinbr
=== jenkinbr is now known as squishy
c2tarunwhat is the timing of next class??17:45
coolbhavic2tarun, please see the topic :)17:47
c2tarunhow can i convert the given time according to indian time?17:49
=== Tscheesy_ is now known as Tscheesy
m4n1shc2tarun: +5:3017:51
c2taruncan i get the log files of previous classes18:05
pleia2c2tarun: they are all linked on the wiki page in the topic18:09
=== maxb_ is now known as maxb
=== squishy is now known as rbniknej
=== rbniknej is now known as jenkinbr
airbornale chuj jestes22:36
airbornups22:36
airbornsorry22:36
airborn:(22:36

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