Subject: Re: pkgsrc - looking to learn how to create packages safely
To: Brad Volz <bradv@affectation.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 05/10/2003 21:20:18
On Sat, 10 May 2003, Brad Volz wrote:

> What is the best way to experiment with creating a package without
> placing the remainder of one's pkgsrc tree, and system in danger?

The easiest way for me is to create a new directory under the category,
you want like:

mkdir -p /usr/pkgsrc/mail/mailgraph
cd /usr/pkgsrc/mail/mailgraph

Here are some ideas:


cat >Makefile <<HERE
# \$NetBSD\$

DISTNAME=     mailgraph-1.2
CATEGORIES=   net
MASTER_SITES= http://people.ee.ethz.ch/~dws/software/mailgraph/pub/

MAINTAINER=   bradv@affectation.org
HOMEPAGE=     http://people.ee.ethz.ch/~dws/software/mailgraph/
COMMENT=      RRDtool frontend for Postfix statistics
USE_PERL5=    yes
REPLACE_PERL= mailgraph.pl

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


make extract
make checksum
ls work*/mailgraph-*


That will get you started. Since mailgraph doesn't have an Makefile or
install script. You would have the pkgsrc Makefile put into place. So
edit the Makefile you made above and add near the bottom:

do-install:
      ${INSTALL_PROGRAM} ${WRKSRC}/mailgraph.pl ${PREFIX}/bin/mailgraph

Create a DESCR file which a paragraph describing it.

Then test with:

make install

Then build a PLIST with:

make print-PLIST | tee PLIST


Also test with pkglint (if you have that installed from pkgtools/pkglint.

Other things to do include adding DEPENDS for the other files it depends
on like databases/rrdtool and time/p5-Time-HiRes.

> As far as I can tell, all of the perl modules except for File-Tail are
> already in pkgsrc.

Look at other p5- perl modules and you can probably make a File-Tail by
copying one.

Also, there is a mailing list at tech-pkg for helping with package
development.

Have fun!

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