Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Aug 2018 13:24:47 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Brad Davis <brd@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r336640 - head/share/mk
Message-ID:  <f6bdd813-f08c-e87a-69be-19e2b2804c58@FreeBSD.org>
In-Reply-To: <201807231611.w6NGB3gh074167@repo.freebsd.org>
References:  <201807231611.w6NGB3gh074167@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--KduTnJGRCWEwr7hH5nfo84qwG8dx6VjbZ
Content-Type: multipart/mixed; boundary="IVYJyTY8k4llANE66BtufUmZ92wWFXMfA";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Brad Davis <brd@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-ID: <f6bdd813-f08c-e87a-69be-19e2b2804c58@FreeBSD.org>
Subject: Re: svn commit: r336640 - head/share/mk
References: <201807231611.w6NGB3gh074167@repo.freebsd.org>
In-Reply-To: <201807231611.w6NGB3gh074167@repo.freebsd.org>

--IVYJyTY8k4llANE66BtufUmZ92wWFXMfA
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 7/23/18 9:11 AM, Brad Davis wrote:
> Author: brd
> Date: Mon Jul 23 16:11:03 2018
> New Revision: 336640
> URL: https://svnweb.freebsd.org/changeset/base/336640
>=20
> Log:
>   Add the initial DIRS infrastructure for creating directories with the=

>   necessary owner, group, mode and flags.
>  =20
>   Approved by:	bapt (mentor)
>   Differential Revision:	https://reviews.freebsd.org/D16405
>=20
> Added:
>   head/share/mk/bsd.dirs.mk   (contents, props changed)
> Modified:
>   head/share/mk/bsd.README
>=20
> Modified: head/share/mk/bsd.README
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/share/mk/bsd.README	Mon Jul 23 15:36:55 2018	(r336639)
> +++ head/share/mk/bsd.README	Mon Jul 23 16:11:03 2018	(r336640)
> @@ -22,6 +22,7 @@ bsd.confs.mk		- install of configuration files
>  bsd.cpu.mk		- sets CPU/arch-related variables (included from sys.mk)
>  bsd.crunchgen.mk	- building crunched binaries using crunchgen(1)
>  bsd.dep.mk		- handle Makefile dependencies
> +bsd.dirs.mk		- handle directory creation
>  bsd.doc.mk		- building troff system documents
>  bsd.endian.mk		- TARGET_ENDIAN=3D1234(little) or 4321 (big) for target=

>  bsd.files.mk		- install of general purpose files
> @@ -291,6 +292,18 @@ CFLAGS		Flags to the compiler when creating C obje=
cts.
>  CLEANDIRS	Additional files (CLEANFILES) and directories (CLEANDIRS) to=

>  CLEANFILES	remove during clean and cleandir targets.  "rm -rf" and
>  		"rm -f" are used, respectively.
> +
> +DIRS		A list of variables referring to directories.  For example:
> +
> +			DIRS+=3D	FOO
> +			FOO=3D	/usr/share/foo
> +
> +		Owner, Group, Mode and Flags are handled by FOO_OWN,
> +		FOO_GRP, FOO_MODE and FOO_FLAGS, respectively.
> +
> +		This allows FILESDIR to be set to FOO, and the directory
> +		will be created before the files are installed and the
> +		dependencies will be set correctly.
> =20
>  DPADD		Additional dependencies for the program.  Usually used for
>  		libraries.  For example, to depend on the compatibility and
>=20
> Added: head/share/mk/bsd.dirs.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ head/share/mk/bsd.dirs.mk	Mon Jul 23 16:11:03 2018	(r336640)
> @@ -0,0 +1,42 @@
> +# $FreeBSD$
> +#
> +# Directory permissions management.
> +
> +.if !target(__<bsd.dirs.mk>__)
> +__<bsd.dirs.mk>__:
> +# List of directory variable names to install.  Each variable name's v=
alue
> +# must be a full path.  If non-default permissions are desired, <DIR>_=
MODE,
> +# <DIR>_OWN, and <DIR>_GRP may be specified.
> +DIRS?=3D
> +
> +.  for dir in ${DIRS:O:u}
> +.    if defined(${dir}) && !empty(${dir})
> +# Set default permissions for a directory
> +${dir}_MODE?=3D	0755
> +${dir}_OWN?=3D	root
> +${dir}_GRP?=3D	wheel
> +.      if defined(${dir}_FLAGS) && !empty(${dir}_FLAGS)
> +${dir}_FLAG=3D	-f ${${dir}_FLAGS}
> +.      endif
> +
> +.      if defined(NO_ROOT)
> +.        if !defined(${dir}TAGS) || ! ${${dir}TAGS:Mpackage=3D*}
> +${dir}TAGS+=3D		package=3D${${dir}PACKAGE:Uruntime}
> +.        endif
> +${dir}TAG_ARGS=3D	-T ${${dir}TAGS:[*]:S/ /,/g}
> +.      endif
> +
> +installdirs: installdirs-${dir}
> +
> +installdirs-${dir}: ${DESTDIR}${${dir}}
> +
> +${DESTDIR}${${dir}}:
> +	@${ECHO} installing DIRS ${dir}

This echo is funky. Seems like it wanted to display the actual dirname
rather than the internal variable name for it, but it's also just not
needed since there's an INSTALL on the next line that shows.

> ~/git/freebsd/secure/usr.sbin/sshd # make install DESTDIR=3D/tmp/blah
> install  -s -o root -g wheel -m 555   sshd /tmp/blah/usr/sbin/sshd
> install  -o root -g wheel -m 444  sshd.debug /tmp/blah/usr/lib/debug/us=
r/sbin/sshd.debug
> installing DIRS CONFSDIR
> install  -d -m 0755 -o root  -g wheel  /tmp/blah/etc/ssh
> install  -o root -g wheel -m 444 sshd.8.gz  /tmp/blah/usr/share/man/man=
8/
> install  -o root -g wheel -m 444 sshd_config.5.gz  /tmp/blah/usr/share/=
man/man5/

=2E..




> +	${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o ${${dir}_OWN} \
> +		-g ${${dir}_GRP} ${${dir}_FLAG} ${DESTDIR}${${dir}}
> +.    endif
> +
> +realinstall: installdirs-${dir}
> +.  endfor
> +
> +.endif
>=20


--=20
Regards,
Bryan Drewery


--IVYJyTY8k4llANE66BtufUmZ92wWFXMfA--

--KduTnJGRCWEwr7hH5nfo84qwG8dx6VjbZ
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlt13ZAACgkQNddxu25G
l8+DJQgAqirYnH6fP2E9P32S/kmCEI+c/LgroaUcYKL132K7uiD5Te+2ECCSY37c
Jc7MHy2IIc3HT9BOIEYRVpihuz1BVgYd4SQdqB5BYIjkiK8EMMIqbLKSkH9tQuxQ
L7qFNKsAcbTf25cfFKbs/7FGtZn0TGtM0vrj/VAJAteNYYgHQ4grlqPQmRukF2Mj
0KDg69TBZ4Chzp1M4EckRZ7kJ/Xyp+I/KGtf4KQlBVL6ZPCmhvhMuu8yRLb5vCxD
IXRvlvC0J0yTetT8AjPw5p4q62+JAmMzBHzmtuOtRID8e+EUCwXr2YdbjwPOvJSy
wVLiTEbzJT2mr+UIDzagQNhIO77Bmw==
=JA/6
-----END PGP SIGNATURE-----

--KduTnJGRCWEwr7hH5nfo84qwG8dx6VjbZ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f6bdd813-f08c-e87a-69be-19e2b2804c58>