Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277995 - sys-auth/libnss-cache has a bad makefile patch
Summary: sys-auth/libnss-cache has a bad makefile patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Michael Weber (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-15 23:09 UTC by Nathan March
Modified: 2010-09-15 00:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan March 2009-07-15 23:09:16 UTC
In 0.1-make-install.patch as part of libnss-cache, the following patch is applied:

-	[ -d $(LIBDIR) ] || install -d $(LIBDIR)
-	install $(BUILD)/$(LIBRARY) $(LIBDIR)
-	cd $(LIBDIR); for link in $(LINKS); do ln -sf $(LIBRARY) $$link ; done
+	[ -d $(DESTDIR)/$(PREFIX)/$(LIBDIR) ] || install -d $(DESTDIR)/$(PREFIX)/$(LIBDIR)
+	install $(BUILD)/$(LIBRARY) $(DESTDIR)/$(PREFIX)/$(LIBDIR)
+	cd $(DESTDIR)/$(PREFIX)/$(LIBDIR); for link in $(LINKS); do ln -sf $(LIBRARY) $$link ; done

$(DESTDIR) was added by the patch so it looks like whoever came up with this was just trying to add support for that, instead they broke it. $(LIBDIR) already contains $(PREFIX) as part of it's declaration:

LIBDIR=$(PREFIX)/lib

So the end result is that this ebuild tries to install to /usr/usr/lib instead of /usr/lib.

Correct patch would be:

-   [ -d $(LIBDIR) ] || install -d $(LIBDIR)
-   install $(BUILD)/$(LIBRARY) $(LIBDIR)
-   cd $(LIBDIR); for link in $(LINKS); do ln -sf $(LIBRARY) $$link ; done
+   [ -d $(DESTDIR)/$(LIBDIR) ] || install -d $(DESTDIR)/$(LIBDIR)
+   install $(BUILD)/$(LIBRARY) $(DESTDIR)/$(LIBDIR)
+   cd $(DESTDIR)/$(LIBDIR); for link in $(LINKS); do ln -sf $(LIBRARY) $$link ; done


Reproducible: Always
Comment 1 Nathan March 2009-07-15 23:15:59 UTC
Ugh, additional error in this ebuild. The makefile doesn't actually run the nss_cache compile when you do an install. I fixed this by duplicating the emake line in the ebuild and switching the first one to nss_cache, like so:

	emake LIBDIR="$(get_libdir)" PREFIX=/ DESTDIR="${D}" nss_cache
	emake LIBDIR="$(get_libdir)" PREFIX=/ DESTDIR="${D}" install

There's probably a nicer way to do this but this makes the ebuild actually work properly.
Comment 2 Lars Wendler (Polynomial-C) gentoo-dev 2009-07-16 11:01:02 UTC
There's no need to CC yourself when you're the reporter of a bug. You will receive mails on changes to this bug anyway.
Comment 3 Nathan March 2009-07-16 16:42:16 UTC
Makes sense =)

Also not sure why I didn't think about this, but the emake line should just read:

        emake LIBDIR="$(get_libdir)" PREFIX=/ DESTDIR="${D}" nss_cache install

Comment 4 Víctor Ostorga (RETIRED) gentoo-dev 2009-09-07 16:03:22 UTC
The ebuild only installs files in /lib and not in /usr

# qlist sys-auth/libnss-cache
/lib/libnss_cache.so.2.0
/lib/libnss_cache.so.2
/lib/libnss_cache.so

Comment 5 Michael Weber (RETIRED) gentoo-dev 2010-09-15 00:54:27 UTC
+*libnss-cache-0.1-r1 (15 Sep 2010)
+
+  15 Sep 2010; Michael Weber <xmw@gentoo.org> +libnss-cache-0.1-r1.ebuild,
+  +files/libnss-cache-0.1-r1-make-install.patch, metadata.xml:
+  Revbump to fix install locations (bug #277995, thanks Nathan March) and
+  LDFLAGS (bug #336554).
+