You are not logged in.

#1 2019-08-23 11:02:08

promach
Member
Registered: 2016-05-18
Posts: 96

PKGBUILD Request : Sonnet

For Sonnet installation , there seems to be no make command needed

There is only a sh script command : ./sonnetinstall

and some environment variables setting up.

How to write a PKGBUILD in this case ?

sonnetinstall

#!/bin/sh
#
# Sonnet Software INSTALLATION PROGRAM
#
# Sonnet Software, Inc.
# (C) COPYRIGHT 1997-2014. ALL RIGHTS RESERVED.
#
# Version 2.7
# Tue Aug 12 10:13:07 EDT 2014
#
#
# This program installs the software from the CD-ROM or from a file
# that is downloaded from the web.
# The software includes a base package which does not include any machine 
# specific executables. The base package includes shell scripts,
# examples, data files, etc. An installation requires, at a minimum,
# the base package in addition to at least one architecture package,  
# which should match the local machine type. The architecture 
# packages are platform specific, e.g., Linux executables.
# You may have more than one architecture package present.
#
# In 14.0, all of the architectures will be installed.  This include
#    linux86 - for linux Red Hat 5.0 and above and equivelent systems
#    rh86    - for linux Red Hat 4.0 and equivelent system
# been installed.
#
# ASSUMPTIONS:
# 1. If there is a bad installation, for instance, part of a package is
# installed rather than the entire package, then the user should delete
# the entire sonnet directory and re-install. Or else the installation
# should be corrected by an experienced user. NOTE: When the sonnet
# directory is deleted, then the license/key information is also deleted.
#
# 2. Installation may not be done over a previous version.
#
# 3. The CD-ROM is on the local machine.  If the CD-ROM is not on the
# local machine, the user should install the software on the local 
# machine, then copy the sonnet directory to the target machine.
# Once on the target machine, the user should run sonnetconfig again to
# set the permissions on the files correctly.
#
# 4. To delete an architecture simply delete the directory containing
# the executables.  For example, delete sonnet/arch/rh86.
#
#
# Options:
#  -v 			Gives verbose output in tar command
#  -c 			Tries to continue even if there is an error
#  -skiplicense 	Skips asking user about license agreement
#
# Debug options:
#   SONNET_TAR_OPTIONS - may override all of the tar options with this
#                      environment variable. The tar command is
#                      tar $UNIXINST_TAR_OPTIONS file.tar
#   SONNET_ARCH - may override the architecture name.  Is used by sscmd.
#   SONNET_UNIXINST_CONT_ON_ERROR - if TRUE then continue tar extraction even

 

PATH=./bin:$PATH; export PATH
PROGNAME=sonnetinstall

TMP=/tmp/$$
ANS=${TMP}ans
VERIFY_LIST=${TMP}verlist
VERIFY_COMMANDS=${TMP}vercmd
INSTALL_LIST=${TMP}instlst
ARCH_LIST=${TMP}archlist
ARCH_TAR=${TMP}archtar
EXIT_PROGRAM=${TMP}exitprog
SHORT_ARCH_LIST=${TMP}sharls
UNZIPEXE=${TMP}unzipexe
TAR_VERBOSE=
CONT_ON_ERROR=FALSE
DISPLAY_LICENSE_AGREEMENT=TRUE

TMP_FILES="
	$ANS
	$VERIFY_LIST
	$VERIFY_COMMANDS
	$INSTALL_LIST
	$ARCH_LIST
	$ARCH_TAR
	$EXIT_PROGRAM
	$SHORT_ARCH_LIST
	$UNZIPEXE
"

trap '
	rm -f $TMP_FILES 
	exit 1
' 1 2 3 14 15

main()
{
	ORIG_PWD=`pwd`

	parce_options $*

	if [ -f product.txt ]
	then
		PRODUCT=` cat product.txt \
				| grep PRODUCT= \
				| sed "s/PRODUCT=//" \
				| sed "s/ //g"
			`
	fi

	echo
	echo "               SONNET SOFTWARE INSTALLATION PROGRAM"
	if [ "$PRODUCT" != "" ]
	then
		echo "                            ($PRODUCT)"
	fi

	cat <<-EOF

		This program copies the Sonnet programs to your disk.

	EOF

	ask_user_about_license
	if [ $? -ne 0 ]
	then 
		# user did not agree to the license
		return
	fi

	set_cdrom_directory
	set_environment
	get_install_directory
	get_package_list	# list of arch in short arch name format
	check_base_package
	check_for_packages

	if [ -s $INSTALL_LIST ]
	then
		echo "The following is already installed"
		cat $INSTALL_LIST | sed "s/^/        - /"
		echo
	fi

	if [ $ALL_PACKAGES_INSTALLED = TRUE ]
	then
		echo All of the software has been previously installed.
		rm -f $TMP_FILES
		exit 1
	fi


	ask_for_packages

	if [ $INSTALL_BINARY = FALSE ]
	then
		echo ERROR: You must install atleast one of the platform executables.
		rm -f $TMP_FILES
		exit 1
	fi

	install_packages

	if [ -f $EXIT_PROGRAM ]
	then
		rm -f $TMP_FILES
		exit 1
	fi

	# Finished the installation by running sonnetconfig
	# If the user moves the directory, sonnetconfig should be run again.
	if [ -d "$INSTALL_DIRECTORY" ]
	then
		cd "$INSTALL_DIRECTORY"
		if [ -f sonnetconfig ]
		then
			sh sonnetconfig -NoPrintHeader
		fi
	fi

	echo
	echo $PROGNAME completed.
	echo

	#cat <<-EOF
	#
	#	You should now run the "sonnetconfig" command.
	#
	#EOF
}

####
####	Parce command line options
####
parce_options()
{
	DEBUG=FALSE
	if [ "$1" = "-D" ]
	then
		# Turn on debug info
		DEBUG=TRUE
		shift
	fi	

	if [ "$1" = "-v" ]
	then
		# Give verbose option on tar commands
		TAR_VERBOSE=v
		shift
	fi	

	if [ "$1" = "-c" ]
	then
		# Give verbose option on tar commands
		CONT_ON_ERROR=TRUE
		shift
	fi	

	if [ "$1" = "-skiplicense" ]
	then
		# Do not display license agreement to user
		DISPLAY_LICENSE_AGREEMENT=FALSE
		shift
	fi	

}

####
####	Set the installation directory to the top directory
####
set_cdrom_directory()
{
	MAX=10
	while [ "`pwd`" != "/" ]
	do
		if [ -f `cd_file $PROGNAME` ]
		then
			break;
		fi

		cd ..

		MAX=`expr $MAX - 1`
		if [ $MAX = 0 ]
		then
			break;
		fi
	done

	if [ ! -f `cd_file $PROGNAME` ]
	then
		echo "ERROR: Must run $PROGNAME from the top directory on the CDROM"
		rm -f $TMP_FILES
		exit 1
	fi

	PROGNAME=`cd_file $PROGNAME`
}

####
####	Get the directory to install the software from the user
####
set_environment()
{
	SSCMD_EXE=`cd_file sonnet/install/linux/bin/sscmd`
	SSARCH=`sh $SSCMD_EXE arch`

	case "$SSARCH"  in
		sun4_u5)	SHORT_SYSTEM_ARCH=sun4u5 ;;
		linux86)	SHORT_SYSTEM_ARCH=linux86 ;;
		rh86)		SHORT_SYSTEM_ARCH=rh86 ;;
		"")		echo ERROR: Could not determine architecture for this machine, assuming Linux.
				SHORT_SYSTEM_ARCH=linux86 
				;;
				
		*)		echo ERROR: Unsupported architecture of $SSARCH, assuming Linux instead.
				SHORT_SYSTEM_ARCH=linux86 
				;;
	esac

	if [ "$SHORT_SYSTEM_ARCH" = "" ]
	then
		# This error should never happen.
		echo ERROR: Could not determine architecture of this machine
		exit 2
	fi

	UNZIPEXE_FILE=`cd_file sonnet/install/linux/bin/arch/$SHORT_SYSTEM_ARCH/sunzip`

	# create a copy of this arch. unzip program to be executed later.

	cp $UNZIPEXE_FILE $UNZIPEXE
	chmod 755 $UNZIPEXE


	CDROM=`pwd`
	PACKAGE_DIR=sonnet/install/linux
	ALL_PACKAGES_INSTALLED=TRUE
	INSTALL_BINARY=FALSE
	BASE_DESCRITPTION="Common software package (Used by all platforms)"
}

####
####	Ask user if he/she agrees to the license.  If no, then quit.
####	Returns:
####		1 - user did not agree to the terms
####		0 - user agree to the terms
####
ask_user_about_license()
{
	if [ "$DISPLAY_LICENSE_AGREEMENT" = "FALSE" ]
	then
		return
	fi

	echo "The following is the Sonnet Software, Inc. license agreement:"
	necho "Hit return"
	read junk

	echo 
	echo "**********************************************************************"
	echo
	print_license
	echo
	echo "************************ End License Agreement ***********************"
	echo
	askyesno $ANS "Do you agree with the above license agreement"
	if [ `cat $ANS` = no ]
	then
		echo "Installation stopped."
		return 1
	fi
	return 0
}


####
####	Get the directory to install the software from the user
####
get_install_directory()
{

	INSTALL_DIRECTORY=""

	while [ "$INSTALL_DIRECTORY" = "" ]
	do
		necho "Type the full path of the Sonnet directory: "

		read INSTALL_DIRECTORY
		echo
 
		if [ "$INSTALL_DIRECTORY" = "sonnet" -a $CONT_ON_ERROR = FALSE ]
		then
			cat <<-EOF
				ERROR: You are trying to install the software into a Sonnet directory named 
				"`pwd`/sonnet" on the CD-ROM.  You need to install the software 
				on your hard disk.  Therefore, specify the full path of the Sonnet directory 
				which you should have previously created. Typically, a full path begins 
				with a "/".


			EOF
			INSTALL_DIRECTORY=""
			continue
		fi

		if [ "$INSTALL_DIRECTORY" = "" ]
		then
			INSTALL_DIRECTORY=""
			continue
		fi

		if [ -d "$INSTALL_DIRECTORY" ]
		then
			# Install directory exists.  See if it is a empty directory.
			# If so, then we assume that the user created this directory
			# and we should continue to use it.
			cd "$ORIG_PWD"
			cd "$INSTALL_DIRECTORY"
			LS_FILES=`ls | grep -v "^\."`
			if [ "$LS_FILES" = "" ]
				then
				# INSTALL_DIRECTORY is an empty directory
				return
			fi

			cd_cd $PACKAGE_DIR

			VER_FILE=`cd_file sonnet.ver`

			cd "$ORIG_PWD"
			if [ ! -f "$INSTALL_DIRECTORY/sonnet.ver" -a $CONT_ON_ERROR = FALSE ]
			then
				echo "Sonnet ERROR: If you are doing a new install, you must specify"
				echo "              a new directory for the Sonnet Software. If you are"
				echo "              loading another platform to an existing Sonnet"
				echo "              installation, you must specify the sonnet top level"
				echo "              directory. (Do not specify the \"arch\" directory"
				echo "              in the Sonnet directory.)"
				echo

				INSTALL_DIRECTORY=""
			fi
		else
			echo "WARNING: Directory \"$INSTALL_DIRECTORY\" does not exist."
			askyesno $ANS "Would you like this directory created?" yes
			if [ `cat $ANS` = yes ]
			then
				cd "$ORIG_PWD"
				echo "Making directory \"$INSTALL_DIRECTORY\""
				mkdir "$INSTALL_DIRECTORY" 2> /dev/null
				if [ $? -ne 0 ]
				then
					# This exit is done in a subshell - so we need to
					# record that the exits occurs to exit in the
					# main function
					echo "ERROR: Could not create directory \"${INSTALL_DIRECTORY}\"."
					echo "$PROGNAME failed - No files copied"
					rm -f $TMP_FILES
					exit 1
				fi
			else
				INSTALL_DIRECTORY=""
			fi
			echo
		fi
	done
}

####
####	Get a list of packages
####
is_arch_installed()
{
	ARCH=$1

	> $SHORT_ARCH_LIST
	# get list of install arch - with sort names
	cd $ORIG_PWD
	if [ -d $INSTALL_DIRECTORY ]
	then
		if [ -d $INSTALL_DIRECTORY/arch ]
		then
			cd $INSTALL_DIRECTORY/arch
			ls | to_short_arch_name > $SHORT_ARCH_LIST
		fi
	fi

	grep "^${ARCH}$" $SHORT_ARCH_LIST > /dev/null
	if [ $? -eq 0 ]
	then
		RC=0
	else
		RC=1
	fi
	return $RC
}

####
####	Get a list of packages, in shortname
####
get_package_list()
{
	cd_cd $PACKAGE_DIR/arch

	ls *.trz* *.TRZ* > $ARCH_TAR 2> /dev/null
	# get list of architectures - in lower case
	cat $ARCH_TAR \
		| tolower \
		| sed -e "s/\;.*//" \
		| sed -e "s/\.trz//" \
		| sed -e "s/\.trz//" \
		> $ARCH_LIST		# shortname
}

check_base_package()
{
	cd $ORIG_PWD
	if [ -d $INSTALL_DIRECTORY ]
	then
		check_sonnet_version
	fi

	if [ -f $INSTALL_DIRECTORY/sonnet.ver ]
	then
		echo "$BASE_DESCRITPTION" >> $INSTALL_LIST
	else
		echo "$BASE_DESCRITPTION" >> $VERIFY_LIST
		echo "base" >> $VERIFY_COMMANDS
	fi
}

####
####	Check for a list of packages that are already installed
####
check_for_packages()
{
	cd_cd $PACKAGE_DIR/arch


	FOUND_AN_ARCH=FALSE

	for arch in `cat $ARCH_LIST`
	do
		FOUND_AN_ARCH=TRUE
		# See if package already exists
		if is_arch_installed $arch
		then
			arch_description $arch >> $INSTALL_LIST
		else
			ALL_PACKAGES_INSTALLED=FALSE
		fi
	 done

	if [ $FOUND_AN_ARCH = FALSE ]
	then
		echo "ERROR: Could not find any architecture packages on the CD or in the download directory."
		echo "       Possibly your CD is bad or the download file was corrupted."
		echo "       Please contact your Sonnet Software representative or check support at"
		echo "       www.sonnetsoftware.com"
		rm -f $TMP_FILES
		exit 1
	fi
}

####
####	Check for a list of packages that are already installed
####
ask_for_packages()
{

	cd_cd $PACKAGE_DIR/arch

	#NU_ARCH=`cat $ARCH_LIST | wc -l`
	#if [ $NU_ARCH -eq 1 ]
	#then
	#	arch=`cat $ARCH_LIST`
	#	DESCRIPTION=`arch_description $arch`
	#	echo $DESCRIPTION >> $VERIFY_LIST
	#	echo "arch $arch" >> $VERIFY_COMMANDS
	#	INSTALL_BINARY=TRUE
	#	echo
	#	return
	#fi

	# Starting in 14.0 all architectures are installed.
	# Before 14.0, we install architecture based on platform

	for arch in `cat $ARCH_LIST`
	do
		# See if package already exists
		is_arch_installed $arch
		if [ $? -ne 0 ]
		then
			DESCRIPTION=`arch_description $arch`
			if [ "$arch" = "$SHORT_SYSTEM_ARCH" ]
			then
				MY_ARCH=yes
			else
				MY_ARCH=no
			fi

			#askyesno $ANS "Do you wish to install $DESCRIPTION" $MY_ARCH
			#if [ `cat $ANS` = yes ]
			#then
				echo $DESCRIPTION >> $VERIFY_LIST
				echo "arch $arch" >> $VERIFY_COMMANDS
				INSTALL_BINARY=TRUE
			#fi
		fi
	done
	echo
}

####

####
####	Get a list of install packages
####
install_packages()
{
	# See if we need to install the base part of the sonnet software.
	# The base does not include any machine specific executables.
	# It does include shell scripts, examples, data files, etc.

	# not needed beginning 14.0
	# echo
	# echo "The following will be installed in $INSTALL_DIRECTORY"
	# echo
	# cat $VERIFY_LIST | sed "s/^/        - /"
	# echo

	askyesno $ANS "Do you wish to begin copying the files" yes
	if [ `cat $ANS` = no ]
	then
		rm -f $TMP_FILES
		exit 0
	fi

	echo

	# Set the tar options
	case "$SSARCH" in
		sun4_u4|sun4_u5|HP-UX)
			# Use -o option on tar to use default parameter.
			# Do not need to maintain permissions since these
			# will be updated by sonnetconfig
			# -o optin does not exists on linux
			TAR_O_OPTION=o
			;;
	esac

	TAR_OPTIONS=${TAR_VERBOSE}${TAR_O_OPTION}xf
	if [ "$SONNET_TAR_OPTIONS" != "" ]
	then
		TAR_OPTIONS=$SONNET_TAR_OPTIONS
	fi

	while read cmd arg
	do
		case $cmd in
			base)
				install_base_package
				;;
			arch)
				install_arch_package $arg
				;;
		esac

		if [ -f $EXIT_PROGRAM ]
		then
			exit 1
		fi

	done < $VERIFY_COMMANDS


}

####
####	Verify that the new installation is not done on top of  
####    an older version of the software.
####
check_sonnet_version()
{
	if [ ! -f $INSTALL_DIRECTORY/sonnet.ver ]
	then
		# install directory not yet filled.
		return
	fi

	cd_cd $PACKAGE_DIR
	VER_FILE=`cd_file sonnet.ver`
	CD_VERSION=`cat $VER_FILE \
		| grep Version: \
		| sed "s/Version://" \
		| sed "s/ //g" \
		`

	INSTALLED_VERSION=`cat $INSTALL_DIRECTORY/sonnet.ver \
		| grep Version: \
		| sed "s/Version://" \
		| sed "s/ //g" \
		`
	if [ "$INSTALLED_VERSION" != "$CD_VERSION" ]
	then
		cat <<-EOF
			WARNING: The Version of software in this installation does
			not match the version of the software found in this directory.
			If you wish to install Version $CD_VERSION in this directory, first
			remove the existing version or move it to another directory,
			then perform the installation. Alternately, specify a different
			directory for the installation of Version $CD_VERSION
			There version you are trying to install to is ${INSTALLED_VERSION}.

		EOF

		rm -f $TMP_FILES
		echo "$PROGNAME failed - No files copied"
		exit 1

	fi
}


####
####	Add packages to an already existing installation
####
install_base_package()
{
	install_package \
		base.trz \
		base \
		. \
		"$BASE_DESCRITPTION"

}

####
####	Add packages to an already existing installation
####
install_arch_package()
{
	ARCH=$1

	cd $ORIG_PWD
	if [ ! -d $INSTALL_DIRECTORY/arch ]
	then
		mkdir $INSTALL_DIRECTORY/arch
	fi

	cd_cd $PACKAGE_DIR/arch

	install_package  \
		$ARCH.trz \
		arch \
		arch \
		"`arch_description $ARCH`"

}

install_package()
{
	SOURCE_TRZ=$1		# linux86.trz
	SOURCE_DIR=$2		# arch
	TARGET_DIR=$3		# arch
	DESCRIPTION=$4		# descrption

	echo Installing "$DESCRIPTION"

	cd_cd $PACKAGE_DIR/$SOURCE_DIR
	FROM_DIR=`pwd`
	TRZ_FILE=`cd_file $SOURCE_TRZ`
	RM_TAR_FILE=FALSE

	COMPRESS_FILE=`cd_file $SOURCE_TRZ`
	if [ ! -f "$COMPRESS_FILE" ]
	then
		echo "ERROR: Could not find file $COMPRESS_FILE in $FROM_DIR"
		echo "       Please contact support@sonnetsoftware.com for assistance"
		rm -f $TMP_FILES
		exit 1
	fi

	SHORT_ARCH=`echo $COMPRESS_FILE | sed "s/\.trz//"`

	if [ $DEBUG = TRUE ]
	then
		echo SOURCE_TRZ = $SOURCE_TRZ
		echo SOURCE_DIR = $SOURCE_DIR
		echo TARGET_DIR = $TARGET_DIR
		echo DESCRIPTION = $DESCRIPTION
		echo COMPRESS_FILE = $COMPRESS_FILE
		echo FROM_DIR = $FROM_DIR
		echo TAR_FILE = $TAR_FILE
		echo RM_TAR_FILE = $RM_TAR_FILE
		echo ORIG_PWD = $ORIG_PWD
		echo INSTALL_DIRECTORY = $INSTALL_DIRECTORY
		
	fi

	# change directory to original path, then change to installation
	# directory, in case it is relative directory, then to the target directory,
	# which is always a relative directory
	cd $ORIG_PWD
	cd $INSTALL_DIRECTORY/$TARGET_DIR

	if [ "$COMPRESS_FILE" ]
	then
		cp "$FROM_DIR/$COMPRESS_FILE" $SOURCE_TRZ
		if [ $? -ne 0 -a "$SONNET_UNIXINST_CONT_ON_ERROR" != TRUE ]
		then
			echo "$PROGNAME failed - all of the files were not copies."
			echo "Copying of the $COMPRESS_FILE file failed."
			echo "Possible disk space issue or permission problem for directory `pwd`"
			rm -f $TMP_FILES
			> $EXIT_PROGRAM
			exit 1
		fi

		# Unzip file
		$UNZIPEXE $SOURCE_TRZ > /dev/null
		if [ $? -ne 0 -a "$SONNET_UNIXINST_CONT_ON_ERROR" != TRUE ]
		then
			echo "$PROGNAME failed - all of the files were not copies."
			echo "Uncompressing of the $SOURCE_TAR.Z file failed."
			echo "Possibly, you should remove the sonnet directory and rerun $PROGNAME after freeing"
			echo "some space on your disk."
			rm -f $TMP_FILES
			> $EXIT_PROGRAM
			exit 1
		fi
		rm -f $SOURCE_TRZ 
		BASE_FILE=`echo $SOURCE_TRZ | sed "s/\.trz//"`
		TAR_FILE=$BASE_FILE.tar
		FROM_DIR=.
		RM_TAR_FILE=TRUE
	fi

	tar ${TAR_OPTIONS} `cd_file $FROM_DIR/$TAR_FILE`
	if [ $? -ne 0 -a "$SONNET_UNIXINST_CONT_ON_ERROR" != TRUE ]
	then
		echo "$PROGNAME failed - all of the files were not copies."
		echo "You should remove the sonnet directory and rerun $PROGNAME after freeing"
		echo "some space on your disk."
		rm -f $TMP_FILES
		> $EXIT_PROGRAM
		exit 1
	fi

	if [ "$TAR_VERBOSE" != ""  ]
	then
		echo
	fi

	if [ $RM_TAR_FILE = TRUE ]
	then
		rm -f $TAR_FILE
	fi

}

####
####	Run the sonnetconfig program for the customer
####
run_sonnetconfig()
{
	cd $ORIG_PWD
	cd $INSTALL_DIRECTORY
	echo
	echo Running the sonnetconfig program
	echo
	./sonnetconfig
}

#########################################################################
####									#
####				UTILITIES				#
####									#
#########################################################################

arch_description()
{
	ARCH=$1
	(
	cd_cd $PACKAGE_DIR/arch
	cat `cd_file $ARCH.txt`
	)
}
####
####	Ask a yes or no question, return in file either yes or no
####
askyesno()
{
	ANSFILE=$1
	QUESTION="$2"
	DEFAULT="$3"

	if [ "$DEFAULT" != "" ]
	then
		QUESTION="$QUESTION ($DEFAULT)? "
	else
		QUESTION="$QUESTION? "
	fi

	while true
	do
		necho "$QUESTION"
		read ans
		if [ "$ans" = "" ]
		then
			ans=$DEFAULT
		fi

		case "$ans" in
			y|Y|yes|YES|Yes)
				echo yes > $ANSFILE
				return
				;;
			n|N|no|NO|No)
				echo no > $ANSFILE
				return
				;;
			*)
				echo "Answer either \"yes\" or \"no\""
				;;
		esac
	done
}

# Need to do an echo with no RETURN.  There are two type of echoes:
# one using -n, the other using "\c".  Must test to determine which
# one to use.
necho()
{
	echo -n test | grep "n test" > /dev/null
	if [ $? -eq 0 ]
	then
		echo "$*\c"
	else
		echo -n "$*"
	fi
}

# change directory.
# To support CD cut for PC, must handle the following
#    Name of directory may be uppercase
#    HP computers add on ";1" onto the file names
cd_cd()
{
	DIR=$1

	cd $CDROM

	if [ -d $DIR ]
	then
		cd $DIR
	else
		UDIR=`echo $DIR | toupper`
		if [ -d $UDIR ]
		then
			cd $UDIR
		else
			UCDIR="$UDIR;1"
			if [ -d "$UCDIR" ]
			then
				cd "$UCDIR"
			else
				UCDIR="$UDIR;*"
				if [ -d "$UCDIR" ]
				then
					cd "$UCDIR"
				else
					echo Could not change directory to $DIR
					echo "$PROGNAME failed"
					rm -f $TMP_FILES
					exit 1
				fi
			fi
		fi
	fi
}

# find if the file is on the CD.  The file may have many
# different name like, "file" could be
#   FILE
#   FILE;1
#   FILE;2
#   FILE.
cd_file()
{
	OUT_FILE=
	for file in $*
	do
		if [ -f $file ]
		then
			OUT_FILE="$OUT_FILE $file"
			continue
		fi

		PFILE=${file}.
		if [ -f $PFILE ]
		then
			OUT_FILE="$OUT_FILE $PFILE"
			continue
		fi

		UFILE=`echo $file | toupper`
		if [ -f $UFILE ]
		then
			OUT_FILE="$OUT_FILE $UFILE"
			continue
		fi

		UPFILE=${UFILE}.
		if [ -f $UPFILE ]
		then
			OUT_FILE="$OUT_FILE $UPFILE"
			continue
		fi

		UCFILE="$UFILE;1"
		if [ -f "$UCFILE" ]
		then
			OUT_FILE="$OUT_FILE $UCFILE"
			continue
		fi

		UCFILE="$UFILE;*"
		if [ -f "$UCFILE" ]
		then
			OUT_FILE="$OUT_FILE $file"
			continue
		fi

		OUT_FILE="$OUT_FILE $file"
	done
	echo $OUT_FILE
}

tolower()
{
	# tr "[A-Z]" "[a-z]" - can not use this due to defect TT#5200
	sed -e "s/A/a/g" \
	    -e "s/B/b/g" \
	    -e "s/C/c/g" \
	    -e "s/D/d/g" \
	    -e "s/E/e/g" \
	    -e "s/F/f/g" \
	    -e "s/G/g/g" \
	    -e "s/H/h/g" \
	    -e "s/I/i/g" \
	    -e "s/J/j/g" \
	    -e "s/K/k/g" \
	    -e "s/L/l/g" \
	    -e "s/M/m/g" \
	    -e "s/N/n/g" \
	    -e "s/O/o/g" \
	    -e "s/P/p/g" \
	    -e "s/Q/q/g" \
	    -e "s/R/r/g" \
	    -e "s/S/s/g" \
	    -e "s/T/t/g" \
	    -e "s/U/u/g" \
	    -e "s/V/v/g" \
	    -e "s/W/w/g" \
	    -e "s/X/x/g" \
	    -e "s/Y/y/g" \
	    -e "s/Z/z/g"
}

toupper()
{
	#tr "[a-z]" "[A-Z]" - can not use this due to defect TT#5200
	sed -e "s/a/A/g" \
	    -e "s/b/B/g" \
	    -e "s/c/C/g" \
	    -e "s/d/D/g" \
	    -e "s/e/E/g" \
	    -e "s/f/F/g" \
	    -e "s/g/G/g" \
	    -e "s/h/H/g" \
	    -e "s/i/I/g" \
	    -e "s/j/J/g" \
	    -e "s/k/K/g" \
	    -e "s/l/L/g" \
	    -e "s/m/M/g" \
	    -e "s/n/N/g" \
	    -e "s/o/O/g" \
	    -e "s/p/P/g" \
	    -e "s/q/Q/g" \
	    -e "s/r/R/g" \
	    -e "s/s/S/g" \
	    -e "s/t/T/g" \
	    -e "s/u/U/g" \
	    -e "s/v/V/g" \
	    -e "s/w/W/g" \
	    -e "s/x/X/g" \
	    -e "s/y/Y/g" \
	    -e "s/z/Z/g"
}
#

# Convert architecture name to a short name.  Change to lower case and
# remove all "-"
# Example:
#   AIX -> aix
#   HP-UX -> hpux
#
to_short_arch_name()
{
	tolower | sed "s/-//g" 
}

print_license()
{
cat <<-EOF

LEGAL NOTICE:  PLEASE READ THESE TERMS BEFORE INSTALLING OR OTHERWISE 
USING THE LICENSED MATERIALS.  ALL USE OF THESE LICENSED MATERIALS ARE 
SUBJECT TO THE LICENSE TERMS SET FORTH BELOW.   "LICENSED MATERIALS" 
INCLUDES THE SOFTWARE, ANY WHOLE OR PARTIAL COPIES, AND ANY ACCOMPANYING 
INSTRUCTIONS, DOCUMENTATION, TECHNICAL DATA, IMAGES, RECORDINGS, 
HARDWARE AND SOFTWARE KEYS, AND OTHER RELATED MATERIALS.

USING THE LICENSED MATERIALS INDICATES YOUR ACCEPTANCE OF THE LICENSE TERMS.  IF 
YOU DO NOT AGREE TO ALL OF THESE TERMS, YOU MAY RETURN ANY UNINSTALLED LICENSED 
MATERIALS FOR A FULL REFUND.  IF THE LICENSED MATERIALS ARE BUNDLED OR PRELOADED 
WITH ANOTHER PRODUCT, YOU MAY RETURN THE ENTIRE UNUSED PRODUCT FOR A 
FULL REFUND. "YOU" AND "YOUR" MEANS THE COMPANY TO WHOM SONNET SOFTWARE, INC., 
OR ITS SUBSIDIARIES, HAS GRANTED A LICENSE TO THE LICENSED MATERIALS. 

SONNET SOFTWARE LICENSE TERMS AND LIMITED WARRANTY

These License Terms govern your use of the Licensed Materials. If you have a separate 
written agreement with Sonnet Software, Inc., or any of its subsidiaries, these License 
Terms are in addition to the terms provided by your separate written agreement. If there is 
a conflict between your separate written agreement and these License Terms, then these 
License Terms will take precedence.

License Grant

Subject to the License Restrictions below, Sonnet Software, Inc. ("Sonnet") grants you a 
non-exclusive license to use one copy of the Licensed Materials. With respect to the software 
portion of the Licensed Materials, "use" means to install, store, display, execute and 
use the software, for the purpose of your design and manufacture of electronic circuits and 
systems, on the computer or device, or on the class or series of equipment, for which you 
have paid the corresponding license fee. With respect to the portion of the Licensed Materials 
that describes the software and provides instructions concerning its operation and 
related matters, "use" includes the right to download and print such materials solely for 
the purpose described above. If the Licensed Materials are licensed for Node-Locked use 
(Node-Locked License), then you may access and use the software only on one computer, 
and may not display the software, or any results from use of the software, on a separate 
computer. "Node-Locked" means that the software is licensed for use solely with a specific 
computer. If the Licensed Materials are licensed for Network use (Floating License), 
you may not allow more than the maximum number of authorized users to access and use 
the software concurrently. A "Network" means any combination of terminals, peripherals 
or other devices electronically linked and capable of accessing the Licensed Materials. 
Certain Licensed Materials are job controlled which limits the number of concurrent 
uses of such Licensed Materials by a user as specified in applicable product documentation.

License Restrictions

Notwithstanding anything to the contrary, you may not use the Licensed Materials to make 
or distribute your own or a third party's application, a principal purpose of which, as 
reasonably determined by Sonnet, is to perform the same or similar functions as Licensed 
Materials or which replaces any component of the Licensed Materials. You may not otherwise 
use the Licensed Materials to compete with Sonnet's products or businesses. Except 
as expressly provided below, you may not permit any third party, or anyone other than 
your employees whose duties require such access or use, to have access to, view the operations 
of, or otherwise use the Licensed Materials, or any information learned or observed 
during the use of the Licensed Materials. Your authorized consultants and subcontractors 
may use the Licensed Materials pursuant to these License Terms solely where such use is 
incidental to their performing services consistent with the License Terms on your behalf, 
provided that you first require such consultants and subcontractors to agree in writing to 
observe the same restrictions provided in these License Terms. You may not use the 
Licensed Materials on any Network that permits remote access to the Licensed Materials 
outside of the Network site designated or expressly agreed to in writing by Sonnet. If Sonnet 
has not designated a Network site, then you may use the Licensed Materials within the 
one-mile radius from the Network host server. You may make copies or adaptations of the 
Licensed Materials only for archival purposes or only when copying or adaptation is an 
essential step in the authorized use of the Licensed Materials. You must reproduce all 
copyright notices in the original Licensed Materials on all permitted copies or adaptations. 
Except as provided herein, you may not copy, modify or translate the Licensed Materials 
or disable any of its features. You may not copy the Licensed Materials onto any public or 
distributed network or service bureau. In addition, you may not lease, rent or sublicense 
the Licensed Materials without Sonnet's prior written consent.

Upgrades

Unless you have purchased a limited-term license, this license does not entitle you to 
receive upgrades, updates or technical support. Such services may be purchased separately. 
In the event you have purchased a limited-term license you are entitled to such services. 
If the Licensed Materials include an upgrade to previously licensed material, your 
license in that material automatically terminates and you must destroy the previous content 
and any copies or adaptations. Software upgrades and updates are provided if and 
when available.

Audits

Upon reasonable notice, Sonnet or its agents may, at Sonnet's expense, inspect your 
facilities (including computers) and records to verify your proper use and payment for all 
Licensed Materials. You will keep records regarding your use in sufficient detail to permit 
this verification. If your payment is determined by usage of the Licensed Materials, you 
also will provide Sonnet with dial-in and on-site access to your Network and on-site 
access to your records, all as is reasonably necessary to conduct a proper audit. If, after an 
audit, it is determined that you have underpaid any amounts due, Sonnet will invoice you 
for and you agree to pay the amount of the underpayment, plus interest, from the date payment 
was due. If the underpayment is more than 5% of the amount properly due, you also 
will pay Sonnet's audit expenses, and Sonnet may, in its discretion, terminate your license.

Ownership

The Licensed Materials are owned and copyrighted by Sonnet or its third party suppliers. 
Your license confers no title to, or ownership in, the Licensed Materials and is not a sale of 
any rights in the Licensed Materials. Sonnet's third party suppliers may protect their rights 
in the event of any violation of these License Terms. Any comments, suggestions, 
improvements or other communications from you to Sonnet regarding the Licensed Materials 
(Feedback) will become the sole property of Sonnet. Sonnet may use the Feedback 
and practice the intellectual property relating thereto without compensation or attribution.

No Disassembly

You may not disassemble, decompile or decrypt the Licensed Materials unless you obtain 
Sonnet's prior written consent. In some jurisdictions, Sonnet's consent may not be 
required for limited disassembly, decompilation or decryption. Upon request, you will 
provide Sonnet with reasonably detailed information regarding any such permitted disassembly, 
decompilation or decryption.

High Risk Activities

The Licensed Materials are not specifically designed, manufactured or intended for use in 
the planning, construction, maintenance or direct operation of a nuclear facility, nor for 
use in on-line control or fail safe operation of aircraft navigation, control or communication 
systems, weapon systems or direct life support systems.

Transfer

Your license to the Licensed Materials is transferable upon Sonnet 's receipt of the name, 
address and location of transferee and payment of any applicable fees to the extent permissible 
under local laws, unless you have purchased a limited-term license, in which case 
your license to the Licensed Materials is not transferable without Sonnet's prior written 
consent, and which Sonnet may or may not provide at its sole discretion. If your license is 
transferable, you will immediately upon transfer deliver all copies of the Licensed Materials 
to the transferee. The transferee must agree in writing to the terms of your license. All 
license terms will be binding on involuntary transferees, notice of which is hereby given. 
Your license will automatically terminate upon transfer.

Obsolescence

Sonnet may, in its sole discretion, discontinue the sale and support of Licensed Materials. 
In such event, Sonnet will use reasonable efforts to notify you of the planned obsolescence, 
and if applicable provide perpetual access codes to enable your continued use of the 
Licensed Materials. Thereafter, no further access codes or support will be available.

Termination

Sonnet may terminate your license upon notice for failure to comply with any of these 
License Terms. Upon termination, you must immediately destroy the Licensed Materials, 
together with all copies, adaptations and merged portions in any form. If you have purchased 
a limited-term license, the license and codewords will expire in accordance with 
the time period set forth in Sonnet's quotation or your purchase order, unless the license is 
renewed.

Encryption Notice

Certain Licensed Materials utilize encryption technology to enable the generation of protected 
circuit models. If the Licensed Materials you have purchased contain encryption technology, 
you agree that encryption is not a guarantee of confidentiality and that Sonnet is not liable 
for any breach of confidentiality that may occur as a result of decryption by a third party.

Security Mechanisms

 Sonnet and its affiliated companies take all legal steps to eliminate piracy of their software 
products. In this context, the Licensed Materials may include a security mechanism 
that can detect the installation or use of illegal copies of the Licensed Materials, and collect 
and transmit data about those illegal copies. Data collected will not include any customer 
data created with the Licensed Materials. By using the Licensed Materials, you 
consent to such detection and collection of data, as well as its transmission and use if an 
illegal copy is detected. Sonnet also reserves the right to use a hardware lock device, 
license administration software, and/or a license authorization key to control access to the 
Licensed Materials. You may not take any steps to avoid or defeat the purpose of any such 
measures. Use of any Licensed Materials without any required lock device or authorization 
key provided by Sonnet is prohibited.

Key Codes & Deactivation

Customer shall only use the Licensed Materials using the key code created by Sonnet that 
is provided to Customer by Sonnet. Customer shall not use the Licensed Materials in any 
manner without that key code. Sonnet reserves the right to update or replace the key code 
periodically or implement an alternative licensing protection mechanism. Customer shall 
comply with any alternative licensing protection mechanism that may be subsequently 
implemented by Sonnet. Customer shall not distribute, make accessible, transmit or provide 
any key code to any third party or make it available to the public, use any key code 
other than key code provided to Customer directly by Sonnet, use or attempt to use the key 
code other than for the Licensed Materials for which it is provided by Sonnet to Customer, 
or take any action to circumvent any key code system or alternative licensing protection 
mechanism. Any action by Customer (including any employee of Customer) in contravention 
of this paragraph is a material breach of this Agreement. THE LICENSED MATERIALS 
MAY CONTAIN CODE THAT WILL, AFTER TERMINATION OR EXPIRATION OF THE LICENSE TERM, 
DEACTIVATE THE LICENSED MATERIALS AND RENDER THE LICENSED MATERIALS UNUSABLE. 
ALTHOUGH THE LICENSED MATERIALS MAY WARN YOU OF THE TIME-FRAME IN WHICH IT WILL 
BE DISABLED, YOU ACKNOWLEDGE AND AGREE THAT THE LICENSED MATERIALS MAY BE DEACTIVATED OR 
RENDERED UNUSABLE WITH OR WITHOUT WARNING.

Evaluation License

If the license is an evaluation license, then this paragraph applies: Subject to the terms and 
conditions of this Agreement, Sonnet hereby grants Customer, solely during the License 
Term, a non-exclusive, non-sublicensable, non-transferable license to (i) reproduce and 
install the Licensed Materials on the Designated Equipment solely at the Designated Site 
only for use and access by a single user at a time, (ii) make an archival copy of the 
Licensed Materials solely for emergency back-up purposes and (iii) permit the single user 
to use the Licensed Materials, only internally and solely to evaluate the Licensed Materials 
for determining whether to license it from Sonnet on a commercial, educational or academic 
license basis. There is no right to use the Licensed Materials for any work to be 
used in commercial or industrial production. Customer may use the Licensed Materials 
only during the License Term or for the duration of the key code, whichever is shorter. Use 
of the Licensed Materials without an authorized evaluation key is to be considered as use 
for commercial purpose regardless of duration of use. LICENSED MATERIALS LICENSED UNDER 
AN EVALUATION LICENSE MAY NOT BE FULLY FUNCTIONAL, AND CUSTOMER ASSUMES THE ENTIRE RISK 
AS TO THE RESULTS AND PERFORMANCE OF THE LICENSED MATERIALS. SONNET WILL NOT UPDATE THE 
LICENSED MATERIALS, NOR WILL SONNET SUPPORT THE LICENSED MATERIALS. 

Personal License

If the license is a personal license, Customer must be an individual (i.e., a natural person), 
and this paragraph applies: Subject to the terms and conditions of this Agreement, Sonnet 
hereby grants Customer, solely during the License Term, a non-exclusive, non-sublicensable, 
non-transferable license to (i) reproduce and install the Licensed Materials on the 
Designated Equipment solely at the Designated Site for use and access only by Customer, 
(ii) make an archival copy of the Licensed Materials solely for emergency back-up purposes 
and (iii) use the Licensed Materials for Customer's own purposes. There is no right 
for anyone other than Customer to access or use the Licensed Materials for any purposes 
whatsoever. 

Export Requirements

The Licensed Materials may be subject to export control laws, including the U.S. Export 
Administration Regulations and other export laws and regulations of other countries. You 
may not export or re-export the Licensed Materials or any copy or adaptation in violation 
of any applicable laws or regulations. You certify that you are not on the U.S. Department 
of Commerce's Denied Persons List, the U.S. Department of Treasury's Specially Designated 
Nationals list or other government list prohibiting you from receiving the Licensed 
Materials.

U.S. Government Restricted Rights

Software and technical data rights granted to the federal government herein by these 
License Terms include only those rights customarily provided to end user customers. Sonnet 
provides this customary commercial license in software and technical data pursuant to 
FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for the Department of 
Defense, DFARS 252.227-7015 (Technical Data - Commercial Items) and DFARS 
227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation).

SONNET SOFTWARE, INC. SOFTWARE PRODUCT LIMITED WARRANTY 

Software

Sonnet warrants for a period of 90 days from the date of purchase that the software that is 
included with the Licensed Materials will execute its programming instructions when 
properly installed on the personal computer or workstation indicated on the media. Sonnet 
does not warrant that the operation of the software will be uninterrupted or error free. In 
the event that this software fails to execute its programming instructions during the warranty 
period, your remedy shall be to return the CD-ROM(s), diskette(s), or tape cartridge(s) 
(Media) to Sonnet for replacement. Should Sonnet be unable to replace the media 
within a reasonable amount of time, your alternate remedy shall be a refund of the purchase 
price upon return of the Licensed Materials and all copies. 

Media

Sonnet warrants the media upon which this software is recorded to be free from defects in 
materials and workmanship under normal use for a period of 90 days from the date of purchase. 
In the event any media proves to be defective during the warranty period, your remedy 
shall be to return the media to Sonnet for replacement. Should Sonnet be unable to 
replace the media within a reasonable amount of time, your alternate remedy shall be a 
refund of the purchase price upon return of the software and all copies. 

Notice of Warranty Claims

You must notify Sonnet in writing of any warranty claim not later than 30 days after the 
expiration of the warranty period. 

Limitation of Warranty

SONNET makes no other express warranty, whether written or oral, with respect to the 
Licensed Materials. Any implied warranty of merchantability or fitness is limited 
to the 90-day duration of this written warranty. Some states or provinces do not allow 
limitations on how long an implied warranty lasts, so the above limitation or exclusion 
may not apply to you.* This warranty gives specific legal rights, and you may also have 
other rights which vary from state to state, or province to province. 

Exclusive Remedies

The remedies provided above are your sole and exclusive remedies arising out of any 
breach of warranty. In no event shall Sonnet be liable for any indirect, special, incidental, 
or consequential damages (including lost profit), whether based on warranty, contract, tort, 
or any other legal theory.  In no event shall Sonnet's total cumulative liability and obligation 
in connection with the Licensed Materials exceed the purchase price that you paid to 
Sonnet for the Licensed Materials.  These limitations shall apply notwithstanding any failure 
of essential purpose of any limited remedy.  Some states or provinces do not allow the 
exclusion or limitation of incidental or consequential damages, so the above limitation or 
exclusion may not apply to you. 

Warranty Service

Warranty service may be obtained from the nearest Sonnet sales office or other location 
indicated in the owner's manual or service booklet. 

* UK only

If you are a "consumer" as defined by statutes, parts of this statement may not apply to 
you. 

EOF
}

main  $*
rm -f $TMP_FILES

Update :

"echo $pkgdir/opt/sonnet" | ./sonnetinstall -skiplicense
ldd $pkgdir/opt/sonnet/arch/linux86/bin/xgeom

Can I put these two lines of code and all the commands in Sonnet installation into package() ?

Last edited by promach (2019-08-23 16:13:15)

Offline

#2 2019-08-24 07:02:08

promach
Member
Registered: 2016-05-18
Posts: 96

Re: PKGBUILD Request : Sonnet

I am getting the following terminal output errors with the PKGBUILD below:

[kevin@archlinux sonnet_linux]$ makepkg -s
==> Making package: sonnetsuite 17.52-1 (Sat 24 Aug 2019 02:52:02 PM +08)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found sonnetsuite.17.52.-linux86.tar
==> Validating source files with md5sums...
    sonnetsuite.17.52.-linux86.tar ... Skipped
==> Extracting sources...
  -> Extracting sonnetsuite.17.52.-linux86.tar with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...

               SONNET SOFTWARE INSTALLATION PROGRAM
                            (SonnetSuite)

This program copies the Sonnet programs to your disk.

Type the full path of the Sonnet directory: 

Do you wish to begin copying the files (yes)? 
Installing Common software package (Used by all platforms)
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
Installing Linux X86 executables
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
-> Configuring files in "bin" directory
-> Configuring files for FLEXnet
-> Configuring DLLs
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
-> Configuring file permissions
-> Configuring miscellaneous files

sonnetinstall completed.

ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
	linux-gate.so.1 (0xf7f79000)
	libpthread.so.0 => /usr/lib32/libpthread.so.0 (0xf7eef000)
	libxvtxmpwr123.so => not found
	libxvtxmba123.so => not found
	libGLU.so.1 => /usr/lib32/libGLU.so.1 (0xf7e75000)
	libGL.so.1 => /usr/lib32/libGL.so.1 (0xf7e11000)
	libMrm.so.4 => not found
	libXm.so.4 => not found
	libXft.so.2 => /usr/lib32/libXft.so.2 (0xf7df8000)
	libfreetype.so.6 => /usr/lib32/libfreetype.so.6 (0xf7d23000)
	libfontconfig.so.1 => /usr/lib32/libfontconfig.so.1 (0xf7cd7000)
	libXrender.so.1 => /usr/lib32/libXrender.so.1 (0xf7cc7000)
	libdl.so.2 => /usr/lib32/libdl.so.2 (0xf7cc1000)
	libtls7812d_linux.so => not found
	libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7ae6000)
	libm.so.6 => /usr/lib32/libm.so.6 (0xf7a19000)
	libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf79fc000)
	libc.so.6 => /usr/lib32/libc.so.6 (0xf781d000)
	libXt.so.6 => /usr/lib32/libXt.so.6 (0xf77b5000)
	libX11.so.6 => /usr/lib32/libX11.so.6 (0xf7668000)
	/lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0xf7f7a000)
	libGLX.so.0 => /usr/lib32/libGLX.so.0 (0xf7645000)
	libXext.so.6 => /usr/lib32/libXext.so.6 (0xf762f000)
	libGLdispatch.so.0 => /usr/lib32/libGLdispatch.so.0 (0xf75cb000)
	libbz2.so.1.0 => /usr/lib32/libbz2.so.1.0 (0xf75b9000)
	libpng16.so.16 => /usr/lib32/libpng16.so.16 (0xf7579000)
	libz.so.1 => /usr/lib32/libz.so.1 (0xf755f000)
	libharfbuzz.so.0 => /usr/lib32/libharfbuzz.so.0 (0xf744c000)
	libexpat.so.1 => /usr/lib32/libexpat.so.1 (0xf7420000)
	libuuid.so.1 => /usr/lib32/libuuid.so.1 (0xf7416000)
	libSM.so.6 => /usr/lib32/libSM.so.6 (0xf740a000)
	libICE.so.6 => /usr/lib32/libICE.so.6 (0xf73ee000)
	libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf73c2000)
	libglib-2.0.so.0 => /usr/lib32/libglib-2.0.so.0 (0xf7288000)
	libXau.so.6 => /usr/lib32/libXau.so.6 (0xf7283000)
	libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf727b000)
	libpcre.so.1 => /usr/lib32/libpcre.so.1 (0xf7202000)
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "sonnetsuite"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
: Can't translate pathname 'opt/sonnetsuite/help/blink/cadence/models_menu/models_=_inductor_ =__show_view.htm' to UTF-8: Can't translate pathname 'opt/sonnetsuite/help/sonnet/cadence/models_menu/models_=_inductor_ =__show_view.htm' to UTF-8==> Leaving fakeroot environment.
==> Finished making: sonnetsuite 17.52-1 (Sat 24 Aug 2019 03:01:27 PM +08)
[kevin@archlinux sonnet_linux]$ 
# Maintainer: Your Name <youremail@domain.com>
pkgname=sonnetsuite
pkgver=17.52
pkgrel=1
epoch=
pkgdesc="A 3D Planar High-Frequency Electromagnetic Software"
arch=("any")
url="http://www.sonnetsoftware.com/products/sonnet-suites/"
license=('unknown')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=($pkgname.$pkgver.-linux86.tar)
        
noextract=()
md5sums=('SKIP')
validpgpkeys=()

#prepare() {
#	cd "$pkgname-$pkgver"
#	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
#}

#build() {
#	cd "$pkgname-$pkgver"
#	./configure --prefix=/usr
#	make
#}

#check() {
#	cd "$pkgname-$pkgver"
#	make -k check
#}

package() {
	cd "$srcdir/$pkgname.$pkgver.-linux86"
	mkdir -p "$pkgdir/opt/$pkgname"
	echo "$pkgdir/opt/$pkgname" | ./sonnetinstall -skiplicense
        ldd $pkgdir/opt/$pkgname/arch/linux86/bin/xgeom
	
	#make DESTDIR="$pkgdir/" install
}

Last edited by promach (2019-08-28 16:45:25)

Offline

#3 2019-08-26 08:47:29

a821
Member
Registered: 2012-10-31
Posts: 381

Re: PKGBUILD Request : Sonnet

promach wrote:
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

looks like a partial update. Is your system up to date?

I cannot comment regarding the PKGBUILD as I don't have access to the software, but at least get rid of the empty variables and check the software dependencies if any.

Offline

#4 2019-08-26 10:40:39

promach
Member
Registered: 2016-05-18
Posts: 96

Re: PKGBUILD Request : Sonnet

access to the software

You can request an evaluation copy of SonnetSuite


I will need to confirm the rest of your comments tomorrow when I have access to my computer again.

Last edited by promach (2019-08-26 10:42:52)

Offline

#5 2019-08-28 16:47:37

promach
Member
Registered: 2016-05-18
Posts: 96

Re: PKGBUILD Request : Sonnet

@a821

Here is the direct link: http://www.sonnetsoftware.com/sonnetdl/ … inux64.tar

looks like a partial update. Is your system up to date?

Yes, I have updated the system with pacman -Syu and reboot the computer, tried makepkg -s again, yet same error

The following is the updated PKGBUILD with the latest version of sonnetsuite.

# Maintainer: Your Name <youremail@domain.com>
pkgname=sonnetsuite
pkgver=17.52.1
pkgrel=1
epoch=
pkgdesc="A 3D Planar High-Frequency Electromagnetic Software"
arch=("x86_64")
url="http://www.sonnetsoftware.com/products/sonnet-suites/"
license=('unknown')
groups=('lib32')
depends=('openmotif' 'qwtpolar')
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=($pkgname.$pkgver.linux64.tar)
        
noextract=()
md5sums=('SKIP')
validpgpkeys=()

#prepare() {
#	cd "$pkgname-$pkgver"
#	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
#}

#build() {
#	cd "$pkgname-$pkgver"
#	./configure --prefix=/usr
#	make
#}

#check() {
#	cd "$pkgname-$pkgver"
#	make -k check
#}

package() {
	cd "$srcdir/sonnetsoftware"
	mkdir -p "$pkgdir/opt/$pkgname"
	echo "$pkgdir/opt/$pkgname" | ./sonnetinstall -skiplicense
        ldd $pkgdir/opt/$pkgname/arch/linux64/bin/xgeom
	
	#make DESTDIR="$pkgdir/" install
}

Last edited by promach (2019-08-29 02:36:33)

Offline

#6 2019-08-28 16:56:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: PKGBUILD Request : Sonnet

It's not really an error, it just says that it's trying the 64 bit libfakeroot (because makepkg preloads it) and failing. Shouldn't cause any problems AFAIK.

Offline

#7 2019-08-29 06:16:54

promach
Member
Registered: 2016-05-18
Posts: 96

Re: PKGBUILD Request : Sonnet

Ok, I ignored those errors and continue the installation. The software opens and works well.

PKGBUILD

# Maintainer: Your Name <youremail@domain.com>
pkgname=sonnetsuite
pkgver=17.52.1
pkgrel=1
epoch=
pkgdesc="A 3D Planar High-Frequency Electromagnetic Software"
arch=("x86_64")
url="http://www.sonnetsoftware.com/products/sonnet-suites/"
license=('unknown')
groups=('lib32')
depends=('openmotif' 'qwtpolar' 'icoutils')
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("http://www.sonnetsoftware.com/sonnetdl/Sonnet-17-52/sonnetsuite.17.52.1.linux64.tar")
        
noextract=()
md5sums=('SKIP')
validpgpkeys=()

#prepare() {
#	cd "$pkgname-$pkgver"
#	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
#}

#build() {
#	cd "$pkgname-$pkgver"
#	./configure --prefix=/usr
#	make
#}

#check() {
#	cd "$pkgname-$pkgver"
#	make -k check
#}

package() {
	cd "$srcdir/sonnetsoftware"
	mkdir -p "$pkgdir/opt/$pkgname"
	echo "$pkgdir/opt/$pkgname" | ./sonnetinstall -skiplicense
        ldd $pkgdir/opt/$pkgname/arch/linux64/bin/xgeom


	#For desktop shortcut file

	icotool -x "$kgdir/opt/sonnetsuite/resource/sonnet.ico"
	mv sonnet_1_256x256x32.png ~/.local/share/icons/hicolor/256x256/sonnetsuite.png

	rm sonnet_2_48x48x32.png sonnet_3_32x32x32.png sonnet_4_16x16x32.png

	cd "$pkgdir/../../"
	cp sonnetsuite.desktop ~/.local/share/applications/
	gtk-update-icon-cache ~/.local/share/icons/hicolor/ -t
	update-desktop-database ~/.local/share/applications/

	#make DESTDIR="$pkgdir/" install
}

sonnetsuite.desktop

[Desktop Entry]

# The type as listed above
Type=Application

# The version of the desktop entry specification to which this file complies
Version=1.0

# The name of the application
Name=sonnetsuite

# A comment which can/will be used as a tooltip
Comment=A 3D Planar High-Frequency Electromagnetic Software

# The path to the folder in which the executable is run
Path=/opt/sonnetsuite/bin

# The executable of the application, possibly with arguments.
Exec=sonnet

# The name of the icon that will be used to display this entry
Icon=sonnetsuite

# Describes whether this application needs to be run in a terminal or not
Terminal=false

# Describes the categories in which this entry should be shown
Categories=Education;

Last edited by promach (2019-08-29 06:22:48)

Offline

#8 2019-08-29 10:31:39

a821
Member
Registered: 2012-10-31
Posts: 381

Re: PKGBUILD Request : Sonnet

some recommendations after a quick look.

  • remove empty variables

  • remove unnecessary comments

  • add the `sonnetsuit.desktop` file to the source array

  • the PKGBUILD should never touch $HOME, get rid of gtk-update-icon-cache  and  update-desktop-database commands (this is managed by pacman hooks anyway)

  • remove the `ldd` command

Offline

#9 2019-09-24 04:12:01

promach
Member
Registered: 2016-05-18
Posts: 96

Re: PKGBUILD Request : Sonnet

I have modified slightly the PKGBUILD to solve a dxf import issue in Sonnetsuite.

PKGBUILD

# Maintainer: Your Name <youremail@domain.com>
pkgname=sonnetsuite
pkgver=17.52.1
pkgrel=1
epoch=
pkgdesc="A 3D Planar High-Frequency Electromagnetic Software"
arch=("x86_64")
url="http://www.sonnetsoftware.com/products/sonnet-suites/"
license=('unknown')
groups=('lib32')
depends=('openmotif' 'qwtpolar' 'icoutils')
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("http://www.sonnetsoftware.com/sonnetdl/Sonnet-17-52/sonnetsuite.17.52.1.linux64.tar" 
	"sonnetsuite.desktop")
        
noextract=()
md5sums=('SKIP' 'SKIP')
validpgpkeys=()


package() {
	cd "$srcdir/sonnetsoftware"
	mkdir -p "$pkgdir/opt/$pkgname"
	echo "$pkgdir/opt/$pkgname" | ./sonnetinstall -skiplicense

        echo "SONNET_DIR=/opt/sonnetsuite/; export SONNET_DIR" >> ~/.bashrc
	echo "PATH=$PATH:$SONNET_DIR/bin; export PATH" >> ~/.bashrc

	#For desktop shortcut file

	icotool -x "$pkgdir/opt/sonnetsuite/resource/sonnet.ico"
	
	mkdir -p "$pkgdir/usr/share/icons/"
	mv sonnet_1_256x256x32.png "$pkgdir/usr/share/icons/sonnetsuite.png"

	rm sonnet_2_48x48x32.png sonnet_3_32x32x32.png sonnet_4_16x16x32.png

	#make DESTDIR="$pkgdir/" install
}

sonnetsuite.desktop

[Desktop Entry]

# The type as listed above
Type=Application

# The version of the desktop entry specification to which this file complies
Version=1.0

# The name of the application
Name=sonnetsuite

# A comment which can/will be used as a tooltip
Comment=A 3D Planar High-Frequency Electromagnetic Software

# The path to the folder in which the executable is run
Path=/opt/sonnetsuite/bin

# The executable of the application, possibly with arguments.
Exec=sonnet

# The name of the icon that will be used to display this entry
Icon=sonnetsuite

# Describes whether this application needs to be run in a terminal or not
Terminal=false

# Describes the categories in which this entry should be shown
Categories=Education;

Offline

#10 2019-10-01 09:03:06

a821
Member
Registered: 2012-10-31
Posts: 381

Re: PKGBUILD Request : Sonnet

Updated PKGBUILD below based on your work. I cleaned it up a little (I removed lines touching `$HOME`, NEVER do that!) and added the build function for the LICENSE (couldn't find it anywhere) and the icon.

I did not check if the software actually runs.

pkgname=sonnetsuite
pkgver=17.52.1
pkgrel=1
pkgdesc="A 3D Planar High-Frequency Electromagnetic Software"
arch=("x86_64")
url="http://www.sonnetsoftware.com/products/sonnet-suites/"
license=('custom')
depends=('openmotif' 'qwtpolar')
makedepends=('icoutils')
source=("http://www.sonnetsoftware.com/sonnetdl/Sonnet-17-52/sonnetsuite.17.52.1.linux64.tar" 
        "sonnetsuite.desktop")
sha256sums=('14e4a17d3d7086e02748e9c1f6888a13575bcc2b47f819d3fa2cf8aabd236bfb'
            '4ad303cb7dc2f75419b163ccd730f25812195d318e0e16c9d147d71917ae622a')

build() {
        cd "sonnetsoftware"
        sed -n '/LEGAL/,/^you\./ p' sonnetinstall > LICENSE
        bsdtar -xf install/base/base.trz -O | bsdtar -xf - resource/sonnet.ico
        icotool -x resource/sonnet.ico
}

package() {
        install -Dm644 sonnetsuite.desktop "$pkgdir/usr/share/applications/sonnetsuite.desktop"

        cd "sonnetsoftware"
        install -dm755 "$pkgdir/opt/$pkgname"
        echo "$pkgdir/opt/$pkgname" | ./sonnetinstall -skiplicense

        install -Dm644 sonnet_1_256x256x32.png "$pkgdir/usr/share/icons/sonnetsuite.png"
        install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Offline

Board footer

Powered by FluxBB