blob: c4c2310e21dc3ce666429c4880965b490aeb72c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#
# generate rpm package source from current git branch
#
# location of rpm source files. We use dist automatically
# created by python distutils command
DISTDIR = ./dist
# determine current package version
RELEASE = $(shell git describe --tags --dirty --always)
TARFILE = $(DISTDIR)/$(RELEASE).tar.bz2
PREFIX = $(shell echo $(RELEASE) | cut -d '-' -f 1)
GITVERSION = $(shell echo $(RELEASE) | cut -d '-' -f 2-)
SPECFILE = $(DISTDIR)/python-$(PREFIX).spec
#
# Replace '-' with '_' in version to be rpm compatible
# This version is used in the spec file for the rpm
# version. The rpm version string will be different from
# the actual package version string. This will only be the
# case for git snapshot releases. Official releases based
# on git tagged version will have matching program/rpm version
# strings.
VERSION = $(shell echo $(GITVERSION) | tr '-' '_')
.PHONY : clean
all: $(SPECFILE)
info:
echo $(TARFILE)
clean:
rm -f $(DISTDIR)/*.tar.bz2
rm -f $(SPECFILE)
changelog:
git log > ChangeLog
$(TARFILE): changelog
python setup.py sdist --formats=bztar
$(SPECFILE): $(TARFILE)
cat ./spec/python-obsapi.spec.tmpl | sed "s/__version__/$(VERSION)/g" | sed "s/__gitversion__/$(GITVERSION)/g" > $(SPECFILE)
install:
python setup.py install --verbose
uninstall:
python setup.py uninstall --verbose
|