From e74ea3abfaf3d218650107e390c292753a441d57 Mon Sep 17 00:00:00 2001 From: cgd Date: Thu, 8 Apr 1993 14:02:00 +0000 Subject: [PATCH] (silently) make sure we have directories before installing --- share/mk/bsd.lib.mk | 8 +++++ share/mk/bsd.man.mk | 72 ++++++++++++++++++++++++++++++++++++++++++++ share/mk/bsd.prog.mk | 8 +++++ 3 files changed, 88 insertions(+) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index fb7e89ce0de8..8ea849526bf3 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -100,6 +100,14 @@ depend: .depend .if !target(install) .if !target(beforeinstall) beforeinstall: + @if [ ! -d ${DESTDIR}${LIBDIR} ]; then \ + /bin/rm ${DESTDIR}${LIBDIR} ; \ + mkdir -p ${DESTDIR}${LIBDIR} ; \ + chown root.wheel ${DESTDIR}${LIBDIR} ; \ + chmod 755 ${DESTDIR}${LIBDIR} ; \ + else \ + true ; \ + fi .endif realinstall: beforeinstall diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 1b4029c5fc7e..c44952bff8fe 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -14,30 +14,102 @@ MINSTALL= install -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} maninstall: .if defined(MAN1) && !empty(MAN1) + @if [ ! -d ${DESTDIR}${MANDIR}1${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}1${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}1${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}1${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}1${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN1} ${DESTDIR}${MANDIR}1${MANSUBDIR} .endif .if defined(MAN2) && !empty(MAN2) + @if [ ! -d ${DESTDIR}${MANDIR}2${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}2${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}2${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}2${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}2${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN2} ${DESTDIR}${MANDIR}2${MANSUBDIR} .endif .if defined(MAN3) && !empty(MAN3) + @if [ ! -d ${DESTDIR}${MANDIR}3${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}3${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}3${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}3${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}3${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN3} ${DESTDIR}${MANDIR}3${MANSUBDIR} .endif .if defined(MAN3F) && !empty(MAN3F) + @if [ ! -d ${DESTDIR}${MANDIR}3f${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}3f${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}3f${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}3f${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}3f${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN3F} ${DESTDIR}${MANDIR}3f${MANSUBDIR} .endif .if defined(MAN4) && !empty(MAN4) + @if [ ! -d ${DESTDIR}${MANDIR}4${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}4${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}4${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}4${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}4${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN4} ${DESTDIR}${MANDIR}4${MANSUBDIR} .endif .if defined(MAN5) && !empty(MAN5) + @if [ ! -d ${DESTDIR}${MANDIR}5${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}5${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}5${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}5${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}5${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN5} ${DESTDIR}${MANDIR}5${MANSUBDIR} .endif .if defined(MAN6) && !empty(MAN6) + @if [ ! -d ${DESTDIR}${MANDIR}6${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}6${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}6${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}6${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}6${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN6} ${DESTDIR}${MANDIR}6${MANSUBDIR} .endif .if defined(MAN7) && !empty(MAN7) + @if [ ! -d ${DESTDIR}${MANDIR}7${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}7${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}7${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}7${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}7${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN7} ${DESTDIR}${MANDIR}7${MANSUBDIR} .endif .if defined(MAN8) && !empty(MAN8) + @if [ ! -d ${DESTDIR}${MANDIR}8${MANSUBDIR} ]; then \ + /bin/rm ${DESTDIR}${MANDIR}8${MANSUBDIR} ; \ + mkdir -p ${DESTDIR}${MANDIR}8${MANSUBDIR} ; \ + chown root.wheel ${DESTDIR}${MANDIR}8${MANSUBDIR} ; \ + chmod 755 ${DESTDIR}${MANDIR}8${MANSUBDIR} ; \ + else \ + true ; \ + fi ${MINSTALL} ${MAN8} ${DESTDIR}${MANDIR}8${MANSUBDIR} .endif .if defined(MLINKS) && !empty(MLINKS) diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index a781915e8efd..eb5993d7aca8 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -120,6 +120,14 @@ depend: .depend _PROGSUBDIR .if !target(install) .if !target(beforeinstall) beforeinstall: + @if [ ! -d ${DESTDIR}${BINDIR} ]; then \ + /bin/rm ${DESTDIR}${BINDIR} ; \ + mkdir -p ${DESTDIR}${BINDIR} ; \ + chown root.wheel ${DESTDIR}${BINDIR} ; \ + chmod 755 ${DESTDIR}${BINDIR} ; \ + else \ + true ; \ + fi .endif .if !target(afterinstall) afterinstall: