pkgsrc/mk/check/check-fakehome.mk
bad 89f715edf7 I'm fed up with having to waste time because PKG_DEVELOPER is "special" and
can't be disabled by setting it to "no" like the other variables.
Besides, flavor/pkg/metadata.mk has been expecting for a long time that "no"
is a valid value.

Make PKG_DEVELOPER DWIM.
2010-08-24 19:08:28 +00:00

40 lines
1 KiB
Makefile

# $NetBSD: check-fakehome.mk,v 1.3 2010/08/24 19:08:29 bad Exp $
#
# This file checks that the package does not install files to $HOME.
#
# User-settable variables:
#
# CHECK_FAKEHOME
# Specifies whether the check should be run at all.
#
# Possible values: yes, no.
#
# Default value: yes for PKG_DEVELOPER, no otherwise.
#
# Package-settable variables:
#
_VARGROUPS+= check-fakehome
_USER_VARS.check-fakehome= CHECK_FAKEHOME
_PKG_VARS.check-fakehome= # None for now. One might be added to override
# the test if the fakehome test is made fatal.
.if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no"
CHECK_FAKEHOME?= yes
.else
CHECK_FAKEHOME?= no
.endif
.if ${CHECK_FAKEHOME:M[Yy][Ee][Ss]}
privileged-install-hook: _check-fakehome
.endif
_check-fakehome: .PHONY
${RUN} if [ `ls -a ${FAKEHOMEDIR:Q} | ${AWK} \
'{if ($$0 != "." && $$0 != "..") {x=1; exit}} \
END {print x + 0}' \
` = 1 ]; then \
${WARNING_MSG} "[check-fakehome.mk] fake home directory not empty:"; \
find ${FAKEHOMEDIR} -print | ${SED} 's/^/ /'; \
exit 0; \
fi