1 # This file contain all configuration information to build
2 # `lustre-release/lustre/contrib/wireshark'
5 ###########################################################################
7 # DOWNLOAD CONFIGURATION
9 ###########################################################################
11 ## BEGIN: -can-edit ##
12 # URL of directory containing all source tar balls
13 export WS_DOWNLOAD_BASE_URL='http://wiresharkdownloads.riverbed.com'
14 WS_DOWNLOAD_BASE_URL+='/wireshark/src/all-versions'
16 # wireshark verion to be used
17 export WS_VERSION='1.6.8'
20 # URL of the wireshark source code tarball
21 # Implicit assumption: Wireshark release names follow the nameing
22 # convention coded in the content of the following varialble
23 export WS_SOURCE_URL="${WS_DOWNLOAD_BASE_URL}/wireshark-${WS_VERSION}.tar.bz2"
26 ###########################################################################
30 ###########################################################################
32 ## BEGIN: -can-edit ##
33 # Space separate list of RPMs needed to be installed for
34 # compilation of wireshark
36 # Package name(s) (can) vary between differnt distributions
37 # If distributions 'marked' by same release file, content has to
38 # parsed and variable PREREQUISITE_RPMS has to be set accoringly to
39 # package name(s) used for each distro.
40 if [ -r /etc/redhat-release ] ; then
41 export PREREQUISITE_RPMS='gtk2 gtk2-devel glib2 libpcap libpcap-devel perl'
42 elif [ -r /etc/SuSE-release ] ; then
43 export PREREQUISITE_RPMS='gtk2 gtk2-devel glib2 libpcap0 libpcap-devel perl'
46 # Include and linker flags needed to Lustre/LNet
47 # Only version indepent information should be added here
48 # (Back ticked expression will be evaluated by make command)
49 export PLUGIN_COMPILE_FLAGS='`pkg-config --libs --cflags glib-2.0`'
52 # Top-level directory to be used to unpack/compile/install
53 # wireshark/lustre-git-repo
54 export BUILD_DIR=`pwd`
56 # Directory location of wireshark source code
57 export WS_HOME="${BUILD_DIR}/wireshark-${WS_VERSION}"
59 # (Relative) path of the wireshark contribution directory
60 export LUSTRE_WS_DIR='lustre-release/lustre/contrib/wireshark'
62 # RPM internal name for the Lustre/LNet plugins
63 export PLUGIN_RPM_NAME='lustre-wireshark-plugins'
65 # TAR command + options to be used to create a bzip2 tarball
66 export TAR='/bin/tar jcpf '
67 # TAR command + options to be used to unpack a bzip2 tarball
68 export UNTAR='/bin/tar jxpf '
73 echo "wsconfig error: $*"
77 # arg1: complete package name, with version
78 # arg2: the minimum version
81 act_ver=${1#*-devel-} ; shift
82 act_ver=${act_ver%%-*}
85 printf "${act_ver}\n$1\n" | sort -V | head -n1 )
86 test "X$low_ver" = "X$1" || \
87 die "wireshark too old: $act_ver is before $1"
93 txt=$(echo $(rpm -q --list $1 | \
94 sed -n '\@/libwire@s@/libwire[^/]*$@@p' | \
98 die "unknown variable: $2"
104 dlst=$(rpm -q --list $pkg | \
105 grep '/usr.*/include.*/wireshark$' | \
106 while read f ; do test -d $f && echo "$f" ; done)
109 do test -f $f/config.h && ln -s ${f}/config.h .
112 test -f config.h || die "cannot find config header"
116 declare pkg=$(rpm -qa | sed -n '/wireshark-devel/{;p;q;}')
124 txt=$(rpm -q --list $pkg | \
125 sed -n 's@\.so$@@p' | \
134 txt=${pkg#wireshark-devel-}
138 --atleast-version=* )
139 chk_ver ${pkg} ${1#*=}
148 set_var ${pkg} ${1#*=}
157 die "unknown option: $1"
160 test ${#txt} -gt 0 && \
161 printf "%s" "$(echo ' '$txt)"
167 pkg-config "$@" 2>/dev/null && exit 0
172 fullpkg=$(rpm -qa | grep -E '^glib[2-9].*-devel' | head -n1)
173 dirs=$(rpm -q --list $fullpkg | \
174 while read f ; do test -d $f && echo $f ; done | \
176 for f in $dirs ; do printf "-I$f " ; done
177 rpm -q --list $fullpkg | \
178 sed -n 's@^.*/libglib@-lglib@p' | \
179 sed -n 's/\.so$//p' | \