Include git revision information in the RPMs, so we can have updates

even when the version doesn't change
This commit is contained in:
Philippe M. Chiasson 2011-04-19 12:09:57 -04:00
Родитель 2578afcc77
Коммит c23665112b
3 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -26,6 +26,8 @@ COVERAGE := coverage
PYLINT = $(BIN_DIR)/pylint
PKGS = linkdrop
GIT_DESCRIBE := `git describe | cut -d- -f2-3`
ifeq ($(TOPSRCDIR),)
export TOPSRCDIR = $(shell pwd)
endif
@ -111,7 +113,7 @@ rpm: f1.spec
$(PYTHON) setup.py bdist_rpm
f1.spec: f1.spec.in Makefile tools/makespec
tools/makespec $(version)$(tag) linkdrop.egg-info/requires.txt < f1.spec.in > f1.spec
tools/makespec $(version)$(tag) linkdrop.egg-info/requires.txt $(GIT_DESCRIBE) < f1.spec.in > f1.spec
build:
$(VIRTUALENV) --no-site-packages --distribute .

Просмотреть файл

@ -19,7 +19,7 @@
Name: %{f1_name_prefix}python%{pyver_sys}
Version: %%version%%
Release: 3%{?dist}
Release: 3%%git%%%{?dist}
Summary: Share Links Fast.
Group: Applications/Internet

Просмотреть файл

@ -2,8 +2,14 @@
use strict;
# The package version
my $version = shift;
# The list of requirements
my $requires = shift;
# The git revision
my $git = shift;
my ($git_cnt, $git_rev) = split('-', $git);
$git = $git_cnt . '.git.' . $git_rev;
my $prefix = "%{f1_name_prefix}python%{pyver}-";
@ -59,5 +65,6 @@ while (<>) {
s/%%version%%/$version/g;
s/%%buildrequires%%//g;
s/%%requires%%/$requires/g;
s/%%git%%/.$git/g;
print;
}