Date: Thu, 5 Aug 2004 16:50:12 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: ports@freebsd.org Subject: Re: changing a Makefile based on user input Message-ID: <20040805155012.GA71609@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <20040805143014.GA84047@esbjerg.name> References: <20040805124822.GE82359@esbjerg.name> <20040805133921.GA70345@happy-idiot-talk.infracaninophile.co.uk> <20040805143014.GA84047@esbjerg.name>
next in thread | previous in thread | raw e-mail | index | archive | help
--liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 05, 2004 at 04:30:14PM +0200, Sven Esbjerg wrote: > On Thu, Aug 05, 2004 at 02:39:21PM +0100, Matthew Seaman wrote: > > Note that there is already a misc/rtfm port, with is an unrelated > > piece of software. You could perhaps call your port 'rt-faq-manager'. > =20 > Hmmm... I guess that would be possible. My first thought was RTFM. Yeah -- that could work too. I don't think there would be any problem with having two ports of the same name except for case differences, but ICBW. =20 > > Easy enough. I'd basically copy pretty much what the www/rt3 port > > does. This isn't going to be the easiest port to write -- whicle the > > install step is fairly obvious, you're going to have to deal with all > > of the different combinations of perl versions, apache versions, > > whether it's running under mod_perl or using FastCGI, MySQL vs PgSQL > > etc. > =20 > It was my impression that I could leave these dependencies to RT since RT= FM > needs RT in the first place. Am I wrong? > I know that RTFM needs to know which database to use but these things are > pulled from RT - hence the need to know where RT has been installed. Well, that very much depends on the details of what the vendor code actually does. If you're lucky, you just copy it into place and it will pick up the settings from the www/rt3 port at runtime. If you're unlucky you'll have to duplicate large chunks of the option management stuff from the rt port. But as the porter this is something you'll have to think about, even if it's only to say "Hah! I don't need to do anything!" What you won't have to do is restate all of the /dependencies/ -- as far as I can see, your port just needs to depend on www/rt3 which should pull in all the necessary perl modules etc. >=20 > > > I guess my question is: can I run some kind of script just after extr= acting > > > but before installing?=20 > >=20 > > Yes. Generally a pkg-install script would be used for that purpose -- > > that script would also be included into any package made from the port > > and pkg_Add would automatically run it when installing that way. > > Actually the pkg-install script gets called twice, once, just before > > any files are installed, with a command line argument of 'PRE-INSTALL' > > and again, just after files are installed, with an argument of > > 'POST-INSTALL'. There's a corresponding pkg-deinstall script too, > > which works similarly. > =20 > I thought pkg-install was after the build process??? What build process is that? You said there was nothing much to do except unpack the distfiles and copy the files into place. Remember too that everything needs to work when installing a package as it does when installing a port. =20 > > Probably just create a patch for the Makefile and put it in the files > > directory. Call it 'patch-something-or-other' and it will be applied > > automatically after your distfiles have been downloaded, checksummed > > and extracted into WRKDIR. >=20 > I can't create a standard patch since I need to patch dynamicly. RTFM's > Makefile is not created by configure - it's static. I guess I could creat= e a > patch-file dynamicly but it's just as easy to edit (sed) the Makefile. A good trick is to edit the Makefile in ${WRKSRC} so that it uses make variables set in the port Makefile and automatically passed into the Make environment. Eg. you can patch the ${WRKSRC} Makefile to use ${PREFIX} itself, rather than trying to substitute in the value of ${PREFIX} at build time. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --liOOAslEiF7prFVr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (FreeBSD) iD8DBQFBElc0iD657aJF7eIRAkWxAJ4g6BSJ2eqH/aBhZBrmvzoznkO2VACePJG+ JLxhCdacRS7qgBGQONrGlKY= =7kyg -----END PGP SIGNATURE----- --liOOAslEiF7prFVr--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040805155012.GA71609>