=== virtuald is now known as leagris === leagris is now known as virtuald === BlackZ_ is now known as BlackZ === yofel_ is now known as yofel [13:54] anyone here?? how much time is left in today's class [13:54] ?? [13:55] c2tarun: 5 mins [13:55] thanks [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 [14:01] Hello people, and welcome to the Packaging tutorial session! [14:01] Logs for this session will be available at http://irclogs.ubuntu.com/2010/11/23/%23ubuntu-classroom.html following the conclusion of the session. [14:02] Before we move ahead, I would like to tell you people how to ask questions and the like [14:02] The session will go on here [14:02] this channel is moderated [14:03] you will have to ask the questions in #ubuntu-classroom-chat , prefixed with QUESTION: , like this: [14:03] QUESTION: What does a deb file do? [14:03] New, let's begin! [14:03] *now [14:03] I would like everyone to install these packages: [14:03] build-essential dpkg-dev fakeroot devscripts autotools-dev debhelper dh-make [14:04] To install them, run this in a terminal: [14:04] sudo apt-get install build-essential dpkg-dev fakeroot devscripts autotools-dev debhelper dh-make [14:04] (let it install in the background) [14:05] Now, make an empty directory called ubuntu-packaging [14:07] and cd into it from a terminal [14:07] Then, 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] wget http://ftp.gnu.org/gnu/hello/hello-2.6.tar.gz [14:07] Then, rename it by typing this: [14:08] mv hello-2.6.tar.gz hello_2.6.orig.tar.gz [14:08] Then, extract the archive: [14:08] tar xzf hello_2.6.orig.tar.gz [14:09] Now, you will have a directory hello-2.6, cd into it [14:09] If you don't have a GPG key already, run this command: [14:09] gpg --gen-key [14:09] and follow the steps [14:11] Now, set your full name and e-mail env variables in your system for use by the packaging tools, like this: [14:12] echo "export DEBFULLNAME=\"YOUR FULL NAME HERE\"" >> ~/.bashrc [14:12] echo "export DEBEMAIL=\"youremail@something.com\"" >> ~/.bashrc [14:13] After that, run these commands to set the vars in the current session as well: [14:13] export DEBFULLNAME="YOUR FULL NAME HERE" [14:13] export DEBEMAIL="youremail@something.com" [14:13] I hope you replaced YOUR FULL NAME HERE and youremail@something.com with your name and e-mail address [14:14] now, let us move ahead with the packaging! [14:14] I hope you are in the hello-2.6 folder [14:14] then run this command: [14:14] dh_make -c gpl3 -s [14:15] Hit enter if every information is correct [14:15] If not, then say 'NO' in #ubuntu-classroom-chat [14:16] I assume it worked for everyone [14:16] now, cd into the newly-created debian subdirectory in the hello-2.6 folder [14:16] Then run these commands to clear the unnecessary files in the folder [14:17] rm *ex *EX [14:17] rm docs info README.* [14:18] Now, let us analyse the files remaining in the directory [14:18] Ignore the compat file and the source folder, they are parts of the source which are never touched [14:19] (not never, but not touched usually) [14:19] Open the control file in your favourite text editor [14:19] Set the Section: field from unknown to misc [14:19] Delete the two #Vcs-* lines [14:20] c2tarun asked: what is misc? [14:20] misc -> Miscellaneous [14:21] There are many debian sections that can be written there [14:21] examples are video, net, etc [14:22] let me give you a list [14:22] The possible sections are: [14:22] admin, 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:23] FYI: perl, php, python, lisp sections are for language modules, not apps made in that language [14:23] okay, so let us move ahead [14:23] In the Homepage: field replace [14:23] with http://www.gnu.org/software/hello/ [14:24] Now, the package description [14:24] Replace [14:24] with a short description of the package [14:25] In this case: Hello program that prints out Hello World! [14:25] Replace the thing with this: [14:26] GNU Hello prints out Hello World! and is translateable. [14:26] It is a good example of how an application should be made and [14:26] follow the GNU coding standards [14:27] IMPORTANT: There should be a space before every line in the long description [14:28] Correction: Please change the short description to: Program that prints out Hello World! [14:28] According to Debian policy we should not have the package name at the beginning of the short description [14:28] Now, open the copyright file [14:29] Replace the placeholders there with the appropriate information [14:30] (this file is very important in actual packaging, but in a tutorial it makes little sense to add info there) [14:30] Now, the rules file [14:31] Since our package is a pure C program that uses autotools, we don't need to edit the rules file [14:31] but 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 well [14:32] let me give you link to documentation on that [14:33] https://wiki.ubuntu.com/PackagingGuide/Basic has good info [14:33] tarora asked: how to find package dependencies? [14:33] Since our package uses autotools, the packaging tools will automatically provide a list of package dependencies when we build the package [14:34] But in other cases, like python modules and other non-autotools packages [14:35] you will need to replace the ${shlibs:Depends} in the Depends: field of the control file with a comma-separated list of dependencies [14:35] but always leave ${misc:Depends} there [14:36] ongolaBoy asked: where do we find a complete reference of debian section ? [14:36] The most comprehensive information you would find would be the Debian policy manual http://www.debian.org/doc/debian-policy/ [14:37] It is the base of all other documentation [14:37] However, if you want tutorial-style docs, you would like https://wiki.ubuntu.com/PackagingGuide [14:37] c2tarun asked: what is the function of rules file?? [14:38] The rules file is like a makefile [14:38] it contains information for the packaging tools to build the package [14:38] c2tarun asked: what are ${shlibs:Depends}, ${misc:Depends} [14:39] The former gets replaced automatically by a list of package dependencies that are unique to the package [14:39] If the package would be a rhythmbox plugin (for example), this would be replaced by rhythmbox, and other deps [14:40] in this case, it would be replaced by libc6 and other basic things, since this is a very basic package [14:40] ${misc:Depends} gets replaced by a list of dependencies common to every package [14:41] like: glibc, linux, and things without which the system would be unusable [14:41] boulabiar asked: is there any GUI for all of this? [14:41] not at the moment :) [14:41] If you want to develop stuff, and want to get your feet wet in packaging, you have to sacrifice the luxury of a GUI [14:42] c2tarun asked: when will this replacement occur?? [14:42] When we build the package [14:42] (which is the next step [14:42] ) [14:42] Now, let us build the package, to do that, type this: [14:42] debuild [14:42] That would do it all [14:43] Some stuff will be printed on the screen [14:44] When it asks you for the gpg passwords, enter the password of your gpg key [14:44] Once that is done, you shall have a deb file in the ubuntu-packaging directory [14:45] Okay, I forgot to mention about the changelog file [14:46] The package should build properly nevertheless [14:46] The very first line of the file should be like this: [14:46] hello (2.6-1) unstable; urgency=low [14:46] hello -> package name [14:46] 2.6-1 -> package version number [14:47] If you are packaging a new package for Ubuntu it would rather be 2.6-0ubuntu1 [14:47] 0 is the debian revision, 0ubuntu1 means this package isn't in Debian yet [14:47] 2.6 is upstream version number [14:48] The second line onwards contains the changes made: [14:48] and the rest is not important for discussion ATM [14:48] Did the package build well? [14:49] c2tarun asked: what about the Makefile?? dont we have to create it?? [14:49] the configure script creates it when we run debuild [14:49] c2tarun asked: can u explain what exactly debuild did?? [14:49] Debuild did nothing but executed the debian/rules file with a different set of arguments [14:50] which built the package [14:50] man debuild will tell you what it did [14:50] It basically runs dpkg-buildpackage, then lintian, then debsign [14:51] dpkg-buildpackage does the main work [14:51] man dpkg-buildpackage will tell you about it [14:51] There are 10 minutes remaining in the current session. [14:51] c2tarun asked: where is the configure script?? [14:51] In the hello-2.6 directory [14:51] it is supplied by upstream [14:52] Questions, please! [14:52] Okay, about PPAs [14:52] debuild must have created many files apart from a deb [14:53] If you want to upload the package to a PPA [14:53] make sure that you replace 'unstable' in the changelog file with 'maverick' or 'lucid' or the version of ubuntu you want to upload for [14:54] By version I mean codename of the release (hardy, jaunty, intrepid, etc) not numbers (8.04, 9.04, etc) [14:54] then run debuild -S [14:54] then install package dput [14:55] https://help.launchpad.net/Packaging/PPA/Uploading will help you then [14:55] c2tarun asked: i can see four configure files here? which one is the one guiding for Makefile [14:55] The one that is named 'configure' [14:55] that one [14:55] not configure.ac or something [14:56] There are 5 minutes remaining in the current session. [14:56] c2tarun asked: there is a file name configure.ac . can u please explain that file?? [14:56] Beyond scope, but I will explain briefly [14:56] Developers use it to create 'configure' using autoconf [14:57] it is a helper file in reality [14:57] but of no use to the user or packager [14:57] < maxpaguro> where to learn more about correct libs and howto correct handle? [14:57] YOu mean correct dependencies? [14:58] they are usually listed in the README file in the upstream tarball [14:58] 2 minutes remaining, might answer 2 more Qs [14:58] quick! [14:59] maxpaguro asked: dependencies and libraries if updating a package [14:59] If you are updating a package [14:59] usually the deps remain the same [15:00] In autotools packages the deps are taken care of automatically [15:00] but in non-autotools packages, check the upstream changelog (not debian/changelog) [15:00] Almost time up! [15:00] Thanks for everyone who attended [15:01] Logs for this session will be available at http://irclogs.ubuntu.com/2010/11/23/%23ubuntu-classroom.html [15:01] * bilalakhtar waits for the bot to call off === 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 || [15:02] today was my first class. it was good :) where can i get logs of previous classes [15:02] http://irclogs.ubuntu.com/2010/11/23/%23ubuntu-classroom.html [15:03] leoquant: at ur link i saw the log of todays class... what about previous classes?? === nhandler_ is now known as nhandler === pleia2_ is now known as pleia2 === rbniknej is now known as jenkinbr === jenkinbr is now known as squishy [17:45] what is the timing of next class?? [17:47] c2tarun, please see the topic :) [17:49] how can i convert the given time according to indian time? === Tscheesy_ is now known as Tscheesy [17:51] c2tarun: +5:30 [18:05] can i get the log files of previous classes [18:09] c2tarun: they are all linked on the wiki page in the topic === maxb_ is now known as maxb === squishy is now known as rbniknej === rbniknej is now known as jenkinbr [22:36] ale chuj jestes [22:36] ups [22:36] sorry [22:36] :(