| 1 | RPMDIR := $(PWD)/redhat |
| 2 | PYTHON := python26 |
| 3 | SUBDIRS := BUILD RPMS RPMS/noarch SOURCES SPECS SRPMS |
| 4 | DIRS := $(foreach subdir,$(SUBDIRS),$(RPMDIR)/$(subdir)) |
| 5 | |
| 6 | rpm: init |
| 7 | python setup.py sdist -d $(RPMDIR)/SOURCES |
| 8 | rpmbuild --define "_topdir $(RPMDIR)" --define "python $(PYTHON)" -ba $(RPMDIR)/pure-sasl.spec |
| 9 | |
| 10 | init: testdir |
| 11 | mkdir -p $(DIRS) |
| 12 | |
| 13 | clean: testdir |
| 14 | rm -rf $(DIRS) |
| 15 | |
| 16 | testdir: |
| 17 | ifeq ($(wildcard setup.py),) |
| 18 | $(error Must be run from same directory as setup.py) |
| 19 | endif |