1 # $NetBSD: bsd.syspkg.mk,v 1.4 2008/10/19 22:05:20 apb Exp $
3 # This file is derived from:
5 # NetBSD: bsd.pkg.mk,v 1.636 2001/01/05 18:03:14 jlam Exp
7 # Plus many fixes and improvements from later revisions.
9 # However, it has been pared down to a minimum of targets, and
10 # adapted to the standard bsd.*.mk world order.
12 # Portions of this code are copyright (c) 2000-2002 Jim Wise
15 .if
!defined
(BSD_SYSPKG_MK
)
16 BSD_SYSPKG_MK
= # defined
18 .if
!target
(__initialized__
)
20 .if exists
(${.CURDIR
}/..
/Makefile.inc
)
21 .
include "${.CURDIR}/../Makefile.inc"
28 PREFIX
:= ${DESTDIR}/${PREFIX}
31 OS_VERSION
!= sh
${.PARSEDIR
}/..
/..
/..
/sys
/conf
/osrelease.sh
33 # keep bsd.own.mk from generating an install: target.
34 NEED_OWN_INSTALL_TARGET
=no
36 ##### Some overrides of defaults below on a per-OS basis.
38 DEINSTALLDEPENDS?
= NO
# add -R to pkg_delete
40 PKGSRCDIR?
= ${.CURDIR
:C|
/[^
/]*/[^
/]*$||
}
41 PKGVERSION?
= ${OS_VERSION}.
${TINY_VERSION}
42 PKGWILDCARD?
= ${PKGBASE}-[0-9]*
44 # For system packages, we set this here, as the version is auto-generated.
45 PKGNAME?
= ${PKGBASE}-${PKGVERSION}
47 PACKAGES?
= ${PKGSRCDIR}/..
/packages
50 # Don't change these!!! These names are built into the _TARGET_USE macro,
51 # there is no way to refer to them cleanly from within the macro AFAIK.
52 PACKAGE_COOKIE
= ${WRKDIR}/.package_done
54 # Miscellaneous overridable commands:
55 SHCOMMENT?
= ${ECHO_MSG} >/dev
/null
'***'
57 MAKE_ENV
+= PREFIX
=${PREFIX}
61 # Debugging levels for this file, dependent on PKG_DEBUG_LEVEL definition
62 # 0 == normal, default, quiet operation
63 # 1 == all shell commands echoed before invocation
64 # 2 == shell "set -x" operation
69 .if
${PKG_DEBUG_LEVEL} > 0
73 .if
${PKG_DEBUG_LEVEL} > 1
77 # In point of fact, this will often be ./obj, as per bsd.obj.mk
80 COMMENT?
= ${PKGDIR}/COMMENT
81 DESCR
= ${PKGDIR}/DESCR
82 PLIST
= ${WRKDIR}/PLIST
83 PLIST_SRC?
= ${PKGDIR}/PLIST
86 # Set PKG_INSTALL_FILE to be the name of any INSTALL file
87 .if
!defined
(PKG_INSTALL_FILE
) && exists
(${PKGDIR}/INSTALL
)
88 PKG_INSTALL_FILE
= ${PKGDIR}/INSTALL
91 # Set PKG_DEINSTALL_FILE to be the name of any DEINSTALL file
92 .if
!defined
(PKG_DEINSTALL_FILE
) && exists
(${PKGDIR}/DEINSTALL
)
93 PKG_DEINSTALL_FILE
= ${PKGDIR}/DEINSTALL
96 # Set MESSAGE_FILE to be the name of any MESSAGE file
97 .if
!defined
(MESSAGE_FILE
) && exists
(${PKGDIR}/MESSAGE
)
98 MESSAGE_FILE
= ${PKGDIR}/MESSAGE
101 AWK?
= ${TOOL_AWK
:U
/usr
/bin
/awk
}
105 ECHO?
= echo
# Shell builtin
106 FALSE?
= false
# Shell builtin
109 IDENT?
= /usr
/bin
/ident
112 MKDIR?
= /bin
/mkdir
-p
114 PKG_TOOLS_BIN?
= /usr
/sbin
116 SED?
= ${TOOL_SED
:U
/usr
/bin
/sed
}
117 SETENV?
= /usr
/bin
/env
119 TEST?
= test # Shell builtin
120 TOUCH?
= /usr
/bin
/touch
121 TRUE?
= true
# Shell builtin
123 PKG_ADD?
= PKG_DBDIR
=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_add
124 PKG_ADMIN?
= PKG_DBDIR
=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_admin
125 PKG_CREATE?
= PKG_DBDIR
=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_create
126 PKG_DELETE?
= PKG_DBDIR
=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_delete
127 PKG_INFO?
= PKG_DBDIR
=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_info
129 .if
!defined
(PKGTOOLS_VERSION
)
130 .if
!exists
(${IDENT})
131 PKGTOOLS_VERSION
=${PKGTOOLS_REQD}
133 PKGTOOLS_VERSION
!=${IDENT} ${PKG_TOOLS_BIN}/pkg_add
${PKG_TOOLS_BIN}/pkg_admin
${PKG_TOOLS_BIN}/pkg_create
${PKG_TOOLS_BIN}/pkg_delete
${PKG_TOOLS_BIN}/pkg_info |
${AWK} 'BEGIN {n = 0;}; $$1 ~ /\$$NetBSD/ && $$2 !~ /^crt0/ {gsub("/", "", $$4); if ($$4 > n) {n = $$4;}}; END {print n;}'
136 MAKEFLAGS
+= PKGTOOLS_VERSION
="${PKGTOOLS_VERSION}"
138 # Latest version of pkgtools required for this file.
139 PKGTOOLS_REQD
= 20000202
141 # Check that we're using up-to-date pkg_* tools with this file.
143 ${_PKG_SILENT}${_PKG_DEBUG} \
144 if
[ ${PKGTOOLS_VERSION} -lt
${PKGTOOLS_REQD} ]; then \
149 ${ECHO} "Your package tools need to be updated to ${PKGTOOLS_REQD:C|(....)(..)(..)|\1/\2/\3|} versions."; \
150 ${ECHO} "The installed package tools were last updated on ${PKGTOOLS_VERSION:C|(....)(..)(..)|\1/\2/\3|}."; \
155 # Files to create for versioning and build information
156 BUILD_VERSION_FILE
= ${WRKDIR}/.build_version
157 BUILD_INFO_FILE
= ${WRKDIR}/.build_info
159 # Files containing size of pkg w/o and w/ all required pkgs
160 SIZE_PKG_FILE
= ${WRKDIR}/.SizePkg
161 SIZE_ALL_FILE
= ${WRKDIR}/.SizeAll
163 .
ifndef PKG_ARGS_COMMON
164 PKG_ARGS_COMMON
= -v
-c
${COMMENT} -d
${DESCR} -f
${PLIST} -l
165 PKG_ARGS_COMMON
+= -b
${BUILD_VERSION_FILE} -B
${BUILD_INFO_FILE}
166 PKG_ARGS_COMMON
+= -s
${SIZE_PKG_FILE} -S
${SIZE_ALL_FILE}
167 PKG_ARGS_COMMON
+= -P
"`${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_DEPENDS_QUICK=true|sort -u`"
169 PKG_ARGS_COMMON
+= -C
"${CONFLICTS}"
171 .
ifdef PKG_INSTALL_FILE
172 PKG_ARGS_COMMON
+= -i
${PKG_INSTALL_FILE}
174 .
ifdef PKG_DEINSTALL_FILE
175 PKG_ARGS_COMMON
+= -k
${PKG_DEINSTALL_FILE}
178 PKG_ARGS_COMMON
+= -D
${MESSAGE_FILE}
181 PKG_ARGS_INSTALL
= -p
${PREFIX} ${PKG_ARGS_COMMON}
182 PKG_ARGS_BINPKG
= -p
${PREFIX
:C
/^
${DESTDIR}//} -L
${PREFIX} ${PKG_ARGS_COMMON}
183 .
endif # !PKG_ARGS_COMMON
186 #PKG_SUFX?= .tbz # bzip2(1) pkgs
187 # where pkg_add records its dirty deeds.
188 PKG_DBDIR?
= ${DESTDIR}/var
/db
/syspkg
190 # Define SMART_MESSAGES in /etc/mk.conf for messages giving the tree
191 # of depencies for building, and the current target.
192 .
ifdef SMART_MESSAGES
193 _PKGSRC_IN?
= ===> ${.TARGET
} [${PKGNAME}${_PKGSRC_DEPS}] ===
198 # Used to print all the '===>' style prompts - override this to turn them off.
201 # How to do nothing. Override if you, for some strange reason, would rather
205 .if
!defined
(PKGBASE
) ||
!defined
(SETNAME
)
207 @
${ECHO_MSG} "PKGBASE and SETNAME are mandatory."
211 PKGREPOSITORY?
= ${PACKAGES}
212 PKGFILE?
= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
216 # Add these defs to the ones dumped into +BUILD_DEFS
217 BUILD_DEFS
+= OPSYS OS_VERSION MACHINE_ARCH OBJECT_FMT
220 # We don't build here
224 ################################################################
225 # More standard targets start here.
227 # These are the body of the build/install framework. If you are
228 # not happy with the default actions, and you can't solve it by
229 # adding pre-* or post-* targets/scripts, override these.
230 ################################################################
232 .if
!target
(show-downlevel
)
234 ${_PKG_SILENT}${_PKG_DEBUG} \
235 found
="`${PKG_INFO} -e \"${PKGBASE}<${PKGVERSION}\" || ${TRUE}`";\
236 if
[ "X$$found" != "X" -a
"X$$found" != "X${PKGNAME}" ]; then \
237 ${ECHO} "${PKGBASE} package: $$found installed, pkgsrc version ${PKGNAME}"; \
243 .if
!target
(do-package
)
245 ${_PKG_SILENT}${_PKG_DEBUG}\
246 ${ECHO_MSG} "${_PKGSRC_IN}> Building binary package for ${PKGNAME}"; \
247 if
[ ! -d
${PKGREPOSITORY} ]; then \
248 ${MKDIR} ${PKGREPOSITORY}; \
249 if
[ $$?
-ne
0 ]; then \
250 ${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
254 if
${PKG_CREATE} ${PKG_ARGS_BINPKG} ${PKGFILE}; then \
255 (cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} package-links
); \
257 (cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} delete-package
); \
262 # Some support rules for do-package
264 .if
!target
(package-links
)
266 ${_PKG_SILENT}${_PKG_DEBUG}(cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} delete-package-links
)
267 ${_PKG_SILENT}${_PKG_DEBUG}for cat in
${CATEGORIES}; do \
268 if
[ ! -d
${PACKAGES}/$$cat ]; then \
269 ${MKDIR} ${PACKAGES}/$$cat; \
270 if
[ $$?
-ne
0 ]; then \
271 ${ECHO_MSG} "=> Can't create directory ${PACKAGES}/$$cat."; \
275 ${RM} -f
${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}; \
276 ${LN} -s ..
/${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PACKAGES}/$$cat; \
280 .if
!target
(delete-package-links
)
281 delete-package-links
:
282 ${_PKG_SILENT}${_PKG_DEBUG}\
283 ${FIND} ${PACKAGES} -type l
-name
${PKGNAME}${PKG_SUFX} | xargs
${RM} -f
286 .if
!target
(delete-package
)
288 ${_PKG_SILENT}${_PKG_DEBUG}(cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} delete-package-links
)
289 ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f
${PKGFILE}
292 ################################################################
293 # This is the "generic" package target, actually a macro used from the
294 # six main targets. See below for more.
295 ################################################################
298 ${_PKG_SILENT}${_PKG_DEBUG}cd
${.CURDIR
} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} ${.TARGET
:S
/^real-
/pre-
/}
299 ${_PKG_SILENT}${_PKG_DEBUG}cd
${.CURDIR
} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} ${.TARGET
:S
/^real-
/do-
/}
300 ${_PKG_SILENT}${_PKG_DEBUG}cd
${.CURDIR
} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} ${.TARGET
:S
/^real-
/post-
/}
302 ################################################################
303 # Skeleton targets start here
305 # You shouldn't have to change these. Either add the pre-* or
306 # post-* targets/scripts or redefine the do-* targets. These
307 # targets don't do anything other than checking for cookies and
308 # call the necessary targets/scripts.
309 ################################################################
312 package
: uptodate-pkgtools
${PACKAGE_COOKIE}
316 ${_PKG_SILENT}${_PKG_DEBUG}(cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} real-package
)
318 # Empty pre-* and post-* targets, note we can't use .if !target()
319 # in the _PORT_USE macro
323 .if
!target
(pre-
${name})
328 .if
!target
(post-
${name})
337 # Special target to remove installation
339 .if
!target
(deinstall
)
340 deinstall
: real-deinstall
342 .if
(${DEINSTALLDEPENDS} != "NO")
343 .if
(${DEINSTALLDEPENDS} != "ALL")
344 # used for removing stuff in bulk builds
345 real-su-deinstall-flags
+= -r
-R
346 # used for "update" target
348 real-su-deinstall-flags
+= -r
352 real-su-deinstall-flags
+= -v
356 ${_PKG_SILENT}${_PKG_DEBUG} \
357 found
="`${PKG_INFO} -e \"${PKGWILDCARD}\" || ${TRUE}`"; \
358 if
[ "$$found" != "" ]; then \
359 ${ECHO} Running
${PKG_DELETE} ${real-su-deinstall-flags
} $$found ; \
360 ${PKG_DELETE} ${real-su-deinstall-flags
} $$found ||
${TRUE} ; \
362 .for pkg in
${BUILD_DEPENDS
:C
/:.
*$//}
363 ${_PKG_SILENT}${_PKG_DEBUG} \
364 found
="`${PKG_INFO} -e \"${pkg}\" || ${TRUE}`"; \
365 if
[ "$$found" != "" ]; then \
366 ${ECHO} Running
${PKG_DELETE} $$found ; \
367 ${PKG_DELETE} ${real-su-deinstall-flags
} $$found ||
${TRUE} ; \
370 .
endif # target(deinstall)
373 ################################################################
374 # Some more targets supplied for users' convenience
375 ################################################################
377 # The 'info' target can be used to display information about a package.
378 info: uptodate-pkgtools
379 ${_PKG_SILENT}${_PKG_DEBUG}${PKG_INFO} ${PKGWILDCARD}
381 # The 'check' target can be used to check an installed package.
382 check: uptodate-pkgtools
383 ${_PKG_SILENT}${_PKG_DEBUG}${PKG_ADMIN} check ${PKGWILDCARD}
387 .if
!target
(pre-clean
)
394 ${RM} -f
${PLIST} ${BUILD_VERSION_FILE} ${BUILD_INFO_FILE} ${SIZE_PKG_FILE} ${SIZE_ALL_FILE}
397 .if
!target
(cleandir
)
401 # Install binary pkg, without strict uptodate-check first
402 # (XXX should be able to snarf via FTP. Later...)
404 @if
[ -f
${PKGFILE} ] ; then \
405 ${ECHO_MSG} "Installing from binary pkg ${PKGFILE}" ; \
406 ${PKG_ADD} ${PKGFILE} ; \
408 ${SHCOMMENT} Cycle through some FTP server here
;\
409 ${ECHO_MSG} "Installing from source" ; \
410 (cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} package
&& \
411 ${MAKE} ${MAKEFLAGS} clean) ; \
415 ################################################################
416 # The special package-building targets
417 # You probably won't need to touch these
418 ################################################################
420 # Nobody should want to override this unless PKGNAME is simply bogus.
422 .if
!target
(package-name
)
425 .
endif # !target(package-name)
427 # Show (recursively) all the packages this package depends on.
428 # If PACKAGE_DEPENDS_WITH_PATTERNS is set, print as pattern (if possible)
429 PACKAGE_DEPENDS_WITH_PATTERNS?
=true
430 # To be used (-> true) ONLY if the pkg in question is known to be installed
431 # (i.e. when calling for pkg_create args, and for fake-pkg)
432 # Will probably not work with PACKAGE_DEPENDS_WITH_PATTERNS=false ...
433 PACKAGE_DEPENDS_QUICK?
=false
434 .if
!target
(run-depends-list
)
436 .for dep in
${DEPENDS}
437 ${_PKG_SILENT}${_PKG_DEBUG} \
438 pkg
="${dep:C/:.*//}"; \
439 dir="${dep:C/[^:]*://}"; \
441 if
${PACKAGE_DEPENDS_WITH_PATTERNS}; then \
444 if cd
$$dir 2>/dev
/null
; then \
445 (cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} package-name
; \
447 ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
450 if
${PACKAGE_DEPENDS_QUICK} ; then \
451 ${PKG_INFO} -qf
"$$pkg" |
${AWK} '/^@pkgdep/ {print $$2}'; \
453 if cd
$$dir 2>/dev
/null
; then \
454 (cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} run-depends-list
; \
456 ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
460 .
endif # target(run-depends-list)
462 # Build a package but don't check the package cookie
464 .if
!target
(repackage
)
465 repackage
: pre-repackage package
468 ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f
${PACKAGE_COOKIE}
471 # Build a package but don't check the cookie for installation, also don't
472 # install package cookie
474 .if
!target
(package-noinstall
)
476 ${_PKG_SILENT}${_PKG_DEBUG}(cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} PACKAGE_NOINSTALL
=yes real-package
)
479 ################################################################
480 # Dependency checking
481 ################################################################
483 .if
!target
(install-depends
)
487 ################################################################
488 # Everything after here are internal targets and really
489 # shouldn't be touched by anybody but the release engineers.
490 ################################################################
492 .if
!target
(show-pkgtools-version
)
493 show-pkgtools-version
:
494 @
${ECHO} ${PKGTOOLS_VERSION}
497 # convenience target, to display make variables from command line
498 # i.e. "make show-var VARNAME=var", will print var's value
500 @
${ECHO} "${${VARNAME}}"
502 # Stat all the files of one pkg and sum the sizes up.
504 # XXX This is intended to be run before pkg_create is called, so the
505 # existence of ${PLIST} can be assumed.
507 @
${SHCOMMENT} "This pkg's files" ; \
508 ${AWK} 'BEGIN { base = "${PREFIX}/" } \
509 /^@cwd/ { base = $$2 "/" } \
510 /^@ignore/ { next } \
511 NF == 1 { print base $$1 }' \
514 |
${SED} -e
's, ,\\ ,g' \
516 |
${AWK} 'BEGIN { print("0 "); } \
517 { print($$5, " + "); } \
518 END { print("p"); }' \
521 # Sizes of required pkgs (only)
523 # XXX This is intended to be run before pkg_create is called, so the
524 # dependencies are all installed.
525 print-pkg-size-depends
:
526 @
(cd
${.CURDIR
} && ${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_DEPENDS_QUICK
=true
) \
527 | xargs
-n
1 ${SETENV} ${PKG_INFO} -e \
529 | xargs
${SETENV} ${PKG_INFO} -qs \
530 |
${AWK} -- 'BEGIN { print("0 "); } \
531 /^[0-9]+$$/ { print($$1, " + "); } \
532 END { print("p"); }' \
536 # Fake installation of package so that user can pkg_delete it later.
537 # Also, make sure that an installed package is recognized correctly in
538 # accordance to the @pkgdep directive in the packing lists
540 .if
!target
(register
)
544 .if
!target
(fake-pkg
)
546 ${_PKG_SILENT}${_PKG_DEBUG}\
547 if
[ ! -f
${PLIST} -o
! -f
${COMMENT} -o
! -f
${DESCR} ]; then \
548 ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; \
551 ${_PKG_SILENT}${_PKG_DEBUG}\
552 if
[ ! -d
${PKG_DBDIR} ]; then \
553 ${RM} -f
${PKG_DBDIR}; \
554 ${MKDIR} ${PKG_DBDIR}; \
556 .if defined
(FORCE_PKG_REGISTER
)
557 ${_PKG_SILENT}${_PKG_DEBUG}${PKG_DELETE} -O
${PKGNAME}
558 ${_PKG_SILENT}${_PKG_DEBUG}${RM} -rf
${PKG_DBDIR}/${PKGNAME}
560 ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f
${BUILD_VERSION_FILE} ${BUILD_INFO_FILE}
561 ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f
${SIZE_PKG_FILE} ${SIZE_ALL_FILE}
562 ${_PKG_SILENT}${_PKG_DEBUG}\
564 for f in
${.CURDIR
}/Makefile
${FILESDIR}/* ${PKGDIR}/*; do \
565 if
[ -f
$$f ]; then \
566 files
="$$files $$f"; \
569 ${GREP} '\$$NetBSD' $$files |
${SED} -e
's|^${PKGSRCDIR}/||' > ${BUILD_VERSION_FILE};
570 .for def in
${BUILD_DEFS}
571 @
${ECHO} ${def}= ${${def}:Q
} |
${SED} -e
's|^PATH=[^ ]*|PATH=...|' >> ${BUILD_INFO_FILE}
573 @
${ECHO} "CC= ${CC}-`${CC} --version`" >> ${BUILD_INFO_FILE}
574 ${_PKG_SILENT}${_PKG_DEBUG} \
575 ${ECHO} "_PKGTOOLS_VER=${PKGTOOLS_VERSION}" >> ${BUILD_INFO_FILE}
576 ${_PKG_SILENT}${_PKG_DEBUG} \
577 size_this
=`(cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} print-pkg-size-this)`; \
578 size_depends
=`(cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} print-pkg-size-depends)`; \
579 ${ECHO} $$size_this >${SIZE_PKG_FILE}; \
580 ${ECHO} $$size_this $$size_depends + p |
${DC} >${SIZE_ALL_FILE}
581 ${_PKG_SILENT}${_PKG_DEBUG} \
582 if
[ ! -d
${PKG_DBDIR}/${PKGNAME} ]; then \
583 ${ECHO_MSG} "${_PKGSRC_IN}> Registering installation for ${PKGNAME}"; \
584 ${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \
585 ${PKG_CREATE} ${PKG_ARGS_INSTALL} -O
${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS
; \
586 ${CP} ${DESCR} ${PKG_DBDIR}/${PKGNAME}/+DESC
; \
587 ${CP} ${COMMENT} ${PKG_DBDIR}/${PKGNAME}/+COMMENT
; \
588 ${CP} ${BUILD_VERSION_FILE} ${PKG_DBDIR}/${PKGNAME}/+BUILD_VERSION
; \
589 ${CP} ${BUILD_INFO_FILE} ${PKG_DBDIR}/${PKGNAME}/+BUILD_INFO
; \
590 if
${TEST} -e
${SIZE_PKG_FILE}; then \
591 ${CP} ${SIZE_PKG_FILE} ${PKG_DBDIR}/${PKGNAME}/+SIZE_PKG
; \
593 if
${TEST} -e
${SIZE_ALL_FILE}; then \
594 ${CP} ${SIZE_ALL_FILE} ${PKG_DBDIR}/${PKGNAME}/+SIZE_ALL
; \
596 if
[ -n
"${PKG_INSTALL_FILE}" ]; then \
597 if
${TEST} -e
${PKG_INSTALL_FILE}; then \
598 ${CP} ${PKG_INSTALL_FILE} ${PKG_DBDIR}/${PKGNAME}/+INSTALL
; \
601 if
[ -n
"${PKG_DEINSTALL_FILE}" ]; then \
602 if
${TEST} -e
${PKG_DEINSTALL_FILE}; then \
603 ${CP} ${PKG_DEINSTALL_FILE} ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL
; \
606 if
[ -n
"${MESSAGE_FILE}" ]; then \
607 if
${TEST} -e
${MESSAGE_FILE}; then \
608 ${CP} ${MESSAGE_FILE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY
; \
611 list
="`(cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_DEPENDS_QUICK=true ECHO_MSG=${TRUE} | sort -u)`" ; \
612 for dep in
$$list; do \
613 realdep
="`${PKG_INFO} -e \"$$dep\" || ${TRUE}`" ; \
614 if
[ `${ECHO} $$realdep | wc -w` -gt
1 ]; then \
615 ${ECHO} '***' "WARNING: '$$dep' expands to several installed packages " ; \
616 ${ECHO} " (" `${ECHO} $$realdep` ")." ; \
617 ${ECHO} " Please check if this is really intended!" ; \
621 for realdep in
`echo $$list | xargs -n 1 ${SETENV} ${PKG_INFO} -e | sort -u`; do \
622 if
${TEST} -z
"$$realdep"; then \
623 ${ECHO} "$$dep not installed - dependency NOT registered" ; \
624 elif
[ -d
${PKG_DBDIR}/$$realdep ]; then \
625 if
${TEST} ! -e
${PKG_DBDIR}/$$realdep/+REQUIRED_BY
; then \
626 ${TOUCH} ${PKG_DBDIR}/$$realdep/+REQUIRED_BY
; \
628 ${AWK} 'BEGIN { found = 0; } \
629 $$0 == "${PKGNAME}" { found = 1; } \
631 END { if (!found) { printf("%s\n", "${PKGNAME}"); }}' \
632 < ${PKG_DBDIR}/$$realdep/+REQUIRED_BY
> ${PKG_DBDIR}/$$realdep/reqby.
$$$$; \
633 ${MV} ${PKG_DBDIR}/$$realdep/reqby.
$$$$ ${PKG_DBDIR}/$$realdep/+REQUIRED_BY
; \
634 ${ECHO} "${PKGNAME} requires installed package $$realdep"; \
640 # Depend is generally meaningless for arbitrary packages, but if someone wants
641 # one they can override this. This is just to catch people who've gotten into
642 # the habit of typing `${MAKE} depend all install' as a matter of course.
654 sh
${.CURDIR
}/..
/..
/..
/..
/sets
/makeplist
${SETNAME} ${PKGBASE} > ${PLIST}
656 .
endif # BSD_SYSPKG_MK