1 hour later…
5:29 PM
in AskUbuntu Classroom Discussion - Packaging, 3 mins ago, by The Evil Phoenix
*** FILES YOU WILL NEED ***
http://kor.trekweb.org/packaging/class-files.zip <--- Files we will use for packaging demonstrations created and owned by myself for this class session.
http://kor.trekweb.org/packaging/class-files.zip <--- Files we will use for packaging demonstrations created and owned by myself for this class session.
5:52 PM
I will be moderating this session. If you have questions, please join the Classroom Discussion Room. Your questions will be relayed to the speaker.
Firstly, I would like to point out that during this session, we will be using the Command Line for most of the commands.
And before we continue, I must point out that during the session, there may be demonstrations of commands and actions.
The demonstrations will be using a file that is available via one of my servers: kor.trekweb.org/packaging/class-files.zip
In order to be able to create a package, it is recommended that users have a firm grasp of basic command line syntax as well as commands.
I'm going to assume that most of you have experience with the Terminal and Command-Line, however I will outline all commands as we go.
1) We will go through the easiest method of creating a PGP key via the GUI. It can be done via the command line, but the easiest method is the GUI.
First, you will need to run the Seahorse program. If you are using Unity, please open up the applications window, and type in "seahorse". An icon will show up that says "Passwords and Encryption keys". An easier method to open could be Alt + F2 (or in the terminal), then running
seahorse
When you are in the GUI interface for seahorse, you will need to use the menu bar. Click "File" > "New".
Provide a name and an email address for the key, and hit "Create". A comment is not required, but may help you to differentiate between keys when you have several
However, if you were going to distribute your Debian packages, you would need to upload the PGP key to a key server, which I will very briefly explain here
Select the PGP key you created in the main seahorse window (the key should be under "personal keys").
close the preferences window, then, with your PGP key selected, go to the menu bar: "Remote" > "Sync and Publish Keys..."
Your PGP key will be uploaded to the Ubuntu keyservers, and will be available within a few minutes on the internet.
This command will run the installation of all required software for packaging:
sudo apt-get install build-essential devscripts ubuntu-dev-tools debhelper dh-make diff patch cdbs quilt gnupg fakeroot lintian pbuilder piuparts
Installation may take anywhere from 5 minutes to 30 minutes depending on various factors such as internet speed, system speeds, and other factors that contribute to a computer's speeds.
After all the packages are installed, we will need to create the
pbuilder
environment. pbuilder
is the "Personal Builder". It is used to build your packages after you've created the source package. This way, you can build the actual .deb in a chroot
ed environment.
Typically, you will be building the
pbuilder
build environment for the same distribution you are running, however you may also build environments for other distributions (Lucid, Maverick, etc).
This command will build the
pbuilder
environment for your distribution: sudo pbuilder create --distribution $(lsb_release -cs) --othermirror "deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs) main restricted universe multiverse"
On this system that I am using,
pbuilder
creation of the base environment for Natty took approximately 10 minutes; on my netbook (running Maverick), it took 20 minutes.
During this time, we can continue to build the core of the package without actually compiling the files into a .deb.
This folder contains the executable .sh script that will be made into a package and subsequently installed into the system for use.
you may name it what you wish, but I recommend you name the folder the same as I name it for congruency between commands.
Within that folder, we will begin creating the Debian control files which steer the creation of the package.
$ dh_make Type of package: single binary, indep binary, multiple binary, library, kernel module, kernel patch? [s/i/m/l/k/n]
[s/i/m/l/k/n] s Maintainer name : IGPF.us Email-Address : [email protected] Date : Sat, 09 Jul 2011 14:38:16 -0400 Package Name : packaging-demo Version : 1.0 License : blank Type of Package : Single Hit <enter> to confirm:
In this case, edit your `.bashrc`, and append this at the end:
export DEBFULLNAME="John Doe"
export DEBEMAIL="[email protected]"
export DEBFULLNAME="John Doe"
export DEBEMAIL="[email protected]"
Currently there is no top level Makefile. This may require additional tuning. Done. Please edit the files in the debian/ subdirectory now. You should also check that the packaging-demo Makefiles install into $DESTDIR and not in / .
When packaging programs, you would usually create a Makefile which would dictate the destination of where things would be written.
$ ls total 16K 4.0K drwxr-xr-x 4 teward teward 4.0K 2011-07-09 14:46 ./ 4.0K drwxr-xr-x 8 teward teward 4.0K 2011-07-09 14:46 ../ 4.0K drwxr-xr-x 3 teward teward 4.0K 2011-07-09 14:46 debian/ 4.0K drwxr-xr-x 2 teward teward 4.0K 2011-07-09 14:34 exec/
What is left should be similar to this: $ ls total 40K 4.0K drwxr-xr-x 3 teward teward 4.0K 2011-07-09 14:51 ./ 4.0K drwxr-xr-x 4 teward teward 4.0K 2011-07-09 14:46 ../ 4.0K -rw-r--r-- 1 teward teward 182 2011-07-09 14:46 changelog 4.0K -rw-r--r-- 1 teward teward 2 2011-07-09 14:46 compat 4.0K -rw-r--r-- 1 teward teward 533 2011-07-09 14:46 control 4.0K -rw-r--r-- 1 teward teward 1.5K 2011-07-09 14:46 copyright 0 -rw-r--r-- 1 teward teward 0 2011-07-09 14:46 docs 4.0K -rw-r--r-- 1 teward teward 183 2011-07-09 14:46 README.Debian
I will give a brief explanation of these items, however these items are fully detailed in the Packaging Guide on the Ubuntu Wiki: wiki.ubuntu.com/PackagingGuide/Complete
packaging-demo (1.0-1) unstable; urgency=low * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP> -- IGPF.us <[email protected]> Sat, 09 Jul 2011 14:46:41 -0400
However, we will cover a method that allows you to use the PPA system of Launchpad to copy this one installer to other distributions. This will be covered in the second session, and not now.
The
compat
file we can ignore, but it is needed in order to identify compatibility levels with the various parts of building the .deb. Source: packaging-demo Section: unknown Priority: extra Maintainer: IGPF.us <[email protected]> Build-Depends: debhelper (>= 7.0.50~) Standards-Version: 3.9.1 Homepage: <insert the upstream URL, if relevant> #Vcs-Git: git://git.debian.org/collab-maint/packaging-demo.git #Vcs-Browser: git.debian.org/?p=collab-maint/packaging-demo.git;a=summary Package: packaging-demo Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: <insert up to 60 chars description> <insert long description, indented with spaces>
This package is not connected to a home page, so that line is irrelevant today, however for a full project, you would put the URL to the project's home page (even if its a Launchpad project) in for that line.
In this case, it doesnt really matter what we put (as long as its a valid section), and in this case we can put
misc
Priority: This sets the importance of the package to users. It should be one of the following:
Required - packages that are essential for the system to work properly. If they are removed it is highly likely that your system will break in an unrecoverable way.
Important - minimal set of packages for a usable system. Removing these packages will not produce an unrecoverable breakage of your system, but they are generally considered important tools without which any Linux installation would be incomplete. Note: This does not include things like Emacs or even the X Window System.
Required - packages that are essential for the system to work properly. If they are removed it is highly likely that your system will break in an unrecoverable way.
Important - minimal set of packages for a usable system. Removing these packages will not produce an unrecoverable breakage of your system, but they are generally considered important tools without which any Linux installation would be incomplete. Note: This does not include things like Emacs or even the X Window System.
the
Source
and Package
lines should remain the same. This denotes the name of the package and its source equivalent all - The source is not architecture-dependent. Programs that use Python or other interpreted languages would use this. The resulting binary package would end with _all.deb.
any - The source is architecture-dependent and should compile on all the supported architectures. There will be a .deb file for each architecture (_i386.deb for instance)
A subset of architectures (i386, amd64, ppc, etc.) can be listed to indicate that the source is architecture-dependent and does not work for all architectures supported by Ubuntu.
any - The source is architecture-dependent and should compile on all the supported architectures. There will be a .deb file for each architecture (_i386.deb for instance)
A subset of architectures (i386, amd64, ppc, etc.) can be listed to indicate that the source is architecture-dependent and does not work for all architectures supported by Ubuntu.
In our case, as this is using a .sh file, there is no dependency for architecture, so we will use
all
for the Architecture
line.
Replace
Description: <insert up to 60 chars description>
with Description: Demo Package
, and replace ` <insert long description, indented with spaces>` with ` Demo Package`, keeping the space in front of it.
For example, if you are packaging a python program and you require Python of version 2.6 or newer, you'd likely want to define that:
Depends: python (>= 2.6)
Format: dep.debian.net/deps/dep5 Upstream-Name: packaging-demo Source: <url://example.com> Files: * Copyright: <years> <put author's name and email here> <years> <likewise for another author> License: <special license> <Put the license of the package here indented by 1 space> <This follows the format of Description: lines in control file> . <Including paragraphs> # If you want to use GPL v2 or later for the /debian/* files use # the following clauses, or change it to suit. Delete these two lines
shlibs:Depends
calculates any dependencies for any dependent packages you specified in Depends:
. In this case, any dependent files for bash
would be installed at the same time. Format: dep.debian.net/deps/dep5 Upstream-Name: packaging-demo Source: <url://example.com> Files: * Copyright: 2011 <yourinfo> License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
IN the install file, you will specify the location of where to place every file you included in the package.
7:33 PM
in AskUbuntu Classroom Discussion - Packaging, 13 secs ago, by dv3500ea
QUESTION: is the file debian/install specific to using the dh_make method? When I've made packages before I've written out the debian/rules file with lots of
cp
s!in AskUbuntu Classroom Discussion - Packaging, 26 secs ago, by Rinzwind
building a deb for LP. Is that based of the DEB made in THIS session?
This session will continue on the adventures of packaging: Ubuntu Packaging for Launchpad PPAs (Packaging: Part 2)
This session requires far less steps than the first session which covered the entire creation of a standalone .deb
However, all the packaging requirements for the first session still apply, as does the
dh_make
command.
The key difference between creating a standalone .deb and uploading to a PPA are that you do not upload a standalone Debian file to the PPA.
After you have installed the package
dput
, you will need to create its config file for the user if you wish to use SFTP or SSH-tunneled uploading. For 9.10 and later, you can use a different method.
In order to do this, you will need to have imported your PGP key that you created earlier into Launchpad
On your user info page, there is a section called "OpenPGP Keys". Click the yellow pencil icon next to that field.
You will need to check the email address you have registered for Launchpad for further instructions on finishing the import
Go to the received email, and copy the text between the lines
-----BEGIN PGP MESSAGE-----
and -----END PGP MESSAGE-----
The content will be decrypted, and you will need to follow the instructions in the decrypted message in order to finish importing your PGP key.
7:57 PM
in AskUbuntu Classroom Discussion - Packaging, 36 secs ago, by Rinzwind
question: passphrase is a random text or the one used when creating the key in seahorse?
After creating the PPA on Launchpad and accepted all terms of them, and also after importing the PGP key, we can continue.
[my-ppa] fqdn = ppa.launchpad.net method = ftp incoming = ~<your_launchpad_id>/<ppa_name>/ubuntu/ login = anonymous allow_unsigned_uploads = 0
You may leave the login as
anonymous
but its recommended you use your own launchpad ID in place of anonymous
[addgpg-apt] fqdn = ppa.launchpad.net method = ftp incoming = ~addgpg-apt-developers/ppa login = trekcaptainusa-tw allow_unsigned_uploads = 0
If you followed the instructions through the first session, the procedure is similar to building the standalone deb
if you did not yet build the program into a .deb from the first session, please disregard this next step.
If you built the program from the first session into a .deb, do the following in the directory that held the folder you unzipped/downloaded:
rm packaging-test_1.0-*
Navigate into the source directory for the Debian package (the folder that contains any programs or source, and also has
debian
in it)
If you created the .dput.cf file as I specified earlier, you will only need to use the text that was between the
[ ]
in this step.
Then allow the program to run (NOTE: It may ask for your launchpad password so you can upload to the PPA)
You will receive an email at your launchpad registered email and it will tell you whether the upload was accepted or rejected.
in AskUbuntu Classroom Discussion - Packaging, 1 min ago, by Rinzwind
are there common reasons for 'rejecting' an upload? Some examples(?)
duplicate versions of the package have been uploaded to the same PPA, unsigned packages were uploaded, or a failure in specifying which distro you're building for
5
(quote from chat) Got a PPA on launchpad for source packages for an IRC bot project I'm associated with (since its all the intermediate packaging for the stuff between releases, it's classified as an "experimental" PPA). Question: I've already packaged the stuff for a lucid build. Any clue ho...
You may copy any already-uploaded package that was built for Natty or other distros into the other distro
if a dependency for the program is present in Maverick and later, but not in Lucid or earlier, the system will not catch it, but when you try and install the package from the PPA in Lucid or earlier, it will fail to install.
« first day (9 days earlier) ← previous day