2012-05-29 09:54:27 +00:00
|
|
|
#-*- tab-width: 4; -*-
|
2012-01-30 12:39:14 +00:00
|
|
|
# ex:ts=4
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2012-02-22 17:34:47 +00:00
|
|
|
.if defined(_POSTMKINCLUDED)
|
|
|
|
PKGNG_Include_MAINTAINER= portmgr@FreeBSD.org
|
2012-01-30 12:39:14 +00:00
|
|
|
|
|
|
|
METADIR= ${WRKDIR}/.metadir
|
|
|
|
MANIFESTF= ${METADIR}/+MANIFEST
|
|
|
|
|
|
|
|
PKGPREINSTALL?= ${PKGDIR}/pkg-pre-install
|
|
|
|
PKGPOSTINSTALL?= ${PKGDIR}/pkg-post-install
|
|
|
|
PKGPREDEINSTALL?= ${PKGDIR}/pkg-pre-deinstall
|
|
|
|
PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
|
|
|
|
PKGPREUPGRADE?= ${PKGDIR}/pkg-pre-upgrade
|
|
|
|
PKGPOSTUPGRADE?= ${PKGDIR}/pkg-post-upgrade
|
|
|
|
PKGUPGRADE?= ${PKGDIR}/pkg-upgrade
|
2013-03-28 07:00:59 +00:00
|
|
|
_FORCE_POST_PATTERNS= rmdir kldxref mkfontscale mkfontdir fc-cache \
|
2013-03-28 07:45:02 +00:00
|
|
|
fonts.dir fonts.scale gtk-update-icon-cache \
|
2013-03-28 07:00:59 +00:00
|
|
|
gio-querymodules \
|
2013-06-17 16:18:54 +00:00
|
|
|
gtk-query-immodules \
|
2013-05-24 11:51:08 +00:00
|
|
|
ldconfig \
|
2013-06-15 09:10:37 +00:00
|
|
|
load-octave-pkg \
|
2014-03-26 08:34:53 +00:00
|
|
|
ocamlfind \
|
2013-04-04 17:03:53 +00:00
|
|
|
update-desktop-database update-mime-database \
|
2013-04-05 09:24:39 +00:00
|
|
|
gdk-pixbuf-query-loaders catalog.ports \
|
2014-02-12 21:35:41 +00:00
|
|
|
glib-compile-schemas \
|
|
|
|
ccache-update-links
|
2013-03-28 07:00:59 +00:00
|
|
|
|
2012-01-30 12:39:14 +00:00
|
|
|
PLIST_REINPLACE:= ${PLIST_REINPLACE:Ndirrmtry}
|
|
|
|
PLIST_REINPLACE:= ${PLIST_REINPLACE:Nstopdaemon}
|
|
|
|
|
|
|
|
ACTUAL-PACKAGE-DEPENDS?= \
|
|
|
|
if [ "${_LIB_RUN_DEPENDS}" != " " ]; then \
|
2013-03-09 14:14:40 +00:00
|
|
|
${PKG_QUERY} "%n: {origin: %o, version: \"%v\"}" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} 2>/dev/null || : ; \
|
2012-01-30 12:39:14 +00:00
|
|
|
fi
|
|
|
|
|
Add support for staging area in the ports tree
The ports tree is now staged by default. With pkgng the sequence hasn't
changed, the main difference is that creating package is now independent
from installing it. With pkg_install, the package is now created first
and make install, do install the package.
New macros:
- STAGEDIR: PATH to the directory where the port will be staged.
- NO_STAGE: Keep the old behaviour of the ports tree (aka no staging area)
Unsupported macro if NO_STAGE is not set:
- MAN* with staging man page compression and handling of hardlinks and
symlinks is automatically done in the stage. the manpages becomes then a
"normal" plist files and should be tracked in pkg-plist.
- MANCOMPRESSED the compress-man target is able to only compress when it
needed.
New target:
- stage: this installs everything into the stage directory
- makeplist: this will create a pkg-plist and print it to stdout. This is
a sample plist and it should always be _reviewed_ not directly used.
NOTE: with staging only what is in the plist will be installed, nothing more,
meaning a port staged cannot have leftovers exect directories left. It is
really important to double check the pkg-plist to make sure all the files
the maintainer want to package are in! make makeplist can help in that area.
The goal is to handle as quickly as possible a full removal of the NO_STAGE
support.
More features can be added once the full ports tree is converted to using the
staging area
Conversion notes:
- Remove NO_STAGE
- in {pre,do,post}-install
* Before any usage of ${PREFIX}, ${ETCDIR}, ${PORTSDIR}, ${PORTEXAMPLES}
prepend ${STAGEDIR}
* Remove any thing that is done by @exec or +INSTALL script it will be
done automatically when syncing packages
* Remove any code to show PKG-MESSAGE it will be done automatically when
syncing packages
* Directory creation should remain in post-install (in particular because
pkgng doesn't work like pkg_install in that area and pkgng ignores the
@exec mkdir but directly pack the directory even if empty)
- PORTDOCS/PORTEXAMPELS
To support PORTDOCS, PORTEXAMPLES most of the time there is no more need
for hacks. just add the right %%PORTDOCS%% or %%PORTEXAMPLES%% in your
plist then the given files from the stagedir will or will not sync
according to NOPORTDOCS and NOPORTEXAMPLES.
With hat: portmgr
Reviewed by: bdrewery
2013-09-23 05:56:35 +00:00
|
|
|
create-manifest:
|
2012-01-30 12:39:14 +00:00
|
|
|
@${MKDIR} ${METADIR}
|
|
|
|
@${ECHO_CMD} "name: ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}" > ${MANIFESTF}
|
2013-12-06 08:20:16 +00:00
|
|
|
@${ECHO_CMD} "version: ${PKGVERSION}" >> ${MANIFESTF}
|
|
|
|
@${ECHO_CMD} "origin: ${PKGORIGIN}" >> ${MANIFESTF}
|
2012-01-30 12:39:14 +00:00
|
|
|
@${ECHO_CMD} "comment: |" >> ${MANIFESTF}
|
2014-01-10 13:07:05 +00:00
|
|
|
@${ECHO_CMD} " "${COMMENT:Q} >> ${MANIFESTF}
|
2012-01-30 12:39:14 +00:00
|
|
|
@${ECHO_CMD} "maintainer: ${MAINTAINER}" >> ${MANIFESTF}
|
|
|
|
@${ECHO_CMD} "prefix: ${PREFIX}" >> ${MANIFESTF}
|
2013-12-10 19:05:41 +00:00
|
|
|
#.if defined(NO_ARCH)
|
|
|
|
# @${ECHO_CMD} "arch: `${PKG_BIN} config abi | ${CUT} -d: -f1,2`:*" >> ${MANIFESTF}
|
|
|
|
#.endif
|
2012-01-30 12:39:14 +00:00
|
|
|
.if defined(WWW)
|
|
|
|
@${ECHO_CMD} "www: ${WWW}" >> ${MANIFESTF}
|
|
|
|
.endif
|
|
|
|
@${ECHO_CMD} "deps: " >> ${MANIFESTF}
|
2013-06-10 14:38:18 +00:00
|
|
|
@${ACTUAL-PACKAGE-DEPENDS} | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u | ${SED} 's/^/ /' >> ${MANIFESTF}
|
2012-01-30 12:39:14 +00:00
|
|
|
@${ECHO_CMD} -n "categories: [" >> ${MANIFESTF}
|
|
|
|
.for cat in ${CATEGORIES:u}
|
|
|
|
@${ECHO_CMD} -n "${cat}," >> ${MANIFESTF}
|
|
|
|
.endfor
|
|
|
|
@${ECHO_CMD} "]" >> ${MANIFESTF}
|
|
|
|
.if defined(LICENSE_COMB)
|
|
|
|
@${ECHO_CMD} "licenselogic: ${LICENSE_COMB}" >> ${MANIFESTF}
|
|
|
|
.else
|
|
|
|
@${ECHO_CMD} "licenselogic: single" >> ${MANIFESTF}
|
|
|
|
.endif
|
|
|
|
@${ECHO_CMD} -n "licenses: [" >> ${MANIFESTF}
|
|
|
|
.for lic in ${LICENSE:u}
|
|
|
|
@${ECHO_CMD} -n "${lic}," >> ${MANIFESTF}
|
|
|
|
.endfor
|
|
|
|
@${ECHO_CMD} "]" >> ${MANIFESTF}
|
|
|
|
@${ECHO_CMD} -n "users: [" >> ${MANIFESTF}
|
|
|
|
.for user in ${USERS:u}
|
|
|
|
@${ECHO_CMD} -n "${user}, " >> ${MANIFESTF}
|
|
|
|
.endfor
|
|
|
|
@${ECHO_CMD} "]" >> ${MANIFESTF}
|
|
|
|
@${ECHO_CMD} -n "groups: [" >> ${MANIFESTF}
|
|
|
|
.for group in ${GROUPS:u}
|
|
|
|
@${ECHO_CMD} -n "${group}, " >> ${MANIFESTF}
|
|
|
|
.endfor
|
|
|
|
@${ECHO_CMD} "]" >> ${MANIFESTF}
|
|
|
|
@${ECHO_CMD} -n "options: {" >> ${MANIFESTF}
|
2013-06-10 13:47:43 +00:00
|
|
|
.for opt in ${COMPLETE_OPTIONS_LIST}
|
2013-06-14 06:56:16 +00:00
|
|
|
@[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}: $${match:-off}," >> ${MANIFESTF}
|
2012-05-29 09:54:27 +00:00
|
|
|
.endfor
|
|
|
|
.undef opt
|
2012-01-30 12:39:14 +00:00
|
|
|
@${ECHO_CMD} "}" >> ${MANIFESTF}
|
2013-10-30 22:13:56 +00:00
|
|
|
@[ -f ${PKGINSTALL} ] && ${CP} ${PKGINSTALL} ${METADIR}/+INSTALL; \
|
2013-10-30 17:47:48 +00:00
|
|
|
${RM} -f ${METADIR}/+PRE_INSTALL ; \
|
|
|
|
for a in ${PKGPREINSTALL}; do \
|
|
|
|
[ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_INSTALL ; \
|
|
|
|
done ; \
|
|
|
|
${RM} -f ${METADIR}/+POST_INSTALL ; \
|
|
|
|
for a in ${PKGPOSTINSTALL}; do \
|
|
|
|
[ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_INSTALL ; \
|
|
|
|
done ; \
|
2012-01-30 12:39:14 +00:00
|
|
|
[ -f ${PKGDEINSTALL} ] && ${CP} ${PKGDEINSTALL} ${METADIR}/+DEINSTALL; \
|
2013-10-30 17:47:48 +00:00
|
|
|
${RM} -f ${METADIR}/+PRE_DEINSTALL ; \
|
|
|
|
for a in ${PKGPREDEINSTALL}; do \
|
|
|
|
[ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_DEINSTALL ; \
|
|
|
|
done ; \
|
|
|
|
${RM} -f ${METADIR}/+POST_DEINSTALL ; \
|
2013-11-25 22:49:29 +00:00
|
|
|
for a in ${PKGPOSTDEINSTALL}; do \
|
2013-10-30 17:47:48 +00:00
|
|
|
[ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_DEINSTALL ; \
|
|
|
|
done ; \
|
2012-01-30 12:39:14 +00:00
|
|
|
[ -f ${PKGPOSTDEINSTALL} ] && ${CP} ${PKGPOSTDEINSTALL} ${METADIR}/+POST_DEINSTALL; \
|
|
|
|
[ -f ${PKGUPGRADE} ] && ${CP} ${PKGUPGRADE} ${METADIR}/+UPGRADE; \
|
|
|
|
[ -f ${PKGPREUPGRADE} ] && ${CP} ${PKGPREUPGRADE} ${METADIR}/+PRE_UPGRADE; \
|
|
|
|
[ -f ${PKGPOSTUPGRADE} ] && ${CP} ${PKGPOSTUPGRADE} ${METADIR}/+POST_UPGRADE; \
|
|
|
|
${CP} ${DESCR} ${METADIR}/+DESC; \
|
|
|
|
[ -f ${PKGMESSAGE} ] && ${CP} ${PKGMESSAGE} ${METADIR}/+DISPLAY || return 0
|
|
|
|
.if !defined(NO_MTREE)
|
|
|
|
@[ -f ${MTREE_FILE} ] && ${CP} ${MTREE_FILE} ${METADIR}/+MTREE_DIRS || return 0
|
|
|
|
.endif
|
Add support for staging area in the ports tree
The ports tree is now staged by default. With pkgng the sequence hasn't
changed, the main difference is that creating package is now independent
from installing it. With pkg_install, the package is now created first
and make install, do install the package.
New macros:
- STAGEDIR: PATH to the directory where the port will be staged.
- NO_STAGE: Keep the old behaviour of the ports tree (aka no staging area)
Unsupported macro if NO_STAGE is not set:
- MAN* with staging man page compression and handling of hardlinks and
symlinks is automatically done in the stage. the manpages becomes then a
"normal" plist files and should be tracked in pkg-plist.
- MANCOMPRESSED the compress-man target is able to only compress when it
needed.
New target:
- stage: this installs everything into the stage directory
- makeplist: this will create a pkg-plist and print it to stdout. This is
a sample plist and it should always be _reviewed_ not directly used.
NOTE: with staging only what is in the plist will be installed, nothing more,
meaning a port staged cannot have leftovers exect directories left. It is
really important to double check the pkg-plist to make sure all the files
the maintainer want to package are in! make makeplist can help in that area.
The goal is to handle as quickly as possible a full removal of the NO_STAGE
support.
More features can be added once the full ports tree is converted to using the
staging area
Conversion notes:
- Remove NO_STAGE
- in {pre,do,post}-install
* Before any usage of ${PREFIX}, ${ETCDIR}, ${PORTSDIR}, ${PORTEXAMPLES}
prepend ${STAGEDIR}
* Remove any thing that is done by @exec or +INSTALL script it will be
done automatically when syncing packages
* Remove any code to show PKG-MESSAGE it will be done automatically when
syncing packages
* Directory creation should remain in post-install (in particular because
pkgng doesn't work like pkg_install in that area and pkgng ignores the
@exec mkdir but directly pack the directory even if empty)
- PORTDOCS/PORTEXAMPELS
To support PORTDOCS, PORTEXAMPLES most of the time there is no more need
for hacks. just add the right %%PORTDOCS%% or %%PORTEXAMPLES%% in your
plist then the given files from the stagedir will or will not sync
according to NOPORTDOCS and NOPORTEXAMPLES.
With hat: portmgr
Reviewed by: bdrewery
2013-09-23 05:56:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
.if !target(fake-pkg)
|
|
|
|
.if defined(NO_STAGE)
|
|
|
|
STAGE_ARGS= -l
|
|
|
|
.else
|
|
|
|
STAGE_ARGS= -i ${STAGEDIR}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(NO_PKG_REGISTER)
|
2014-01-03 23:05:37 +00:00
|
|
|
fake-pkg: create-manifest
|
Add support for staging area in the ports tree
The ports tree is now staged by default. With pkgng the sequence hasn't
changed, the main difference is that creating package is now independent
from installing it. With pkg_install, the package is now created first
and make install, do install the package.
New macros:
- STAGEDIR: PATH to the directory where the port will be staged.
- NO_STAGE: Keep the old behaviour of the ports tree (aka no staging area)
Unsupported macro if NO_STAGE is not set:
- MAN* with staging man page compression and handling of hardlinks and
symlinks is automatically done in the stage. the manpages becomes then a
"normal" plist files and should be tracked in pkg-plist.
- MANCOMPRESSED the compress-man target is able to only compress when it
needed.
New target:
- stage: this installs everything into the stage directory
- makeplist: this will create a pkg-plist and print it to stdout. This is
a sample plist and it should always be _reviewed_ not directly used.
NOTE: with staging only what is in the plist will be installed, nothing more,
meaning a port staged cannot have leftovers exect directories left. It is
really important to double check the pkg-plist to make sure all the files
the maintainer want to package are in! make makeplist can help in that area.
The goal is to handle as quickly as possible a full removal of the NO_STAGE
support.
More features can be added once the full ports tree is converted to using the
staging area
Conversion notes:
- Remove NO_STAGE
- in {pre,do,post}-install
* Before any usage of ${PREFIX}, ${ETCDIR}, ${PORTSDIR}, ${PORTEXAMPLES}
prepend ${STAGEDIR}
* Remove any thing that is done by @exec or +INSTALL script it will be
done automatically when syncing packages
* Remove any code to show PKG-MESSAGE it will be done automatically when
syncing packages
* Directory creation should remain in post-install (in particular because
pkgng doesn't work like pkg_install in that area and pkgng ignores the
@exec mkdir but directly pack the directory even if empty)
- PORTDOCS/PORTEXAMPELS
To support PORTDOCS, PORTEXAMPLES most of the time there is no more need
for hacks. just add the right %%PORTDOCS%% or %%PORTEXAMPLES%% in your
plist then the given files from the stagedir will or will not sync
according to NOPORTDOCS and NOPORTEXAMPLES.
With hat: portmgr
Reviewed by: bdrewery
2013-09-23 05:56:35 +00:00
|
|
|
.if defined(INSTALLS_DEPENDS)
|
|
|
|
@${ECHO_MSG} "===> Registering installation for ${PKGNAME} as automatic"
|
|
|
|
.else
|
|
|
|
@${ECHO_MSG} "===> Registering installation for ${PKGNAME}"
|
|
|
|
.endif
|
2012-01-30 12:39:14 +00:00
|
|
|
.if defined(INSTALLS_DEPENDS)
|
2014-04-12 22:29:15 +00:00
|
|
|
@${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} -d ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
|
2012-01-30 12:39:14 +00:00
|
|
|
.else
|
2014-04-12 22:29:15 +00:00
|
|
|
@${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
|
2012-01-30 12:39:14 +00:00
|
|
|
.endif
|
2012-09-20 19:51:30 +00:00
|
|
|
@${RM} -rf ${METADIR}
|
2012-01-30 12:39:14 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(check-build-conflicts)
|
|
|
|
check-build-conflicts:
|
|
|
|
.if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
|
2012-05-17 22:07:18 +00:00
|
|
|
@conflicts_with=$$( \
|
2013-03-12 22:15:57 +00:00
|
|
|
{ ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \
|
2012-01-30 12:39:14 +00:00
|
|
|
| while read pkgname prfx orgn; do \
|
|
|
|
if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
|
2012-05-17 22:07:18 +00:00
|
|
|
${ECHO_CMD} -n " $${pkgname}"; \
|
2012-01-30 12:39:14 +00:00
|
|
|
fi; \
|
2012-05-17 22:07:18 +00:00
|
|
|
done); \
|
2012-01-30 12:39:14 +00:00
|
|
|
if [ -n "$${conflicts_with}" ]; then \
|
|
|
|
${ECHO_MSG}; \
|
|
|
|
${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
|
|
|
|
for entry in $${conflicts_with}; do \
|
|
|
|
${ECHO_MSG} " $${entry}"; \
|
|
|
|
done; \
|
|
|
|
${ECHO_MSG}; \
|
|
|
|
${ECHO_MSG} " They will not build together."; \
|
|
|
|
${ECHO_MSG} " Please remove them first with pkg delete."; \
|
|
|
|
exit 1;\
|
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(identify-install-conflicts)
|
|
|
|
identify-install-conflicts:
|
|
|
|
.if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
|
2012-05-17 22:07:18 +00:00
|
|
|
@conflicts_with=$$( \
|
2013-03-12 22:15:57 +00:00
|
|
|
{ ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
|
2012-01-30 12:39:14 +00:00
|
|
|
| while read pkgname prfx orgn; do \
|
|
|
|
if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
|
2012-05-17 22:07:18 +00:00
|
|
|
${ECHO_CMD} -n " $${pkgname}"; \
|
2012-01-30 12:39:14 +00:00
|
|
|
fi; \
|
2012-05-17 22:07:18 +00:00
|
|
|
done); \
|
2012-01-30 12:39:14 +00:00
|
|
|
if [ -n "$${conflicts_with}" ]; then \
|
|
|
|
${ECHO_MSG}; \
|
|
|
|
${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
|
|
|
|
for entry in $${conflicts_with}; do \
|
|
|
|
${ECHO_MSG} " $${entry}"; \
|
|
|
|
done; \
|
|
|
|
${ECHO_MSG}; \
|
|
|
|
${ECHO_MSG} " They install files into the same place."; \
|
|
|
|
${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
|
|
|
|
sleep 10; \
|
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(check-install-conflicts)
|
|
|
|
check-install-conflicts:
|
|
|
|
.if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
|
|
|
|
.if defined(DEFER_CONFLICTS_CHECK)
|
2012-05-17 22:07:18 +00:00
|
|
|
@conflicts_with=$$( \
|
2013-03-12 22:15:57 +00:00
|
|
|
{ ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
|
2012-01-30 12:39:14 +00:00
|
|
|
| while read pkgname prfx orgn; do \
|
|
|
|
if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
|
2012-05-17 22:07:18 +00:00
|
|
|
${ECHO_CMD} -n " $${pkgname}"; \
|
2012-01-30 12:39:14 +00:00
|
|
|
fi; \
|
2012-05-17 22:07:18 +00:00
|
|
|
done); \
|
2012-01-30 12:39:14 +00:00
|
|
|
if [ -n "$${conflicts_with}" ]; then \
|
|
|
|
${ECHO_MSG}; \
|
|
|
|
${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
|
|
|
|
for entry in $${conflicts_with}; do \
|
|
|
|
${ECHO_MSG} " $${entry}"; \
|
|
|
|
done; \
|
|
|
|
${ECHO_MSG}; \
|
2013-10-16 00:38:38 +00:00
|
|
|
${ECHO_MSG} " Please remove them first with pkg delete."; \
|
2012-01-30 12:39:14 +00:00
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
.else
|
2012-05-17 22:07:18 +00:00
|
|
|
@conflicts_with=$$( \
|
2013-03-12 22:15:57 +00:00
|
|
|
{ ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
|
2012-01-30 12:39:14 +00:00
|
|
|
| while read pkgname prfx orgn; do \
|
|
|
|
if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
|
2012-05-17 22:07:18 +00:00
|
|
|
${ECHO_CMD} -n " $${pkgname}"; \
|
2012-01-30 12:39:14 +00:00
|
|
|
fi; \
|
2012-05-17 22:07:18 +00:00
|
|
|
done); \
|
2012-01-30 12:39:14 +00:00
|
|
|
if [ -n "$${conflicts_with}" ]; then \
|
|
|
|
${ECHO_MSG}; \
|
|
|
|
${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
|
|
|
|
for entry in $${conflicts_with}; do \
|
2012-06-14 21:34:13 +00:00
|
|
|
${ECHO_MSG} " $${entry}"; \
|
2012-01-30 12:39:14 +00:00
|
|
|
done; \
|
|
|
|
${ECHO_MSG}; \
|
|
|
|
${ECHO_MSG} " They install files into the same place."; \
|
2013-10-16 00:38:38 +00:00
|
|
|
${ECHO_MSG} " Please remove them first with pkg delete."; \
|
2012-01-30 12:39:14 +00:00
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
.endif # defined(DEFER_CONFLICTS_CHECK)
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(do-package)
|
Add support for staging area in the ports tree
The ports tree is now staged by default. With pkgng the sequence hasn't
changed, the main difference is that creating package is now independent
from installing it. With pkg_install, the package is now created first
and make install, do install the package.
New macros:
- STAGEDIR: PATH to the directory where the port will be staged.
- NO_STAGE: Keep the old behaviour of the ports tree (aka no staging area)
Unsupported macro if NO_STAGE is not set:
- MAN* with staging man page compression and handling of hardlinks and
symlinks is automatically done in the stage. the manpages becomes then a
"normal" plist files and should be tracked in pkg-plist.
- MANCOMPRESSED the compress-man target is able to only compress when it
needed.
New target:
- stage: this installs everything into the stage directory
- makeplist: this will create a pkg-plist and print it to stdout. This is
a sample plist and it should always be _reviewed_ not directly used.
NOTE: with staging only what is in the plist will be installed, nothing more,
meaning a port staged cannot have leftovers exect directories left. It is
really important to double check the pkg-plist to make sure all the files
the maintainer want to package are in! make makeplist can help in that area.
The goal is to handle as quickly as possible a full removal of the NO_STAGE
support.
More features can be added once the full ports tree is converted to using the
staging area
Conversion notes:
- Remove NO_STAGE
- in {pre,do,post}-install
* Before any usage of ${PREFIX}, ${ETCDIR}, ${PORTSDIR}, ${PORTEXAMPLES}
prepend ${STAGEDIR}
* Remove any thing that is done by @exec or +INSTALL script it will be
done automatically when syncing packages
* Remove any code to show PKG-MESSAGE it will be done automatically when
syncing packages
* Directory creation should remain in post-install (in particular because
pkgng doesn't work like pkg_install in that area and pkgng ignores the
@exec mkdir but directly pack the directory even if empty)
- PORTDOCS/PORTEXAMPELS
To support PORTDOCS, PORTEXAMPLES most of the time there is no more need
for hacks. just add the right %%PORTDOCS%% or %%PORTEXAMPLES%% in your
plist then the given files from the stagedir will or will not sync
according to NOPORTDOCS and NOPORTEXAMPLES.
With hat: portmgr
Reviewed by: bdrewery
2013-09-23 05:56:35 +00:00
|
|
|
.if !defined(NO_STAGE)
|
|
|
|
PKG_CREATE_ARGS= -r ${STAGEDIR} -m ${METADIR} -p ${TMPPLIST}
|
|
|
|
do-package: create-manifest
|
|
|
|
.endif
|
2012-01-30 12:39:14 +00:00
|
|
|
do-package: ${TMPPLIST}
|
|
|
|
@if [ -d ${PACKAGES} ]; then \
|
|
|
|
if [ ! -d ${PKGREPOSITORY} ]; then \
|
|
|
|
if ! ${MKDIR} ${PKGREPOSITORY}; then \
|
|
|
|
${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
Add support for staging area in the ports tree
The ports tree is now staged by default. With pkgng the sequence hasn't
changed, the main difference is that creating package is now independent
from installing it. With pkg_install, the package is now created first
and make install, do install the package.
New macros:
- STAGEDIR: PATH to the directory where the port will be staged.
- NO_STAGE: Keep the old behaviour of the ports tree (aka no staging area)
Unsupported macro if NO_STAGE is not set:
- MAN* with staging man page compression and handling of hardlinks and
symlinks is automatically done in the stage. the manpages becomes then a
"normal" plist files and should be tracked in pkg-plist.
- MANCOMPRESSED the compress-man target is able to only compress when it
needed.
New target:
- stage: this installs everything into the stage directory
- makeplist: this will create a pkg-plist and print it to stdout. This is
a sample plist and it should always be _reviewed_ not directly used.
NOTE: with staging only what is in the plist will be installed, nothing more,
meaning a port staged cannot have leftovers exect directories left. It is
really important to double check the pkg-plist to make sure all the files
the maintainer want to package are in! make makeplist can help in that area.
The goal is to handle as quickly as possible a full removal of the NO_STAGE
support.
More features can be added once the full ports tree is converted to using the
staging area
Conversion notes:
- Remove NO_STAGE
- in {pre,do,post}-install
* Before any usage of ${PREFIX}, ${ETCDIR}, ${PORTSDIR}, ${PORTEXAMPLES}
prepend ${STAGEDIR}
* Remove any thing that is done by @exec or +INSTALL script it will be
done automatically when syncing packages
* Remove any code to show PKG-MESSAGE it will be done automatically when
syncing packages
* Directory creation should remain in post-install (in particular because
pkgng doesn't work like pkg_install in that area and pkgng ignores the
@exec mkdir but directly pack the directory even if empty)
- PORTDOCS/PORTEXAMPELS
To support PORTDOCS, PORTEXAMPLES most of the time there is no more need
for hacks. just add the right %%PORTDOCS%% or %%PORTEXAMPLES%% in your
plist then the given files from the stagedir will or will not sync
according to NOPORTDOCS and NOPORTEXAMPLES.
With hat: portmgr
Reviewed by: bdrewery
2013-09-23 05:56:35 +00:00
|
|
|
fi
|
2013-04-22 22:13:14 +00:00
|
|
|
@for cat in ${CATEGORIES}; do \
|
2013-04-26 20:19:50 +00:00
|
|
|
${RM} -f ${PACKAGES}/$$cat/${PKGNAMEPREFIX}${PORTNAME}*${PKG_SUFX} ; \
|
2013-04-22 22:13:14 +00:00
|
|
|
done
|
2014-03-23 15:34:13 +00:00
|
|
|
@${MKDIR} ${WRKDIR}/pkg
|
2014-04-03 13:35:51 +00:00
|
|
|
@if ${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CREATE} ${PKG_CREATE_ARGS} -o ${WRKDIR}/pkg ${PKGNAME}; then \
|
2014-03-23 15:21:42 +00:00
|
|
|
if [ -d ${PKGREPOSITORY} -a -w ${PKGREPOSITORY} ]; then \
|
2014-03-23 15:34:13 +00:00
|
|
|
${LN} -f ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE} 2>/dev/null \
|
|
|
|
|| ${CP} -af ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE}; \
|
2014-03-23 15:22:36 +00:00
|
|
|
if [ "${PKGORIGIN}" = "ports-mgmt/pkg" -o "${PKGORIGIN}" = "ports-mgmt/pkg-devel" ]; then \
|
|
|
|
if [ ! -d ${PKGLATESTREPOSITORY} ]; then \
|
|
|
|
if ! ${MKDIR} ${PKGLATESTREPOSITORY}; then \
|
|
|
|
${ECHO_MSG} "=> Can't create directory ${PKGLATESTREPOSITORY}."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi ; \
|
|
|
|
${LN} -sf ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PKGLATESTFILE} ; \
|
|
|
|
fi; \
|
2014-03-23 15:21:42 +00:00
|
|
|
fi; \
|
2012-01-30 12:39:14 +00:00
|
|
|
else \
|
|
|
|
cd ${.CURDIR} && eval ${MAKE} delete-package; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(check-already-installed)
|
|
|
|
.if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
|
2014-01-03 23:05:37 +00:00
|
|
|
check-already-installed:
|
2012-01-30 12:39:14 +00:00
|
|
|
@${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed"; \
|
|
|
|
pkgname=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
|
|
|
|
if [ -n "$${pkgname}" ]; then \
|
|
|
|
v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
|
2013-09-27 19:10:59 +00:00
|
|
|
if [ "$${v}" = "<" ]; then \
|
|
|
|
${ECHO_CMD} "===> An older version of ${PKGORIGIN} is already installed ($${pkgname})"; \
|
2012-01-30 12:39:14 +00:00
|
|
|
else \
|
|
|
|
${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
|
|
|
|
fi; \
|
|
|
|
${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
|
|
|
|
${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
|
|
|
|
${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGORIGIN}"; \
|
|
|
|
${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
|
|
|
|
${ECHO_MSG} " in your environment or the \"make install\" command line."; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
.if !target(deinstall)
|
|
|
|
deinstall:
|
2013-07-05 12:29:35 +00:00
|
|
|
.if defined(UID) && ${UID} != 0 && !defined(INSTALL_AS_USER)
|
2013-06-25 12:24:10 +00:00
|
|
|
@${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
|
|
|
|
@cd ${.CURDIR} && \
|
|
|
|
${SU_CMD} "${MAKE} ${.TARGET}"
|
|
|
|
@${ECHO_MSG} "===> Returning to user credentials"
|
|
|
|
.else
|
2012-01-30 12:39:14 +00:00
|
|
|
@${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
|
|
|
|
@if ${PKG_INFO} -e ${PKGORIGIN}; then \
|
|
|
|
p=`${PKG_INFO} -q ${PKGORIGIN}`; \
|
|
|
|
${ECHO_MSG} "===> Deinstalling $${p}"; \
|
|
|
|
${PKG_DELETE} -f ${PKGORIGIN} ; \
|
|
|
|
else \
|
|
|
|
${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \
|
|
|
|
fi
|
|
|
|
@${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
|
|
|
|
.endif
|
2013-06-25 12:24:10 +00:00
|
|
|
.endif
|
2012-01-30 12:39:14 +00:00
|
|
|
|
2012-02-22 17:34:47 +00:00
|
|
|
.endif # defined(_POSTMKINCLUDED)
|