1###########################################################################
2# LPRng - An Extended Print Spooler System
3#
4# Copyright 1988-1997 Patrick Powell, San Diego, California
5#     papowell@sdsu.edu
6# See LICENSE for conditions of use.
7#
8###########################################################################
9# MODULE: UTILS/Makefile
10# PURPOSE: generate utilities
11# Makefile.in,v 3.7 1998/03/30 01:54:50 papowell Exp
12########################################################################## 
13
14# Manual pages installation Makefile.
15#
16SRC = .
17VPATH=${SRC}
18INSTALL=/usr/bin/install -c
19
20# change MANEXT to .gz or .Z if you use compressed manpages.
21MANEXT =
22
23## fix up prefix to be a make variable
24prefix = /usr/local
25MAN =		${prefix}/man
26SHELL =		/bin/sh
27
28# Install man pages in compressed form.
29# COMPRESS     = compression utility
30# COMPRESS_DIR = man compressed directory
31# COMPRESS_EXT = man extension for compressed files
32COMPRESS_DIR=
33COMPRESS_EXT=.gz
34COMPRESS=gzip -c
35
36PAGES= cancel.1 checkpc.8 lp.1 lpbanner.1 lpc.8 lpd.8 lpd.conf.5 \
37	 lpd.perms.5 lpf.1 lpq.1 lpr.1 lprm.1 lpstat.1 monitor.1 pclbanner.1 \
38	 printcap.5 psbanner.1 lprng_certs.1 lprng_index_certs.1
39RAW= cancel.n checkpc.n lp.n lpbanner.n lpc.n lpd.n lpd.conf.n \
40	 lpd.perms.n lpf.n lpq.n lpr.n lprm.n lpstat.n monitor.n pclbanner.n \
41	 printcap.n psbanner.n  lprng_certs.n lprng_index_certs.n
42
43
44# prefix
45prefix=/usr/local
46# exec prefix
47exec_prefix=${prefix}
48# for binaries
49bindir=${exec_prefix}/bin
50# for admin type of binaries
51sbindir=${exec_prefix}/sbin
52# for the filters
53libexecdir=${exec_prefix}/libexec
54# for the configuration stuff
55sysconfdir=${prefix}/etc
56# for the man pages
57mandir=${prefix}/man
58# top build directory
59top_builddir=..
60
61LPD_PERMS_PATH=${sysconfdir}/lpd/lpd.perms
62LPD_CONF_PATH=${sysconfdir}/lpd/lpd.conf
63PRINTCAP_PATH=${sysconfdir}/printcap
64LPD_PATH=${sbindir}/lpd
65LOCKFILE=/var/run/lpd
66SSL_CA_FILE=${sysconfdir}/lpd/ssl.ca/ca.crt
67SSL_CA_KEY=${sysconfdir}/lpd/ssl.ca/ca.key
68SSL_CERTS_DIR=${sysconfdir}/lpd/ssl.certs
69SSL_SERVER_CERT=${sysconfdir}/lpd/ssl.server/server.crt
70SSL_SERVER_PASSWORD=@SSL_SERVER_PASSWORD@
71
72all: ${PAGES}
73
74${PAGES}: ${RAW} Makefile
75	for i in ${PAGES} ; do \
76		v=`expr "$$i" : "\(.*\).[0-9]"` ; \
77		echo ${SRC}/$$i; \
78		rm -f $$i; \
79		sed \
80		 -e "s!_PRINTCAP_PATH_!${PRINTCAP_PATH}!" \
81		 -e "s!_LPD_PERMS_PATH_!${LPD_PERMS_PATH}!" \
82		 -e "s!_LPD_CONF_PATH_!${LPD_CONF_PATH}!" \
83		 -e "s!_LOCKFILE_!${LOCKFILE}!" \
84		 -e "s!_SSL_CA_FILE_!${SSL_CA_FILE}!" \
85		 -e "s!_SSL_CA_KEY_!${SSL_CA_KEY}!" \
86		 -e "s!_SSL_CERTS_DIR_!${SSL_CERTS_DIR}!" \
87		 -e "s!_SSL_SERVER_CERT_!${SSL_SERVER_CERT}!" \
88		 -e "s!_SSL_SERVER_PASSWORD_!${SSL_SERVER_PASSWORD}!" \
89		${SRC}/$$v.n > $$i; \
90	done
91
92
93
94.PHONY: all clean install ci install.zman
95
96CI=
97CO=-kv
98update:
99	- for i in *.[0-9]; do \
100		rcs -l ./$$i; \
101		ci $(CI) -l -mUpdate -t-Initial ./$$i; \
102	done;
103
104	- VER=`cat ${SRC}/../VERSION`; \
105	  for i in *.[0-9]; do \
106		sed -e "s/^.ds VE.*/.ds VE $$VER/" ./$$i >/tmp/$$i; \
107		cp /tmp/$$i ./$$i; \
108	done;
109
110	- for i in *.[0-9]; do \
111		ci $(CI) -mUpdate -t-Initial ./$$i; \
112		yes | co $(CO) ./$$i; \
113	done
114
115# Standard man install target.
116#
117install:
118	for suffix in 1 2 3 4 5 6 7 8 ; do \
119	  if ls *.$${suffix} >/dev/null 2>&1 ; then \
120	    if [ ! -d $(DESTDIR)$(MAN)/man$${suffix} ] ; then \
121		    echo ${SRC}/mkinstalldirs $(DESTDIR)$(MAN)/man$${suffix}; \
122		    ${SRC}/mkinstalldirs $(DESTDIR)$(MAN)/man$${suffix}; \
123	    fi; \
124	    for i in *.$$suffix; do \
125		echo   $(INSTALL) -m 644 $$i $(DESTDIR)$(MAN)/man$$suffix/`basename $$i`$(MANEXT); \
126		$(INSTALL)   -m 644 $$i $(DESTDIR)$(MAN)/man$$suffix/`basename $$i`$(MANEXT); \
127	    done; \
128	  fi; \
129	done;
130
131uninstall:
132	for suffix in 1 2 3 4 5 6 7 8 ; do \
133	  if ls *.$${suffix} >/dev/null 2>&1 ; then \
134	    for i in *.$$suffix; do \
135		echo   rm $(DESTDIR)$(MAN)/man$$suffix/`basename $$i`$(MANEXT); \
136		rm   $(DESTDIR)$(MAN)/man$$suffix/`basename $$i`$(MANEXT); \
137	    done; \
138	  fi; \
139	done;
140	
141realclean mostlyclean distclean:: clean
142
143clean::
144	rm -f *.[0-9] ?
145
146TAGS info:
147
148cifast ci:
149	if test ! -d RCS ; then mkdir RCS; fi;
150	checkin() { \
151		(set +e; rcs -l $$1; exit 0); \
152		ci $(CI) -l -u -f -mUpdate -t-Initial $$1; \
153	}; \
154	for i in *.n Makefile.in Makefile; do \
155		checkin $$i; \
156	done;
157