Not packaged for Precise
As you can see on the packages.ubuntu.com
site with a query, this isn't available in Precise (12.04), but only for Quantal (12.10) and newer.
Rather than installing from source, here's how to build your own package from the sources of Quantal.
Manual package build (backport)
This is a very very verbose description - for anyone building a package for the first time.
Install basic packages to build software and packages: build-essential
and devscripts
.
Go to the source package (gflags
) page at Launchpad: https://launchpad.net/ubuntu/+source/gflags
Unfold the section for "The Quantal Quetzal (supported) 2.0-1" version.
Locate the source package description file (.dsc
extension). At the time of writing this is https://launchpad.net/ubuntu/+archive/primary/+files/gflags_2.0-1.dsc
Copy the link to your clipboard.
Open a terminal and download the source package using dget
:
dget https://launchpad.net/ubuntu/+archive/primary/+files/gflags_2.0-1.dsc
This will fail the first time:
gpg: Signature made Thu 31 May 2012 14:48:41 CEST using RSA key ID 8AE09345
gpg: Can't check signature: public key not found
Validation FAILED!!
Install the required RSA key as in the error message above:
gpg --keyserver keyserver.ubuntu.com --recv-key 8AE09345
Configure the DPKG development scripts to use your GPG keyring:
echo 'DSCVERIFY_KEYRINGS="/etc/apt/trusted.gpg:~/.gnupg/pubring.gpg"' > ~/.devscripts
See Added key, but dget still shows "gpg: Can't check signature: public key not found" for why.
Run the earlier dget
command again. This should now succeed.
Hop into the directory created:
cd gflags-2.0/
Try building the package.
debuild -uc -us
Explanation for the options: unsigned changes file, unsigned new .dsc
file. As you are not redistributing the package, there's no need to sign anything.
This may fail due to missing build dependencies, e.g.:
dpkg-checkbuilddeps: Unmet build dependencies: debhelper
Note this is really system specific.
Install the build dependencies (satisfy all above from the output you get), e.g.:
sudo apt-get install debhelper
Try building the package again:
debuild -uc -us
One directory below, you'll find your packages, e.g.:
$ cd ..
$ ls -al *gflags*.deb
-rw-r--r-- 1 gert gert 108450 Jun 24 18:59 libgflags2_2.0-1_amd64.deb
-rw-r--r-- 1 gert gert 147590 Jun 24 18:59 libgflags-dev_2.0-1_amd64.deb
-rw-r--r-- 1 gert gert 14778 Jun 24 18:59 libgflags-doc_2.0-1_all.deb
Install them:
sudo dpkg -i *gflags*.deb
In case this fails because of binary dependencies not satisfied, run
sudo apt-get install -f
Done!
You can remove or update them any time, like any other package.
The next time you will build any package you will not have to go through all the hoops... in general the recipe is like:
dget <.dsc-file>
cd thefolder
debuild -uc -us
sudo dpkg -i ../*somepattern*.deb