3 # Directory permissions management.
5 .if !target(__<bsd.dirs.mk>__)
7 # List of directory variable names to install. Each variable name's value
8 # must be a full path. If non-default permissions are desired, <DIR>_MODE,
9 # <DIR>_OWN, and <DIR>_GRP may be specified.
12 . for dir in ${DIRS:O:u}
13 . if defined(${dir}) && !empty(${dir})
14 # Set default permissions for a directory
18 . if defined(${dir}_FLAGS) && !empty(${dir}_FLAGS)
19 ${dir}_FLAG= -f ${${dir}_FLAGS}
23 . if !defined(${dir}TAGS) || ! ${${dir}TAGS:Mpackage=*}
24 ${dir}TAGS+= package=${${dir}PACKAGE:Uruntime}
26 ${dir}TAG_ARGS= -T ${${dir}TAGS:[*]:S/ /,/g}
29 installdirs: installdirs-${dir}
31 installdirs-${dir}: installdirs-${DESTDIR}${${dir}}
33 . if !target(installdirs-${DESTDIR}${${dir}})
34 installdirs-${DESTDIR}${${dir}}:
35 @${ECHO} installing DIRS ${dir}
36 ${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o ${${dir}_OWN} \
37 -g ${${dir}_GRP} ${${dir}_FLAG} ${DESTDIR}${${dir}}
41 realinstall: installdirs-${dir}