Annotation of pkgsrc/pkgtools/pkg_install/Makefile, Revision 1.120
1.120 ! jlam 1: # $NetBSD: Makefile,v 1.119 2005/11/07 06:32:58 jlam Exp $
1.4 hubertf 2:
1.58 schmonz 3: # Notes to package maintainers:
1.57 hubertf 4: #
1.58 schmonz 5: # To update this package, import from src/usr.sbin/pkg_install.
1.57 hubertf 6: #
1.58 schmonz 7: # Updating this package does not automatically necessitate bumping
8: # PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical
9: # change in the pkg_* tools that pkgsrc relies on for proper operation.
1.57 hubertf 10:
1.58 schmonz 11: DISTNAME= pkg_install-${VERSION}
1.1 agc 12: CATEGORIES= pkgtools
1.58 schmonz 13: MASTER_SITES= # empty
14: DISTFILES= # empty
1.1 agc 15:
1.73 grant 16: MAINTAINER= tech-pkg@NetBSD.org
1.82 reed 17: HOMEPAGE= http://www.pkgsrc.org/
1.90 grant 18: COMMENT= Package management and administration tools for pkgsrc
1.60 schmonz 19:
1.115 rillig 20: GNU_CONFIGURE= yes
1.58 schmonz 21: CONFIGURE_ARGS+= --with-pkgdbdir=${PKG_DBDIR}
1.110 uebayasi 22: CONFIGURE_ARGS+= --with-ftp="\"${FETCH_CMD}"\"
23: CONFIGURE_ARGS+= --with-mtree="\"${MTREE}"\"
24: CONFIGURE_ARGS+= --with-pax="\"${PAX}"\"
25: CONFIGURE_ARGS+= --with-tar="\"${TAR}"\"
1.112 jlam 26: USE_TOOLS= mtree pax tar
1.58 schmonz 27:
1.113 jlam 28: # The following tools are needed by pkg_view and linkfarm.
1.114 jlam 29: USE_TOOLS+= chmod cmp cp env find grep ln mkdir rm rmdir \
1.113 jlam 30: sed sort touch
31:
1.65 schmonz 32: NO_PKGTOOLS_REQD_CHECK= # defined
1.115 rillig 33: NO_CHECKSUM= yes
34: NO_MTREE= yes
1.66 agc 35: PKG_PRESERVE= # defined
1.117 jlam 36: INSTALL_FILE= ${PKG_DB_TMPDIR}/+INSTALL
1.119 jlam 37: INSTALL_SCRIPTS_ENV+= PKG_PREFIX=${PREFIX}
1.1 agc 38:
1.97 jlam 39: # These are needed to solve a chicken-and-egg problem where pkgsrc uses
1.96 jlam 40: # newer features of pkg_install, but older NetBSD installations won't
41: # support them. In this case, we explicitly use the native GCC
42: # compiler to avoid problems with depending on pkgsrc GCC for building
1.97 jlam 43: # pkg_install. We also avoid building digest as that would involve
44: # using the newer pkg_install tools.
1.117 jlam 45: #
46: # We also use the newly built pkg_delete since upgrading from an older
47: # pkg_install might required features of the new program.
1.96 jlam 48: #
49: USE_NATIVE_GCC= yes
1.97 jlam 50: USE_DIGEST= no
1.117 jlam 51: PKG_DELETE= ${WRKSRC}/delete/pkg_delete
1.89 grant 52:
1.100 tv 53: CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK}
54:
1.95 grant 55: MAKE_ENV+= MACHINE_ARCH="${MACHINE_ARCH}"
56: MAKE_ENV+= OPSYS="${OPSYS}"
1.91 grant 57:
1.92 jlam 58: PKG_DBDIR?= /var/db/pkg
59: PKG_INFO= PKG_DBDIR=${PKG_DBDIR} ${PKG_INFO_CMD}
1.94 jlam 60: PKG_ADMIN= PKG_DBDIR=${PKG_DBDIR} ${PKG_ADMIN_CMD}
1.92 jlam 61:
1.117 jlam 62: PLIST_SUBST+= PKG_DBDIR=${PKG_DBDIR}
63:
1.92 jlam 64: .include "../../mk/bsd.prefs.mk"
65:
1.117 jlam 66: PKG_TOOLS_PREFIX= ${PKG_TOOLS_BIN:C|/[^/]?bin$||}
1.58 schmonz 67: VERSION!= ${AWK} -F '"' '/PKGTOOLS_VERSION/ {print $$2}' \
68: ${FILESDIR}/lib/version.h
1.78 jlam 69:
1.117 jlam 70: # XXX This breaks for those who set their own LOCALBASE to "/usr" and also
71: # XXX set PKGMANDIR to be other than "share/man".
72: # XXX
73: .if !empty(PKG_TOOLS_PREFIX:M/usr)
74: PKGMANDIR= share/man
75: .endif
76:
1.58 schmonz 77: do-extract:
1.107 tv 78: @${CP} -R ${FILESDIR} ${WRKSRC}
1.12 hubertf 79:
1.117 jlam 80: post-build:
81: ${SED} -e "s|@PKG_DBDIR@|${PKG_DBDIR}|g" \
1.120 ! jlam 82: -e "s|@PKG_TOOLS_BIN@|${PKG_TOOLS_BIN}|g" \
1.117 jlam 83: -e "s|@MKDIR@|${MKDIR}|g" \
84: ${PKGDIR}/INSTALL > ${INSTALL_FILE}
85: ${CHMOD} +x ${INSTALL_FILE}
86:
87: pre-install-script:
88: cd ${PKG_DB_TMPDIR} && ${SETENV} ${INSTALL_SCRIPTS_ENV} \
89: ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
90:
91: post-install-script:
92: cd ${PKG_DB_TMPDIR} && ${SETENV} ${INSTALL_SCRIPTS_ENV} \
93: ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
1.1 agc 94:
1.106 erh 95: # XXX Reverse the order that update does things since
96: # XXX we need pkg_delete built before we can deinstall.
97: # XXX This should probably be the default order for all packages.
98: update:
99: ${MAKE}
100: ${MAKE} deinstall UPDATE_RUNNING=YES
1.118 jlam 101: ${MAKE} ${UPDATE_TARGET}
1.108 jklos 102: ${MAKE} clean
1.106 erh 103:
1.103 jlam 104: .include "../../pkgtools/libnbcompat/inplace.mk"
1.1 agc 105: .include "../../mk/bsd.pkg.mk"
1.65 schmonz 106:
1.117 jlam 107: PREFIX:= ${PKG_TOOLS_PREFIX}
CVSweb <webmaster@jp.NetBSD.org>