error by installation (linux : ubuntu 5.1)

Bugs and Suggestions in XnView Classic which have been resolved

Moderators: XnTriq, helmut, xnview

Post Reply
lexl

error by installation (linux : ubuntu 5.1)

Post by lexl »

I had problems by the installation on a Linux System (ubuntu 5.1).
root@ubuntu:/home/lexl/Desktop/XnView-1.70-x86-unknown-linux2.x-static-fc4# ./install
OS : Linux, version 2.6.12-10-386
This script will install nview/nconvert/xnview in the /usr/local/bin directory
cp: reguläre Datei „/usr/lib/X11/app-defaults/XnView“ kann nicht angelegt werden: Datei oder Verzeichnis nicht gefunden
chmod: Zugriff auf „/usr/lib/X11/app-defaults/XnView“ nicht möglich: Datei oder Verzeichnis nicht gefunden

Done!
Problem solution:
I have add a few lines to the install script. With this script the error didn't occur in the future:

Code: Select all

#!/bin/sh

VERSION="1.70"
LIBVERSION="4.47"

if [ -e /sbin/uname -o -e /bin/uname ]; then
	echo "  OS  : `uname -s`, version `uname -r`"
	case "`uname -s`" in
	IRIX)
		echo "  CPU : `hinv | grep CPU | cut -f3 -d' '` Processor (`uname -p`)"
		;;
	SunOS)
		echo "  CPU : `uname -p`)"
		;;
	Linux)
		;;
	FreeBSD)
		;;
	esac
else
	echo "Unknown system \!"
	exit
fi

case "`id`" in
	uid=*\(root\)*)
		;;
	*)
		echo "You must be root \!"
		exit
esac

#
#

echo This script will install nview/nconvert/xnview in the /usr/local/bin directory

BASEDIR="/usr/local"

if [ ! -e $BASEDIR ]; then
	mkdir $BASEDIR
fi

if [ ! -e $BASEDIR ]; then
	exit 0
fi

if [ ! -e $BASEDIR/bin ]; then
	mkdir -p $BASEDIR/bin
	chmod 755 $BASEDIR/bin
fi

if [ ! -e $BASEDIR/lib ]; then
	mkdir $BASEDIR/lib
	chmod 755 $BASEDIR/lib
fi

if [ ! -e $BASEDIR/man/man1 ]; then
	mkdir -p $BASEDIR/man/man1
	chmod 755 $BASEDIR/man/man1
fi

if [ ! -e $BASEDIR/doc/XnView ]; then
	mkdir -p $BASEDIR/doc/XnView
	chmod 755 $BASEDIR/doc/XnView
fi

rm -f $BASEDIR/bin/nview $BASEDIR/bin/nconvert $BASEDIR/bin/xnview
rm -f $BASEDIR/man/man1/nview.z $BASEDIR/man/man1/xnview.z

##
## Install BINARY
##
cp bin/nview bin/nconvert bin/xnview $BASEDIR/bin
chmod 755 $BASEDIR/bin/nview $BASEDIR/bin/nconvert $BASEDIR/bin/xnview

##
## Install APP-DEFAULTS
##

# --------------------------- the next lins ar needes by the following error:
# cp: reguläre Datei „/usr/lib/X11/app-defaults/XnView“ 
# kann nicht angelegt werden: Datei oder Verzeichnis nicht gefunden
# chmod: Zugriff auf „/usr/lib/X11/app-defaults/XnView“ nicht möglich: 
# Datei oder Verzeichnis nicht gefunden
# ------- error solution ----------------------------------------------------
if  [ ! -e /usr/lib ]; then
	echo "1"
	mkdir /usr/lib/
	chmod 755 /usr/lib/
fi

if [ ! -e /usr/lib/X11 ]; then
	echo "2"
	mkdir /usr/lib/X11
	chmod 755 /usr/lib/X11
fi

if [ ! -e /usr/lib/X11/app-defaults ]; then
	echo "3"
	mkdir /usr/lib/X11/app-defaults
	chmod 755 /usr/lib/X11/app-defaults
fi
# -------^ error solution ^-------------------------------------------------^

cp app-defaults/XnView.ad /usr/lib/X11/app-defaults/XnView
chmod 444 /usr/lib/X11/app-defaults/XnView

##
## Install MAN page
##

if [ -e man/nview.z ]; then
#	cp man/nview.z man/xnview.z $BASEDIR/man/cat1/
#	chmod 644 $BASEDIR/man/cat1/nview.z $BASEDIR/man/cat1/xnview.z
	cp man/nview.z $BASEDIR/man/man1/nview.1.gz
	cp man/xnview.z $BASEDIR/man/man1/xnview.1.gz
	chmod 644 $BASEDIR/man/man1/nview.1.gz $BASEDIR/man/man1/xnview.1.gz
else
	cp man/nview.1 man/xnview.1 $BASEDIR/man/man1/
	chmod 644 $BASEDIR/man/man1/nview.1 $BASEDIR/man/man1/xnview.1
fi

##
## Install DOC
##
cp *.txt $BASEDIR/doc/XnView
chmod 644 $BASEDIR/doc/XnView/*.txt

echo 
echo Done!
Post Reply