pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/44163: misc/gkrellm-weather compiles in incorrect path for GrabWeather (+FIX)

>Number:         44163
>Category:       pkg
>Synopsis:       misc/gkrellm-weather compiles in incorrect path for 
>GrabWeather (+FIX)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 28 13:35:00 +0000 2010
>Originator:     Robert Elz
>Release:        NetBSD 5.1   (pkgsrc current 2010-11-28)
        Prince of Songkla University
System: NetBSD 5.1 NetBSD 5.1 (JADE-1.12-20101117) #5: Wed 
Nov 17 05:30:55 ICT 2010 i386
Architecture: i386
Machine: i386
        misc/gkrellm-weather references the (included) GrabWeather script
        twice, and in two completely different ways.   One of those is
        patched (by patches/patch-aa) to remove the path, and so reply
        upon the user's PATH setting (that's OK, if not ideal).  The other
                PREFIX "/bin/GrabWeather"
        which if PREFIX were correct would be perfect (GrabWeather gets
        installed in ${PREFIX}/bin).

        However, while gkrellm-weather's pkgsrc Makefile includes
                MAKE_ENV+=      PREFIX=${PREFIX:Q}

        it uses gmake, and for that (it seems) the explicit setting of
        PREFIX in the Makefile
                PREFIX = /usr/local

        overrides the one that pkgsrc is putting in the environment.
        In any case, what gets compiled generates ...

strings /usr/pkg/lib/gkrellm2/plugins/  | grep Grab
/usr/local/bin/GrabWeather %s

        which is not what we want, and leads to diagnostics at runtime
        when the script cannot be found (but only if a non-default weather
        station is selected, with the default, the other path is used, and
        this doesn't happen).

        I use pkg_comp with NetBSD 5.0 release sets and libkver installed,
        but none of that is relevant to this problem.

        Simply build misc/gkrellm-weather and inspect the
        produced (or actually use it, and select any non-default weather
        station - I use VTSS).

        There must be a dozen different ways to fix this one, I chose the
        version with minimal impact on pkgsrc itself (ie: modify the
        Makefile and only the Makefile - this change requires a revbump,
        so the Makefile is going to get modified, keeping the entire
        fix there means only one modified cvs file...

        My patch is below.

        Alternatives would be to simply modify patch-aa so it corrects
        this problem as well as the other (more obviously incorrect)
        reference to GrabWeather (it would probably make sense for both
        references to be implemented the same way, but ...)

        Or, the Makefile (the gkrellm-weather Makefile, rather than pkgsrc's)
        could be modified (patch-ab is already touching it) by simply
        removing the setting of PREFIX from there, then the one from the
        environment would be used (I assume.)

        Or ...

        Also, I have no way to test it, as I have no idea what it is
        used for, but this stuff claims to use nls (locales) and the
        setting of the locale directory is based upon the (I think)
        incorrect version fo PREFIX - again, pkgsrc attempts to
        override that by putting a setting for LOCALEDIR in gmake's
        environment, but if that doesn't work for PREFIX, I doubt it
        works for LOCALEDIR either.

        In any case, the following change to the pkgsrc Makefile
        causes the correct path (/usr/pkg/bin/GrabWeather in my case)
        to be built info the .so file, so this one is effective, if
        not ideal.   Altering patches/patch-aa so it actually inserted
        PREFIX in place of the path it deletes rather than simply
        deleting it (what I mean will be obvious to anyone who looks
        at the patch) would allow this patch to make the two references

        Apply the following patch in pkgsrc/misc/gkrellm-weather

Index: Makefile
RCS file: /cvsroot/NetBSD/pkgsrc/misc/gkrellm-weather/Makefile,v
retrieving revision 1.34
diff -u -r1.34 Makefile
--- Makefile    15 Nov 2010 22:57:56 -0000      1.34
+++ Makefile    28 Nov 2010 13:20:54 -0000
@@ -2,7 +2,7 @@
 DISTNAME=      gkrellweather-2.0.7
 PKGNAME=       gkrellm-weather-2.0.7
 CATEGORIES=    misc
@@ -20,6 +20,12 @@
 REPLACE_PERL=          GrabWeather
+SUBST_CLASSES+=                pfx
+SUBST_MESSAGE.pfx=     PREFIX replacement
+SUBST_STAGE.pfx=       post-patch
+SUBST_FILES.pfx=       gkrellweather.c
+SUBST_SED.pfx=         -e 's,PREFIX,"${PREFIX}",'
 MAKE_ENV+=     enable_nls=1

Home | Main Index | Thread Index | Old Index