Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Mar 2008 20:55:12 +0200 (CEST)
From:      Stefan Sperling <stsp@stsp.name>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/122268: graphics/graphviz creates symlinks in $HOME during installation
Message-ID:  <200803301855.m2UItCtn024417@ted.stsp.name>
Resent-Message-ID: <200803301900.m2UJ01va079726@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         122268
>Category:       ports
>Synopsis:       graphics/graphviz creates symlinks in $HOME during installation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 30 19:00:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Sperling
>Release:        FreeBSD 7.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD ted.stsp.name 7.0-RELEASE FreeBSD 7.0-RELEASE #2: Sat Mar 29 23:54:21 CET 2008 stsp@ted.stsp.name:/usr/obj/home/stsp/src/freebsd-7.0/sys/TED i386

	
>Description:
While reinstalling all my ports after upgrading from 6.3 to 7.0,
I noticed that I suddenly had two symlinks in my home
directory called gv.pm and gv.so:

/home/stsp/gv.pm -> /usr/local/lib/graphviz/perl/gv.pm
/home/stsp/gv.so -> /usr/local/lib/graphviz/perl/libgv_perl.so
	
>How-To-Repeat:

Note that I build ports as normal user, with
SU_CMD=/home/stsp/bin/sucmd.sh
That script contains:

----------------------------------------------------------------------
#!/bin/sh

if [ -x /usr/local/bin/sudo ]
then
	/usr/local/bin/sudo /bin/sh -c "$*"
else
	/usr/bin/su root -c "$*"
fi
----------------------------------------------------------------------

I also use WRKDIRPREFIX=/usr/obj

To find out why the links were created I made them immutable:

$ ls -lo ~/gv*
lr-xr-xr-x  1 root  stsp  schg 34 Mar 30 20:18 /home/stsp/gv.pm -> /usr/local/lib/graphviz/perl/gv.pm
lr-xr-xr-x  1 root  stsp  schg 42 Mar 30 20:18 /home/stsp/gv.so -> /usr/local/lib/graphviz/perl/libgv_perl.so

and ran 'make deinstall reinstall' in the port's directory.

Then I got this:

----------------------------------------------------------------------
gmake[4]: Entering directory `/usr/obj/usr/ports/graphics/graphviz/work/graphviz-2.18/tclpkg'
mkdir -p ;
usage: mkdir [-pv] [-m mode] directory_name ...
gmake[4]: [install-data-hook] Error 64 (ignored)
if test -w ; then \
		(cd ; \
			ln -s -f /usr/local/lib/graphviz/perl/libgv_perl.so gv.s
o; \
			ln -s -f /usr/local/lib/graphviz/perl/gv.pm gv.pm;) \
	else \
		echo "Warning:  is not writable."; \
		echo "Skipping system installation of perl binding."; \
	fi
ln: gv.so: Operation not permitted
ln: gv.pm: Operation not permitted
gmake[4]: *** [install-data-hook] Error 1
----------------------------------------------------------------------

This happens even if TCL support is disabled.
This is the configuration I set for this port:

----------------------------------------------------------------------
===> The following configuration options are available for graphviz-2.18:
     ICONV=on "Build with ICONV support"
     XPM=on "Build with XPM support"
     DIGCOLA=off "DIGCOLA features in neato layout engine"
     IPSEPCOLA=off "IPSEPCOLA features in neato layout engine"
     NLS=on "Build with gettext support"
     TK=off "Build with TK support"
     PANGOCAIRO=on "build with pangocairo support"
     GTK=on "build with gtk plugin"
     GDK_PIXBUF=on "build with gdk pixbuf support"
     GNOMEUI=off "build with libgnomeui support"
     MING=off "Build with ming plugin"
     PERL=off "Perl bindings (swig)"
     PHP=off "PHP bindings (swig)"
     PYTHON=off "Python bindings (swig)"
     RUBY=off "Ruby bindings (swig)"
     LUA=off "Lua bindings (swig)"
     TCL=off "TCL bindings (swig)"
     GUILE=off "Guile bindings (swig)"
===> Use 'make config' to modify these settings
----------------------------------------------------------------------

	
>Fix:

Looking at /usr/obj/usr/ports/graphics/graphviz/work/graphviz-2.18/tclpkg/Makefile,
it seems like the section creating these links can be safely
patched out (see below). Note that most of it is already commented, anyway.

I have no idea why DESTDIR isn't set while the port runs
'make install' -- in the make error above you can see that DESTDIR
is empty. This is probably what made the symlinks end up in my home
directory.

This is the relevant section of the Makefile.
It should be commented out or removed altogether.
----------------------------------------------------------------------
# Installation of softlinks into non-owned directories is done as a
# separate step, with soft failures, so that a developer can do:
#    ./configure --prefix=$HOME/graphviz; make; make install
# without root priviledges.
install-data-hook:
	-mkdir -p $(DESTDIR);
	if test -w $(DESTDIR); then \
		(cd $(DESTDIR); \
			$(LN_S) -f $(pkgperldir)/libgv_perl.so gv.so; \
			$(LN_S) -f $(pkgperldir)/gv.pm gv.pm;) \
	else \
		echo "Warning:  is not writable."; \
		echo "Skipping system installation of perl binding."; \
	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR); then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgphpdir)/libgv_php.so gv.so;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of php binding."; \
#	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR); then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgphpdir)/gv.php gv.php;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of php binding."; \
#	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR); then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgpythondir)/libgv_python.so _gv.so; \
#			$(LN_S) -f $(pkgpythondir)/gv.py gv.py;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of python binding."; \
#	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR); then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgpython23dir)/libgv_python23.so _gv.so; \
#			$(LN_S) -f $(pkgpython23dir)/gv.py gv.py;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of python23 binding."; \
#	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR); then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgpython24dir)/libgv_python24.so _gv.so; \
#			$(LN_S) -f $(pkgpython24dir)/gv.py gv.py;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of python24 binding."; \
#	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR); then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgpython25dir)/libgv_python25.so _gv.so; \
#			$(LN_S) -f $(pkgpython25dir)/gv.py gv.py;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of python25 binding."; \
#	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR); then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgrubydir)/libgv_ruby.so gv.so;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of ruby binding."; \
#	fi
#	-mkdir -p $(DESTDIR);
#	if test -w $(DESTDIR)/; then \
#		(cd $(DESTDIR); \
#			$(LN_S) -f $(pkgtcldir) graphviz-2.18;) \
#	else \
#		echo "Warning:  is not writable."; \
#		echo "Skipping system installation of tcl bindings."; \
#	fi
----------------------------------------------------------------------

	
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803301855.m2UItCtn024417>