summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-04-28 10:26:22 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2011-04-28 10:26:22 +0200
commitc6971f6de60e441c8edfe38e192c84a179d173b1 (patch)
treebcac2fe291c34ea9d0c4ccd709ceef7d3684a8d1
parentc23fc7ddbee64dec63b4a2a2e91cb4c8a65babdf (diff)
parente10c31ccbf72f3408ed2ba6488989860b7d9a2a5 (diff)
downloadabrt-c6971f6de60e441c8edfe38e192c84a179d173b1.tar.gz
abrt-c6971f6de60e441c8edfe38e192c84a179d173b1.tar.xz
abrt-c6971f6de60e441c8edfe38e192c84a179d173b1.zip
Merge branch 'abrt/gen-version'
* abrt/gen-version: generate abrt version from git
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am18
-rw-r--r--abrt.spec.in (renamed from abrt.spec)16
-rw-r--r--configure.ac5
-rwxr-xr-xgen-version17
5 files changed, 32 insertions, 25 deletions
diff --git a/.gitignore b/.gitignore
index 7d1a59b9..291acaca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -117,6 +117,7 @@ po/.intltool-merge-cache
# misc
\#*
*~
+abrt.spec
# autogenerated soure file
src/gui-wizard-gtk/wizard_glade.c
diff --git a/Makefile.am b/Makefile.am
index 6f38997f..7201f608 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,8 @@ SUBDIRS = src po icons tests doc
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
-EXTRA_DIST = doc/coding-style abrt.spec abrt.pc.in doc/abrt-plugin/ doc/howto-write-reporter
+EXTRA_DIST = doc/coding-style abrt.spec.in abrt.pc.in doc/abrt-plugin/ doc/howto-write-reporter \
+ gen-version
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = abrt.pc
@@ -16,18 +17,15 @@ RPM_DIRS = --define "_sourcedir `pwd`" \
--define "_srcrpmdir `pwd`"
rpm: dist
+ ./gen-version
rpmbuild $(RPM_DIRS) -ba abrt.spec
srpm: dist
+ ./gen-version
rpmbuild $(RPM_DIRS) -bs abrt.spec
-test-rpm: dist
- rpmbuild --define "_buildid `date +%G%m%d%H%M%S`" \
- $(RPM_DIRS) -ba abrt.spec
-
-test-srpm: dist
- rpmbuild --define "_buildid `date +%G%m%d%H%M%S`" \
- $(RPM_DIRS) -bs abrt.spec
-
+# value for overriding from command line
+# e.g: make scratch-build DIST=f15
+DIST=rawhide
scratch-build: srpm
- koji build --scratch dist-f12 $(PACKAGE)-$(VERSION)-1.fc12.src.rpm
+ koji build --scratch dist-$(DIST) `make srpm | grep Wrote | cut -d' ' -f2`
diff --git a/abrt.spec b/abrt.spec.in
index 38ee7fd3..efe47ab0 100644
--- a/abrt.spec
+++ b/abrt.spec.in
@@ -7,22 +7,10 @@
%define with_systemd 0
%endif
-# please modify the "_buildid" define in a way that identifies
-# that the built package isn't the stock distribution package,
-# for example, by setting abbreviation sha1 hash "238f49f"
-#
-# % define _buildid git238f49f
-
-%if "0%{?_buildid}" != "0"
-%define pkg_release 0.%{?_buildid}%{?dist}
-%else
-%define pkg_release 1%{?dist}
-%endif
-
Summary: Automatic bug detection and reporting tool
Name: abrt
-Version: 2.0.2
-Release: %{?pkg_release}
+Version: @@ABRT_VERSION@@
+Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: https://fedorahosted.org/abrt/
diff --git a/configure.ac b/configure.ac
index ed5eeb37..be36b3f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,7 @@
-AC_INIT([abrt], [2.0.2], [crash-catcher@fedorahosted.org])
+AC_INIT([abrt],
+ m4_esyscmd([./gen-version]),
+ [crash-catcher@fedorahosted.org])
+
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign silent-rules])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
diff --git a/gen-version b/gen-version
new file mode 100755
index 00000000..b0af4fdb
--- /dev/null
+++ b/gen-version
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+DEF_VER=2.0.1
+
+if test -d .git -o -f .git
+then
+ VN=$(git describe --tags --match "[0-9]*" --abbrev=4 HEAD 2>/dev/null)
+ git update-index -q --refresh
+ test -z "$(git diff-index --name-only HEAD --)" || VN="$VN-dirty"
+ VN=$(echo "$VN" | sed -e 's/-/./g');
+else
+ VN="$DEF_VER"
+fi
+
+sed -e "s/@@ABRT_VERSION@@/$VN/g" < abrt.spec.in > abrt.spec
+
+echo -n $VN