Can't build netatalk 3.0.3,1

When I try to build net/netatalk3 I get the following error, regardless of whether the DBUS option is selected or not:

Code:
main.c: In function 'main':
main.c:317: error: 'OPTION_DBUS_AFPSTATS' undeclared (first use in this function)
main.c:317: error: (Each undeclared identifier is reported only once
main.c:317: error: for each function it appears in.)
gmake[4]: *** [afpd-main.o] Error 1
gmake[4]: Leaving directory `/usr/ports/net/netatalk3/work/netatalk-3.0.3/etc/afpd'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/ports/net/netatalk3/work/netatalk-3.0.3/etc/afpd'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/ports/net/netatalk3/work/netatalk-3.0.3/etc'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/net/netatalk3/work/netatalk-3.0.3'
gmake: *** [all] Error 2
*** [do-build] Error code 1

Stop in /usr/ports/net/netatalk3.
*** [build] Error code 1

Stop in /usr/ports/net/netatalk3.
 
Apparently it uses already installed files like atalk/globals.h instead of the ones in the package because system includes are used for the atalk header files instead of local includes. I see that OPTION_DBUS_AFPSTATS is defined in this file in 3.0.3 but not in 3.0.2 and lower. Uninstalling net/netatalk3 and then reinstalling does work here.
 
Works here too. Probably the fix is to change the way the globals.h gets included. Currently it searches in /usr/local/include which results in failure.
 
This is yet another case where so called "staging" would help. Now it's possible for a badly written port Makefile to cause the port build to use headers/libraries from the older installed version of the port instead of just sticking to the files from the clean build environment.
 
Back
Top