== Open Week -- Intro to Ubuntu Development -- Bilal Akhtar -- Wed, Oct 13 == {{{#!IRC [16:01] Slides for Intro to Ubuntu Development: http://people.ubuntu.com/~nhandler/slides/openweekmaverick/IntroductionToUbuntuDevelopment.pdf [16:01] Logs for this session will be available at http://irclogs.ubuntu.com/2010/10/13/%23ubuntu-classroom.html following the conclusion of the session. [16:02] Hellos folks [16:02] Hello people and welcome to the third day of the Ubuntu Open week! [16:02] The next session will be taken by bilal and here he is :) [16:02] Hello people and welcome to the third day of the Ubuntu Open week! [16:02] I am Bilal Akhtar, 14 (yes, 10+4) years old, studying at Delhi Public School, Riyadh, Saudi Arabia, though I am Indian by origin [16:02] sorry for repeating that line, happened by mistake [16:03] I am an Ubuntu Developer, and hence, I am here to give you an introduction to Ubuntu Development! [16:03] [SLIDE 1] [16:03] Before I begin with the session, I want you people to install the following packages, since these will be needed in packaging an application. [16:03] These packages are: dpkg-dev build-essential dh-make fakeroot devscripts . To install them, type in a terminal: [16:04] sudo apt-get install dpkg-dev build-essential dh-make fakeroot devscripts [16:04] [Slide 1] [16:06] So let's begin! [16:06] If you want to ask a question, ask it on #ubuntu-classroom-chat with the prefix QUESTION: eg. QUESTION: What does 'foo' mean? [16:07] Now, create an empty directory in your home directory [16:07] since I will now tell you how to package a small C application [16:07] [SLIDE 2] [16:08] Name the directory hello-packaging [16:08] and open a terminal and cd into it by typing cd hello-packaging [16:08] Then, download the source code of the upstream package. What is upstream? Let me explain [16:09] Upstream refers to the original application. The upstream application is packaged and made into a Debian package, also called a deb [16:09] Download the upstream source by running this command: [16:09] wget http://ftp.gnu.org/gnu/hello/hello-2.6.tar.gz [16:10] then extract the source by running: tar xzf hello-2.6.tar.gz [16:10] Okay, machinezilla just tols something about a postfix problem he is facing [16:10] sorry for ignoring it earlier [16:11] Set it to No configuration [16:11] nisshh asked: apparently there are multiple ways to package something, which is confusing for new developers, is there a "recommended" or "simple and easy" way to package the majority of things? [16:12] Of course there are multiple ways of packagign [16:12] *packaging [16:12] Packaging Python/PHP/Perl applications involve different processes [16:12] The simplest is packaging C/C++ apps [16:13] there are different ways in that as well [16:13] but I am telling the latest and best of them [16:13] which is, of course, *recommended* for new packages [16:13] Right! [16:14] Now, you shall have 1 folder and 1 file in your directory [16:15] Rename the hello-2.6.tar.gz file to hello_2.6.orig.tar.gz [16:15] and then cd into the hello-2.6 directory [16:15] okay, now you need to set up your packaging environment [16:15] for which you need to run the below commands: [16:16] echo "export DEBEMAIL \"YOUR_EMAIL_ADDRESS@something.com\"" >> ~/.bashrc [16:17] Replace YOUR_EMAIL_ADDRESS@something.com with your e-mail address [16:17] Alo run: [16:17] echo "export DEBFULLNAME \"Your Full Name\"" >> ~/.bashrc [16:17] Then run : [16:17] gpg --gen-key [16:18] Answer the questions, and you shall have a gpg key [16:19] Now, I assume you are in your hello-packaging/hello-2.6 directory === abadr_ is now known as abadr [16:20] Run the below command: === abadr is now known as badara [16:20] dh_make -c gpl3 -s === badara is now known as ABadr [16:21] -c gpl3 specifies the license === ABadr is now known as Badr [16:21] and -s means a single binary package === Badr is now known as ubuntero [16:21] Now, your hello-2.6 folder must be having a debian/ subfolder [16:21] cd into it [16:21] we need to remove the extra files [16:21] to do that, run: === 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 || UOW Survey: http://is.gd/fZlwL || Event: Ubuntu Open Week - Current Session: Intro to Ubuntu Development - Instructors: bilalakhtar - Slides: http://tinyurl.com/244y3k7 [16:22] [SLIDE 2] [16:23] Make sure you are in the debian folder, and run: [16:24] rm *ex *EX README.* info docs [16:25] Now, open the control file in the debian folder with your favourite text editor [16:25] Set the Homepage: line to Homepage: http://www.gnu.org/software/hello/ [16:26] This is the link to the main page of the project [16:26] And, you will need to add a description as well [16:26] so edit the Description: line and add a short description just after Description: [16:27] machinezilla asked: i am stuck at gpg keygen step. i keep getting the following: Not enough random bytes available. Please do some other work to give [16:29] You must leave it at the step for some time (upto 5 mins) so that it has enough random bytes [16:29] So I was at the Description: step [16:30] Enter a long description BELOW the line, intended with spaces [16:30] like this: [16:30] Hello is a tiny program that prints Hello World! [16:31] It follows GNU standards in coding [16:31] and can be translated into other languages [16:31] Make sure each line has a space before it, otherwise the description won't come as intended [16:32] Now, save and close the control file [16:32] Ignore the compat file, its usage is beyond the scope of this tutorial [16:32] Open the copyright file [16:34] In real packaging, you will have to fill the placeholders in the file with real URLs and real authors [16:34] that's all about this file [16:34] now, open control again [16:34] I missed something in it [16:35] Change the Section: to Section: misc [16:36] And remove the #Vcs- fields [16:36] Save and exit [16:36] Since this is a simple C application using GNU autotools [16:36] you don't need to modify the rules file [16:36] however, if you follow other packaging techniques, you do need to [16:37] so now for the changelog file [16:37] The changelog contains a list of all the changes in a package, version-by-version [16:37] let me give an example [16:38] http://changelogs.ubuntu.com/changelogs/pool/universe/a/a2ps/a2ps_4.14-1.1/changelog [16:38] This is a typical changelog [16:38] Too confusing, eh? But there is a utility to help you deal with debian changelogs [16:38] which is debchange [16:39] You already have it installed as part of package devscripts [16:39] so poke it with: [16:39] debchange -e [16:39] If it asks for an editor, select your favourite one [16:39] Now, let us analyse the changelog [16:39] The first line is something like this: [16:39] hello (2.6-1) unstable; urgency=low [16:39] Change unstable above to maverick [16:40] 2.6-1 is the version [16:40] though when packagign for Ubuntu it would be 2.6-0ubuntu1 [16:40] 2.6 is the upstream application number, 0 is the debian version for a package not in Debian, and 1 is Ubuntu revision number [16:40] Modify the second line like this [16:41] * Initial Release [16:41] that's all [16:41] Save and close [16:41] Now, run debuild in the terminal [16:41] machinezilla asked: what are the #Vcs fields? [16:41] They contain the links to the upstream revision control source location [16:41] What is that? [16:42] Its a link to the place where the latest source code is located [16:42] daker asked: do i have right to package a proprietary software ? [16:42] Yes you can, but you will need to have access to the source [16:42] and [16:42] you will need to mention about the license of the package PROPERLY in debian/copyright [16:43] Now, as I said, run the command debuild [16:43] It will build the package [16:43] machinezilla asked: so the vcs field is the "Homepage:" field? [16:43] no [16:43] Homepage: refers to the home page of the software project [16:43] which is meant for user [16:43] *users [16:44] while Vcs-* fields point directly at the developer source of the package [16:44] I hope the package is built now [16:44] and in the hello-packaging folder you should have a deb file [16:45] Congrats! You just packaged an application! [16:46] [SLIDE 3] [16:47] Oops, sorry for not mentioning this earlier [16:47] but you will need to modify the Maintainer: field in debian/control to: Maintainer: Ubuntu Developers [16:47] Now building should work [16:48] As the slide shows, Ubuntu is based on Debian http://www.debian.org [16:49] [SLIDE 4] [16:49] The slides now tell everything [16:49] Please ask questions if you have any [16:50] [SLIDE 5] [16:51] https://wiki.ubuntu.com/UbuntuDevelopment/Merging outlines the merging process [16:51] There are 10 minutes remaining in the current session. [16:52] [SLIDE 6] [16:52] autif asked: If I have a piece of software (say) of source forge or git hub and I want to submit it to debian. Where do I sent it to to be included as a part of the official repository? [16:53] Wait a minute, I am searching for a link [16:54] [SLIDE 7] [16:55] http://wiki.debian.org/HowToPackageForDebian [16:55] and [16:55] There are 5 minutes remaining in the current session. [16:56] [SLIDE 8] [16:56] http://mentors.debian.net/cgi-bin/maintainer-intro should help you if you want to get a new package in debian [16:57] https://wiki.ubuntu.com/ContributingToDebian will also help you [16:57] autif asked: What is the level of testing expected before that package is submitted to the official repository - I mean if my fav distro is xubuntu, do I need to test it on ubuntu or latest debian? [16:57] As I said [16:57] new packages should come into Debian first [16:58] so testing with latest Debian is the best [16:58] Xubuntu uses same repos as Ubuntu [16:58] [SLIDE 9] [16:58] And Ubuntu syncs from Debian [16:58] so getting a package in Debian will mean that it will come everywhere :) [16:58] kstailey_ asked: What does it take to get a PPA into Multiverse? [16:58] What do you actually mean? [16:59] You mean, a PPA Package? [16:59] you will need to check it for errors [16:59] [SLIDE 10] [16:59] And then apply through the sponsorship process for new packages [16:59] https://wiki.ubuntu.com/UbuntuDevelopment/NewPackages [16:59] is the process :) [17:00] machinezilla asked: debuild is failing at gpp step. see paste: http://paste.ubuntu.com/512465/ [17:00] Make sure that your DEBEMAIL and DEBFULLNAME variables are set [17:00] and your GPG key e-mail address matches it [17:00] okay, almost time up [17:00] Any more Qs? }}}