Date: Thu, 17 Apr 2008 19:50:04 GMT From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/122860: databases/phpMyAdmin installs in the wrong dir Message-ID: <200804171950.m3HJo46M080706@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/122860; it has been noted by GNATS. From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Ruud Althuizen <ruud@il.fontys.nl> Cc: freebsd-gnats-submit@freebsd.org Subject: Re: ports/122860: databases/phpMyAdmin installs in the wrong dir Date: Thu, 17 Apr 2008 20:48:53 +0100 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig15374BDB6FB9BAE1CF8AE49E Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Ruud Althuizen wrote: >> Description: > When you have WWWDIR set in /etc/make.conf phpMyAdmin will install all = its files directly into that dir instead of creating its own subdir. >=20 > It will also be unable to uninstall according to this line and others l= ike it: > pkg_delete: file '/usr/local//beast/web/www/translators.html' doesn't e= xist > (WWWDIR=3D"/beast/web/www") >> How-To-Repeat: > Install and/or deinstall phpMyAdmin I can confirm this behaviour, but this is not a problem specific to the phpmyadmin port. You'll see this effect with any port using $(WWWDIR= ) or $(ETCDIR) if you attempt to override the automatically chosen values with any path that isn't a subdirectory of $(PREFIX). Compare the following: happy-idiot-talk:...ports/databases/phpmyadmin:% make WWWDIR=3D/tmp/phpMy= Admin -V PREFIX -V WWWDIR -V WWWDIR_REL /usr/local /tmp/phpMyAdmin /tmp/phpMyAdmin happy-idiot-talk:...ports/databases/phpmyadmin:% make WWWDIR=3D/usr/local= /ptooey -V PREFIX -V WWWDIR -V WWWDIR_REL /usr/local /usr/local/ptooey ptooey It's the value of WWWDIR_REL which is used to substitute the %%WWWDIR%% token in pkg-plist as the plist is /always/ relative to the $(PREFIX).=20 Hence the 1st example would give the effects seen by Mr Althuizen while the 2nd example would work flawlessly. Exactly the same thing applies to $(ETCDIR) and $(ETCDIR_REL) and similarly the other variables added to PLIST_SUB around line 2973 of bsd.port.mk.=20 A fairly simple workaround is to redefine PREFIX in parallel with WWWDIR -- something like this in /etc/make.conf should work: =2Eif ${.CURDIR:M*/databases/phpmyadmin} WWWDIR=3D /beast/web/www PREFIX=3D /beast/web =2Eendif The code that results in this behaviour is in bsd.port.mk, so this is definitely portmgr@ territory. I'd vote for putting in some tests like this: happy-idiot-talk:/usr/ports/Mk:% diff -u bsd.port.mk{.orig,} --- bsd.port.mk.orig 2008-04-17 20:34:40.000000000 +0100 +++ bsd.port.mk 2008-04-17 20:44:24.000000000 +0100 @@ -2965,10 +2965,29 @@ .endif =20 DOCSDIR_REL?=3D ${DOCSDIR:S,^${PREFIX}/,,} +.if ${DOCSDIR_REL} =3D=3D ${DOCSDIR} +BROKEN=3D DOCSDIR is not beneath PREFIX +.endif + EXAMPLESDIR_REL?=3D ${EXAMPLESDIR:S,^${PREFIX}/,,} +.if ${EXAMPLESDIR_REL} =3D=3D ${EXAMPLESDIR} +BROKEN=3D EXAMPLESDIR is not beneath PREFIX +.endif + DATADIR_REL?=3D ${DATADIR:S,^${PREFIX}/,,} +.if ${DATADIR_REL} =3D=3D ${DATADIR} +BROKEN=3D DATADIR is not beneath PREFIX +.endif + WWWDIR_REL?=3D ${WWWDIR:S,^${PREFIX}/,,} +.if ${WWWDIR_REL} =3D=3D ${WWWDIR} +BROKEN=3D WWWDIR is not beneath PREFIX +.endif + ETCDIR_REL?=3D ${ETCDIR:S,^${PREFIX}/,,} +.if ${ETCDIR_REL} =3D=3D ${ETCDIR} +BROKEN=3D ETCDIR is not beneath PREFIX +.endif =20 PLIST_SUB+=3D DOCSDIR=3D"${DOCSDIR_REL}" \ EXAMPLESDIR=3D"${EXAMPLESDIR_REL}" \ Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig15374BDB6FB9BAE1CF8AE49E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkgHqasACgkQ8Mjk52CukIxLWwCfexrCWSc18yauQNIWBk/fzWX8 ns4AmwZWkEUnpUx1KS21Gyxa1YHen9LY =AYLe -----END PGP SIGNATURE----- --------------enig15374BDB6FB9BAE1CF8AE49E--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804171950.m3HJo46M080706>