-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
66 lines (53 loc) · 1.78 KB
/
Makefile
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
TMP = $(CURDIR)/tmp
VERSION = $(shell grep ^Version python-nitrate.spec | sed 's/.* //')
# Push files to the production web only when in the master branch
ifeq "$(shell git rev-parse --abbrev-ref HEAD)" "master"
PUSH_URL = fedorapeople.org:public_html/python-nitrate
else
PUSH_URL = fedorapeople.org:public_html/python-nitrate/testing
endif
PACKAGE = python-nitrate-$(VERSION)
DOCS = $(TMP)/$(PACKAGE)/docs
EXAMPLES = $(TMP)/$(PACKAGE)/examples
CSS = --stylesheet=style.css --link-stylesheet
FILES = LICENSE README.rst \
Makefile python-nitrate.spec setup.py \
docs examples source
all: push clean
build:
mkdir -p $(TMP)/{SOURCES,$(PACKAGE)}
cp -a $(FILES) $(TMP)/$(PACKAGE)
rst2man README.rst | gzip > $(DOCS)/python-nitrate.1.gz
rst2html README.rst $(CSS) > $(DOCS)/index.html
rst2man $(DOCS)/notes.rst | gzip > $(DOCS)/nitrate-notes.1.gz
rst2html $(DOCS)/notes.rst $(CSS) > $(DOCS)/notes.html
rst2man $(DOCS)/nitrate.rst | gzip > $(DOCS)/nitrate.1.gz
rst2html $(DOCS)/nitrate.rst $(CSS) > $(DOCS)/nitrate.html
tarball: build
cd $(TMP) && tar cfj SOURCES/$(PACKAGE).tar.bz2 $(PACKAGE)
@echo ./tmp/SOURCES/$(PACKAGE).tar.bz2
version:
@echo "$(VERSION)"
rpm: tarball
rpmbuild --define '_topdir $(TMP)' -bb python-nitrate.spec
srpm: tarball
rpmbuild --define '_topdir $(TMP)' -bs python-nitrate.spec
packages: rpm srpm
# Python packaging
wheel:
python setup.py bdist_wheel
upload: wheel
twine upload dist/*.whl
push: packages
# Documentation
scp $(DOCS)/*.{css,html} $(PUSH_URL)
# Examples
scp $(EXAMPLES)/*.py $(PUSH_URL)/examples
# Archives & rpms
scp python-nitrate.spec \
$(TMP)/SRPMS/$(PACKAGE)* \
$(TMP)/RPMS/noarch/$(PACKAGE)* \
$(TMP)/SOURCES/$(PACKAGE).tar.bz2 \
$(PUSH_URL)/download
clean:
rm -rf $(TMP) build dist nitrate.egg-info source/*.pyc source/__pycache__