Skip to content

How to upload to Launchpad PPA repository (.deb packages)

Antonio Monje edited this page Mar 2, 2016 · 1 revision

How to publish eXe Learning on the Launchpad Personal Package Archive

Table of Contents

Set OpenPGP key for identification

Generate OpenPGP key

https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Using_GnuPG_to_generate_a_key

 $ gpg --gen-key
  • select (1) RSA and RSA
  • Keysize: accept 2048
  • Valid for: accept 0
  • Type name, email and comment (comment is optional)
  • Type 0
  • Type passphrase (twice)
  • Follow instructions to help generate a random key
  • Keep the Key ID and fingerprint text, you will need them in next step
Set generated key as default in ~/.bashrc
 $ sudo nano ~/.bashrc
 [.. add this ..]
 export GPGKEY=<key_id>

Restart GPG-agent and source ./bashrc, or restart session

Configure OpenPGP key in Launchpad

https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Uploading_the_key_to_Ubuntu_keyserver

http://askubuntu.com/questions/29889/how-do-i-check-if-my-openpgp-key-is-in-the-ubuntu-keyserver

https://help.launchpad.net/YourAccount/ImportingYourPGPKey

https://help.launchpad.net/ReadingOpenPgpMail

Export OpenPGP key to Ubuntu Keyserver and check that key is already exported (can take up to 30mins)

 $ gpg --keyserver keyserver.ubuntu.com --send-keys <key_id>
 $ gpg --keyserver hkp://keyserver.ubuntu.com --search-key <e-mail>

Log into (or create) your Launchpad account

In your profile page, beside OpenPGP keys, click on the pencil icon to edit.

Under Import an OpenPGP key, type the fingerprint of the generated OpenPGP key.

A message encrypted with your public key will be sent to your signature e-mail. Decrypt the message and follow the instructions to confirm that the provided key is yours.

Build source package

Download eXe Learning

Import the eXe Learning version to upload from the forge Git repository, and merge latest changes from the release tag

 $ git clone --branch ppa-<distribution>  git+ssh://<username>@forja.cenatic.es//var/lib/gforge/chroot/scmrepos/git/iteexe/iteexe.git
 $ git merge <tagname>
 $ git mergetool
  ... Resolve posible conflicts on debian/changelog or others and commit ...
 $ git commit

Adapt package control files to PPA guidelines

https://help.launchpad.net/Packaging/PPA/BuildingASourcePackage

 $ cd iteexe
 iteexe$ debchange --newversion 3:<exeversion>ppa<n> Adapt version number to Ubuntu PPA guidelines
 iteexe$ debchange -r
 [.. Edit suggested changelog as needed, with release precise, save and exit editor ..]
  • <exeversion></exeversion>ppa<n></n> → Keep the 'official' version number and add a ppa<n></n> suffix, where <n></n> is an incremental integer. Doing so, when the PPA version of eXe Learning is updated, package managemente software will detect it and install the new version.
Right now, eXe 'as is' can be uploaded to Launchpad, for distribution 'precise' without further changes.

Version control

Commit and tag changes into repository

 $ git commit
 ... Commit message ...
 $ git tag -a &lt;exeversion&gt;&lt;/exeversion&gt;ppa&lt;n&gt;&lt;/n&gt; -m "eXe &lt;exeversion&gt;&lt;/exeversion&gt;, with the modifications needed to upload to Launchpad PPA."
 $ git push origin HEAD 
 $ git push origin --tags

Check the commit id and save for next step

 $ git show

Create a version file, wich contains just a single line with this format:

 $ cd iteexe
 $ nano version
 &lt;exeversion&gt;&lt;/exeversion&gt;ppa&lt;n&gt;&lt;/n&gt;-r&lt;commit&gt;&lt;/commit&gt;

Git is no longer needed, clean up git files

 $ sudo rm -R .git .gitignore

Adding the manual

Download manual.zip from: https://www.dropbox.com/sh/nyd30mfssci9bhj/eFkeXSzHiO and unzip it under exe/webui/docs/manual.

 $ cd iteexe/exe/webui/docs/manual
 $ wget https://www.dropbox.com/sh/nyd30mfssci9bhj/AAAHL6v0XVxl8ALa3BMu26uBa?dl=1 -O manual.zip
 $ unzip manual.zip
 $ rm manual.zip

Build package

We will upload a source file, wich will be built by Launchpad systems to i386 and amd64 architectures. There is no need of solving dependencies in the local machine. Launchpad will not accept unsigned packages (-uc or -us options).

 iteexe$ debuild -S
  • Type OpenPGP passphrase when asked
Check generated files
 iteexe$ cd ..
 $ ls -l
 [..] iteexe
 [..] intef-exe_&lt;exeversion&gt;&lt;/exeversion&gt;ppa&lt;n&gt;&lt;/n&gt;.dsc
 [..] intef-exe_&lt;exeversion&gt;&lt;/exeversion&gt;ppa&lt;n&gt;&lt;/n&gt;_source.build
 [..] intef-exe_&lt;exeversion&gt;&lt;/exeversion&gt;ppa&lt;n&gt;&lt;/n&gt;_source.changes
 [..] intef-exe_&lt;exeversion&gt;&lt;/exeversion&gt;ppa&lt;n&gt;&lt;/n&gt;.tar.gz

Upload to PPA

Upload source package

https://help.launchpad.net/Packaging/PPA/Uploading

eXeLearning PPA belongs to a restricted Team, you must be authorized by an admin to upload packages. If you want to join the team, please contact an user with Administrator status: https://launchpad.net/~exelearning/+members.

In your local machine, install and set up dput:

 $ sudo aptitude install dput
 $ sudo nano ~/.dput.cf
 [exelearning]
 fqdn = ppa.launchpad.net
 method = ftp
 incoming = ~exelearning/exelearning/ubuntu/
 login = &lt;your_launchpad_id&gt;&lt;/your_launchpad_id&gt;
 allow_unsigned_uploads = 0

Upload package

 $ dput exelearning intef-exe_&lt;exeversion&gt;&lt;/exeversion&gt;ppa&lt;n&gt;&lt;/n&gt;_source.changes
  • Type Launchpad password when asked.
Launchpad will send a message when the package is uploaded and accepted. The sources will be automatically built on i386 and amd64 architectures (messages will be sent if building process fails).

Copy package to other distributions

http://askubuntu.com/questions/30145/ppa-packaging-having-versions-of-packages-for-multiple-distros https://help.launchpad.net/Packaging/PPA/BuildingASourcePackage#Versioning

The intef-exe_<exeversion></exeversion>ppa<n></n> package built is targeted to Ubuntu release set on debian/changelog, so it will not be available to install on other Ubuntu versions.

From Launchpad profile page, under Personal Package Archives, click on PPA name (eXeLearning). Then click on View package details and Copy packages.

  • Select package/s to copy and a new target distribution.
  • Choose Copy existing binaries to skip rebuilding the package from sources.
Rebuild the copied sources requires including the name of the distribution as a suffix to the version number (intef-exe_<exeversion></exeversion>ppa<n></n>~quantal)

Install eXe Learning from PPA

https://help.launchpad.net/Packaging/PPA/InstallingSoftware

Add PPA to sources list and update Apt cache.

 $ sudo add-apt-repository ppa:exelearning/exelearning
 $ sudo apt-get update

Check that Intef eXe Learning is now available on your distribution, and install

 $ apt-cache search intef-exe
 $ apt-cache show intef-exe
 $ sudo apt-get install intef-exe

eXe Learning has been installed!

Clone this wiki locally