Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rpm: another enhancements for the final versions
  • Loading branch information
perexg committed May 25, 2015
1 parent 6adcf7c commit 667da0c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 13 additions & 2 deletions rpm/Makefile
Expand Up @@ -27,22 +27,33 @@ VERSION ?= "0.0.0"
RELEASE ?= 1
ifeq ($(VERSION),$(RELEASE))
RELEASE = 1
COMMIT1 = $(COMMIT)
REF = $(COMMIT)
COMMITR = $(shell echo $(COMMIT) | sed "s/^v//")
else
REF = $(COMMIT1)
COMMITR = $(COMMIT1)
endif

tvheadend.spec: tvheadend.spec.in
@sed -e 's/@VERSION@/$(VERSION)/g' \
-e 's/@RELEASE@/$(RELEASE)/g' \
-e 's/@COMMIT@/$(COMMIT1)/g' \
-e 's/@REF@/$(REF)/g' \
-e 's/@COMMIT@/$(COMMITR)/g' \
$< > $@

~/rpmbuild/SOURCES:
mkdir -p $(foreach f,BUILD RPMS SOURCES SPECS SRPMS,~/rpmbuild/$(f))

.PHONY: srpm
srpm: ~/rpmbuild/SOURCES tvheadend.spec
spectool --get-files --sourcedir tvheadend.spec
rpmbuild -bs tvheadend.spec

.PHONY: build
build: ~/rpmbuild/SOURCES tvheadend.spec
spectool --get-files --sourcedir tvheadend.spec
rpmbuild -ba tvheadend.spec

.PHONY: clean.
clean:
rm -f tvheadend.spec
4 changes: 3 additions & 1 deletion rpm/tvheadend.spec.in
@@ -1,3 +1,4 @@
%global ref @REF@
%global commit @COMMIT@
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Expand All @@ -10,7 +11,7 @@ License: GPLv3
Group: Applications/Multimedia
URL: http://tvheadend.org

Source: https://github.com/tvheadend/tvheadend/archive/%{commit}/tvheadend-%{commit}.tar.gz
Source: https://github.com/tvheadend/tvheadend/archive/%{ref}/tvheadend-%{commit}.tar.gz
#Patch999: test.patch

BuildRequires: systemd-units >= 1
Expand Down Expand Up @@ -83,6 +84,7 @@ exit 0
%changelog
* Mon May 25 2015 Jaroslav Kysela <perex@perex.cz> v4.0.2
- fix requires (libs) and improve description
- add support for final version to Source

* Thu May 21 2015 Jaroslav Kysela <perex@perex.cz> v4.0.1
- changed versioning system (put changes and git hash to revision)
Expand Down

0 comments on commit 667da0c

Please sign in to comment.