Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rpm package information: Auto incrementing version

Tags:

rpmbuild

I wondering if any one knew if there was a way to auto increment the Version/Release number for the information found in an rpm package.

i.e.

rpm -qil 'package_name'

Would return something like:

Name: package_name
Version: 1.5
Release: 000001

Is there a way to auto increment the release number every time i perform an rpmbuild? The rpm information is located in a spec file.

Thanks in advance!

like image 418
user459811 Avatar asked Dec 01 '25 17:12

user459811


1 Answers

If you don't mind having epoch as a release number, you could do this:

Release: 0.%(perl -e 'print time()')

The reason I put 0. in front is so if you want to ever use something other than epoch as the release tag, and not change the version, you can.

like image 112
Corey Henderson Avatar answered Dec 07 '25 17:12

Corey Henderson