112 lines
3.2 KiB
Makefile
112 lines
3.2 KiB
Makefile
# $NetBSD: Makefile,v 1.10 2007/03/02 08:48:51 thomasklausner Exp $
|
|
|
|
# Notes to package maintainers:
|
|
#
|
|
# To update this package, import from src/usr.sbin/pkg_install.
|
|
#
|
|
# Updating this package does not automatically necessitate bumping
|
|
# PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical
|
|
# change in the pkg_* tools that pkgsrc relies on for proper operation.
|
|
|
|
DISTNAME= pkg_install-${VERSION}
|
|
PKGREVISION= 2
|
|
CATEGORIES= pkgtools
|
|
MASTER_SITES= # empty
|
|
DISTFILES= # empty
|
|
|
|
MAINTAINER= pkgsrc-users@NetBSD.org
|
|
HOMEPAGE= http://www.pkgsrc.org/
|
|
COMMENT= Package management and administration tools for pkgsrc
|
|
|
|
GNU_CONFIGURE= yes
|
|
CONFIGURE_ARGS+= --with-pkgdbdir=${PKG_DBDIR:Q}
|
|
CONFIGURE_ARGS+= --with-ftp=${FETCH_CMD:Q}
|
|
CONFIGURE_ARGS+= --with-mtree=${MTREE:Q}
|
|
CONFIGURE_ARGS+= --with-pax=${PAX:Q}
|
|
CONFIGURE_ARGS+= --with-tar=${TAR:Q}
|
|
|
|
SKIP_AUDIT_PACKAGES= yes
|
|
NO_PKGTOOLS_REQD_CHECK= yes
|
|
NO_CHECKSUM= yes
|
|
NO_MTREE= yes
|
|
PKG_PRESERVE= yes
|
|
|
|
# These are needed to solve a chicken-and-egg problem where pkgsrc uses
|
|
# newer features of pkg_install, but older NetBSD installations won't
|
|
# support them. In this case, we explicitly use the native GCC
|
|
# compiler to avoid problems with depending on pkgsrc GCC for building
|
|
# pkg_install.
|
|
#
|
|
# 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
|
|
PKG_DELETE= ${WRKSRC}/delete/pkg_delete
|
|
|
|
PLIST_SUBST+= MANDIR=${MANDIR:Q}
|
|
PLIST_SUBST+= PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q}
|
|
|
|
LIBNBCOMPAT_FILESDIR= ${.CURDIR}/../../pkgtools/libnbcompat/files
|
|
LIBNBCOMPAT_SRCDIR= ${WRKDIR}/libnbcompat
|
|
|
|
CPPFLAGS+= -I${LIBNBCOMPAT_SRCDIR}
|
|
LDFLAGS+= -L${LIBNBCOMPAT_SRCDIR}
|
|
LIBS+= -lnbcompat
|
|
|
|
CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK}
|
|
|
|
MAKE_ENV+= MACHINE_ARCH=${MACHINE_ARCH:Q}
|
|
MAKE_ENV+= OPSYS=${OPSYS:Q}
|
|
|
|
MAKE_DIRS+= ${PKG_DBDIR}
|
|
|
|
PKG_DBDIR?= /var/db/pkg
|
|
PKG_INFO= PKG_DBDIR=${PKG_DBDIR} ${PKG_INFO_CMD}
|
|
PKG_ADMIN= PKG_DBDIR=${PKG_DBDIR} ${PKG_ADMIN_CMD}
|
|
|
|
.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
|
|
|
|
# If ${PKG_TOOLS_PREFIX} doesn't match ${LOCALBASE}, then don't run
|
|
# check-files since it's likely ${PKG_TOOLS_PREFIX} contains directories
|
|
# that shouldn't be checked.
|
|
#
|
|
.if ${PKG_TOOLS_PREFIX} != ${LOCALBASE}
|
|
CHECK_FILES_SUPPORTED= no
|
|
.endif
|
|
|
|
do-extract:
|
|
@${CP} -R ${LIBNBCOMPAT_FILESDIR} ${LIBNBCOMPAT_SRCDIR}
|
|
@${CP} -R ${FILESDIR} ${WRKSRC}
|
|
|
|
pre-configure:
|
|
@cd ${LIBNBCOMPAT_SRCDIR} && ${SETENV} ${CONFIGURE_ENV:NLIBS=*} \
|
|
CC="${CC}" CPPFLAGS=${CPPFLAGS:Q} ./configure && ${MAKE_PROGRAM}
|
|
|
|
post-install:
|
|
if [ ! -f ${PKG_DBDIR}/pkgdb.byfile.db ]; then \
|
|
${PKG_ADMIN} rebuild; \
|
|
fi
|
|
|
|
# XXX Reverse the order that update does things since
|
|
# XXX we need pkg_delete built before we can deinstall.
|
|
# XXX This should probably be the default order for all packages.
|
|
update:
|
|
${MAKE}
|
|
${MAKE} deinstall _UPDATE_RUNNING=YES
|
|
${MAKE} ${UPDATE_TARGET}
|
|
${MAKE} clean
|
|
|
|
.include "../../mk/bsd.pkg.mk"
|
|
|
|
PREFIX:= ${PKG_TOOLS_PREFIX}
|