| 1 |
PYTHON := python3 |
| 2 |
BUILD_HELPER := ./build-helper |
| 3 |
|
| 4 |
VERSION = $(shell $(BUILD_HELPER) --version) |
| 5 |
RELEASE = $(shell $(BUILD_HELPER) --release) |
| 6 |
DATE = $(shell LC_ALL=C date +'%a %b %d %Y') |
| 7 |
TARBALL = argparse_manpage-$(VERSION).tar.gz |
| 8 |
|
| 9 |
all: argparse-manpage.spec $(TARBALL) |
| 10 |
|
| 11 |
.PHONY: $(TARBALL) |
| 12 |
$(TARBALL): |
| 13 |
rm -f $(TARBALL) |
| 14 |
cd .. && python -m build && cp "dist/argparse_manpage-$(VERSION).tar.gz" rpm/ |
| 15 |
|
| 16 |
argparse-manpage.spec: argparse-manpage.spec.tpl ../setup.py |
| 17 |
@echo " GEN $@" ; \ |
| 18 |
rm -f "[email protected]" ; \ |
| 19 |
sed -e "s|@VERSION@|$(VERSION)|g" \ |
| 20 |
-e "s|@RELEASE@|$(RELEASE)|g" \ |
| 21 |
-e "s|@DATE@|$(DATE)|g" \ |
| 22 |
$< > [email protected] ; \ |
| 23 |
chmod 0444 "[email protected]" ; \ |
| 24 |
mv -f "[email protected]" "$@" # move when successful |
| 25 |
|
| 26 |
srpm: all |
| 27 |
dir=`pwd` ; \ |
| 28 |
rm *.src.rpm ; \ |
| 29 |
rpmbuild --define "_sourcedir $$dir" \ |
| 30 |
--define "_rpmdir $$dir" \ |
| 31 |
--define "_builddir $$dir" \ |
| 32 |
--define "_specdir $$dir" \ |
| 33 |
--define "_srcrpmdir $$dir" \ |
| 34 |
-bs *.spec |
| 35 |
|
| 36 |
clean: |
| 37 |
rm -rf *.src.rpm *.tar.gz *.spec noarch |