Make problem

Ion-Mihai Tetcu itetcu at people.tecnik93.com
Thu Feb 10 20:36:08 PST 2005


On Thu, 10 Feb 2005 20:47:43 -0600
Paul Schmehl <pauls at utdallas.edu> wrote:


> Here's the port Makefile:
> 
> # New ports collection makefile for:    sancp
> # Date created:                         10 Feb 2005
> # Whom:                                 pauls

Usually you put your name and email here, but it's your choice.

> #
> # $FreeBSD$
> #
> 
> PORTNAME=       sancp
> PORTVERSION=    1.6.1
> CATEGORIES=     security
> MASTER_SITES=   http://www.metre.net/
> MASTER_SITE_SUBDIR=     files

This works now, but it isn't guaranteed. Probably it's better to use
MASTER_SITES=   http://www.metre.net/files/
 
> MAINTAINER=     pauls at utdallas.edu
> COMMENT=        A network connection profiler
> 
> PKGINSTALL=    ${WRKDIR}/pkg-install
> LOG_DIR=        ${LOGDIR}/sancp

I don't see it used anywhere. If you what the user to set it perhaps
it would be good to tell in pre-everything:: and use
LOG_DIR?=	/var/log/snacp

> LIB_DEPENDS+=   libpcap:/usr/lib/libpcap.a
> 
> USE_REINPLACE=  yes
> USE_RC_SUBR=    yes
> RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
> 
> DOCS=           AUTHORS COPYING LICENSE.QPL README docs/BUGS docs/ChangeLog \
>                 docs/FAQ docs/INSTALL docs/NEWS docs/USAGE

Using PORTDOCS=	..... will simplify the pkg-plist.

> .include <bsd.port.pre.mk>
> 
> post-patch:
>         @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
>                 ${FILESDIR}/sancp.sh > ${WRKDIR}/sancp.sh
> 
> post-install:
>         ${INSTALL_SCRIPT} -m 751 ${WRKDIR}/sancp.sh  ${PREFIX}/etc/rc.d/sancp.sh

Does this work ? It translates to install  -o root -g wheel -m 555 -m 751

> .for f in sancp.conf
>         ${INSTALL_DATA} ${WRKSRC}/etc/sancp/${f} ${PREFIX}/etc/${f}-sample
>         [ -f ${PREFIX}/etc/${f} ] || \
>         ${INSTALL_DATA} ${WRKSRC}/etc/sancp/${f} ${PREFIX}/etc/${f}
> .endfor

Why .for if it's one file ? The problem with this is that you don't know
if sancp.conf is installed or not and you'll receive a nice email from
pointyhat. See mail/dspam for the way to do it in pkg-plist

> .if !defined(NOPORTDOCS)
>         @${MKDIR} ${DOCSDIR}
>         cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
> .endif
>         @${CAT} ${PKGMESSAGE}
> 
> .include <bsd.port.post.mk>


-- 
IOnut
Unregistered ;) FreeBSD "user"




More information about the freebsd-ports mailing list