Add /usr/Makefile to 'make upgrade'.
[dragonfly.git] / etc / Makefile
index d4eea15..d42f752 100644 (file)
@@ -1,6 +1,6 @@
 #      from: @(#)Makefile      5.11 (Berkeley) 5/21/91
 # $FreeBSD: src/etc/Makefile,v 1.219.2.38 2003/03/04 09:49:00 ru Exp $
-# $DragonFly: src/etc/Makefile,v 1.211 2008/02/02 18:24:00 matthias Exp $
+# $DragonFly: src/etc/Makefile,v 1.217 2008/10/03 10:27:42 swildner Exp $
 
 .if !defined(NO_SENDMAIL)
 SUBDIR=        sendmail
@@ -26,11 +26,12 @@ BINUPDATE+=${.CURDIR}/../usr.bin/mail/misc/mail.rc \
 #
 BIN1=  amd.map auth.conf \
        crontab csh.cshrc csh.login csh.logout \
-       devices.conf dhclient.conf dm.conf dntpd.conf ftpusers group \
-       hosts hosts.allow host.conf hosts.equiv hosts.lpd \
+       devd.conf devices.conf dhclient.conf dm.conf dntpd.conf \
+       ftpusers group \
+       hosts hosts.allow hosts.equiv hosts.lpd \
        inetd.conf login.access login.conf \
-       motd modems networks newsyslog.conf \
-       pf.conf phones printcap profile \
+       motd modems netconfig networks newsyslog.conf \
+       nscd.conf pf.conf phones printcap profile \
        remote sensorsd.conf \
        shells sysctl.conf syslog.conf usbd.conf \
        etc.${MACHINE_ARCH}/ttys
@@ -54,8 +55,6 @@ DIRS+=        secure/usr.bin/openssl
 BIN2=  pccard_ether rc.firewall rc.suspend rc.resume
 
 DEFAULTS= rc.conf make.conf periodic.conf uuids
-PAMD_CONF=     README convert.sh ftpd gdm imap login other pop3 sshd \
-       telnetd xdm xserver
 
 MTREE= BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
        BSD.var.dist
@@ -94,6 +93,12 @@ distribute:
 
 remove-obsolete-files:
        @echo "===> Remove now obsolete files"
+       @for item in ${TO_REMOVE:M*.info.gz}; do \
+               if [ -e ${DESTDIR}$${item} ]; then \
+                       install-info --delete ${DESTDIR}$${item} \
+                           /usr/share/info/dir; \
+               fi; \
+       done;
        @for item in ${TO_REMOVE}; do \
                if [ -e ${DESTDIR}$${item} ]; then \
                        echo "${DESTDIR}$${item}"; \
@@ -119,12 +124,18 @@ preupgrade:
                pw -V ${DESTDIR}/etc useradd _sdpd -u 70 \
                   -c "sdpd privsep user" \
                   -d /var/empty -s /sbin/nologin
+       (pw -V ${DESTDIR}/etc usershow _dhcp -q > /dev/null) || \
+               pw -V ${DESTDIR}/etc useradd _dhcp -u 77 \
+                  -c "DHCP programs" \
+                  -d /var/empty -s /sbin/nologin
        (pw -V ${DESTDIR}/etc groupshow authpf -q > /dev/null) || \
                pw -V ${DESTDIR}/etc groupadd authpf -g 63
        (pw -V ${DESTDIR}/etc groupshow _pflogd -q > /dev/null) || \
                pw -V ${DESTDIR}/etc groupadd _pflogd -g 64
        (pw -V ${DESTDIR}/etc groupshow _sdpd -q > /dev/null) || \
                pw -V ${DESTDIR}/etc groupadd _sdpd -g 70
+       (pw -V ${DESTDIR}/etc groupshow _dhcp -q > /dev/null) || \
+               pw -V ${DESTDIR}/etc groupadd _dhcp -g 77
 
 upgrade_etc:   preupgrade remove-obsolete-files
 .if !defined(BINARY_UPGRADE) # binary upgrade just copies these files
@@ -134,6 +145,11 @@ upgrade_etc:       preupgrade remove-obsolete-files
            ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
                ${BINUPDATE} ${DESTDIR}/etc; \
            cap_mkdb ${DESTDIR}/etc/login.conf; \
+           for f in ${BIN1}; do \
+               [ -e "${DESTDIR}/etc/$${f##*/}" ] || \
+                   ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
+                       $$f ${DESTDIR}/etc; \
+           done; \
            ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
                ${BIN2} ${DESTDIR}/etc;
        cd ${UPGRADE_SRCDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
@@ -157,6 +173,7 @@ upgrade_etc:        preupgrade remove-obsolete-files
            ${MTREE} ${DESTDIR}/etc/mtree
        cd ${UPGRADE_SRCDIR}/bluetooth; ${MAKE} install
        cd ${UPGRADE_SRCDIR}/dma; ${MAKE} install
+       cd ${UPGRADE_SRCDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 Makefile.usr ${DESTDIR}/usr/Makefile
 .if !exists(${DESTDIR}/etc/pam.d)
        mkdir -p ${DESTDIR}/etc/pam.d
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${UPGRADE_SRCDIR}/pam.d/README ${DESTDIR}/etc/pam.d
@@ -169,6 +186,9 @@ upgrade_etc:        preupgrade remove-obsolete-files
 .endif
 .endfor
 .endif
+       # these removals must occur AFTER any pam conversion
+       csh -c "rm -f /usr/lib/pam_{cleartext_pass_ok,deny,opie,opieaccess,permit,radius,skey,ssh,tacplus,unix}.so"
+       rm -f /etc/pam.conf
 .if !defined(BINARY_UPGRADE) # binary upgrade just copies these files
        cd ${UPGRADE_SRCDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
            ${FREEBSD} ${DESTDIR}/
@@ -180,87 +200,36 @@ upgrade_etc:      preupgrade remove-obsolete-files
 .if exists(${DESTDIR}/usr/lib/gcc2)
        ldconfig -m ${DESTDIR}/usr/lib/gcc2
 .endif
-.if exists(${DESTDIR}/usr/share/info/dc.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/dc.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/dc.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/dc.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/gmp.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/gmp.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/gmp.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/gmp.info
-.endif
 .for lib in ${COMPAT_LIBS:M*.so.*}
 .if exists(${DESTDIR}/usr/lib/${lib})
        chflags noschg ${DESTDIR}/usr/lib/${lib}
        rm -f ${DESTDIR}/usr/lib/${lib}
 .endif
 .endfor
-.if exists(${DESTDIR}/usr/share/info/bzip2.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/bzip2.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/bzip2.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/bzip2.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/gasp.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/gasp.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/gasp.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/gasp.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/gperf.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/gperf.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/gperf.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/gperf.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/gxxint.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/gxxint.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/gxxint.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/gxxint.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/iostream.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/iostream.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/iostream.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/iostream.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/ptx.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/ptx.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/ptx.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/ptx.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/send-pr.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/send-pr.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/send-pr.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/send-pr.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/cpp40.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/cpp40.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/cpp40.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/cpp40.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/cppinternals40.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/cppinternals40.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/cppinternals40.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/cppinternals40.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/gcc40.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/gcc40.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/gcc40.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/gcc40.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/gccint40.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/gccint40.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/gccint40.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/gccint40.info
-.endif
-.if exists(${DESTDIR}/usr/share/info/tar.info.gz)
-       gzip -d ${DESTDIR}/usr/share/info/tar.info.gz
-       install-info --delete ${DESTDIR}/usr/share/info/tar.info ${DESTDIR}/usr/share/info/dir
-       rm -f ${DESTDIR}/usr/share/info/tar.info
+.if !defined(NO_OPENSSH)
+       cd ${.CURDIR}/../secure/lib/libssh; ${MAKE} -f Makefile.etc obj
+       cd ${.CURDIR}/../secure/lib/libssh; ${MAKE} -f Makefile.etc install
+.endif
+.if exists(${DESTDIR}/boot)
+.if exists(${DESTDIR}/kernel)
+       chflags noschg ${DESTDIR}/kernel
+       mv ${DESTDIR}/kernel ${DESTDIR}/boot/kernel
+       chflags schg ${DESTDIR}/boot/kernel
+.endif
+.if exists(${DESTDIR}/modules)
+       mv ${DESTDIR}/modules ${DESTDIR}/boot/modules
+       rm -rf ${DESTDIR}/boot/modules/modules
+.endif
+.if exists(${DESTDIR}/kernel.old)
+       mv ${DESTDIR}/kernel.old ${DESTDIR}/boot/kernel.old
+.endif
+.if exists(${DESTDIR}/modules.old)
+       mv ${DESTDIR}/modules.old ${DESTDIR}/boot/modules.old
+       rm -rf ${DESTDIR}/boot/modules.old/modules.old
+.endif
 .endif
        ldconfig -R
 .if !defined(BINARY_UPGRADE) # binary upgrade just copies these nodes
-.if !defined(NOMAN)
-       cd ${UPGRADE_SRCDIR}/../share/man; ${MAKE} makedb
-.endif
 .if !defined(NO_MAKEDEV)
        cd ${UPGRADE_SRCDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
            MAKEDEV.local MAKEDEV ${DESTDIR}/dev
@@ -284,8 +253,7 @@ distribution:
            pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
        cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
            ${DEFAULTS} ${DESTDIR}/etc/defaults
-       cd ${.CURDIR}/pam.d; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
-           ${PAMD_CONF} ${DESTDIR}/etc/pam.d
+       cd ${.CURDIR}/pam.d; ${MAKE} install
        cd ${.CURDIR}/bluetooth; ${MAKE} install
        cd ${.CURDIR}/dma; ${MAKE} install
        cd ${.CURDIR}/periodic; ${MAKE} install