You're pretty close with your example steps, but here's what I'd suggest:
- Grab the sources with
apt-get source wine
and cd
into the new directory
- Find what sort of patch system the wine package is based on:
what-patch
; in this case, it tells us we that the wine package uses quilt
for patch management
- Since we're using quilt, add your custom patch(es) to the quilt series:
QUILT_PATCHES=debian/patches quilt import <your-patchfile.patch>
If you have multiple patches, do this for each patch, in the order that you want them applied.
- Add a suitable entry to the
debian/changelog
file - you'll need to alter the version number to ensure that your PPA version is differentiated from the official version. Typically, you should increment the last version number, and add a tilde (~) followed by your custom version string (eg ~jbowtie1
). The dch -i
command can help with this too.
- Build the source package:
debuild -S
- Upload your source package to the PPA build system:
dput ppa:<your-ppa> ../wine*.changes
The <your-ppa> parameter is specified on the launchpad page for the PPA you want to upload it to (you'll have to create this beforehand).
It's usually a good idea to do a test build before doing the dput - the pbuilder
command allows you to recreate what the PPA build system would do with your package (ie, start from a clean install, add required deps, then build).
In this case you would have to set up pbuilder first (see https://wiki.ubuntu.com/PbuilderHowto), then do this before the dput
:
sudo pbuilder build ../*.dsc
Found one way to do it.
The trick is using two pinning clauses. The first to disallow ALL packages from the PPA and the second to select the ones you want.
So for the example above, I first add the ppa as usual:
$ sudo add-apt-repository ppa:webapps/preview
...
$ sudo apt-get update
...
Now if i run apt-cache policy, it will show me that there's a newer version of chromium-browser available and that it will install with an upgrade because it's in the same priority (500) as my current chromium-browser.
$ sudo apt-cache policy chromium-browser
chromium-browser:
Installed: 18.0.1025.168~r134367-0ubuntu0.12.04.1
Candidate: 20.0.1132.47~r144678-0precise1+webapps3
Version table:
20.0.1132.47~r144678-0precise1+webapps3 0
500 http://ppa.launchpad.net/webapps/preview/ubuntu/ precise/main amd64 Packages
*** 18.0.1025.168~r134367-0ubuntu0.12.04.1 0
500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/universe amd64 Packages
500 http://ppa.launchpad.net/chromium-daily/beta/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status
18.0.1025.151~r130497-0ubuntu1 0
500 http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
E: Unable to parse package file /etc/apt/preferences.d/webapps-preview-pin-400 (1)
$
That's great as far as that package but I don't want the others in this ppa (which also have a 500 priority) to install. Right now if I try to upgrade, I'll get more than just the chromium packages I want from that repository:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
bamfdaemon gwibber gwibber-service gwibber-service-facebook gwibber-service-twitter indicator-appmenu libbamf0 libbamf3-0 shotwell
The following packages will be upgraded:
chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg gwibber-service-identica indicator-messages indicator-status-provider-mc5
indicator-status-provider-pidgin libindicator-messages-status-provider1
8 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Need to get 25.3 MB of archives.
After this operation, 5,034 kB of additional disk space will be used.
Do you want to continue [Y/n]?
So what I can do is tell apt that I want all the packages in that ppa, webapps-preview in this case, to have a lower priority except the ones with "chromium" in their name. The mechanism for this is pinning a package
I create a file in /etc/apt/preferences.d/ with two clauses. The first one says give all the packages in the webapps-preview ppa a lower priority than the regular one (so that they are not preferred even if they have a higher version number. The second clause partly overrides the first by saying give the packages in that ppa with "chromium" in their name the same priority as other packages so that it will get installed (by it having a higher version number).
$ cat /etc/apt/preferences.d/webapps-preview-pin-400
Package: *
Pin: release o=LP-PPA-webapps-preview
Pin-Priority: 400
Package: *chromium*
Pin: release o=LP-PPA-webapps-preview
Pin-Priority: 500
To identify the correct string for "Pin: release" option we can use apt-cache policy again.
$ apt-cache policy
...
500 http://ppa.launchpad.net/webapps/preview/ubuntu/ precise/main i386 Packages
release v=12.04,o=LP-PPA-webapps-preview,a=precise,n=precise,l=preview,c=main
origin ppa.launchpad.net
...
For apt versions < 0.8.14 pinned packages have to be specified explicitly as wildcards do not work:
$ cat /etc/apt/preferences.d/webapps-preview-pin-400
Package: *
Pin: release o=LP-PPA-webapps-preview
Pin-Priority: 400
Package: chromium-browser chromium-codecs-ffmpeg chromium-browser-l10n chromium-codecs-ffmpeg-extra
Pin: release o=LP-PPA-webapps-preview
Pin-Priority: 500
And now, when i try to upgrade I get only the packages I want from that ppa and not the other ones. All nicely cherry picked for me:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.1 MB of archives.
After this operation, 5,026 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Best Answer
Your question is very broad, but I will try to give some guidance.
Contact the current ppa owner and coordinate your efforts. You can skin the cat more then one way, probably easiest to make a work group that maintains the ppa. Perhaps the old maintainer can (briefly) mentor you.
https://help.launchpad.net/Teams/CreatingAndRunning
If you do not know how to package, I highly suggest you read the packaging guidelines. http://packaging.ubuntu.com/html/
Launchpad / a ppa greatly automates much of the process, but nothing replaces at least a working knowledge of packaging, especially if you hope one day to have your package in the Debian / Ubuntu repositories.
On the flip side, improper packaging often causes problems / compatibility problems.
Next read the ppa tutorial - https://help.launchpad.net/Packaging/PPA