wiki:VagrantBuild

Version 6 (modified by jlarouche, 11 years ago) ( diff )

--

For this example we'll rebuild the GDAL Precise package.

  1. Let's download the files we need from Launchpad. We need to download the .orig.tar.gz, .debian.tar.gz and .dsc.

This step can be done in the Host machine.

$ cd ~/vm/ubuntugis/packages
$ mkdir gdal
$ cd gdal
$ wget https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable/+files/gdal_1.10.0.orig.tar.gz
$ wget https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable/+files/gdal_1.10.0-1~precise1.debian.tar.gz
$ wget https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable/+files/gdal_1.10.0-1~precise1.dsc
  1. With these files downloaded, we simply need to extract the .dsc

This step can be done in the host machine

$ dpkg-source -x gdal_1.10.0-1~precise1.dsc gdal
  1. Then you can cd into the folder and update the changelog for a rebuild or make change to the package if you want.

This step should be done in the VM

# On the host
$ vagrant up && vagrant ssh
# in the VM
$ cd /vagrant/packages/gdal/gdal
$ dch -p -D precise -l precise "Launchpad rebuild for Precise"

You can then open debian/changelog and add entries if you have made other changes to the package. You can also use Quilt to modify or create patches for the package, the patches are located in (debian/patches)

  1. With the changelog updated, we can now create the debian source package.

This step should be done in the VM

$ debuild -S -sd

If you are building a new package or a new version that is not already on Launchpad, you have to use debuild -S -sa that way dput will also upload the .orig.tar.gz

  1. Now we can try the build using pbuilder-dist

This step should be done in the VM

$ pbuilder-dist precise amd64 build ../gdal_1.10.0-1~precise2.dsc

Since the source packages are uploaded to Launchpad to be built and used with UbuntuGIS, we only use pbuilder to test the build since it's faster then uploading it first to see if it works. Pbuilder will create the .deb in ~/pbuilder/precise_result/ so you could use the .deb there if you want.

  1. If the build succeeded, we are now ready to upload the package to UbuntuGIS-unstable.

This step should be done in the VM

$ dput ubuntugis-unstable ../gdal_1.10.0-1~precise2_source.changes

That's it! The package is uploaded to Launchpad to be built and published.

Note: See TracWiki for help on using the wiki.