Creating PPA is very simple & at the same time somewhat complex process depending on the complexity of the package( i.e single binary, multiple binary...etc). But for simple application like your MyAgenda creating a PPA is very simple.
First install necessary packages.
sudo apt-get install build-essential devscripts ubuntu-dev-tools debhelper dh-make diff patch cdbs quilt gnupg fakeroot lintian pbuilder piuparts
. Most of them are probably already installed by default.
Now setup your gpg-key & ssh-key. Follow instruction from here & here.
STEP1:Layout Of The Source Package
Now go to your application source folder.Here's your basic source package layout:
MyAgenda-1.0/
-- data/
-- myagenda
-- myagenda.desktop
-- myagenda.svg
--ui
-- myagenda.glade
-- otherfiles
-- debian/
-- changelog
-- copyright
-- compat
-- rules
-- control
-- install
STEP2:Know your GPG KEY ID & Format
First run:
gpg --list-keys
. It will give you output something like this:
pub: YOURGPG-KEY
uid: YOURUSERNAME <YOURMAIL-ID> #note your username & email.
sub: --------
STEP3:Create Debian Folder
To create debian folder & all other necessary files under debian folder run(use the same username & email-id from above):
DEBFULLNAME="YOURUSERNAME" dh_make -n -s -e YOUREMAIL-ID
. This will help to sign the package with gpg key.
However this wont create the "install" file under debian folder. Create the file manually & save it with following data:
data/myagenda /opt/extras.ubuntu/com/myagenda/bin
data/ui/* /opt/extras.ubuntu/com/myagenda/ui
data/myagenda.desktop /usr/share/applications
data/myagenda.svg /usr/share/icons/hicolor/scalable/apps
STEP4: Update Changelog
To update changelog run:
dch -i
Here is a sample changelog:
package (version) distribution; urgency=urgency
* change details
more change details
* even more change details
-- maintainer name <email address>[two spaces] Sun, 8 July 2012 18:14:08 +0530
Make sure the above format is preserved.When done editing press CTRL+O to write out.Remove
.dch part & overwrite changelog file.Press CTRL+X to exit.
You may want to delete extra .ex files under debian.Enter into debian folder & delete .ex & .EX files.
cd debian
rm *.ex *.EX
STEP5: Create DEB Package
Then to create deb package run:
debuild --no-tgz-check
#Optional.it will not check for the source tarball.
STEP6: Upload To PPA
To upload the source package to a PPA you must run:
debuild -S
What the -S flag does is tell debuild to build a source package using another script, dpkg-buildpackage, together with fakeroot, which grants us fake root privileges while making the package. It will take the .orig.tar.gz file and produce a .diff.gz (the difference between the original tarball from the author and the directory we have created, debian/ and its contents) and a .dsc file that has the description and md5sums for the source package. The .dsc and *_source.changes (used for uploading the source package) files are signed using your GPG key.
debuild -S
will create a source.changes file outside your source directory. Go to launchpad & create a PPA. Now upload the source.changes to that PPA((change the file name accordingly):
dput ppa:YOUR-LAUNCHPAD-USERNAME/myagenda myagenda-1.0-ubuntu1.changes
DONE!
Notes:
If you want to upload package for several ubuntu versions get help from here.
Sources: Complete Packaging Guide Wiki.
install
inside debian folder. Setup destination path like this:glade/* /opt/extras.ubuntu.com/myagenda/bin/myagenda/ui
.icons/* /usr/share/icons/hicolor/scalable/apps
.bin/myagenda /opt/extras.ubuntu.com/myagenda/bin/myagenda
. Save the file.Here I am assuming "bin/agenda" is your binary folder. "icons" is your icon folder & glade files located under "glade" folder.Change the folder path accordingly.Then rundebuild
. It will create a deb file. Install the deb file to check everything goes to proper location.Architecture: all
under package name. see this image as reference.