-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (42 loc) · 1.7 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
XSLTPROC=/usr/bin/xsltproc
DSSSL=docbook-xsl/docbook.xsl
TMPDIR=$(shell mktemp -d --suffix=.tmp -p /tmp management.html.XXXXXX)
WORKSPACE=~/workspace
PROJECT=Management
DOCBOOK=management
PUBLIC_HTML=~/public_html
PROJECT_DIR=$(WORKSPACE)/$(PROJECT)
HTML_DIR=$(PUBLIC_HTML)/$(DOCBOOK)
HTMLHELP_DIR=~/htmlhelp/$(DOCBOOK)/htmlhelp
#HTMLHELP=$(PUBLIC_HTML)/download/$(date +%Y)/chm/Netkiller$(PROJECT).chm
HTMLHELP=../Netkiller$(PROJECT).chm
all: git html htmlhelp
git:
@git pull
@git submodule init
@git submodule update
html: git
@mkdir -p ${HTML_DIR}
@find ${HTML_DIR} -type f -iname "*.html" -exec rm -rf {} \;
@rsync -au common/docbook.css $(HTML_DIR)/
@$(XSLTPROC) -o $(HTML_DIR)/ $(DSSSL) $(PROJECT_DIR)/book.xml
@$(shell test -d $(HTML_DIR)/images && find $(HTML_DIR)/images/ -type f -exec rm -rf {} \;)
@$(shell test -d images && rsync -au $(PROJECT_DIR)/images $(HTML_DIR)/)
htmlhelp:
@rm -rf $(HTMLHELP_DIR) && mkdir -p $(HTMLHELP_DIR)
@test -d $(PROJECT_DIR)/images && rsync -a images $(HTMLHELP_DIR)
@${XSLTPROC} -o $(HTMLHELP_DIR)/ --stringparam htmlhelp.chm $(HTMLHELP) ../docbook-xsl/htmlhelp/template.xsl book.xml
@test -f $(HTMLHELP_DIR)/htmlhelp.hhp && ../common/chm.sh $(HTMLHELP_DIR)
rpm:
rpmbuild -ba --sign ../Miscellaneous/package/package.spec --define "book $(DOCBOOK)"
rpm -qpi ~/rpmbuild/RPMS/x86_64/netkiller-$(DOCBOOK)-*.x86_64.rpm
rpm -qpl ~/rpmbuild/RPMS/x86_64/netkiller-$(DOCBOOK)-*.x86_64.rpm
article:
DSSSL=../docbook-xsl/article.xsl
DATE=$(shell date --iso-8601)
$(XSLTPROC) $(DSSSL) article.xml > $(PUBLIC_HTML)/journal/devops.html
$(shell test -d images && rsync -auv images $(PREFIX)/)
clean:
rm -rf $(HTML)
test:
@$(XSLTPROC) -o $(TMPDIR)/ $(DSSSL) $(PROJECT_DIR)/book.xml