File: Makefile

package info (click to toggle)
man2html 1.5-23.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 344 kB
  • ctags: 218
  • sloc: ansic: 3,889; awk: 241; sh: 224; makefile: 124
file content (161 lines) | stat: -rw-r--r-- 4,950 bytes parent folder | download | duplicates (2)
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
#
# vh-man2html
# -----------
#
# Makefile
#                                                             Michael Hamilton 
#                                                        michael@actrix.gen.nz
# ----------------------------------------------------------------------------
# Set these to your desires...
# They over ride the defaults built into the C code and scripts.
#
# CGIBASE is defined relative to the current server.
# If CGIBASE starts with a relative "http:..." address (ie not "http://.."),
# man2html will insert the httpd's server name (as reported by the 
# SERVER_NAME environment variable) into server any redirects it generates
#  ie a redirect of        location: http:/cgi-bin/...
#     will be returned as  location: http://server_name/cgi-bin/...
# This is so that remote browsers will receive the necessary server 
# address on redirects.
#
# Installation configuration:
#
CACHE_DIR  = $(DEST)/var/cache/man2html
CGI_BIN    = cgi-bin
CGI_DIR    = $(DEST)/usr/lib/cgi-bin
CGIBASE    = http:/$(CGI_BIN)/man2html
HTTP_HOME  = $(DEST)/usr/share/doc/man2html
HTML_DIR   = $(HTTP_HOME)/html
OWNER      = root.root
BIN_DIR    = $(DEST)/usr/bin
MAN_DIR1   = $(DEST)/usr/share/man/man1
MAN_DIR8   = $(DEST)/usr/share/man/man8

#
# Man config file as per Linux man-1.4g.
# Comment out if there is no man.config file - in which case you will
# have to edit man2html.c to alter the man path.
#
MAN_CONFIG = /etc/manpath.config

#
# Man2html Uses popen with man.config decompressor info to decompress man
# source.  The popen parameters are checked for possible hacking attempts,
# and strings passed to man2html are prevented from over-running memory.
# Uncomment the following to disable this feature.  This makes the cgi 
# program more secure - i.e. no popen() calls.
#
# DISABLE_ZCATS = TRUE

#
# If the following is defined the man2html -M option can be used to point
# man2html at man pages outside of the normal hierarchy.  By default (in 
# version 1.4 and above) -M only allows the user to select what part of 
# the hierarchy to search first - they cannot specify a path outside of
# the official hierarchy.
#
# UNSECURE_MANPATH = TRUE
#

#
# Programs used:
#
AWK_PROG   = /usr/bin/awk
MAN_PROG   = /usr/bin/man
FIND_PROG  = /usr/bin/find
EGREP_PROG = /usr/bin/egrep


#
# Compiler options:
# -fno-strength-reduce is in case this gcc has a bug.
#
DEFINES = -DTOPLEVELDOC='"$(TOPLEVELDOC)"' -DCGIBASE='"$(CGIBASE)"' -DMAN_CONFIG='"$(MAN_CONFIG)"'
#
CFLAGS = -O2 -pipe -g -Wall -Wshadow $(DEFINES)
#CFLAGS = -O0 -g -fno-strength-reduce $(DEFINES)

#
# Installer program:
#
INSTALL = install


# UNLESS YOU WANT TO CHANGE THE RPM CONFIG, NOTHING BELOW THIS LINE NEEDS
# EDITING.
# ----------------------------------------------------------------------------
#
# The name of the cwd must be PACKAGENAME in order to build an rpm
#
# The following are used to construct source and binary rpm's.
RPM_PROG = rpm-1.4
PACKAGENAME = vh-man2html-1.5
TARFILE =  $(PACKAGENAME).tar.gz
SPECFILE = $(PACKAGENAME).spec
SPECLOC = /usr/src/SPECS
SOURCELOC = /usr/src/SOURCES
#
# The following commands will edit the scripts - works on freshly untar'ed
# source only (ie can't be undone by reapplication).
#
SED_SCRIPT = \
 -e s?/home/http/cgi-bin?$(CGI_DIR)?g \
 -e s?/home/http/html?$(HTML_DIR)?g \
 -e s?/var/cache/man2html?$(CACHE_DIR)?g \
 -e s?/usr/bin/awk?$(AWK_PROG)?g \
 -e s?/usr/bin/man?$(MAN_PROG)?g \
 -e s?/usr/bin/find?$(FIND_PROG)?g \
 -e s?http:/cgi-bin/man?http:/$(CGI_BIN)/man?g \
 -e s?/usr/bin/egrep?$(EGREP_PROG)?g
#
TOPLEVELDOC = $(HTML_DIR)/man.html
#
#
INCLUDES =
BROWSER = netscape-man
SCRIPTS = mansearch
HTML_FILES =  man.html mansearch.html mansearchhelp.html
SERVER_FILES = man2html manwhatis $(SCRIPTS)
DIST_FILES = $(BROWSER) $(SCRIPTS) $(HTML_FILES) man2html.8 netscape-man.1 


targets: man2html manwhatis $(DIST_FILES)

man2html: man2html.c
	$(CC) $(CFLAGS) $< -o $@

manwhatis: manwhatis.c
	$(CC) $(CFLAGS) $< -o $@

$(DIST_FILES): Makefile $(addprefix dist/,$(DIST_FILES))
	sed $(SED_SCRIPT) dist/$@ > $@

install: targets
	strip man2html
	for i in $(SERVER_FILES); do \
	  $(INSTALL) -p $$i $(CGI_DIR) ; \
	  chown $(OWNER) $(CGI_DIR)/$$i ; \
	done
	ln $(CGI_DIR)/manwhatis $(CGI_DIR)/mansec
	for i in $(HTML_FILES); do \
	  $(INSTALL) -p $$i $(HTML_DIR) ; \
	  chown $(OWNER) $(HTML_DIR)/$$i ; \
	done
	$(INSTALL) $(BROWSER)         $(BIN_DIR)
	$(INSTALL) -p -m0644 man2html.8         $(MAN_DIR8)
	$(INSTALL) -p -m0644 netscape-man.1     $(MAN_DIR1)
	if [ \! -d $(CACHE_DIR) ] ; then \
		mkdir $(CACHE_DIR) ; chmod o=rwxt $(CACHE_DIR); \
	fi;
	cp glimpse_filters $(CACHE_DIR)/.glimpse_filters

rpm: spotless
	(cd ..; tar cvzf $(SOURCELOC)/$(TARFILE) $(PACKAGENAME) ) ; \
	cp $(SPECFILE) $(SPECLOC)/$(SPECFILE)
	$(RPM_PROG) -ba -v $(SPECFILE)

clean:
	rm -f *.o *~ core manwhatis

spotless: clean
	rm -f man2html man.html man2html.8 mansearch mansearch.html mansearchhelp.html netscape-man netscape-man.1