summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install/Makefile
diff options
context:
space:
mode:
authorjlam <jlam>2005-11-06 22:15:44 +0000
committerjlam <jlam>2005-11-06 22:15:44 +0000
commit44c96beae4e675421c97d65c439f11175255a644 (patch)
tree868a337a175af90df4a8fdfc6c5353160d3cf10d /pkgtools/pkg_install/Makefile
parenta1a132298e662d623d6ebdb196d7060ee8d29600 (diff)
downloadpkgsrc-44c96beae4e675421c97d65c439f11175255a644.tar.gz
Remove @exec from PLIST and put the action into an INSTALL script instead.
Also, simplify the package by making use of the PKGMANDIR-handling in pkgsrc to remove the custom MANDIR code from the package Makefile and the PLIST. Technically, this type of a change would require a PKGREVISION bump, but as this is the pkg_* tools package and there were no changes to the binaries, we refrain from doing so.
Diffstat (limited to 'pkgtools/pkg_install/Makefile')
-rw-r--r--pkgtools/pkg_install/Makefile55
1 files changed, 31 insertions, 24 deletions
diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile
index df60d9022d7..72bce9e6f4a 100644
--- a/pkgtools/pkg_install/Makefile
+++ b/pkgtools/pkg_install/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.116 2005/10/07 18:05:07 reed Exp $
+# $NetBSD: Makefile,v 1.117 2005/11/06 22:15:44 jlam Exp $
# Notes to package maintainers:
#
@@ -33,6 +33,7 @@ NO_PKGTOOLS_REQD_CHECK= # defined
NO_CHECKSUM= yes
NO_MTREE= yes
PKG_PRESERVE= # defined
+INSTALL_FILE= ${PKG_DB_TMPDIR}/+INSTALL
# These are needed to solve a chicken-and-egg problem where pkgsrc uses
# newer features of pkg_install, but older NetBSD installations won't
@@ -40,15 +41,13 @@ PKG_PRESERVE= # defined
# compiler to avoid problems with depending on pkgsrc GCC for building
# pkg_install. We also avoid building digest as that would involve
# using the newer pkg_install tools.
-# We also use the newly built pkg_delete since upgrading from
-# an older pkg_install might required features of the new program.
+#
+# We also use the newly built pkg_delete since upgrading from an older
+# pkg_install might required features of the new program.
#
USE_NATIVE_GCC= yes
USE_DIGEST= no
-PKG_DELETE= ${WRKSRC}/delete/pkg_delete
-
-PLIST_SUBST+= MANDIR=${MANDIR}
-PLIST_SUBST+= PKG_TOOLS_BIN=${PKG_TOOLS_BIN}
+PKG_DELETE= ${WRKSRC}/delete/pkg_delete
CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK}
@@ -59,21 +58,37 @@ PKG_DBDIR?= /var/db/pkg
PKG_INFO= PKG_DBDIR=${PKG_DBDIR} ${PKG_INFO_CMD}
PKG_ADMIN= PKG_DBDIR=${PKG_DBDIR} ${PKG_ADMIN_CMD}
+PLIST_SUBST+= PKG_DBDIR=${PKG_DBDIR}
+
.include "../../mk/bsd.prefs.mk"
+PKG_TOOLS_PREFIX= ${PKG_TOOLS_BIN:C|/[^/]?bin$||}
VERSION!= ${AWK} -F '"' '/PKGTOOLS_VERSION/ {print $$2}' \
${FILESDIR}/lib/version.h
+# XXX This breaks for those who set their own LOCALBASE to "/usr" and also
+# XXX set PKGMANDIR to be other than "share/man".
+# XXX
+.if !empty(PKG_TOOLS_PREFIX:M/usr)
+PKGMANDIR= share/man
+.endif
+
do-extract:
@${CP} -R ${FILESDIR} ${WRKSRC}
-post-install:
- if [ ! -f ${PKG_DBDIR}/pkgdb.byfile.db ]; then \
- if [ ! -d ${PKG_DBDIR} ]; then \
- ${INSTALL_DATA_DIR} ${PKG_DBDIR}; \
- fi; \
- ${PKG_ADMIN} rebuild; \
- fi
+post-build:
+ ${SED} -e "s|@PKG_DBDIR@|${PKG_DBDIR}|g" \
+ -e "s|@MKDIR@|${MKDIR}|g" \
+ ${PKGDIR}/INSTALL > ${INSTALL_FILE}
+ ${CHMOD} +x ${INSTALL_FILE}
+
+pre-install-script:
+ cd ${PKG_DB_TMPDIR} && ${SETENV} ${INSTALL_SCRIPTS_ENV} \
+ ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
+
+post-install-script:
+ cd ${PKG_DB_TMPDIR} && ${SETENV} ${INSTALL_SCRIPTS_ENV} \
+ ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
# XXX Reverse the order that update does things since
# XXX we need pkg_delete built before we can deinstall.
@@ -81,18 +96,10 @@ post-install:
update:
${MAKE}
${MAKE} deinstall UPDATE_RUNNING=YES
- ${MAKE} install
+ ${MAKE} update
${MAKE} clean
.include "../../pkgtools/libnbcompat/inplace.mk"
.include "../../mk/bsd.pkg.mk"
-PREFIX:= ${PKG_TOOLS_BIN:C|/[^/]?bin$||}
-.if ${PREFIX} == "/usr"
-# XXX This breaks for those who set their own LOCALBASE to /usr
-# XXX and also define PKGMANDIR to different than share/man.
-CONFIGURE_ARGS+= --mandir=${PREFIX}/share/man
-MANDIR= share/
-.else
-MANDIR= # empty
-.endif
+PREFIX:= ${PKG_TOOLS_PREFIX}