2001-05-05 16:20:59 -04:00
|
|
|
# $OpenBSD: old-install.mk,v 1.6 2001/05/05 20:20:59 espie Exp $
|
2000-12-23 07:25:57 -05:00
|
|
|
# Stuff that is needed for old, pre-fake, port installations.
|
|
|
|
|
|
|
|
# If ${FAKE} == No
|
|
|
|
# install - Install the results of a build.
|
|
|
|
# reinstall - Install the results of a build, ignoring "already installed"
|
|
|
|
# flag.
|
|
|
|
# deinstall - Remove the installation. Alias: uninstall
|
|
|
|
# package - Create a package from an _installed_ port.
|
|
|
|
|
2001-01-18 09:58:16 -05:00
|
|
|
# Corresponding obsolescent variables
|
|
|
|
# PKG_DBDIR - Where package installation is recorded (default: /var/db/pkg)
|
|
|
|
# FORCE_PKG_REGISTER - If set, it will overwrite any existing package
|
2001-03-21 19:23:15 -05:00
|
|
|
# registration information in ${PKG_DBDIR}/${FULLPKGNAME}.
|
2001-01-18 09:58:16 -05:00
|
|
|
|
|
|
|
# where pkg_add records its dirty deeds.
|
|
|
|
PKG_DBDIR?= /var/db/pkg
|
|
|
|
|
2000-12-23 07:25:57 -05:00
|
|
|
|
|
|
|
${_FAKE_COOKIE}: ${_BUILD_COOKIE}
|
2001-03-21 19:23:15 -05:00
|
|
|
@echo 1>&2 "*** ${FULLPKGNAME} does not use fake installation yet"
|
2000-12-23 07:25:57 -05:00
|
|
|
|
|
|
|
# The real install, old version
|
|
|
|
${_INSTALL_COOKIE}: ${_BUILD_COOKIE}
|
2001-05-05 16:20:59 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} run-depends lib-depends
|
2000-12-23 07:25:57 -05:00
|
|
|
.if !defined(NO_INSTALL)
|
2001-03-21 19:23:15 -05:00
|
|
|
@${ECHO_MSG} "===> Installing for ${FULLPKGNAME}"
|
2000-12-23 07:25:57 -05:00
|
|
|
# Kludge
|
|
|
|
. if ${CONFIGURE_STYLE:Mimake}
|
2001-05-05 16:20:59 -04:00
|
|
|
@${SUDO} mkdir -p /usr/local/lib/X11
|
2000-12-23 07:25:57 -05:00
|
|
|
@if [ ! -e /usr/local/lib/X11/app-defaults ]; then \
|
2001-05-05 16:20:59 -04:00
|
|
|
${SUDO} ln -sf /var/X11/app-defaults /usr/local/lib/X11/app-defaults; \
|
2000-12-23 07:25:57 -05:00
|
|
|
fi
|
|
|
|
. endif
|
|
|
|
. if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
|
2001-03-21 19:23:15 -05:00
|
|
|
@if [ -d ${PKG_DBDIR}/${FULLPKGNAME} -o "X$$(ls -d ${PKG_DBDIR}/${FULLPKGNAME:C/-[0-9].*//g}-* 2> /dev/null)" != "X" ]; then \
|
|
|
|
echo "===> ${FULLPKGNAME} is already installed - perhaps an older version?"; \
|
2000-12-23 07:25:57 -05:00
|
|
|
echo " If so, you may wish to \`\`make deinstall'' and install"; \
|
|
|
|
echo " this port again by \`\`make reinstall'' to upgrade it properly."; \
|
2001-03-21 19:23:15 -05:00
|
|
|
echo " If you really wish to overwrite the old port of ${FULLPKGNAME}"; \
|
2000-12-23 07:25:57 -05:00
|
|
|
echo " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
|
|
|
|
echo " in your environment or the \"make install\" command line."; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
. endif
|
|
|
|
@if [ `${SH} -c umask` != ${DEF_UMASK} ]; then \
|
|
|
|
${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
|
|
|
|
${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
|
|
|
|
${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
|
|
|
|
fi
|
|
|
|
@${_MAKE_COOKIE} ${_INSTALL_PRE_COOKIE}
|
|
|
|
. if target(pre-install)
|
2001-05-05 16:20:59 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} pre-install
|
2000-12-23 07:25:57 -05:00
|
|
|
. endif
|
|
|
|
. if target(do-install)
|
2001-05-05 16:20:59 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} do-install
|
2000-12-23 07:25:57 -05:00
|
|
|
. else
|
|
|
|
# What INSTALL normally does:
|
2001-05-05 16:20:59 -04:00
|
|
|
@cd ${WRKBUILD} && ${SUDO} ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKE_FILE} ${INSTALL_TARGET}
|
2000-12-23 07:25:57 -05:00
|
|
|
# End of INSTALL.
|
|
|
|
. endif
|
|
|
|
. if target(post-install)
|
2001-05-05 16:20:59 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} post-install
|
2000-12-23 07:25:57 -05:00
|
|
|
. endif
|
|
|
|
. if defined(_MANPAGES) || defined(_CATPAGES)
|
|
|
|
. if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
|
2001-03-21 19:23:15 -05:00
|
|
|
@${ECHO_MSG} "===> Uncompressing manual pages for ${FULLPKGNAME}"
|
2000-12-23 07:25:57 -05:00
|
|
|
. for manpage in ${_MANPAGES} ${_CATPAGES}
|
2001-05-05 16:20:59 -04:00
|
|
|
@${SUDO} ${GUNZIP_CMD} ${manpage}.gz
|
2000-12-23 07:25:57 -05:00
|
|
|
. endfor
|
|
|
|
. elif !defined(MANCOMPRESSED) && !defined(NOMANCOMPRESS)
|
2001-03-21 19:23:15 -05:00
|
|
|
@${ECHO_MSG} "===> Compressing manual pages for ${FULLPKGNAME}"
|
2000-12-23 07:25:57 -05:00
|
|
|
. for manpage in ${_MANPAGES} ${_CATPAGES}
|
|
|
|
@if [ -L ${manpage} ]; then \
|
|
|
|
set - `file ${manpage}`; \
|
|
|
|
shift `expr $$# - 1`; \
|
2001-05-05 16:20:59 -04:00
|
|
|
${SUDO} ln -sf $${1}.gz ${manpage}.gz; \
|
|
|
|
${SUDO} rm ${manpage}; \
|
2000-12-23 07:25:57 -05:00
|
|
|
else \
|
2001-05-05 16:20:59 -04:00
|
|
|
${SUDO} ${GZIP_CMD} ${manpage}; \
|
2000-12-23 07:25:57 -05:00
|
|
|
fi
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. endif
|
2001-02-15 16:51:32 -05:00
|
|
|
. if defined(MESSAGE)
|
2000-12-23 07:25:57 -05:00
|
|
|
@cat ${WRKBUILD}/MESSAGE${SUBPACKAGE}
|
|
|
|
. endif
|
|
|
|
. if !defined(NO_PKG_REGISTER)
|
2001-05-05 16:20:59 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} fake-pkg
|
2000-12-23 07:25:57 -05:00
|
|
|
. endif
|
|
|
|
.endif
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
2000-12-23 07:25:57 -05:00
|
|
|
|
|
|
|
# Figure out where the local mtree file is
|
|
|
|
.if ${PREFIX} == "/usr/local"
|
|
|
|
MTREE_FILE?= /etc/mtree/BSD.local.dist
|
|
|
|
.else
|
|
|
|
MTREE_FILE?= /etc/mtree/BSD.x11.dist
|
|
|
|
.endif
|
|
|
|
|
|
|
|
plist: install
|
|
|
|
@DESTDIR=${PREFIX} PREFIX=${PREFIX} LDCONFIG="${LDCONFIG}" MTREE_FILE=${MTREE_FILE} \
|
|
|
|
INSTALL_PRE_COOKIE=${_INSTALL_PRE_COOKIE} \
|
|
|
|
perl ${PORTSDIR}/infrastructure/install/make-plist ${PLIST}
|
|
|
|
|
|
|
|
# Fake installation of package so that user can pkg_delete it later.
|
|
|
|
# Also, make sure that an installed port is recognized correctly in
|
|
|
|
# accordance to the @pkgdep directive in the packing lists
|
|
|
|
|
|
|
|
fake-pkg: ${_PKG_PREREQ}
|
2001-05-05 16:20:59 -04:00
|
|
|
@if [ `${_COMMENT} | wc -c` -gt 60 ]; then \
|
2000-12-23 07:25:57 -05:00
|
|
|
echo "** ${COMMENT} too large - installation not recorded."; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
@if [ ! -d ${PKG_DBDIR} ]; then rm -f ${PKG_DBDIR}; mkdir -p ${PKG_DBDIR}; fi
|
|
|
|
.if defined(FORCE_PKG_REGISTER)
|
2001-03-21 19:23:15 -05:00
|
|
|
@rm -rf ${PKG_DBDIR}/${FULLPKGNAME}
|
2000-12-23 07:25:57 -05:00
|
|
|
.endif
|
2001-03-21 19:23:15 -05:00
|
|
|
@if [ ! -d ${PKG_DBDIR}/${FULLPKGNAME} ]; then \
|
|
|
|
${ECHO_MSG} "===> Registering installation for ${FULLPKGNAME}"; \
|
|
|
|
mkdir -p ${PKG_DBDIR}/${FULLPKGNAME}; \
|
|
|
|
${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${FULLPKGNAME}/+CONTENTS; \
|
|
|
|
cp ${WRKPKG}/DESCR${SUBPACKAGE} ${PKG_DBDIR}/${FULLPKGNAME}/+DESC; \
|
2001-05-05 16:20:59 -04:00
|
|
|
${_COMMENT} >${PKG_DBDIR}/${FULLPKGNAME}/+COMMENT; \
|
2000-12-23 07:25:57 -05:00
|
|
|
if [ -f ${WRKPKG}/INSTALL${SUBPACKAGE} ]; then \
|
2001-03-21 19:23:15 -05:00
|
|
|
cp ${WRKPKG}/INSTALL${SUBPACKAGE} ${PKG_DBDIR}/${FULLPKGNAME}/+INSTALL; \
|
2000-12-23 07:25:57 -05:00
|
|
|
fi; \
|
|
|
|
if [ -f ${WRKPKG}/DEINSTALL${SUBPACKAGE} ]; then \
|
2001-03-21 19:23:15 -05:00
|
|
|
cp ${WRKPKG}/DEINSTALL${SUBPACKAGE} ${PKG_DBDIR}/${FULLPKGNAME}/+DEINSTALL; \
|
2000-12-23 07:25:57 -05:00
|
|
|
fi; \
|
|
|
|
if [ -f ${WRKPKG}/REQ${SUBPACKAGE} ]; then \
|
2001-03-21 19:23:15 -05:00
|
|
|
cp ${WRKPKG}}/REQ${SUBPACKAGE} ${PKG_DBDIR}/${FULLPKGNAME}/+REQ; \
|
2000-12-23 07:25:57 -05:00
|
|
|
fi; \
|
|
|
|
if [ -f ${WRKPKG}/MESSAGE${SUBPACKAGE} ]; then \
|
2001-03-21 19:23:15 -05:00
|
|
|
cp ${WRKPKG}/MESSAGE${SUBPACKAGE} ${PKG_DBDIR}/${FULLPKGNAME}/+DISPLAY; \
|
2000-12-23 07:25:57 -05:00
|
|
|
fi; \
|
|
|
|
for dep in `cd ${.CURDIR} && ${MAKE} package-depends ECHO_MSG=true | ${_SORT_DEPENDS}`; do \
|
|
|
|
if [ -d ${PKG_DBDIR}/$$dep ]; then \
|
2001-03-21 19:23:15 -05:00
|
|
|
if ! grep ^${FULLPKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \
|
2000-12-23 07:25:57 -05:00
|
|
|
>/dev/null 2>&1; then \
|
2001-03-21 19:23:15 -05:00
|
|
|
echo ${FULLPKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \
|
2000-12-23 07:25:57 -05:00
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
.PHONY: fake-pkg
|