From owner-freebsd-ports Sat Jan 1 18:17:26 2000 Delivered-To: freebsd-ports@freebsd.org Received: from mail.HiWAAY.net (fly.HiWAAY.net [208.147.154.56]) by hub.freebsd.org (Postfix) with ESMTP id 0E43A14CF1 for ; Sat, 1 Jan 2000 18:17:24 -0800 (PST) (envelope-from sprice@hiwaay.net) Received: from localhost (sprice@localhost) by mail.HiWAAY.net (8.9.3/8.9.0) with ESMTP id UAA27983; Sat, 1 Jan 2000 20:17:21 -0600 (CST) Date: Sat, 1 Jan 2000 20:17:21 -0600 (CST) From: Steve Price To: Karl Denninger Cc: freebsd-ports@FreeBSD.ORG Subject: Re: ports/15822: Update port misc/HomeDaemon to V0.99 In-Reply-To: <20000101194611.A17603@Denninger.Net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sat, 1 Jan 2000, Karl Denninger wrote: # I'm NOT going to maintain two SEPARATE bases of code, one for FreeBSD-Ports Surely the fifteen lines of make(1) magic is easier to maintain than the Makefile and three scripts that currently do nearly the same thing. I can't help it that most of the world chooses to use gmake(1) in all its brokenness. # and one for everyone else. As such the "one" has to work both ways, or the # Ports lose - that much is simple (widest audience for ONE version is a # non-port one) Except when it comes to including FreeBSD in that audience. I'd venture to guess that most software is being used via the Ports Collection. Sure many people venture out on there own, but they tend to be the more apt to cope with any problems they might find. Fundamentally I agree with your argument of one distribution fits all. We have a ports collection because many don't believe this and we *have* to tweak things to get them to work with FreeBSD. # > post-patch: # > .for f in defs.h Defaults/HomeDaemon.rc # > ${PERL} -pi -e 's,/usr/local,${PREFIX},g' ${WRKSRC}/${f} # > .endfor # # That's even more ill , as its a one-way road. No thanks. Not if you stick it in your Makefile. There are quite a number of ways of accomplishing the same thing in your distribution. Before you go and slam perl, use sed(1) instead. Something like this ought to work in your Makefile. PREFIX?= /usr/local all: defs.h Defaults/HomeDaemon.rc $(PROGS) ... defs.h: defs.h.in sed -e 's,%%PREFIX%%,${PREFIX},g' $@.in > $@ Defaults/HomeDaemon.rc: Defaults/HomeDaemon.rc.in sed -e 's,%%PREFIX%%,${PREFIX},g' $@.in > $@ Then in defs.h.in you have lines like this. #define BASE_DIR "%%PREFIX%%/share/HomeDaemon" #define BIN_DIR "%%PREFIX%%/bin" Similarly for HomeDaemon.rc, which should probably get installed as ${PREFIX}/etc/rc.d/HomeDaemon.sh BTW so that it will get started automagically when the machine is rebooted. -steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message