-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
51 lines (40 loc) · 1.2 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
TMP = $(CURDIR)/tmp
VERSION = $(shell grep ^Version edd.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/edd
else
PUSH_URL = fedorapeople.org:public_html/edd/testing
endif
PACKAGE = edd-$(VERSION)
DOCS = $(TMP)/$(PACKAGE)/docs
CSS = --stylesheet=style.css --link-stylesheet
FILES = LICENSE README.rst \
Makefile edd.spec \
edd docs
all: push clean
build:
mkdir -p $(TMP)/{SOURCES,$(PACKAGE)}
cp -a $(FILES) $(TMP)/$(PACKAGE)
cp docs/man.rst $(TMP)
tail -n+16 README.rst >> $(TMP)/man.rst
rst2man $(TMP)/man.rst | gzip > $(DOCS)/edd.1.gz
rst2html README.rst $(CSS) > $(DOCS)/index.html
tarball: build
cd $(TMP) && tar cfj SOURCES/$(PACKAGE).tar.bz2 $(PACKAGE)
rpm: tarball
rpmbuild --define '_topdir $(TMP)' -bb edd.spec
srpm: tarball
rpmbuild --define '_topdir $(TMP)' -bs edd.spec
packages: rpm srpm
push: packages
# Documentation & examples
scp $(DOCS)/*.{css,html} $(PUSH_URL)
# Archives & rpms
scp edd.spec \
$(TMP)/SRPMS/$(PACKAGE)* \
$(TMP)/RPMS/noarch/$(PACKAGE)* \
$(TMP)/SOURCES/$(PACKAGE).tar.bz2 \
$(PUSH_URL)/download
clean:
rm -rf $(TMP)