Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically bump versions when building a Debian package

I have a set of Debian packaging scripts and I would like the version number of the package to be incremented each time it is built. (i.e. debian_revision as specified in the Debian Policy Manual) That is, the first build should be PACKAGE-1.0-0, then PACKAGE-1.0-0, and so on (where 1.0 is the upstream_version). Is there an easy way to specify this "extra" version number without having to create a new entry in the changelog?

I'm looking to have this automatically done by the Makefile for the project whenever a particular target (i.e. deb is built)

like image 349
Michael Mior Avatar asked Jul 26 '10 20:07

Michael Mior


People also ask

What does dpkg-Buildpackage do?

dpkg-buildpackage is a program that automates the process of building a Debian package. It consists of the following steps: 1. It prepares the build environment by setting various environment variables (see ENVIRONMENT), runs the init hook, and calls dpkg-source --before-build (unless -T or --target has been used).

How do I Debianize a package?

Debianize the package by using dh_make or one of the other automatic packaging tools. File debian/control: Add to the Build-Depends (sometimes even Build-Depends-Indep) the list of packages needed to be installed for the application to compile (remember the list done previously).

What is Dh_make?

dh_make is a tool to convert a regular source code package into one formatted according to the requirements of the Debian Policy. dh_make must be invoked within a directory containing the source code, which must be named <packagename>-<version>. The <packagename> must be all lowercase, digits and dashes.

What is Debhelper in Linux?

Debhelper is used to help you build a Debian package. The philosophy behind debhelper is to provide a collection of small, simple, and easily understood tools that are used in debian/rules to automate various common aspects of building a package. This means less work for you, the packager.


1 Answers

dh_* scripts read debian/changelog to build a changes file and set the versions, among other things. You should not change the version without editing the changelog, but if your problem is changes made manually you can make a script that invokes

dch -i

or if your problem is changes made at the debian/changelog, you can make a bash script to change the version automatically.

like image 61
fakeroot Avatar answered Sep 21 '22 15:09

fakeroot