]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/Makefile
MFC rev. 1.71, 1.74:
[FreeBSD/FreeBSD.git] / etc / Makefile
1 #       from: @(#)Makefile      5.11 (Berkeley) 5/21/91
2 # $FreeBSD$
3
4 .if !defined(NO_SENDMAIL)
5 SUBDIR= sendmail
6 .endif
7
8 BIN1=   amd.map apmd.conf auth.conf \
9         crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \
10         dhclient.conf disktab fbtab freebsd-update.conf \
11         ftpusers gettytab group \
12         hosts hosts.allow hosts.equiv hosts.lpd \
13         inetd.conf login.access login.conf \
14         mac.conf motd netconfig network.subr networks newsyslog.conf \
15         portsnap.conf pf.conf pf.os phones profile protocols \
16         rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
17         rc.sendmail rc.shutdown \
18         rc.subr remote rpc services shells \
19         snmpd.config sysctl.conf syslog.conf usbd.conf \
20         etc.${MACHINE_ARCH}/ttys \
21         ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
22         ${.CURDIR}/../usr.bin/mail/misc/mail.rc \
23         ${.CURDIR}/../usr.bin/locate/locate/locate.rc
24
25 OPENBSMDIR=                     ${.CURDIR}/../contrib/openbsm
26 BSM_ETC_OPEN_FILES=             ${OPENBSMDIR}/etc/audit_class \
27                                 ${OPENBSMDIR}/etc/audit_event
28 BSM_ETC_RESTRICTED_FILES=       ${OPENBSMDIR}/etc/audit_control \
29                                 ${OPENBSMDIR}/etc/audit_user
30 BSM_ETC_EXEC_FILES=             ${OPENBSMDIR}/etc/audit_warn
31 BSM_ETC_DIR=                    ${DESTDIR}/etc/security
32
33 .if !defined(NO_LPR)
34 BIN1+=  printcap
35 .endif
36
37 .if !defined(NO_CRYPT) && !defined(NO_OPENSSL)
38 .if !defined(NO_OPENSSH)
39 SSH=    ${.CURDIR}/../crypto/openssh/ssh_config \
40         ${.CURDIR}/../crypto/openssh/sshd_config \
41         ${.CURDIR}/../crypto/openssh/moduli
42 .endif
43 SSL=    ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
44 .endif
45
46 # -rwxr-xr-x root:wheel, for the new cron root:wheel
47 BIN2=   netstart pccard_ether rc.suspend rc.resume
48
49 MTREE=  BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
50         BSD.var.dist BSD.x11.dist BSD.x11-4.dist
51 .if !defined(NO_SENDMAIL)
52 MTREE+= BSD.sendmail.dist
53 .endif
54 .if !defined(NO_BIND)
55 MTREE+= BIND.chroot.dist
56 .if defined(WITH_BIND_LIBS)
57 MTREE+= BIND.include.dist
58 .endif
59 .endif
60
61 .if !defined(NO_BIND_ETC) && !defined(NO_BIND) && !defined(NO_BIND_MTREE)
62 NAMEDB= PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
63         make-localhost
64 .endif
65
66 PPPCNF= ppp.conf
67
68 .if defined(NO_SENDMAIL)
69 ETCMAIL=mailer.conf aliases
70 .else
71 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
72         mailertable.sample aliases
73 .endif
74
75 # Special top level files for FreeBSD
76 FREEBSD=COPYRIGHT
77
78 afterinstall:
79 .if !defined(NO_MAN)
80         cd ${.CURDIR}/../share/man; ${MAKE} makedb
81 .endif
82
83 distribute:
84         cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
85         cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
86
87 .include <bsd.endian.mk>
88 .if ${TARGET_ENDIANNESS} == "1234"
89 CAP_MKDB_ENDIAN?= -l
90 PWD_MKDB_ENDIAN?= -L
91 .elif ${TARGET_ENDIANNESS} == "4321"
92 CAP_MKDB_ENDIAN?= -b
93 PWD_MKDB_ENDIAN?= -B
94 .else
95 CAP_MKDB_ENDIAN?=
96 PWD_MKDB_ENDIAN?=
97 .endif
98
99 distribution:
100 .if !defined(DESTDIR)
101         @echo "set DESTDIR before running \"make ${.TARGET}\""
102         @false
103 .endif
104         cd ${.CURDIR}; \
105             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
106                 ${BIN1} ${DESTDIR}/etc; \
107             cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
108             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
109                 ${BIN2} ${DESTDIR}/etc; \
110             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
111                 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
112             pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
113                 ${DESTDIR}/etc/master.passwd
114         cd ${.CURDIR}/bluetooth; ${MAKE} install
115         cd ${.CURDIR}/defaults; ${MAKE} install
116         cd ${.CURDIR}/periodic; ${MAKE} install
117         cd ${.CURDIR}/rc.d; ${MAKE} install
118         cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
119         cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
120         cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
121         cd ${.CURDIR}/pam.d; ${MAKE} install
122         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
123             ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
124         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
125             ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
126         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
127             ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
128 .if !defined(NO_I4B)
129         cd ${.CURDIR}/isdn; ${MAKE} install
130 .endif
131 .if !defined(NO_SENDMAIL)
132         cd ${.CURDIR}/sendmail; ${MAKE} distribution
133 .endif
134 .if !defined(NO_CRYPT) && !defined(NO_OPENSSL)
135 .if !defined(NO_OPENSSH)
136         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
137             ${SSH} ${DESTDIR}/etc/ssh
138 .endif
139         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
140             ${SSL} ${DESTDIR}/etc/ssl
141 .endif
142 .if !defined(NO_KERBEROS)
143         cd ${.CURDIR}/root; \
144             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
145                 dot.k5login ${DESTDIR}/root/.k5login;
146 .endif
147         cd ${.CURDIR}/root; \
148             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
149                 dot.cshrc ${DESTDIR}/root/.cshrc; \
150             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
151                 dot.login ${DESTDIR}/root/.login; \
152             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
153                 dot.profile ${DESTDIR}/root/.profile; \
154             rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
155             ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
156             ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
157         cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
158             ${MTREE} ${DESTDIR}/etc/mtree
159 .if !defined(NO_BIND)
160 .if !defined(NO_BIND_ETC) && !defined(NO_BIND_MTREE)
161         cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
162             ${NAMEDB} ${DESTDIR}/var/named/etc/namedb
163 .endif
164 .if !defined(NO_BIND_MTREE)
165         @if [ ! -e ${DESTDIR}/etc/namedb ]; then \
166                 set -x; \
167                 ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
168         fi
169 .endif
170 .endif
171         cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
172             ${PPPCNF} ${DESTDIR}/etc/ppp
173         cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
174             ${ETCMAIL} ${DESTDIR}/etc/mail
175         @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
176               ! -f ${DESTDIR}/etc/aliases ]; then \
177                 set -x; \
178                 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
179         fi
180         ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
181             ${DESTDIR}/etc/dumpdates
182         ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
183             ${DESTDIR}/var/db/locate.database
184         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
185             ${DESTDIR}/var/crash
186         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
187                 ${FREEBSD} ${DESTDIR}/
188         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
189             ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
190             ${DESTDIR}/boot/device.hints
191
192 distrib-dirs:
193         mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
194         mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
195         mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
196         mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
197                 -p ${DESTDIR}/usr/include
198 .if !defined(NO_BIND)
199 .if defined(WITH_BIND_LIBS)
200         mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
201             -p ${DESTDIR}/usr/include
202 .endif
203 .if !defined(NO_BIND_MTREE)
204         mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
205             -p ${DESTDIR}/var/named
206 .endif
207 .endif
208 .if !defined(NO_SENDMAIL)
209         mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
210 .endif
211         cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
212         cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
213         cd ${DESTDIR}/usr/share/man; \
214         set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
215         while [ $$# -gt 0 ] ; \
216         do \
217                 rm -rf "$$1"; \
218                 ln -s "$$2" "$$1"; \
219                 shift; shift; \
220         done
221         cd ${DESTDIR}/usr/share/openssl/man; \
222         set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
223         while [ $$# -gt 0 ] ; \
224         do \
225                 rm -rf "$$1"; \
226                 ln -s "$$2" "$$1"; \
227                 shift; shift; \
228         done
229         cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
230         cd ${DESTDIR}/usr/share/nls; \
231         set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
232         while [ $$# -gt 0 ] ; \
233         do \
234                 rm -rf "$$1"; \
235                 ln -s "$$2" "$$1"; \
236                 shift; shift; \
237         done
238
239 etc-examples:
240         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
241             ${BIN1} ${BIN2} nsmb.conf opieaccess \
242             ${DESTDIR}/usr/share/examples/etc
243         cd ${.CURDIR}/defaults; ${MAKE} install \
244             DESTDIR=${DESTDIR}/usr/share/examples
245
246 .include <bsd.prog.mk>