Home Home > GIT Browse > packaging
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2013-09-30 17:12:10 +0200
committerMichal Marek <mmarek@suse.cz>2013-09-30 17:12:10 +0200
commite505178475824a8dd2b8fbc3f09e94daea4e47bb (patch)
tree828e5dbdd07fc5a42a88614b7069187657d3b856
parentcb5d5b512620472726c1d1f81b75e13c765c06f4 (diff)
parenta80e5ef5b4db3fcbf42464887f5350218056fc8d (diff)
Merge branch 'packaging' into openSUSE-13.1
-rw-r--r--rpm/kernel-binary.spec.in4
-rw-r--r--rpm/kernel-docs.spec.in4
-rw-r--r--rpm/kernel-source.spec.in4
-rw-r--r--rpm/kernel-syms.spec.in4
-rwxr-xr-xrpm/mkspec24
5 files changed, 40 insertions, 0 deletions
diff --git a/rpm/kernel-binary.spec.in b/rpm/kernel-binary.spec.in
index 23a4c34b55..00b945c2de 100644
--- a/rpm/kernel-binary.spec.in
+++ b/rpm/kernel-binary.spec.in
@@ -60,7 +60,11 @@
Name: kernel-@FLAVOR@
Summary: @SUMMARY@
Version: @RPMVERSION@
+%if 0%{?is_kotd}
+Release: <RELEASE>.g@COMMIT@
+%else
Release: @RELEASE@
+%endif
License: GPL-2.0
Group: System/Kernel
Url: http://www.kernel.org/
diff --git a/rpm/kernel-docs.spec.in b/rpm/kernel-docs.spec.in
index 3118fc4db6..435a058726 100644
--- a/rpm/kernel-docs.spec.in
+++ b/rpm/kernel-docs.spec.in
@@ -25,7 +25,11 @@
Name: kernel-docs@VARIANT@
Summary: Kernel Documentation
Version: @RPMVERSION@
+%if 0%{?is_kotd}
+Release: <RELEASE>.g@COMMIT@
+%else
Release: @RELEASE@
+%endif
BuildRequires: docbook-toys docbook-utils ghostscript_any libjpeg-devel texlive transfig xmlto xorg-x11-devel
BuildRequires: kernel-source%variant
Url: http://www.kernel.org/
diff --git a/rpm/kernel-source.spec.in b/rpm/kernel-source.spec.in
index f646d19808..bea7ed4249 100644
--- a/rpm/kernel-source.spec.in
+++ b/rpm/kernel-source.spec.in
@@ -30,7 +30,11 @@
Name: kernel-source@VARIANT@
Summary: The Linux Kernel Sources
Version: @RPMVERSION@
+%if 0%{?is_kotd}
+Release: <RELEASE>.g@COMMIT@
+%else
Release: @RELEASE@
+%endif
License: GPL-2.0
Group: Development/Sources
Url: http://www.kernel.org/
diff --git a/rpm/kernel-syms.spec.in b/rpm/kernel-syms.spec.in
index cfc507cae7..201fa139f9 100644
--- a/rpm/kernel-syms.spec.in
+++ b/rpm/kernel-syms.spec.in
@@ -25,7 +25,11 @@ Name: kernel-syms@VARIANT@
Summary: Kernel Symbol Versions (modversions)
Version: @RPMVERSION@
%if %using_buildservice
+%if 0%{?is_kotd}
+Release: <RELEASE>.g@COMMIT@
+%else
Release: @RELEASE@
+%endif
%else
%define kernel_source_release %(LC_ALL=C rpm -q kernel-devel%variant-%version --qf "%{RELEASE}" | grep -v 'not installed' || echo 0)
Release: %kernel_source_release
diff --git a/rpm/mkspec b/rpm/mkspec
index 0c302b907a..48805aca6e 100755
--- a/rpm/mkspec
+++ b/rpm/mkspec
@@ -67,6 +67,8 @@ if ($srcversion =~ /^(\d+)(?:\.\d+)*(-rc\d+)?$/) {
$tarball_url = "";
}
+my $commit = get_commit();
+
my %macros = (
VARIANT => $variant,
VANILLA_ONLY => $vanilla_only,
@@ -75,6 +77,7 @@ my %macros = (
RPMVERSION => $rpmversion,
TARBALL_URL => $tarball_url,
RELEASE => $rpmrelease,
+ COMMIT => $commit,
SOURCES => $sources,
NOSOURCE => $nosource,
UNPACK_PATCHES => $unpack_patches,
@@ -303,6 +306,27 @@ sub provides_obsoletes {
return $res;
}
+sub get_commit {
+ my ($commit, $fh);
+
+ if (!open($fh, '<', "source-timestamp")) {
+ print STDERR "warning: source-timestamp: $!\n";
+ print STDERR "warning: Cannot determine commit id\n";
+ return "0000000";
+ }
+ while (<$fh>) {
+ if (/^GIT Revision: ([0-9a-f]{7})/) {
+ $commit = $1;
+ }
+ }
+ close($fh);
+ if (!$commit) {
+ print STDERR "warning: Commit id missing in source-timestamp file\n";
+ return "0000000";
+ }
+ return $commit;
+}
+
sub do_spec {
my $template = shift;
my $specfile = shift;