Bzr
Experimenting with Bazaar (bzr)
The desktop team is considering using Bazaar (bzr) for packaging work. Some packages have been added to bzr to evaluate the workflow, but things like editing patches are not easy enough yet so there is no requirement to update bzr when uploading a new revision of one of those packages. You are welcome to try using bzr for packaging though and let us know what you think about it and make suggestions on changes we could do there.
Ensure that you have Bazaar Builddeb, package bzr-builddeb, installed on your computer, in addition to bzr.
You need to be member of the ubuntu-desktop team on launchpad to commit. You need be a known contributor to be added to the team since it gives you commit rights. Only the debian/ directory is stored in bzr (merge mode of bzr-builddeb).
List of the desktop team packages
You can see the list of packages available in our Bazaar repository here.
Adding a package using bzr
Below, "package_name" is the name of the source package and "userid" your username on launchpad. Launchpad require to use the same name as a registred product (Please don't start adding all the desktop packages now, we want to try how bzr is working for us on a given set of package before switching)
apt-get source <package_name>
- lsdiff -z *.diff.gz
-> Ensure every files are listed in debian/ directory. If not, ping a ubuntu-desktop team member
mv package_name-<version> ubuntu
- cd ubuntu
- bzr init
- mkdir .bzr-builddeb
echo -e '[BUILDDEB]\nmerge = True\nignore-unknowns = True' > .bzr-builddeb/default.conf
- bzr add debian .bzr-builddeb/default.conf
- bzr clean-tree
- Ensure that everything's correct:
- ls -a
- .. .bzr .bzr-builddeb debian
- Eventually, change watch file to adress unstable version
- uscan --verbose --report
-> if a newer unstable version is available and not listed there, update the watch file accordingly
- uscan --verbose --report
- add in debian/control.in:
Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/<package_name>/ubuntu
generate debian/control from debian/control.in with DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean (clean target normally has an instruction to generate debian/control from debian/control.ini)
bzr commit -m "initial <package_name> import"
=> If you are a member of the ubuntu-desktop team : you can push it to lp:~ubuntu-desktop/<package_name>/ubuntu
=> Otherwise push it somewhere like in your personal LP code page: bzr push lp:~<userid>/<packgage_name>/ubuntu
Ask for someone on #ubuntu-desktop for merging it into #ubuntu-desktop branch
Getting a package
- bzr branch lp:~ubuntu-desktop/package_name/ubuntu
Building a package
- bzr branch lp:~ubuntu-desktop/package_name/ubuntu
- cd ubuntu
- bzr-buildpackage or bzr bd
- If debian/watch is properly set, this will download the orig.tar.gz tarball for you.
you can add --builder pdebuild if you use pbuilder.
Building a source package
- bzr branch lp:~ubuntu-desktop/package_name/ubuntu
- cd ubuntu
- bzr bd-do
- Note: you will be set in a subshell where "exit 0" will take into account any changes in debian/ directory back into the initial branch. You will probably, once your work done, exit with "exit 1".
- and there... debuild -S
Updating a package
- bzr branch lp:~ubuntu-desktop/package_name/ubuntu
- Ensure that debian/watch is looking at unstable version if available. Otherwise, update it. (uscan --verbose --report to see what is the latest version corresponding to debian/watch regexp)
- dch -vversion and edit changelog.
- # do the traditionnal hack
You can add some files to debian/ by bzr add ... or removing them executing bzr rm ...
If you want to see the full tree (with files coming from .orig.tar.gz) to retrieve automagically, for instance, the NEWS file from upstream, you can try: bzr bd-do. You will be dropped in a subshell
- there, you can patch the files with dpatch/quilt/simple-patch-sys.
- To exit :
- exit 1 to exit without any changes taken into account.
- exit 0 copy back changes in debian/ directory in the branch.
- Note: It will automatically download the new .orig.tar.gz the first time, accordingly to debian/watch
- Note for packages using autotools (many of ubuntu desktop package does)
diff -u <oldversion>/configure.in build-area/<new-version>/configure.in to see impacts in configure.in (dependencies, etc.)
to generate debian/patch/<autotools_patch>, do not delete this file before doing bzr bd-do, otherwise bzr will shout. Solution:
- bzr bd-do
echo "" > debian/patch/<autotools_patch>
quilt push -f debian/patch/<autotools_patch>
- quilt add *
- autoconf...
dh_install --list-missing to see files that may miss you in the debian package if you don't handle them properly
bzr status to ensure that everything that is listed is correct
debcommit (it will copy then the changelog file)
add a tag with bzr tag corresponding to the version.
=> If you are a member of the ubuntu-desktop team : you can push it to lp:~ubuntu-desktop/<package_name>/ubuntu
=> Otherwise push it somewhere like in your personal LP code page (after having created the branch there): bzr push lp:~<userid>/<packgage_name>/ubuntu (--use-existing-dir if it is the first time)
Uploads to the team archive for sponsoring
You can read https://help.launchpad.net/PPA about how to use the team archive; we will use this for sponsoring.