Build a debian package and upload to Launchpad ppa

2014-11-22

  1. Create Launchpad PPA at https://launchpad.net/people/+me/+activate-ppa
  2. Creating your OpenPGP keys with gpg command

    • Open a terminal and type:

      gpg --gen-key
      
      • GPG will now ask you a number of questions about the type of key you want to generate. follow the steps below to select the default option each time.
      • Check that your key has been generated by typing gpg –list-keys and, if successful. pub 1024D/12345678 -> this is the important number
      • Launchpad doesn’t store your key directly, so you need to export your public key to a key server, such as keyserver.ubuntu.com:

        gpg --keyserver keyserver.ubuntu.com --send-keys 12345678
        Replace 12345678 with the pub id you noted in step 3.
        

        If successful, GPG will display a message similar to:

        gpg: sending key 12345678 to hkp server keyserver.ubuntu.com
        Importing your key into Launchpad with gpg
        
      1. Add OpenPGP key to Launchpad
      2. Launchpad identifies your OpenPGP key by its fingerprint. In your terminal, you can ask GPG for your key’s fingerprint by typing: ```

gpg –fingerprint

GPG will display a message similar to:

Key fingerprint = 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72 copy only the numeric fingerprint: 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72.

  * Visit your OpenPGP key page at https://launchpad.net/people/+me/+editpgpkeys
  * Paste the fingerprint that you copied in step 1 into the Fingerprint text-box, then click the Import Key button. Launchpad will use the fingerprint to check the Ubuntu key server for your key and, if successful, send you an encrypted email asking you to confirm the key import. (Note : this is a brief ... from launchpad process..... both process take a while so just take your time...)

4. set ~/.devscripts
``` bash
DEBUILD_DPKG_BUILDPACKAGE_OPTS="-us -I -i"
DEBUILD_LINTIAN_OPTS="-i -I --show-overrides"
  1. get source

    apt-get build-dep lshw
    bzr lp:ubuntu/trusty/lshw
    dch -v X.XtestVersion -D trusty
    debuild -S
    
    1. upload changes to launchpad’s ppa and push code bash dput ppa:swem/ppa xxxxxxxxxxxxxxxxxx_source.changes bzr push lp:~swem/totem/trunk

Extra: Build debian package on your own machine

pbuilder-dist trusty amd64 create
pbuilder-dist trusty amd64 build xxxxxxxxxxxxxxxxxx_source.dsc

Check ~/pbuilder/trusty_result/, the xxxxxxxxxxxxxxxxxx.deb should be there.

Ref: - Ubuntu packaging guide - 6. Packaging New Software - 5. Tutorial: Fixing a bug in Ubuntu - Creating Ubuntu packages for Launchpad - 製作 deb package for Ubuntu Linux 並且上傳至 Launchpad PPA - 淺談 Launchpad 上面的 Bazaar 分支架構 - Chapter 6. Building the package