diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-08-07 17:46:42 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-08-07 17:46:42 -0300 |
commit | c92d29c9544a20731aede14332cf02b18aabd740 (patch) | |
tree | 7af137c969204017d029d2d92b9ae5122553e73c /Makefile | |
parent | 87829ffadf56518f04583a8b1d5f89c7c15ce499 (diff) | |
download | python-ethtool-c92d29c9544a20731aede14332cf02b18aabd740.tar.gz python-ethtool-c92d29c9544a20731aede14332cf02b18aabd740.tar.xz python-ethtool-c92d29c9544a20731aede14332cf02b18aabd740.zip |
Makefile: standardize on the one used in p-l-procfs
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 68 |
1 files changed, 19 insertions, 49 deletions
@@ -1,56 +1,26 @@ -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 +PACKAGE := python-ethtool +VERSION := $(shell rpm -q --qf '%{VERSION}' --specfile rpm/SPECS/$(PACKAGE).spec) -all: +rpmdirs: + @[ -d rpm/BUILD ] || mkdir rpm/BUILD + @[ -d rpm/RPMS ] || mkdir rpm/RPMS + @[ -d rpm/SRPMS ] || mkdir rpm/SRPMS + @[ -d rpm/SOURCES ] || mkdir rpm/SOURCES -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 +bz2: rpmdirs + git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD | \ + bzip2 -9 > rpm/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2 -install: all +install: python setup.py install --root=$(DESTDIR) -tag: - git tag $(TAG) +rpm: bz2 rpmdirs + rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/$(PACKAGE).spec -push: - @git tag -l | grep -q $(TAG) && \ - git push origin $(TAG) || \ - echo Not tagged. +bz2dev: rpmdirs + @mkdir -p /tmp/$(PACKAGE)-$(VERSION) + @tar cf - `cat MANIFEST` | (cd /tmp/$(PACKAGE)-$(VERSION) ; tar xf -) + @(cd /tmp; tar cf - $(PACKAGE)-$(VERSION)) | bzip2 -9 > rpm/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2 -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 +rpmdev: bz2dev rpmdirs + rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/$(PACKAGE).spec |