Subject: packages installing outside $prefix?
To: None <tech-pkg@netbsd.org>
From: Hal Snyder <hal@vailsys.com>
List: tech-pkg
Date: 02/05/2004 12:12:31
In an ongoing quest to maximize gains from using pkgsrc for code
deployment, I'm now looking at some packages which need to install
files (no autoconf needed) on i386 Solaris to such places as /var
and /export/home/someuser.

I see that constructs OWN_DIRS_PERMS, do-install, and DEINSTALL allow
successful install and deinstall, but the binary package made has only
glue files, not the files to be installed.

So, two questions:

1. Is there an approved way of getting files-to-be-installed into the
   binary package when those files aren't destined for /usr/pkg or
   other usual location?

2. Is there a way to generate a PLIST for such things? I guess I don't
   completely understand the role of PLIST - how it's created, what
   uses it, usw. A shove in the right direction will be appreciated.

The motivation for pkgsrc integration is for automatic creation of
user and group as well as tracking of inter-package dependencies.

Thanks.


BTW here's a sample Makefile for a package whose distfile is just a
tarball of some files.

===

# $NetBSD$
#

DISTNAME=		testpkg-1.0.0
CATEGORIES=		mytest
MASTER_SITES=		http://ddsvws68.vail/pkg/
MASTER_SITE_BACKUP=

MAINTAINER=		hal@vailsys.com
HOMEPAGE=		http://ddwvws68.vail/
COMMENT=		Test Package

# tarball should go to /export/home/userx/1.0.0
USERX_DIR=		/export/home/userx

NO_BUILD=		yes
NO_CONFIGURE=		yes

# need USE_PKGINSTALL to process OWN_DIRS_PERMS
# and to enable work/.DEINSTALL to remove these directories

USE_PKGINSTALL= YES

OWN_DIRS_PERMS+=	${USERX_DIR}        userx groupx 775
OWN_DIRS_PERMS+=	${USERX_DIR}/1.0.0  userx groupx 775

PKG_GROUPS=		groupx:2351
PKG_USERS=		userx:groupx:3928:User X:/export/home/userx:/bin/sh
PKG_CREATE_USERGROUP?=	yes

USE_BUILDLINK2=		yes
USE_PKGLOCALEDIR=	yes

# DEINSTALL does rm -r ${USERX_DIR}/1.0.0 in STAGE1
DEINSTALL_EXTRA_TMPL+=	${.CURDIR}/DEINSTALL

do-extract:
	@${ECHO} ... but, this package does not really get extracted

do-install:
	${GTAR} -C ${USERX_DIR}/1.0.0 -xzpf ${DISTDIR}/${DISTFILES}

.include "../../mk/bsd.pkg.mk"