diff mbox series

[libselinux,1/2] libselinux/src/Makefile: don't use ln --relative option

Message ID 20191025134304.12666-1-thomas.petazzoni@bootlin.com (mailing list archive)
State Rejected
Headers show
Series [libselinux,1/2] libselinux/src/Makefile: don't use ln --relative option | expand

Commit Message

Thomas Petazzoni Oct. 25, 2019, 1:43 p.m. UTC
The ln --relative option is not available in fairly old versions of
ln, which are still in use in older Linux distributions.

Since the two use of ln --relative can very trivially be implemented
differently in libselinux/src/Makefile, let's do so.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 libselinux/src/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stephen Smalley Oct. 28, 2019, 5:06 p.m. UTC | #1
On 10/25/19 9:43 AM, Thomas Petazzoni wrote:
> The ln --relative option is not available in fairly old versions of
> ln, which are still in use in older Linux distributions.
> 
> Since the two use of ln --relative can very trivially be implemented
> differently in libselinux/src/Makefile, let's do so.

This changes where the libselinux.so symlink is created (from LIBDIR to 
SHLIBDIR), and yields a broken build for make DESTDIR=~/obj install.  As 
a result, the travis build breaks.

> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>   libselinux/src/Makefile | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
> index 2b1696a0..dc675a49 100644
> --- a/libselinux/src/Makefile
> +++ b/libselinux/src/Makefile
> @@ -170,12 +170,12 @@ install: all
>   	install -m 755 $(LIBSO) $(DESTDIR)$(SHLIBDIR)
>   	test -d $(DESTDIR)$(LIBDIR)/pkgconfig || install -m 755 -d $(DESTDIR)$(LIBDIR)/pkgconfig
>   	install -m 644 $(LIBPC) $(DESTDIR)$(LIBDIR)/pkgconfig
> -	ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
> +	cd $(DESTDIR)$(SHLIBDIR) && ln -sf $(LIBSO) $(TARGET)
>   
>   install-pywrap: pywrap
>   	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
>   	install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
> -	ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
> +	cd $(DESTDIR)$(PYTHONLIBDIR) && ln -sf selinux/_selinux$(PYCEXT) _selinux$(PYCEXT)
>   
>   install-rubywrap: rubywrap
>   	test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL)
>
diff mbox series

Patch

diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index 2b1696a0..dc675a49 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -170,12 +170,12 @@  install: all
 	install -m 755 $(LIBSO) $(DESTDIR)$(SHLIBDIR)
 	test -d $(DESTDIR)$(LIBDIR)/pkgconfig || install -m 755 -d $(DESTDIR)$(LIBDIR)/pkgconfig
 	install -m 644 $(LIBPC) $(DESTDIR)$(LIBDIR)/pkgconfig
-	ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
+	cd $(DESTDIR)$(SHLIBDIR) && ln -sf $(LIBSO) $(TARGET)
 
 install-pywrap: pywrap
 	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
 	install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
-	ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
+	cd $(DESTDIR)$(PYTHONLIBDIR) && ln -sf selinux/_selinux$(PYCEXT) _selinux$(PYCEXT)
 
 install-rubywrap: rubywrap
 	test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL)