-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (21 loc) · 992 Bytes
/
Copy pathMakefile
File metadata and controls
25 lines (21 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Minimal Makefile for building the source tarball that
# python-supportinfo.spec consumes. Downstream packagers can use this to
# produce a clean source archive without invoking setuptools directly.
PACKAGE = python-supportinfo
VERSION = $(shell awk -F'"' '/^version[[:space:]]*=/ { print $$2; exit }' pyproject.toml)
TARBALL = $(PACKAGE)-$(VERSION).tar.gz
STAGE = $(PACKAGE)-$(VERSION)
.PHONY: sources clean
sources:
@test -n "$(VERSION)" || (echo "ERROR: could not read version from pyproject.toml" && exit 1)
rm -rf $(STAGE) $(TARBALL)
mkdir -p $(STAGE)
cp -r src test LICENSE NOTICE README.md pyproject.toml setup.py $(STAGE)/
find $(STAGE) -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find $(STAGE) -name "*.pyc" -delete 2>/dev/null || true
find $(STAGE) -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
tar -czf $(TARBALL) $(STAGE)/
rm -rf $(STAGE)
@echo "Created $(TARBALL)"
clean:
rm -rf $(STAGE) $(TARBALL) build dist *.egg-info src/*.egg-info