Bug 122268

Summary: graphics/graphviz creates symlinks in $HOME during installation
Product: Ports & Packages Reporter: Stefan Sperling <stsp>
Component: Individual Port(s)Assignee: Dirk Meyer <dinoex>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Stefan Sperling 2008-03-30 20:00:01 UTC
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

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
----------------------------------------------------------------------
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
----------------------------------------------------------------------
Comment 1 Edwin Groothuis freebsd_committer 2008-03-30 20:00:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Dirk Meyer freebsd_committer 2008-04-02 09:49:00 UTC
State Changed
From-To: open->analyzed

You must have WITH_PERL in /etc/make.conf 
or selected in your "make config." 

I am testing a patch to fix the perl path problem.
Comment 3 dfilter service freebsd_committer 2008-04-02 10:58:59 UTC
dinoex      2008-04-02 09:58:54 UTC

  FreeBSD ports repository

  Modified files:
    graphics/graphviz    Makefile pkg-plist 
  Log:
  - fix installation of perl module
  PR:             122268
  
  Revision  Changes    Path
  1.94      +1 -0      ports/graphics/graphviz/Makefile
  1.44      +2 -0      ports/graphics/graphviz/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Dirk Meyer freebsd_committer 2008-04-02 11:07:50 UTC
State Changed
From-To: analyzed->closed

a fix is committed, thanks.