Merge pull request #7334 from neheb/monit
[feed/packages.git] / libs / libndpi / patches / 0007-Symlink-the-shared-library-to-pwd.patch
1 From a1f6cbb6c9a212b5b3b6605254ae35bead5c43df Mon Sep 17 00:00:00 2001
2 From: Hank Leininger <hlein@korelogic.com>
3 Date: Mon, 8 Oct 2018 18:17:30 -0600
4 Subject: [PATCH 7/9] Symlink the shared library to pwd.
5
6 DESTDIR is used, for instance, by distros to facilitate installing
7 to a temp path for testing / package-building.
8
9 In general nDPI supports DESTDIR (yay!), but using an absolute path
10 for the target of the library link has two problems:
11
12 1) If DESTDIR is set to /some/tmp/path, we end up with a link that
13 points to /some/tmp/path/usr/lib/libndpi-x.y.z, which is definitely
14 not what is intended - once the package is installed, the link is
15 broken.
16
17 2) Absolute links are problematic for distributions; pointing to
18 /usr/lib/libndpi-x.y.z during package build-and-test would point to
19 either a nonexistent file, or an old and possibly wrong one.
20
21 Both of these are avoided if we just link to the target with no path
22 at all.
23 ---
24 src/lib/Makefile.in | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27 diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
28 index cbbc54b..dc1e34b 100644
29 --- a/src/lib/Makefile.in
30 +++ b/src/lib/Makefile.in
31 @@ -49,6 +49,6 @@ clean:
32 install: $(NDPI_LIBS)
33 mkdir -p $(DESTDIR)$(libdir)
34 cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/
35 - ln -Fs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE)
36 + ln -Fs $(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE)
37 mkdir -p $(DESTDIR)$(includedir)
38 cp ../include/*.h $(DESTDIR)$(includedir)
39 --
40 2.19.1
41