Subject: diff for pkgtools/pkg_install
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 03/17/2003 11:31:03
Please share thoughts on diff below.

- The DESCRiption is more descriptive; also it shouldn't mention that it
  it isn't packaged.
- The comment is changed to be more clear on what this package is for.
- Allow it to be registered and installed as a package, because
  PKG_PRESERVE is already used.
- Make sure man page is installed correctly when not NetBSD.
- Make sure PLIST has correct path to manpage.
- Make sure that PLIST's exec has this path to pkg_admin executable.

Index: pkgtools/pkg_install/DESCR
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/DESCR,v
retrieving revision 1.2
diff -b -u -r1.2 DESCR
--- pkgtools/pkg_install/DESCR	2002/12/20 18:15:52	1.2
+++ pkgtools/pkg_install/DESCR	2003/03/17 19:27:56
@@ -1,4 +1,11 @@
+This package includes the package installation and administration tools:
+
+pkg_add - a utility for installing and upgrading software packages
+pkg_admin - perform various administrative tasks to the pkg system
+pkg_create - a utility for creating software package distributions
+pkg_delete - a utility for deleting previously installed software packages
+pkg_info - a utility for displaying information on software packages
+
 This is a copy of NetBSD-current's pkg_* tools in a format which
-is able to be installed as a package. To prevent deinstallation,
-they don't register themselves as a package. On NetBSD, they simply
+is able to be installed as a package.  On NetBSD, they simply
 replace the tools in /usr/sbin.
Index: pkgtools/pkg_install/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/Makefile,v
retrieving revision 1.69
diff -b -u -r1.69 Makefile
--- pkgtools/pkg_install/Makefile	2003/01/11 11:59:35	1.69
+++ pkgtools/pkg_install/Makefile	2003/03/17 19:27:56
@@ -15,7 +15,7 @@

 MAINTAINER=		packages@netbsd.org
 HOMEPAGE=		http://www.netbsd.org/
-COMMENT=		NetBSD-current's pkg_* tools
+COMMENT=		package installation and administration tools

 USE_BUILDLINK2=		# defined

@@ -28,8 +28,6 @@
 NO_CHECKSUM=		# defined
 NO_PATCH=		# defined
 NO_MTREE=		# defined
-NO_PKG_REGISTER=	# defined
-NO_PACKAGE=		Deinstallation is not permitted
 PKG_PRESERVE=		# defined

 .include "../../mk/bsd.prefs.mk"
@@ -58,8 +56,12 @@
 .include "../../mk/bsd.pkg.mk"

 PREFIX:=		${PKG_TOOLS_BIN:C|/[^/]?bin$||}
-.if ${PREFIX} == "/usr"
+.if ${OPSYS} == "NetBSD" && ${PREFIX} == "/usr"
 CONFIGURE_ARGS+=	--mandir=${PREFIX}/share/man
+MANDIR=			share/
 .else
 CONFIGURE_ARGS+=	--mandir=${PREFIX}/man
+MANDIR=
 .endif
+PLIST_SUBST+=		MANDIR=${MANDIR}
+PLIST_SUBST+=		PKG_TOOLS_BIN=${PKG_TOOLS_BIN}
Index: pkgtools/pkg_install/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/PLIST,v
retrieving revision 1.2
diff -b -u -r1.2 PLIST
--- pkgtools/pkg_install/PLIST	2003/01/12 02:33:02	1.2
+++ pkgtools/pkg_install/PLIST	2003/03/17 19:27:56
@@ -4,14 +4,14 @@
 sbin/pkg_create
 sbin/pkg_delete
 sbin/pkg_info
-share/man/cat1/pkg_add.0
-share/man/cat1/pkg_admin.0
-share/man/cat1/pkg_create.0
-share/man/cat1/pkg_delete.0
-share/man/cat1/pkg_info.0
+${MANDIR}man/cat1/pkg_add.0
+${MANDIR}man/cat1/pkg_admin.0
+${MANDIR}man/cat1/pkg_create.0
+${MANDIR}man/cat1/pkg_delete.0
+${MANDIR}man/cat1/pkg_info.0
 @comment share/man/man1/pkg_add.1
 @comment share/man/man1/pkg_admin.1
 @comment share/man/man1/pkg_create.1
 @comment share/man/man1/pkg_delete.1
 @comment share/man/man1/pkg_info.1
-@exec [ -f ${PKG_DBDIR:-/var/db/pkg}/pkgdb.byfile.db ] || pkg_admin rebuild
+@exec [ -f ${PKG_DBDIR:-/var/db/pkg}/pkgdb.byfile.db ] || ${PKG_TOOLS_BIN}/pkg_admin rebuild

   Jeremy C. Reed
   http://bsd.reedmedia.net/