COMMIT ?= $(shell git rev-parse HEAD)
COMMIT1 = $(shell git rev-parse $(COMMIT))
-VERSION = $(shell cd .. && git describe --match "v*" $(COMMIT1) | sed -e 's/-/./g' -e 's/^v//g' )
+FVERSION = $(shell cd .. && git describe --match "v*" $(COMMIT1) | sed "s/^v//")
+VERSION = $(shell echo "$(FVERSION)" | cut -d '-' -f 1)
+RELEASE = $(shell echo "$(FVERSION)" | cut -d '-' -f 2-10 | sed "s/-/~/g")
+VERSION ?= "0.0.0"
+RELEASE ?= 1
+ifeq ($(VERSION),$(RELEASE))
+RELEASE = 1
+endif
tvheadend.spec: tvheadend.spec.in
@sed -e 's/@VERSION@/$(VERSION)/g' \
+ -e 's/@RELEASE@/$(RELEASE)/g' \
-e 's/@COMMIT@/$(COMMIT1)/g' \
$< > $@
Summary: Tvheadend - a TV streaming server and DVR
Name: tvheadend
Version: @VERSION@
-Release: 1
+Release: @RELEASE@
License: GPLv3
Group: Applications/Multimedia
BuildRequires: dbus-devel
BuildRequires: avahi-libs
BuildRequires: openssl-devel
+BuildRequires: libdvbv5-devel
BuildRequires: git wget python
Requires: systemd-units >= 1
#%patch999 -p1 -b .test
%build
-echo %{version} > %{_builddir}/%{buildsubdir}/rpm/version
+echo %{version}-%{release} > %{_builddir}/%{buildsubdir}/rpm/version
%ifarch %arm
%configure --disable-lockowner --enable-bundle --disable-libffmpeg_static
%else
%{_unitdir}/*
%changelog
+* Thu May 21 2015 Jaroslav Kysela <perex@perex.cz> v4.0.1
+- add libdvbv5-devel to BuildRequires
+- changed versioning system (put changes and git hash to revision)
+
* Thu May 14 2015 Jaroslav Kysela <perex@perex.cz> v3.9-2842
- add python to BuildRequires