Don't consider RHEL versions as developmental even if they're latest.
[pykickstart.git] / Makefile
blob60b42d932e41fd4c053542e31b3a870e99ea54ea
1 PKGNAME=pykickstart
2 VERSION=$(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
3 RELEASE=$(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g')
4 TAG=r$(VERSION)-$(RELEASE)
6 MANDIR=/usr/share/man
7 PREFIX=/usr
9 TESTSUITE:=tests/baseclass.py
11 PYCHECKEROPTS=--no-override --no-argsused --no-miximport --maxargs 0 --no-local -\# 0 --only -Q
13 default: all
15 all:
16 $(MAKE) -C po
18 docs:
19 mkdir -p docs
20 curl -A "pykickstart-build" -o docs/kickstart-docs.txt "http://fedoraproject.org/w/index.php?title=Anaconda/Kickstart&action=raw"
21 curl -A "programmers-guide" -o docs/programmers-guide "http://fedoraproject.org/w/index.php?title=PykickstartIntro&action=raw"
23 check:
24 @echo "*** Running pychecker to verify source ***"
25 PYTHONPATH=. pychecker $(PYCHECKEROPTS) pykickstart/*.py pykickstart/commands/*.py pykickstart/handlers/*.py
27 test:
28 @echo "*** Running unittests ***"
29 PYTHONPATH=. python $(TESTSUITE) -v
31 clean:
32 -rm *.tar.gz pykickstart/*.pyc pykickstart/commands/*.pyc pykickstart/handlers/*.pyc tests/*.pyc tests/commands/*.pyc docs/* ChangeLog
33 $(MAKE) -C po clean
34 python setup.py -q clean --all
36 install: all
37 python setup.py install --root=$(DESTDIR)
38 $(MAKE) -C po install
40 ChangeLog:
41 (GIT_DIR=.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
43 tag:
44 git tag -a -m "Tag as $(TAG)" -f $(TAG)
45 @echo "Tagged as $(TAG)"
47 archive: check test tag docs
48 @rm -f ChangeLog
49 @make ChangeLog
50 git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
51 mkdir -p $(PKGNAME)-$(VERSION)/docs/
52 cp docs/kickstart-docs.txt $(PKGNAME)-$(VERSION)/docs/
53 cp docs/programmers-guide $(PKGNAME)-$(VERSION)/docs/
54 cp ChangeLog $(PKGNAME)-$(VERSION)/
55 tar -rf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION)
56 gzip -9 $(PKGNAME)-$(VERSION).tar
57 rm -rf $(PKGNAME)-$(VERSION)
58 @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
60 local: docs
61 @rm -f ChangeLog
62 @make ChangeLog
63 @rm -rf $(PKGNAME)-$(VERSION).tar.gz
64 @rm -rf /tmp/$(PKGNAME)-$(VERSION) /tmp/$(PKGNAME)
65 @dir=$$PWD; cp -a $$dir /tmp/$(PKGNAME)-$(VERSION)
66 @cd /tmp/$(PKGNAME)-$(VERSION) ; python setup.py -q sdist
67 @cp /tmp/$(PKGNAME)-$(VERSION)/dist/$(PKGNAME)-$(VERSION).tar.gz .
68 @rm -rf /tmp/$(PKGNAME)-$(VERSION)
69 @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
71 rpmlog:
72 @git log --pretty="format:- %s (%ae)" $(TAG).. |sed -e 's/@.*)/)/'
73 @echo
75 bumpver:
76 @NEWSUBVER=$$((`echo $(VERSION) |cut -d . -f 2` + 1)) ; \
77 NEWVERSION=`echo $(VERSION).$$NEWSUBVER |cut -d . -f 1,3` ; \
78 DATELINE="* `date "+%a %b %d %Y"` `git config user.name` <`git config user.email`> - $$NEWVERSION-1" ; \
79 cl=`grep -n %changelog pykickstart.spec |cut -d : -f 1` ; \
80 tail --lines=+$$(($$cl + 1)) pykickstart.spec > speclog ; \
81 (head -n $$cl pykickstart.spec ; echo "$$DATELINE" ; make --quiet rpmlog 2>/dev/null ; echo ""; cat speclog) > pykickstart.spec.new ; \
82 mv pykickstart.spec.new pykickstart.spec ; rm -f speclog ; \
83 sed -i "s/Version: $(VERSION)/Version: $$NEWVERSION/" pykickstart.spec ; \
84 sed -i "s/version='$(VERSION)'/version='$$NEWVERSION'/" setup.py
86 .PHONY: check clean install tag archive local docs