From owner-freebsd-ports Tue Oct 26 10:10: 6 1999 Delivered-To: freebsd-ports@freebsd.org Received: from picnic.mat.net (picnic.mat.net [206.246.122.133]) by hub.freebsd.org (Postfix) with ESMTP id 2898D14BF9 for ; Tue, 26 Oct 1999 10:09:54 -0700 (PDT) (envelope-from chuckr@picnic.mat.net) Received: from localhost (chuckr@localhost [127.0.0.1]) by picnic.mat.net (8.9.3/8.9.3) with ESMTP id NAA07316; Tue, 26 Oct 1999 13:08:56 -0400 (EDT) (envelope-from chuckr@picnic.mat.net) Date: Tue, 26 Oct 1999 13:08:55 -0400 (EDT) From: Chuck Robey To: Marcin Cieslak Cc: ports@FreeBSD.ORG Subject: Re: gif2png: 'optional' dependencies In-Reply-To: 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 Tue, 26 Oct 1999, Marcin Cieslak wrote: > > First, smaller problem, is to fix the initial "#!" line. > The original one says: > > #! /usr/bin/python > > and is obviuosly incorrect, since most pythons are > installed in /usr/local/bin. > > What is The Right Way(tm) of finding the location of python > binary? Should I just use 'which' or should I somehow search > the package database ... or should I just assume ${PREFIX}/bin? This is done by a lot of ports. Use a patch to change that line to something easily replaced, like %%PREFIX%%/bin, and then use a pre-install target to sed that: pre-install: $(SED) -e "s/%%PREFIX%%/$(PREFIX)/" < infile >outfile The Makefile will change the second part of the sed to what it should be for the port automatically, and then it just gets installed right byt he install target. > > Second, a bit more important is... what about python dependency? > I don't think it is necessary to add python as a dependency > for this little script. I see three options: > > 1) install this script as-is into ${PREFIX}/bin and fix the > #! (see the problem above) > > 2) detect whether python is installed and install the script then. > (what if the user installs python later for any reason?) > > 3) create a small mini-port for web2png alone (say py-web2png), > requiring both gif2png and python to be installed. > Any hints how to force this mini-port not to use it's own > distfile and just to sneak into the gif2png work tree and install > the script and manpage of it's own? This seems more elegant, > however isn't it a waste of space/bandwidth for yet > another Makefile, pkg, and all the stuff belonging to the port. This part is up to you. Do you think it adds enough real functionality to justify adding python? If you do that, does it really functionally operate (more than just compile, does it work)? > > Or any other suggestions welcome... > > ---------------------------------------------------------------------------- Chuck Robey | Interests include C programming, Electronics, 213 Lakeside Dr. Apt. T-1 | communications, and signal processing. Greenbelt, MD 20770 | I run picnic.mat.net: FreeBSD-current(i386) and (301) 220-2114 | jaunt.mat.net : FreeBSD-current(Alpha) ---------------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message