-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.mk
39 lines (30 loc) · 1.11 KB
/
package.mk
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
version = $(shell git describe)
short_version = $(shell git describe | sed -e 's/-g.*//')
major_version = $(shell git describe --abbrev=0)
minor_version = $(shell git describe | sed -e 's,[^-]*-,,')
path = $(realpath .)
base = $(shell basename $(path))
export DEBFULLNAME := Mika Eloranta
export DEBEMAIL := [email protected]
rpm:
echo "__version__ = '$(version)'" > poni/version.py
cd .. ; tar -zcv --exclude=*~ --exclude=.git -f $(base)-$(version).tar.gz $(base)
$(RM) poni/version.py
rpmbuild -ta ../$(base)-$(version).tar.gz \
--define 'full_version $(version)' \
--define 'major_version $(major_version)' \
--define 'minor_version $(subst -,_,$(minor_version))'
debian:
python setup.py sdist -d ..
cp "../poni-$(version).tar.gz" "../poni_$(short_version).orig.tar.gz"
echo | dh_make -b -i -p "poni_$(version)" -c blank -f "../poni-$(version).tar.gz"
rm debian/*ex debian/*EX debian/docs debian/README.Debian
cp debian.in/* debian/
dch -v $(version) -D unstable "TODO: message"
deb-debuild: debian
debuild -us -uc
deb-clean:
rm -rf debian/
deb: debian
dpkg-buildpackage -S -us -uc
.PHONY: debian