Signed-off-by: Steve Youngs <steve@sxemacs.org>
-# The wrappers directory must be the first entry in the PATH. Once
-# you are no longer needing or using the tools dir you can remove it
-# from the PATH if you want, but leaving it there won't hurt
-PATH=/usr/lib/pkgusr:/usr/bin:/bin:/usr/X11R6/bin:/tools/bin
+# The wrappers directory must be the first entry in the PATH.
+#
+# Once you are no longer needing or using the tools dir you can remove it
+# from the PATH if you want, but leaving it there won't hurt.
+#PATH=/usr/lib/pkgusr:/usr/bin:/bin:/usr/X11R6/bin:/opt/qt/bin:/tools/bin
+PATH=/usr/lib/pkgusr:/usr/bin:/bin:/usr/X11R6/bin:/opt/qt/bin
## A couple things to make less(1) nicer.
LESS=-MRgisw
## A couple things to make less(1) nicer.
LESS=-MRgisw
TZ='Australia/Brisbane'
## pkg-config
TZ='Australia/Brisbane'
## pkg-config
-PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/X11R6/lib/pkgconfig
+PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config):/usr/X11R6/lib/pkgconfig:/usr/X11R6/share/pkgconfig
+PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/opt/qt/lib/pkgconfig
+
+## QT
+QTDIR=/opt/qt
-export LC_ALL PATH LESS LESSCHARSET LESSOPEN TZ PKG_CONFIG_DIR
+export LC_ALL PATH LESS LESSCHARSET LESSOPEN TZ PKG_CONFIG_PATH QTDIR
# Make prompt reflect that we are a package user.
# Make prompt reflect that we are a package user.
tar) opts=xf ;;
gzip) opts=zxf ;;
bzip2) opts=jxf ;;
tar) opts=xf ;;
gzip) opts=zxf ;;
bzip2) opts=jxf ;;
*)
# try lzma
if lzmainfo ${fname} &>/dev/null; then
*)
# try lzma
if lzmainfo ${fname} &>/dev/null; then
tar) opts=tvvvf ;;
gzip) opts=ztvvvf ;;
bzip2) opts=jtvvvf ;;
tar) opts=tvvvf ;;
gzip) opts=ztvvvf ;;
bzip2) opts=jtvvvf ;;
*)
# lzma. Here because lzmainfo is too stupid
if lzmainfo ${fname} &>/dev/null; then
*)
# lzma. Here because lzmainfo is too stupid
if lzmainfo ${fname} &>/dev/null; then
Use the build script.
Configure options used...
Use the build script.
Configure options used...
- ./configure --prefix=/usr \
- --infodir=/usr/share/info \
- --mandir=/usr/share/man \
- --sysconfdir=/etc \
- --libexecdir=/usr/lib \
- --localstatedir=/var
+ ./configure --prefix=/usr \
+ --infodir=/usr/share/info \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib \
+ --localstatedir=/var
## Version info.
ourname=${0##*/}
## Version info.
ourname=${0##*/}
-VERSION=1.0
-COPYRIGHT="Copyright (C) 2007 - 2010 Steve Youngs <steve@steveyoungs.com>"
+VERSION=1.2
+COPYRIGHT="Copyright (C) 2007 - 2011 Steve Youngs <steve@steveyoungs.com>"
version_str="${ourname}: ${VERSION}\n${COPYRIGHT}"
show_version()
version_str="${ourname}: ${VERSION}\n${COPYRIGHT}"
show_version()
forall_direntries_from $(whoami) -name \*.la -exec chmod -v 644 {} \;
}
forall_direntries_from $(whoami) -name \*.la -exec chmod -v 644 {} \;
}
-update_commands()
-{ :
- sed -i s/"Last_Updated.*"/"Last_Updated: $(date +%c)"/g ${HOME}/.project
- awk '/^CONTENTS:/ { print; exit; } {print}' ${HOME}/.project > ${HOME}/.projtmp
- echo "--------" >> ${HOME}/.projtmp
- list_package $(whoami) >> ${HOME}/.projtmp
- mv ${HOME}/.projtmp ${HOME}/.project
-}
-
#*
# Set `arg' to command(s) that output just the version number of the
# package.
#*
# Set `arg' to command(s) that output just the version number of the
# package.
+update_commands()
+{ :
+ sed -i s/"Last_Updated.*"/"Last_Updated: $(date +%c)"/g ${HOME}/.project
+ awk '/^CONTENTS:/ { print; exit; } {print}' ${HOME}/.project > ${HOME}/.projtmp
+ echo "--------" >> ${HOME}/.projtmp
+ list_package $(whoami) >> ${HOME}/.projtmp
+ mv ${HOME}/.projtmp ${HOME}/.project
+}
# Header directories.
# These are the directories we search. If you have other header directories
# such as /usr/local/include, /opt/include, add them here.
# Header directories.
# These are the directories we search. If you have other header directories
# such as /usr/local/include, /opt/include, add them here.
-header_dirs=(/usr/include /usr/X11/include)
+header_dirs=(/usr/include /usr/X11R6/include)
+
+## bastard header directories...
+# header_dirs=(/usr/include /usr/X11R6/include /opt/jdk/include /opt/qt/include)
*.bz2) bzip2 -dc "$1" 2>/dev/null ;;
*.lzma) lzma -dc "$1" 2>/dev/null ;;
*.xz) xz -dc "$1" 2>/dev/null ;;
*.bz2) bzip2 -dc "$1" 2>/dev/null ;;
*.lzma) lzma -dc "$1" 2>/dev/null ;;
*.xz) xz -dc "$1" 2>/dev/null ;;
-# *) FILE=`file -L "$1"` ; # Check to see if binary, if so -- view with 'strings'
-# FILE1=`echo $FILE | cut -d ' ' -f 2`
-# FILE2=`echo $FILE | cut -d ' ' -f 3`
-# if [ "$FILE1" = "Linux/i386" -o "$FILE2" = "Linux/i386" \
-# -o "$FILE1" = "ELF" -o "$FILE2" = "ELF" ]; then
-# strings "$1"
-# fi ;;
+ *) FILE=`file -L "$1"` ; # Check to see if binary, if so -- view with 'strings'
+ FILE1=`echo $FILE | cut -d ' ' -f 2`
+ FILE2=`echo $FILE | cut -d ' ' -f 3`
+ if [ "$FILE1" = "Linux/i386" -o "$FILE2" = "Linux/i386" \
+ -o "$FILE1" = "ELF" -o "$FILE2" = "ELF" ]; then
+ strings "$1"
+ fi ;;
# are searched for, but with -a option, all syms, both defined and
# undefined are searched.
#
# are searched for, but with -a option, all syms, both defined and
# undefined are searched.
#
-# First, it tries with nm(1), and if that gets nowhere (like in the
-# case of stripped libraries), fall back on objdump(1).
## Code:
ourname=${0##*/}
## Code:
ourname=${0##*/}
# Library directories.
# These are the directories we search. If you have other lib directories
# such as /usr/local/lib, /opt/lib, add them here.
# Library directories.
# These are the directories we search. If you have other lib directories
# such as /usr/local/lib, /opt/lib, add them here.
-lib_dirs=(/usr/lib /usr/X11/lib /lib)
+lib_dirs=(/usr/lib /usr/X11R6/lib /lib)
+
+# bastard library directories...
+#lib_dirs=(/usr/lib /usr/X11R6/lib /lib /opt/qt/lib)
- nm_opts="--demangle=gnu-v3 --debug-syms"
+ obj_opts="--demangle=gnu-v3 --reloc --syms --debugging"
+ want_all=1
- nm_opts="--demangle=gnu-v3 --defined-only --dynamic"
+ obj_opts="--demangle=gnu-v3 --reloc --syms"
+ want_all=0
-obj_opts="--demangle=gnu-v3 --reloc --dynamic-reloc --syms --dynamic-syms"
# $1 should now be the symbol (or symbol regexp) to search for
sym=${1}
# $1 should now be the symbol (or symbol regexp) to search for
sym=${1}
-all_libs=$(find -H -L ${lib_dirs[*]} -type f \( -name "lib*.so" -o -name "lib*.a" \) -print)
+all_libs=$(find ${lib_dirs[*]} -name lost+found -prune -o \( -name lib\*.so\* -o -name lib\*.a \) -print)
for lib in ${all_libs} ; do
for lib in ${all_libs} ; do
- unset good_file lib_syms
- good_file="$(file ${lib}|grep \(\(shared object\)\|\(ar archive\)\) 2>/dev/null)"
+ unset good_file
+ good_file="$(file ${lib}|grep '\(shared object\|ar archive\)' 2>/dev/null)"
if [ -n "${good_file}" ]; then
if [ -n "${good_file}" ]; then
- lib_syms=$(nm ${nm_opts} ${lib} 2>/dev/null)
- if [ -n "${lib_syms}" ]; then
- echo ${lib_syms}|grep -E ${sym} 1>/dev/null && echo ${lib}
+ if [ $want_all -eq 1 ]; then
+ objdump ${obj_opts} ${lib}|grep -q -E ${sym} && echo ${lib}
- objdump ${obj_opts} ${lib} 2>/dev/null |
- grep -E ${sym} 1>/dev/null &&
- echo ${lib}
+ objdump ${obj_opts} ${lib}|grep -v UND|grep -q -E ${sym} && echo ${lib}
# You may do everything with this code except misrepresent its origin.
# PROVIDED `AS IS' WITH ABSOLUTELY NO WARRANTY OF ANY KIND!
# You may do everything with this code except misrepresent its origin.
# PROVIDED `AS IS' WITH ABSOLUTELY NO WARRANTY OF ANY KIND!
-#The following list should contain the mount points of all filesystems
-#that are to be scanned as a space-separated list within parentheses.
-#/ will usually be in this list and if you have /usr
-#on a separate partition, it will also be in this list. Other non-special
-#filesystems where suspicious files could be located should also be put in
-#this list.
-#Mount points whose filesystems are special, such as procfs or sysfs should
-#not be in this list.
-
-## Bastard settings
-# fs_to_scan=(/ /opt /usr /usr/local /var)
+# The following list should contain the mount points of all filesystems
+# that are to be scanned as a space-separated list within parentheses.
+# / will usually be in this list and if you have /usr
+# on a separate partition, it will also be in this list. Other non-special
+# filesystems where suspicious files could be located should also be put in
+# this list.
+# Mount points whose filesystems are special, such as procfs or sysfs should
+# not be in this list.
-#Files with a path prefix found in the following list are ignored.
-#DO !!!!NOT!!! PUT /usr/src OR WHATEVER THE HOME DIRECTORY prefix is for your
-#package users into this list!!! You DO want to scan those directories in
-#order to spot e.g. world-writable tarballs and other abominations that
-#may have crept in.
-#Ideally, this list should be empty.
-
-# prune_prefixes=(/*/\{arch\}) #NO TRAILING SLASHES!!!
+#fs_to_scan=(\
+# / \
+# /opt \
+# /usr \
+# /usr/X11R6 \
+# /usr/lib \
+# /usr/share \
+# /usr/src \
+# /var)
+
+# Files with a path prefix found in the following list are ignored.
+# DO !!!!NOT!!! PUT /usr/src OR WHATEVER THE HOME DIRECTORY prefix is for your
+# package users into this list!!! You DO want to scan those directories in
+# order to spot e.g. world-writable tarballs and other abominations that
+# may have crept in.
+# Ideally, this list should be empty.
+
+prune_prefixes=(/root /*/lost+found) #NO TRAILING SLASHES!!!
-prune_prefixes=()
-
-#If the following variable is set to "yes", then files that contain
-#control characters or other non-printable characters (except for space)
-#will be reported as suspicious.
-#This test slows down the search considerably!
+## Bastard settings
+#prune_prefixes=(\
+# /root \
+# /{,*/{,*/}}lost+found \
+# /etc/polkit-1/localauthority \
+# /etc/sudoers.d \
+# /opt/pgsql/data \
+# /var/lib/{polkit-1,sasl,net-snmp,udisks} \
+# /var/log/syslog-ng \
+# /mnt \
+# /media)
+
+# If the following variable is set to "yes", then files that contain
+# control characters or other non-printable characters (except for space)
+# will be reported as suspicious.
+# This test slows down the search considerably!
-#suppress ugly debug output from shell
+# suppress ugly debug output from shell
-#"-false" as 1st argument is used when called by list_suspicious_files_from
+# "-false" as 1st argument is used when called by list_suspicious_files_from
if [ $# -ge 1 -a "$1" != "-false" ]; then
echo 1>&2
echo 1>&2 "USAGE: ${0##*/}"
if [ $# -ge 1 -a "$1" != "-false" ]; then
echo 1>&2
echo 1>&2 "USAGE: ${0##*/}"
echo Please run this script as root.
exit 1
fi
echo Please run this script as root.
exit 1
fi
add_package_user "${1}" $2 10000 20000 $3 10000 20000 || exit 1
rm -f /var/mail/$2
su $2
add_package_user "${1}" $2 10000 20000 $3 10000 20000 || exit 1
rm -f /var/mail/$2
su $2