Subject: learning how to port to pkgsrc
To: None <tech-pkg@netbsd.org>
From: Georg Schwarz <georg.schwarz@freenet.de>
List: tech-pkg
Date: 12/30/2004 22:58:06
I thought it was time to learn how to port things to pkgsrc, so I
figured I should try with an easy example.
I would like to ask you to please review and test the result of my
attempts.
It's small enough to include it here:

lorenz 136% cat Makefile 
DISTNAME=       boa-0.94.13
CATEGORIES=     www
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE:=boa/}

HOMEPAGE=       http://www.boa.org/
COMMENT=        boa is a small http server

USE_BUILDLINK3= YES
WRKSRC=         ${WRKDIR}/${DISTNAME}/src       
GNU_CONFIGURE=  YES
USE_GNU_TOOLS+= make

do-install:
                ${INSTALL_PROGRAM} ${WRKSRC}/boa ${WRKSRC}/boa_indexer
${PREFIX}/sbin
                ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/boa
                ${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/boa.conf
${PREFIX}/share/examples/boa
                ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/boa
                ${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/CREDITS
${WRKDIR}/${DISTNAME}/README ${PREFIX}/share/doc/boa
                ${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/docs/boa.8
${PREFIX}/man/man8

.include "../../mk/bsd.pkg.mk"
lorenz 137% cat DESCR 
boa is a small http server.
lorenz 138% cat PLIST 
sbin/boa
sbin/boa_indexer
share/examples/boa/boa.conf
share/doc/boa/CREDITS
share/doc/boa/README
man/man8/boa.8
@dirrm share/examples/boa
@dirrm share/doc/boa
lorenz 139% cat distinfo 
$NetBSD$

SHA1 (boa-0.94.13.tar.gz) = 7ce96f6d917baf328449be7f40783156afe634cb
Size (boa-0.94.13.tar.gz) = 122066 bytes

I've tested it on my IRIX 5.3 machine and it works there.
Nevertheless I've still a few questions:

- boa needs flex and yacc to build. Can I simply assume they are present
on the system?
- are the extra commands to create the examples/boa and doc/boa
directories needed, or would they be created automatically if not
existing?
- what is the policy of preserving documents that come with the original
tar archive in share/doc?
- should I try to rewrite the paths in the sample boa.conf,  or would
that simply be overkill?
- Do you think it would be a good idea to have a MESSAGE pointing out
the sample config file?

Again, any comments would be welcome. Thanks.

Georg
 


-- 
Georg Schwarz    http://home.pages.de/~schwarz/
 georg.schwarz@freenet.de   +49 177 8811442