Skip to contentSkip to conversation

: fix symbolic links creation to the shared libraries

PATCH New Guido Trentalancia 1 participant 1 message Jul 21, 2012 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : fix symbolic links creation to the shared libraries

Hello.

The current Makefiles for the userspace libraries only install correct symbolic links to the shared libraries when a two-level (relatively to the root directory) SHLIBDIR is used.

The attached patch can be easily modified to avoid using sed at no functional difference (it would not be able to remove multiple consecutive slash).

Fix the creation of symbolic links to the shared libraries during installation.

---
 libselinux/src/Makefile  |    2 +-
 libsemanage/src/Makefile |    2 +-
 libsepol/src/Makefile    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
libselinux/src/Makefile +1 -1
@@ -153,7 +153,7 @@ install: all
 	install -m 755 $(LIBSO) $(SHLIBDIR)
 	test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
 	install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
-	cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET)
+	cd $(LIBDIR) && ln -sf `echo $(SHLIBDIR)/$(LIBSO) | sed 's/\/\/\{1,\}/\//g'` $(TARGET)
 
 install-pywrap: pywrap
 	test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux
libsepol/src/Makefile +1 -1
@@ -43,7 +43,7 @@ install: all
 	install -m 755 $(LIBSO) $(SHLIBDIR)
 	test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
 	install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
-	cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET)
+	cd $(LIBDIR) && ln -sf `echo $(SHLIBDIR)/$(LIBSO) | sed 's/\/\/\{1,\}/\//g'` $(TARGET)
 
 relabel:
 	/sbin/restorecon $(SHLIBDIR)/$(LIBSO)
libsemanage/src/Makefile +1 -1
@@ -146,7 +146,7 @@ install: all
 	test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
 	install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
 	test -f $(DEFAULT_SEMANAGE_CONF_LOCATION) || install -m 644 -D semanage.conf $(DEFAULT_SEMANAGE_CONF_LOCATION)
-	cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET)
+	cd $(LIBDIR) && ln -sf `echo $(SHLIBDIR)/$(LIBSO) | sed 's/\/\/\{1,\}/\//g'` $(TARGET)
 
 install-pywrap: pywrap 
 	test -d $(PYLIBDIR)/site-packages || install -m 755 -d $(PYLIBDIR)/site-packages

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.