Skip to content

Commit c92d29c

Browse files
committed
Makefile: standardize on the one used in p-l-procfs
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 87829ff commit c92d29c

File tree

1 file changed

+19
-49
lines changed

1 file changed

+19
-49
lines changed

Makefile

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,26 @@
1-
PKGNAME = python-ethtool
2-
VERSION = $(shell grep version setup.py | cut -f 2 -d \' )
3-
TAG = $(PKGNAME)-$(VERSION)
4-
GITURL = git://git.kernel.org/pub/scm/linux/kernel/git/acme/$(PKGNAME).git
1+
PACKAGE := python-ethtool
2+
VERSION := $(shell rpm -q --qf '%{VERSION}' --specfile rpm/SPECS/$(PACKAGE).spec)
53

6-
all:
4+
rpmdirs:
5+
@[ -d rpm/BUILD ] || mkdir rpm/BUILD
6+
@[ -d rpm/RPMS ] || mkdir rpm/RPMS
7+
@[ -d rpm/SRPMS ] || mkdir rpm/SRPMS
8+
@[ -d rpm/SOURCES ] || mkdir rpm/SOURCES
79

8-
clean:
9-
-rm *.tar.gz python-ethtool/*.pyc
10-
-rm rpm/SOURCES/${PKGNAME}-$(VERSION).tar.bz2
11-
-rm -rf rpm/{BUILD,RPMS/*,SRPMS}/*
12-
python setup.py -q clean --all
10+
bz2: rpmdirs
11+
git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD | \
12+
bzip2 -9 > rpm/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2
1313

14-
install: all
14+
install:
1515
python setup.py install --root=$(DESTDIR)
1616

17-
tag:
18-
git tag $(TAG)
17+
rpm: bz2 rpmdirs
18+
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/$(PACKAGE).spec
1919

20-
push:
21-
@git tag -l | grep -q $(TAG) && \
22-
git push origin $(TAG) || \
23-
echo Not tagged.
20+
bz2dev: rpmdirs
21+
@mkdir -p /tmp/$(PACKAGE)-$(VERSION)
22+
@tar cf - `cat MANIFEST` | (cd /tmp/$(PACKAGE)-$(VERSION) ; tar xf -)
23+
@(cd /tmp; tar cf - $(PACKAGE)-$(VERSION)) | bzip2 -9 > rpm/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2
2424

25-
archive:
26-
@rm -rf /tmp/${PKGNAME}-$(VERSION) /tmp/${PKGNAME}
27-
@cd /tmp; git clone -q $(GITURL) $(PKGNAME)
28-
@mv /tmp/${PKGNAME} /tmp/${PKGNAME}-$(VERSION)
29-
@cd /tmp/${PKGNAME}-$(VERSION) ; git checkout $(TAG)
30-
@cd /tmp/${PKGNAME}-$(VERSION) ; python setup.py -q sdist
31-
@cp /tmp/${PKGNAME}-$(VERSION)/dist/${PKGNAME}-$(VERSION).tar.gz .
32-
@rm -rf /tmp/${PKGNAME}-$(VERSION)
33-
@echo "The archive is in ${PKGNAME}-$(VERSION).tar.gz"
34-
35-
local:
36-
@rm -rf ${PKGNAME}-$(VERSION).tar.gz
37-
@rm -rf /tmp/${PKGNAME}-$(VERSION) /tmp/${PKGNAME}
38-
@dir=$$PWD; cp -a $$dir /tmp/${PKGNAME}-$(VERSION)
39-
@cd /tmp/${PKGNAME}-$(VERSION) ; python setup.py -q sdist
40-
@cp /tmp/${PKGNAME}-$(VERSION)/dist/${PKGNAME}-$(VERSION).tar.gz .
41-
@rm -rf /tmp/${PKGNAME}-$(VERSION)
42-
@echo "The archive is in ${PKGNAME}-$(VERSION).tar.gz"
43-
44-
bz2:
45-
git archive --format=tar --prefix=${PKGNAME}-$(VERSION)/ HEAD | bzip2 -9 > rpm/SOURCES/${PKGNAME}-$(VERSION).tar.bz2
46-
47-
rpm: bz2
48-
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/${PKGNAME}.spec
49-
50-
bz2dev:
51-
@mkdir -p /tmp/${PKGNAME}-$(VERSION)
52-
@tar cf - `cat MANIFEST` | (cd /tmp/${PKGNAME}-$(VERSION) ; tar xf -)
53-
@(cd /tmp; tar cf - ${PKGNAME}-$(VERSION)) | bzip2 -9 > rpm/SOURCES/${PKGNAME}-$(VERSION).tar.bz2
54-
55-
rpmdev: bz2dev
56-
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/${PKGNAME}.spec
25+
rpmdev: bz2dev rpmdirs
26+
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/$(PACKAGE).spec

0 commit comments

Comments
 (0)