How do I copy a package from Debian to my PPA?
I'd like to add the latest gourmet package from Debian sid to our team's PPA so Ubuntu users who would like to run an up-to-date version of Gourmet can add that PPA to their software sources. (Dependency-wise, that shouldn't be much of an issue as pretty much all our current dependencies are already available in all currently supported Ubuntu versions.)
I've downloaded the *.dsc
file and debian and orig tarballs, and even figured out I could use this for the package's source.changes
file. I also downloaded the Debian maintainer's public key so dput
can validate the package. I then tried to upload the package to our PPA using dput ppa:~gourmet/ppa gourmet_0.17.3-1_source.changes
(I also tried without the tilda.)
This seemed to succeed, but I didn't get a confirmation email, and no packages are now displayed at our PPA, which leads me to believe that the package was rejected because the Debian maintainer's key is obviously not among our team members' keys.
So what's the easiest way to "copy" a package from Debian (sid) to a Launchpad PPA? Do I really need to rebuild the entire package locally before I can upload it?
Solution 1:
You do need to rebuild the source package locally before uploading in order to adjust the change log and regenerate the changes file. Though since backporting a package is a pretty common task, this has been scripted. Check out the backportpackage
command ubuntu-dev-tools package.
To backport a package from Debian, simply provide the target distro series, PPA, and the dsc file for the package:
backportpackage -d trusty -u ppa:gourmet/ppa http://ftp.de.debian.org/debian/pool/main/g/gourmet/gourmet_0.17.3-1.dsc
It's even simpler to backport a package from one Ubuntu release to another since you don't need to find the dsc file. Let's say we want to backport from utopic to trusty:
backportpackage -s utopic -d trusty -u ppa:gourmet/ppa gourmet
Solution 2:
There are a few ways to do this.
When I did this for Rhythmbox I followed the following receipe:
a. Take the source file and the debian files
b. Uncompress the source (.orig.tar.xz)
c. rename the source folder something like rhythmbox-3.0.3
c. uncompress the debian file (.debian.tar.xz)
d. move the debian folder under the source directory
e. dch -i
to change the changelog file
f. change the "unstable" package name to the name of the ubuntu target - here I've used precise for 12.04. Change the version as appropriate for your app. Here rhythmbox was 3.0.3 - so I've just added -1~ppafossfreedom
rhythmbox (3.0.3-1~ppafossfreedom) precise; urgency=low
* rebuild
-- fossfreedom <[email protected]> Thur, 07 Jun 2012 13:19:18 +0100
g. create a new source package: dh_build --createorig
h. Build just the source with your key: debuild -S -k0xABCDEFG
where ABCDEFG
is your key
i. upload your package for building:
cd ..
dput ppa:fossfreedom/rhythmbox rhythmbox_3.0.3-1_sources.changes