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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
SHELL = /bin/sh
VERSION := 2.3.4
SVNREPO = svn://svn.oetiker.ch/smokeping
############ A is for features
############ B is for bugfixes
############ V.AAABBB
############ 2.000001
############ 2.000002
NUMVERSION = 2.003004
IGNORE = ~|CVS|var/|smokeping-$(VERSION)/smokeping-$(VERSION)|cvsignore|rej|orig|DEAD|pod2htm[di]\.tmp|\.svn|tar\.gz|DEADJOE|svn-commit\.tmp
GROFF = groff
PERL = perl-5.8.8
.PHONY: man html txt ref examples check-examples patch killdoc doc tar rename-man symlinks remove-symlinks
.SUFFIXES:
.SUFFIXES: .pm .pod .txt .html .man .1 .3 .5 .7
DOCS = $(filter-out doc/smokeping_config.pod doc/smokeping.pod doc/smokeping.cgi.pod,$(wildcard doc/*.pod)) doc/smokeping_examples.pod # section 7
DOCSCONFIG := doc/smokeping_config.pod # section 5
PM := lib/Config/Grammar.pm lib/Smokeping.pm lib/Smokeping/Examples.pm lib/Smokeping/RRDtools.pm
PODPROBE := $(wildcard lib/Smokeping/probes/*.pm)
PODMATCH := $(wildcard lib/Smokeping/matchers/*.pm)
PODSORT := $(wildcard lib/Smokeping/sorters/*.pm)
DOCSBASE = $(subst .pod,,$(DOCS))
MODBASE = $(subst .pm,,$(subst lib/,doc/,$(PM))) \
$(subst .pm,,$(subst lib/,doc/,$(PODPROBE))) \
$(subst .pm,,$(subst lib/,doc/,$(PODMATCH))) \
$(subst .pm,,$(subst lib/,doc/,$(PODSORT)))
PROGBASE = doc/smokeping doc/smokeping.cgi doc/tSmoke
DOCSCONFIGBASE = doc/smokeping_config
BASE = $(DOCSBASE) $(MODBASE) $(PROGBASE) $(DOCSCONFIGBASE)
MAN = $(addsuffix .3,$(MODBASE)) $(addsuffix .5,$(DOCSCONFIGBASE)) $(addsuffix .7,$(DOCSBASE)) $(addsuffix .1,$(PROGBASE))
TXT = $(addsuffix .txt,$(BASE))
HTML= $(addsuffix .html,$(BASE))
POD2MAN = pod2man --release=$(VERSION) --center=SmokePing $<
MAN2TXT = $(GROFF) -man -Tascii $< > $@
# pod2html apparently needs to be in the target directory to get L<> links right
POD2HTML= cd $(dir $@); top="$(shell echo $(dir $@)|sed -e 's,doc/,,' -e 's,[^/]*/,../,g' -e 's,/$$,,')"; top=$${top:-.}; pod2html --infile=$(CURDIR)/$< --noindex --htmlroot=. --podroot=. --podpath=$${top} --title=$* | $${top}/../util/fix-pod2html.pl > $(notdir $@)
# we go to this trouble to ensure that MAKEPOD only uses modules in the installation directory
MAKEPOD= $(PERL) -I/home/oetiker/lib/fake-perl/ -Ilib -I/usr/pack/rrdtool-1.2svn-to/lib/perl -mSmokeping -e 'Smokeping::main()' -- --makepod
GENEX= $(PERL) -I/home/oetiker/lib/fake-perl/ -Ilib -I/usr/pack/rrdtool-1.2svn-to/lib/perl -mSmokeping -e 'Smokeping::main()' -- --gen-examples
doc/%.7: doc/%.pod
$(POD2MAN) --section 7 > $@
doc/%.5: doc/%.pod
$(POD2MAN) --section 5 > $@
doc/Smokeping.3: lib/Smokeping.pm
$(POD2MAN) --section 3 > $@
doc/Smokeping/Examples.3: lib/Smokeping/Examples.pm
$(POD2MAN) --section 3 > $@
doc/Smokeping/RRDtools.3: lib/Smokeping/RRDtools.pm
$(POD2MAN) --section 3 > $@
doc/Smokeping/probes/%.pod: lib/Smokeping/probes/%.pm
$(MAKEPOD) Smokeping::probes::$* > $@
doc/Smokeping/probes/%.3: doc/Smokeping/probes/%.pod
$(POD2MAN) --section 3 > $@
doc/Smokeping/matchers/%.3: lib/Smokeping/matchers/%.pm
$(POD2MAN) --section 3 > $@
doc/Smokeping/sorters/%.3: lib/Smokeping/sorters/%.pm
$(POD2MAN) --section 3 > $@
doc/Config/%.3: lib/Config/%.pm
$(POD2MAN) --section 3 > $@
doc/smokeping.1: bin/smokeping.dist
$(POD2MAN) --section 1 > $@
doc/smokeping.cgi.1: htdocs/smokeping.cgi.dist
$(POD2MAN) --section 1 > $@
doc/tSmoke.1: bin/tSmoke.dist
$(POD2MAN) --section 1 > $@
doc/%.html: doc/%.pod
$(POD2HTML)
doc/Smokeping.html: lib/Smokeping.pm
$(POD2HTML)
doc/Smokeping/Examples.html: lib/Smokeping/Examples.pm
$(POD2HTML)
doc/Smokeping/RRDtools.html: lib/Smokeping/RRDtools.pm
$(POD2HTML)
doc/Smokeping/matchers/%.html: lib/Smokeping/matchers/%.pm
$(POD2HTML)
doc/Smokeping/sorters/%.html: lib/Smokeping/sorters/%.pm
$(POD2HTML)
doc/Config/%.html: lib/Config/%.pm
$(POD2HTML)
doc/smokeping.html: bin/smokeping.dist
$(POD2HTML)
doc/smokeping.cgi.html: htdocs/smokeping.cgi.dist
$(POD2HTML)
doc/tSmoke.html: bin/tSmoke.dist
$(POD2HTML)
doc/%.txt: doc/%.1
$(MAN2TXT)
doc/%.txt: doc/%.3
$(MAN2TXT)
doc/%.txt: doc/%.5
$(MAN2TXT)
doc/%.txt: doc/%.7
$(MAN2TXT)
man: $(MAN)
html: symlinks $(HTML) remove-symlinks
txt: $(TXT)
rename-man: $(MAN)
for j in probes matchers sorters; do \
for i in doc/Smokeping/$$j/*.3; do \
if echo $$i | grep Smokeping::$$j>/dev/null; then :; else \
mv $$i `echo $$i | sed s,$$j/,$$j/Smokeping::$$j::,`; \
fi; \
done; \
done
mv doc/Config/Grammar.3 doc/Config/Config::Grammar.3
mv doc/Smokeping/Examples.3 doc/Smokeping/Smokeping::Examples.3
mv doc/Smokeping/RRDtools.3 doc/Smokeping/Smokeping::RRDtools.3
ref: doc/smokeping_config.pod
symlinks:
-ln -s bin/smokeping.dist doc/smokeping.pod
-ln -s htdocs/smokeping.cgi.dist doc/smokeping.cgi.pod
remove-symlinks:
-rm doc/smokeping.pod
-rm doc/smokeping.cgi.pod
examples:
$(GENEX)
check-examples:
$(GENEX) --check
doc/smokeping_config.pod: lib/Smokeping.pm
$(MAKEPOD) > $@
doc/smokeping_examples.pod: lib/Smokeping/Examples.pm etc/config.dist
$(GENEX)
killdoc:
-rm doc/*.[1357] doc/*.txt doc/*.html doc/Smokeping/* doc/Smokeping/probes/* doc/Smokeping/matchers/* doc/Smokeping/sorters/* doc/Config/* doc/examples/* doc/smokeping_examples.pod doc/smokeping_config.pod doc/smokeping.pod doc/smokeping.cgi.pod
doc: killdoc ref examples man html txt rename-man
# patch first so Smokeping.pm is older than smokeping_config.pod in the tarball
smokeping-$(VERSION).tar.gz:
$(PERL) -i~ -p -e 's/VERSION="\d.*?"/VERSION="$(NUMVERSION)"/' lib/Smokeping.pm
$(PERL) -i~ -p -e 's/Smokeping \d.*?;/Smokeping $(NUMVERSION);/' bin/smokeping.dist htdocs/smokeping.cgi.dist bin/tSmoke.dist
$(PERL) -i~ -p -e 'do { my @d = localtime; my $$d = (1900+$$d[5])."/".(1+$$d[4])."/".$$d[3]; print "$$d -- released version $(VERSION)\n\n" } unless $$done++ || /version $(VERSION)/' CHANGES
svn commit -m "prepare for the release of smokeping-$(VERSION)"
svn export $(SVNREPO)/trunk/software smokeping-$(VERSION)
rm -rf smokeping-$(VERSION)/qooxdoo
(cd smokeping-$(VERSION) && $(MAKE) doc)
tar czvf smokeping-$(VERSION).tar.gz --exclude '*.tmp' smokeping-$(VERSION)
rm -rf smokeping-$(VERSION)
dist: smokeping-$(VERSION).tar.gz
scp CHANGES smokeping-$(VERSION).tar.gz oposs@oss.oetiker.ch:public_html/smokeping/pub/
tag: dist
svn ls $(SVNREPO)/tags/$(VERSION) || \
svn copy -m "tagging version $(VERSION)" $(SVNREPO)/trunk/software $(SVNREPO)/tags/$(VERSION)
|