blob: 333394d83daf3a415ca7335e3d9a183917aa1516 (
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
48
49
50
51
52
53
54
55
56
|
PKGNAME = python-ethtool
VERSION = $(shell grep version setup.py | cut -f 2 -d \' )
TAG = $(PKGNAME)-$(VERSION)
GITURL = git://git.kernel.org/pub/scm/linux/kernel/git/acme/$(PKGNAME).git
all:
clean:
-rm *.tar.gz python-ethtool/*.pyc
-rm rpm/SOURCES/${PKGNAME}-$(VERSION).tar.bz2
-rm -rf rpm/{BUILD,RPMS/*,SRPMS}/*
python setup.py -q clean --all
install: all
python setup.py install --root=$(DESTDIR)
tag:
git tag $(TAG)
push:
@git tag -l | grep -q $(TAG) && \
git push origin $(TAG) || \
echo Not tagged.
archive:
@rm -rf /tmp/${PKGNAME}-$(VERSION) /tmp/${PKGNAME}
@cd /tmp; git clone -q $(GITURL) $(PKGNAME)
@mv /tmp/${PKGNAME} /tmp/${PKGNAME}-$(VERSION)
@cd /tmp/${PKGNAME}-$(VERSION) ; git checkout $(TAG)
@cd /tmp/${PKGNAME}-$(VERSION) ; python setup.py -q sdist
@cp /tmp/${PKGNAME}-$(VERSION)/dist/${PKGNAME}-$(VERSION).tar.gz .
@rm -rf /tmp/${PKGNAME}-$(VERSION)
@echo "The archive is in ${PKGNAME}-$(VERSION).tar.gz"
local:
@rm -rf ${PKGNAME}-$(VERSION).tar.gz
@rm -rf /tmp/${PKGNAME}-$(VERSION) /tmp/${PKGNAME}
@dir=$$PWD; cp -a $$dir /tmp/${PKGNAME}-$(VERSION)
@cd /tmp/${PKGNAME}-$(VERSION) ; python setup.py -q sdist
@cp /tmp/${PKGNAME}-$(VERSION)/dist/${PKGNAME}-$(VERSION).tar.gz .
@rm -rf /tmp/${PKGNAME}-$(VERSION)
@echo "The archive is in ${PKGNAME}-$(VERSION).tar.gz"
bz2:
git archive --format=tar --prefix=${PKGNAME}-$(VERSION)/ HEAD | bzip2 -9 > rpm/SOURCES/${PKGNAME}-$(VERSION).tar.bz2
rpm: bz2
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/${PKGNAME}.spec
bz2dev:
@mkdir -p /tmp/${PKGNAME}-$(VERSION)
@tar cf - `cat MANIFEST` | (cd /tmp/${PKGNAME}-$(VERSION) ; tar xf -)
@(cd /tmp; tar cf - ${PKGNAME}-$(VERSION)) | bzip2 -9 > rpm/SOURCES/${PKGNAME}-$(VERSION).tar.bz2
rpmdev: bz2dev
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/${PKGNAME}.spec
|