Bug 64393 - establish proper master-slave relations between ports
Summary: establish proper master-slave relations between ports
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-18 00:10 UTC by Oliver Eikemeier
Modified: 2005-07-18 05:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Eikemeier 2004-03-18 00:10:17 UTC
Dear port maintainers,

recently I noticed that two of out best tools, FreshPorts 
<http://www.freshports.org/> and portsmon <http://portsmon.firepipe.net/> have 
difficulties to establish proper master-slave relations between the ports in 
the ports tree.

Essentially all tools that work on the ports tree as a whole assume a certain 
uniformity in ports Makefiles, which goes beyond just compiling and installing 
without errors.

Non-adherence to these standards makes it hard to write tools that work for 
all ports and hinders progress, because small changes in bsd.port.mk may break 
your port.

Fix: 

Sometimes there are simply some comment lines at the end of the Makefile. 
Please move or delete them.

If you do not know how to fix the port, ask at ports@FreeBSD.org or don't 
hesitate to contact me.

If there is currently no other way to do what you need for installing the 
port, this may be an area where bsd.port.mk has to be improved, and it is 
important that we become aware of this fact.

Please fix your port(s) and mark the fixed ports with an `X' in the list
below (just edit-pr this PR)

ale@FreeBSD.org
 [X] devel/motor (5)

clement@FreeBSD.org
 [X] databases/py-MySQLdb (5)

clive@FreeBSD.org
 [X] chinese/bitchx (4)
 [X] chinese/mutt (4)

cyrille.lefevre@laposte.net
 [X] lang/gforth (5)

daniel@freebsd.ro
 [X] mail/vqregister (5)

dinoex@FreeBSD.org
 [X] lang/gnustep-base (5)
 [X] mail/popa3d (5)

dmitry@karasik.eu.org
 [ ] x11-toolkits/p5-Prima (5)

don@na.rim.or.jp
 [X] japanese/ruby-ming (4)

eric@fractal.csie.org
 [X] chinese/links (4)

erwin@FreeBSD.org
 [ ] archivers/p5-Archive-Zip (5)
 [X] security/p5-Crypt-SSLeay (5)

gerald@FreeBSD.org
 [ ] lang/gcc33 (5)
 [ ] lang/gcc34 (5)

girgen@pingpong.net
 [ ] databases/postgresql7 (5)
 [ ] databases/postgresql72 (5)
 [ ] databases/postgresql73 (5)

holger@e-gitt.net
 [ ] chinese/mldonkey-core (4)

honda@kashio.info.mie-u.ac.jp
 [ ] japanese/ng-canna (4)

jb.quenot@caraldi.com
 [X] x11/numlockx (5)

jihuang@gate.sinica.edu.tw
 [ ] chinese/bind8 (4)

jonas@jonas.night-light.net
 [X] irc/ircproxy (5)

kay_lehmann@web.de
 [X] databases/qt-mysql-plugin (5)

kde@freebsd.org
 [X] databases/qt-ibase-plugin (2,4)
 [X] databases/qt-odbc-plugin (2,4)
 [X] databases/qt-pgsql-plugin (2,4)
 [X] databases/qt-sqlite-plugin (2,4)
 [X] devel/tinyq (5)

kiri@FreeBSD.org
 [ ] chinese/xemacs21 (5)

knu@FreeBSD.org
 [ ] archivers/ruby-bz2 (5)
 [ ] comms/ruby-termios (5)
 [ ] devel/ruby-bsearch (5)
 [ ] devel/ruby-cache (5)
 [ ] devel/ruby-cvs (5)
 [ ] devel/ruby-filemagic (5)
 [ ] devel/ruby-gemfinder (5)
 [ ] devel/ruby-gettext (5)
 [ ] devel/ruby-mmap (5)
 [ ] devel/ruby-sdl (5)
 [ ] devel/ruby-sysvipc (5)
 [ ] devel/ruby-tzfile (5)
 [ ] graphics/ruby-evas (5)
 [ ] graphics/ruby-image_size (5)
 [ ] graphics/ruby-libexif (5)
 [ ] graphics/ruby-libpng (5)
 [ ] japanese/rbnamazu (5)
 [ ] japanese/ruby-romkan (5)
 [ ] print/ruby-pdflib (5)
 [ ] security/ruby-acl (5)
 [ ] textproc/eruby (5)
 [ ] textproc/ruby-sary (5)
 [ ] www/mod_ruby (5)

ko@irfu.se
 [ ] math/vtk (5)
 [ ] math/vtk-data (1,4)
 [ ] math/vtk-examples (1,4)
 [ ] math/vtk-headers (1,4)
 [ ] math/vtk-java (1,4)
 [ ] math/vtk-python (1,4)
 [ ] math/vtk-tcl (1,4)

kuriyama@FreeBSD.org
 [x] japanese/zipcodes (5)
 [x] www/p5-HTML-Template (5)

laszlof@vonostingroup.com
 [X] audio/taglib (5)

lioux@FreeBSD.org
 [X] emulators/vgb-bin (5)
 [X] emulators/vgba-bin (5)
 [ ] games/hlserver-esf (5)
 [ ] games/hlserver-existence (5)
 [ ] games/hlserver-glbwar (5)
 [ ] games/hlserver-heroes (5)
 [ ] games/hlserver-ns (5)
 [ ] games/hlserver-opera (5)
 [ ] games/hlserver-opfor (5)
 [ ] games/hlserver-pvk (5)
 [ ] games/hlserver-snow (5)
 [ ] games/hlserver-svencoop (5)
 [ ] games/hlserver-ts (5)
 [ ] games/hlserver-tsc (5)
 [ ] games/hlserver-vs (5)
 [ ] games/hlserver-wasteland (5)
 [ ] games/hlserver-wizwars (5)
 [ ] mail/qmail (5)
 [ ] mail/qmail-ldap (6)
 [ ] mail/qmail-mysql (6)
 [ ] mail/qmail-smtp_auth+tls (6)
 [ ] mail/qmail-tls (6)
 [ ] sysutils/clockspeed (5)
 [ ] x11-themes/kde-icons-amaranth (5)
 [ ] x11-themes/kde-icons-amaranth-althaea (5)
 [ ] x11-themes/kde-icons-crystalosx (5)
 [ ] x11-themes/kde-icons-gorilla_svg (5)
 [ ] x11-themes/kde-icons-graphite-rade8 (5)
 [ ] x11-themes/kde-icons-icosx (5)
 [ ] x11-themes/kde-icons-kids (5)
 [ ] x11-themes/kde-icons-kool-gorilla (5)
 [ ] x11-themes/kde-icons-lime-rade8 (5)
 [ ] x11-themes/kde-icons-lush (5)
 [ ] x11-themes/kde-icons-marbles-translucent (5)
 [ ] x11-themes/kde-icons-noia (5)
 [ ] x11-themes/kde-icons-noia-warm (5)
 [ ] x11-themes/kde-icons-nuvola (5)
 [ ] x11-themes/kde-icons-outline (5)
 [ ] x11-themes/kde-icons-sky (5)
 [ ] x11-themes/kde-icons-sparkling (5)
 [ ] x11-themes/kde-icons-steel (5)
 [ ] x11-themes/kde-icons-umicons (5)
 [ ] x11-themes/kde-icons-wasp (5)

maho@FreeBSD.org
 [ ] math/spooles-mpich (4)
 [ ] science/mpqc-mpich (4)

martin@tradex.sk
 [ ] games/hlserver-psychostats (5)

matthias.andree@gmx.de
 [X] databases/db42 (5)

mi@aldan.algebra.com
 [ ] databases/mysqltcl (5)
 [X] databases/tcl-Mysql (5)
 [ ] devel/tcl-memchan (5)
 [ ] devel/tcltls (5)
 [ ] devel/tkp4 (5)
 [ ] graphics/gdtclft (5)

mita@FreeBSD.org
 [ ] japanese/ghostscript-gnu-jpnfont (4)
 [ ] korean/ghostscript-gnu-korfont (4)
 [ ] print/ghostscript-gnu-commfont (5)

murakami@ahs.scitec.kobe-u.ac.jp
 [X] science/cdcl-gtk (5)
 [X] science/ruby-dcl-gtk (5)

nadav@cs.technion.ac.il
 [ ] hebrew/pine (5)

nobutaka@FreeBSD.org
 [X] mail/wanderlust-emacs20 (4)
 [X] mail/wanderlust-xemacs21-mule (4)
 [X] www/emacs-w3m-emacs20 (4)
 [X] www/emacs-w3m-xemacs21-mule (4)

obrien@FreeBSD.org
 [ ] shells/bash2 (5)
 [ ] vietnamese/unicode-uhoai (5)
 [ ] vietnamese/vis2u (5)

okazaki@FreeBSD.org
 [X] converters/mule-ucs-emacs20 (4)
 [X] devel/elib-emacs19 (4)
 [X] devel/elib-emacs20 (4)
 [X] devel/pcl-cvs-emacs20 (4)

oliver@FreeBSD.org
 [X] mail/vqadmin (5)

openoffice@FreeBSD.org
 [ ] portuguese/ooodict-pt_BR (4)
 [ ] portuguese/ooodict-pt_PT (4)

orlando.bassotto@ieo-research.it
 [ ] emulators/vmware3 (5)

pat@FreeBSD.org
 [ ] games/hlserver-action (5)
 [ ] games/hlserver-admin (5)
 [ ] games/hlserver-cs (5)
 [ ] games/hlserver-dod (5)
 [ ] games/hlserver-fa (5)
 [ ] games/hlserver-flf (5)
 [ ] games/q3server-excessive (5)
 [ ] games/q3server-freezetag (5)
 [ ] games/q3server-osp (5)
 [ ] games/q3server-ut (5)
 [ ] games/q3server-wfa (5)

pav@FreeBSD.org
 [X] deskutils/multisync-backup (5)
 [X] deskutils/multisync-evolution (5)
 [X] deskutils/multisync-syncml (5)

ports@FreeBSD.org
 [ ] chinese/dictd (4)
 [X] chinese/unzip (4)
 [X] devel/cvsbook (5)
 [D] devel/qt-designer (4)
 [X] editors/psgml-xemacs21-mule (4)
 [X] editors/tamago-emacs20 (4)
 [ ] games/utserver-asu (5)
 [ ] graphics/libimg (5)
 [ ] graphics/linux-jpeg (5)
 [ ] graphics/linux-png (5)
 [ ] graphics/linux-ungif (5)
 [ ] japanese/gnomelibs (1,4)
 [ ] japanese/xvi-euc (4)
 [ ] japanese/xvi-sjis (4)
 [X] net/cap (5)
 [X] print/envelope (5)
 [ ] www/linux-lesstif-ns (5)
 [ ] www/w3c-httpd (5)
 [X] editors/chexedit (5)

riggs@rrr.de
 [ ] german/linux-eagle (5)
 [ ] german/netscape7 (5)

roam@FreeBSD.org
 [ ] devel/makedepend (5)

sada@FreeBSD.org
 [X] japanese/p5-manual (5)

seanc@FreeBSD.org
 [ ] databases/postgresql-devel (5)

sf@FreeBSD.org
 [X] japanese/navi2ch-emacs21 (4)
 [X] japanese/navi2ch-xemacs21-mule (4)

shige@FreeBSD.org
 [X] editors/apel-emacs19 (4)
 [X] editors/apel-emacs20 (4)
 [X] editors/apel-mule (4)
 [X] editors/apel-xemacs21-mule (4)
 [X] editors/bitmap-emacs20 (4)
 [X] editors/bitmap-mule (4)
 [X] editors/custom-mule (4)
 [X] editors/flim-emacs20 (4)
 [X] editors/flim-xemacs21-mule (4)
 [X] editors/flim113-emacs19 (4)
 [X] editors/flim113-emacs20 (4)
 [X] editors/flim113-mule (4)
 [X] editors/flim113-xemacs21-mule (4)
 [X] editors/psgml-emacs19 (4)
 [X] editors/psgml-emacs20 (4)
 [X] editors/psgml-mule (4)
 [X] editors/semi-emacs20 (4)
 [X] editors/semi-xemacs21-mule (4)
 [X] editors/semi113-emacs19 (4)
 [X] editors/semi113-emacs20 (4)
 [X] editors/semi113-mule (4)
 [X] editors/semi113-xemacs21-mule (4)

taguchi@tohoku.iij.ad.jp
 [D] x11-servers/XttXF86srv-SVGA (4)
 [D] x11-servers/XttXF86srv-common (1,4,5)

taoka@FreeBSD.org
 [ ] audio/linux-esound (5)
 [ ] audio/linux-libaudiofile (5)
 [ ] devel/linux-libglade (5)
 [ ] graphics/linux-imlib (5)
 [ ] graphics/linux-tiff (5)
 [ ] textproc/linux-libxml (5)
 [ ] x11/linux-gnomelibs (5)

tg@FreeBSD.org
 [X] graphics/xbmbrowser (5)

tmclaugh@sdf.lonestar.org
 [ ] x11-themes/gnome-icons-aqua-fusion (5)
 [ ] x11-themes/gnome-icons-cool-gorilla (5)
 [ ] x11-themes/gnome-icons-crystal (5)
 [ ] x11-themes/gnome-icons-gentoo-test (5)
 [ ] x11-themes/gnome-icons-iris (5)
 [ ] x11-themes/gnome-icons-noia-full (5)
 [ ] x11-themes/gnome-icons-noia-warm (5)
 [ ] x11-themes/gnome-icons-refined (5)
 [ ] x11-themes/gnome-icons-slick (5)
 [ ] x11-themes/gnome-icons-snow-apple (5)
 [ ] x11-themes/gnome-icons-stylish (5)
 [ ] x11-themes/gnome-icons-ximian-south (5)

tmutoh@mx10.freecom.ne.jp
 [ ] japanese/ical (1,4,5)

trevor@FreeBSD.org
 [ ] accessibility/linux-atk (5)
 [ ] audio/linux-mbrola (4)
 [ ] devel/linux-glib2 (5)
 [ ] french/netscape7 (5)
 [ ] japanese/linux-ttfonts (5)
 [ ] japanese/netscape7 (5)
 [ ] portuguese/netscape7 (5)
 [ ] textproc/linux-expat (5)
 [ ] x11-fonts/linux-fontconfig (5)
 [ ] x11-fonts/linux-urw-fonts (5)
 [ ] x11-toolkits/linux-gtk2 (5)
 [ ] x11-toolkits/linux-pango (5)

vanilla@FreeBSD.org
 [X] chinese/irssi (4)

voisine@yahoo.com
 [ ] chinese/linux-mozillafirebird-zh_CN (5)
 [ ] chinese/linux-mozillafirebird-zh_TW (5)
 [ ] german/linux-mozillafirebird (5)
 [ ] japanese/linux-mozillafirebird-gtk1 (5)
 [ ] japanese/linux-mozillafirebird-gtk2 (5)
 [ ] russian/linux-mozillafirebird (5)
 [ ] www/linux-mozillafirebird-el (5)

voland@catpipe.net
 [X] misc/afbackup-client (4)
 [X] misc/afbackup-server (4)

yabu@uopmu.ees.osakafu-u.ac.jp
 [X] japanese/t2ps (5)

yatt@luna2.org
 [ ] audio/timidity++-emacs (1,4,5)

yoichi@FreeBSD.org
 [X] databases/bbdb-emacs20 (4)
 [X] deskutils/mhc-emacs20 (4)
 [X] deskutils/mhc-xemacs21-mule (4)
 [X] mail/emh-emacs20 (4)
 [X] mail/emh-xemacs21-mule (4)

yssu@CCCA.NCTU.edu.tw
 [D] chinese/ti(1,4)
How-To-Repeat: 
I checked the current ports tree assuming the following rules:

1.) A port is a slave port if and only if MASTERDIR != .CURDIR

2.) Slave ports shout define MASTERDIR using one of the following lines:

MASTERDIR=  ${.CURDIR}/../../<category>/<port>
MASTERDIR=  ${.CURDIR}/../<port>

3.) Non-slave ports shouldn't define MASTERDIR at all

4.) The last line of a slave port's Makefile has to be

.include "${MASTERDIR}/Makefile"

5.) The last line of a non-slave ports Makefile must be one of:

.include <bsd.port.mk>
.include <bsd.port.post.mk>

6.) slave ports may not include bsd.port(.pre).mk

These rules are more or less checked by portlint and described in:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-masterdir.html
  http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/dads-after-port-mk.html

In most cases a violation of these rules is an attempt to work around the 
structure of bsd.port.mk.

Even though this may be an easy solution for the needs of your port, please 
think about an other way to do it.
Comment 1 Oliver Eikemeier freebsd_committer freebsd_triage 2004-03-18 00:11:17 UTC
State Changed
From-To: open->feedback

maintainers are notified 


Comment 2 Oliver Eikemeier freebsd_committer freebsd_triage 2004-03-18 00:11:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->eik

I'll handle this
Comment 3 Oliver Eikemeier 2004-03-18 01:23:55 UTC
rule two originally read:

> 2.) Slave ports shout define MASTERDIR using one of the following lines:
> 
> MASTERDIR=  ${.CURDIR}/../../<category>/<port>
> MASTERDIR=  ${.CURDIR}/../<port>
> MASTERDIR=  ${PORTSDIR}/<category>/<port>

Thanks to Clement Laforet <clement@FreeBSD.org> for pointing out that
${PORTSDIR}/... won't work without including bsd.port.pre.mk.

Because including bsd.port.pre.mk is a slave port is bad (rule 6), since
all the variables that have to be defined *before* bsd.port.pre.mk in
the master port won't have any effect, only the first two possibilities
remain.

Sorry for the oversight
    Oliver
Comment 4 Cyrille Lefevre 2004-03-18 02:26:49 UTC
"Oliver Eikemeier" <eikemeier@fillmore-labs.com> wrote:
> 5.) The last line of a non-slave ports Makefile must be one of:
> 
> include <bsd.port.mk>
> include <bsd.port.post.mk>
[snip]
> cyrille.lefevre@laposte.net
>  [ ] lang/gforth (5)

I'm not the one who add the following line to the Makefile :

CONFIGURE_TARGET:=      --build=${CONFIGURE_TARGET}

however, the best way to handle this is to move CONFIGURE_TARGET
from bsd.port.pre.mk to bsd.port.post.mk.
so, CONFIGURE_TARGET could be updated in a port's Makefile.
of course, it is still possible to manually define CONFIGURE_TARGET
in Makefile, but that may cause trouble in the future.

Cyrille Lefevre.
-- 
home: mailto:cyrille.lefevre@laposte.net
Comment 5 dirk.meyer 2004-03-18 06:00:43 UTC
Oliver Eikemeier schrieb:,

> I checked the current ports tree assuming the following rules:
> 1.) A port is a slave port if and only if MASTERDIR != .CURDIR

I checked that this should work woth a symlinked portstree.

# ls -l /usr/ports
lrwxr-xr-x  1 root  wheel  12 Aug  9  2001 /usr/ports@ -> /image/ports

/usr/ports/german/webalizer2# make -V MASTERDIR -V .CURDIR
/image/ports/german/webalizer2/../../www/webalizer
/image/ports/german/webalizer2

/usr/ports/www/webalizer# make -V MASTERDIR -V .CURDIR
/image/ports/www/webalizer
/image/ports/www/webalizer

> 2.) Slave ports shout define MASTERDIR using one of the following lines:
> 
> MASTERDIR=  ${.CURDIR}/../../<category>/<port>
> MASTERDIR=  ${.CURDIR}/../<port>

both seen ...

> MASTERDIR=  ${PORTSDIR}/<category>/<port>

This construct will have problmes on the bento cluser,
or when /usr/ports is a symlink ...

if I revert /usr/ports/german/webalizer2/Makefile to use:
PORTSDIR=       /usr/ports
MASTERDIR?=     ${PORTSDIR}/www/webalizer

# make -V MASTERDIR -V .CURDIR
/usr/ports/www/webalizer
/image/ports/german/webalizer2

We have common setups where:
${.CURDIR}/../.. is diffrent from ${PORTSDIR}

> dinoex@FreeBSD.org
>  [ ] lang/gnustep-base (5)

This can't be fixed now:

# bsd.port.post.mk clobbers MAKE_ENV
MAKE_ENV+=      PATH=${autotools_path}:$(PREFIX)/System/Tools:${PATH}

>  [x] mail/popa3d (5)i

fixed.

kind regards Dirk

- Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
- [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]
Comment 6 Oliver Eikemeier 2004-03-18 08:48:37 UTC
Cyrille Lefevre wrote:
>>cyrille.lefevre@laposte.net
>> [ ] lang/gforth (5)
> 
> I'm not the one who add the following line to the Makefile :
> 
> CONFIGURE_TARGET:=      --build=${CONFIGURE_TARGET}
> 
> however, the best way to handle this is to move CONFIGURE_TARGET
> from bsd.port.pre.mk to bsd.port.post.mk.
> so, CONFIGURE_TARGET could be updated in a port's Makefile.
> of course, it is still possible to manually define CONFIGURE_TARGET
> in Makefile, but that may cause trouble in the future.

this is a longstanding problem. Most ports use

CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}

which should not be problematic if we ever change the default in bsd.port.mk 
(which we currently can not, since it will break your port) and is easy to 
search and replace if all ports use the same line. This is a good example why 
it is important to adhere to the rules and a workaround than makes it hard to 
improve bsd.port.mk.

Thanks
    Oliver
Comment 7 Ceri Davies freebsd_committer freebsd_triage 2004-03-18 20:07:07 UTC
Just a note here as the recipient list is so long.

Please, please, please make sure that you either leave the subject list
intact or drop freebsd-gnats-submit@freebsd.org from the recipients when
replying to this, or the gnats database will get spammed stupid with
misfiled PRs.

Thank you,

Ceri
[with bugmeister@ hat on]
-- 
Comment 8 Mark Linimon freebsd_committer freebsd_triage 2005-07-18 05:09:32 UTC
State Changed
From-To: feedback->closed

With bugmeister hat on, reassign from inactive committer. 

A later change to bsd.port.mk that I submitted allows a way for individual 
ports to force a flag to state that they are either a slave port or a 
master port.  In all but a few dozen cases, the default that my code 
reports is sufficient for both FreshPorts and portsmon to so determine. 
The maintainers of all but one other port agreed to add these variables. 

eik, however, is correct in that my solution is insufficiently rigorous 
to completely determine whether or not a port's metadata must be 
rebuilt given changes to a different port (which is what FreshPorts and 
portsmon want to know) -- for instance, neither of those understands 
such things as dependencies on changes to things in bsd.*.mk.  The 
current technology that the two monitoring systems employ is to simply 
rebuild the metadata on occasion.  eik at one time had some code that 
he claimed completely modeled all the file dependencies in the ports 
tree, but neither Dan nor I took the time to pursue that avenue. 

So, basically, a far lighterweight solution than this PR was adopted. 


Comment 9 Mark Linimon freebsd_committer freebsd_triage 2005-07-18 05:09:32 UTC
Responsible Changed
From-To: eik->linimon