diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-06-16 00:37:58 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-06-16 07:38:30 +0000 |
commit | d01e9df47258cdd6bf66ace1d6f592773b574926 (patch) | |
tree | 8feff85e04fee587e960f0cb97aeab6013751d08 /macosx-setup.sh | |
parent | 2486b7e8fa6ca76f75b36dfffe0de42b4f2e8380 (diff) | |
download | wireshark-d01e9df47258cdd6bf66ace1d6f592773b574926.tar.gz |
Put the {un}install_XXX() definitions in the right order.
Put them in the same order as the order in which the _VERSION values are
defined and in which they're invoked.
Similarly, do the "make sure we have the requested version installed"
tests in the same order as the un-installation order (which is the
reverse of the installation order).
Change-Id: I0e2bd1d249832090c3d81bacfe010de19de54cdf
Reviewed-on: https://code.wireshark.org/review/22158
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'macosx-setup.sh')
-rwxr-xr-x | macosx-setup.sh | 325 |
1 files changed, 162 insertions, 163 deletions
diff --git a/macosx-setup.sh b/macosx-setup.sh index a5aa2ef137..88f2e0ecc0 100755 --- a/macosx-setup.sh +++ b/macosx-setup.sh @@ -246,150 +246,6 @@ uninstall_lzip() { fi } -install_snappy() { - if [ "$SNAPPY_VERSION" -a ! -f snappy-$SNAPPY_VERSION-done ] ; then - echo "Downloading, building, and installing snappy:" - [ -f snappy-$SNAPPY_VERSION.tar.gz ] || curl -L -O https://github.com/google/snappy/releases/download/$SNAPPY_VERSION/snappy-$SNAPPY_VERSION.tar.gz || exit 1 - $no_build && echo "Skipping installation" && return - gzcat snappy-$SNAPPY_VERSION.tar.gz | tar xf - || exit 1 - cd snappy-$SNAPPY_VERSION - CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1 - make $MAKE_BUILD_OPTS || exit 1 - $DO_MAKE_INSTALL || exit 1 - cd .. - touch snappy-$SNAPPY_VERSION-done - fi -} - -uninstall_snappy() { - if [ ! -z "$installed_snappy_version" ] ; then - echo "Uninstalling snappy:" - cd snappy-$installed_snappy_version - $DO_MAKE_UNINSTALL || exit 1 - make distclean || exit 1 - cd .. - rm snappy-$installed_snappy_version-done - - if [ "$#" -eq 1 -a "$1" = "-r" ] ; then - # - # Get rid of the previously downloaded and unpacked version. - # - rm -rf snappy-$installed_snappy_version - rm -rf snappy-$installed_snappy_version.tar.gz - fi - - installed_snappy_version="" - fi -} - -install_libxml2() { - if [ "$LIBXML2_VERSION" -a ! -f libxml2-$LIBXML2_VERSION-done ] ; then - echo "Downloading, building, and installing libxml2:" - [ -f libxml2-$LIBXML2_VERSION.tar.gz ] || curl -L -O ftp://xmlsoft.org/libxml2/libxml2-$LIBXML2_VERSION.tar.gz || exit 1 - $no_build && echo "Skipping installation" && return - gzcat libxml2-$LIBXML2_VERSION.tar.gz | tar xf - || exit 1 - cd libxml2-$LIBXML2_VERSION - CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1 - make $MAKE_BUILD_OPTS || exit 1 - $DO_MAKE_INSTALL || exit 1 - cd .. - touch libxml2-$LIBXML2_VERSION-done - fi -} - -uninstall_libxml2() { - if [ ! -z "$installed_libxml2_version" ] ; then - echo "Uninstalling libxml2:" - cd libxml2-$installed_libxml2_version - $DO_MAKE_UNINSTALL || exit 1 - make distclean || exit 1 - cd .. - rm libxml2-$installed_libxml2_version-done - - if [ "$#" -eq 1 -a "$1" = "-r" ] ; then - # - # Get rid of the previously downloaded and unpacked version. - # - rm -rf libxml2-$installed_libxml2_version - rm -rf libxml2-$installed_libxml2_version.tar.gz - fi - - installed_libxml2_version="" - fi -} - -install_lz4() { - if [ "$LZ4_VERSION" -a ! -f lz4-$LZ4_VERSION-done ] ; then - echo "Downloading, building, and installing lz4:" - [ -f lz4-$LZ4_VERSION.tar.gz ] || curl -L -o lz4-$LZ4_VERSION.tar.gz https://github.com/lz4/lz4/archive/$LZ4_VERSION.tar.gz || exit 1 - $no_build && echo "Skipping installation" && return - gzcat lz4-$LZ4_VERSION.tar.gz | tar xf - || exit 1 - cd lz4-$LZ4_VERSION - # CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1 - make $MAKE_BUILD_OPTS || exit 1 - $DO_MAKE_INSTALL || exit 1 - cd .. - touch lz4-$LZ4_VERSION-done - fi -} - -uninstall_lz4() { - if [ ! -z "$installed_lz4_version" ] ; then - echo "Uninstalling lz4:" - cd lz4-$installed_lz4_version - $DO_MAKE_UNINSTALL || exit 1 - make distclean || exit 1 - cd .. - rm lz4-$installed_lz4_version-done - - if [ "$#" -eq 1 -a "$1" = "-r" ] ; then - # - # Get rid of the previously downloaded and unpacked version. - # - rm -rf lz4-$installed_lz4_version - rm -rf lz4-$installed_lz4_version.tar.gz - fi - - installed_lz4_version="" - fi -} - -install_sbc() { - if [ "$SBC_VERSION" -a ! -f sbc-$SBC_VERSION-done ] ; then - echo "Downloading, building, and installing sbc:" - [ -f sbc-$SBC_VERSION.tar.gz ] || curl -L -O https://www.kernel.org/pub/linux/bluetooth/sbc-$SBC_VERSION.tar.gz || exit 1 - $no_build && echo "Skipping installation" && return - gzcat sbc-$SBC_VERSION.tar.gz | tar xf - || exit 1 - cd sbc-$SBC_VERSION - CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure --disable-tools --disable-tester --disable-shared || exit 1 - make $MAKE_BUILD_OPTS || exit 1 - $DO_MAKE_INSTALL || exit 1 - cd .. - touch sbc-$SBC_VERSION-done - fi -} - -uninstall_sbc() { - if [ ! -z "$installed_sbc_version" ] ; then - echo "Uninstalling sbc:" - cd sbc-$installed_sbc_version - $DO_MAKE_UNINSTALL || exit 1 - make distclean || exit 1 - cd .. - rm sbc-$installed_sbc_version-done - - if [ "$#" -eq 1 -a "$1" = "-r" ] ; then - # - # Get rid of the previously downloaded and unpacked version. - # - rm -rf sbc-$installed_sbc_version - rm -rf sbc-$installed_sbc_version.tar.gz - fi - - installed_sbc_version="" - fi -} - install_autoconf() { if [ "$AUTOCONF_VERSION" -a ! -f autoconf-$AUTOCONF_VERSION-done ] ; then echo "Downloading, building and installing GNU autoconf..." @@ -1652,6 +1508,150 @@ uninstall_portaudio() { fi } +install_snappy() { + if [ "$SNAPPY_VERSION" -a ! -f snappy-$SNAPPY_VERSION-done ] ; then + echo "Downloading, building, and installing snappy:" + [ -f snappy-$SNAPPY_VERSION.tar.gz ] || curl -L -O https://github.com/google/snappy/releases/download/$SNAPPY_VERSION/snappy-$SNAPPY_VERSION.tar.gz || exit 1 + $no_build && echo "Skipping installation" && return + gzcat snappy-$SNAPPY_VERSION.tar.gz | tar xf - || exit 1 + cd snappy-$SNAPPY_VERSION + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1 + make $MAKE_BUILD_OPTS || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch snappy-$SNAPPY_VERSION-done + fi +} + +uninstall_snappy() { + if [ ! -z "$installed_snappy_version" ] ; then + echo "Uninstalling snappy:" + cd snappy-$installed_snappy_version + $DO_MAKE_UNINSTALL || exit 1 + make distclean || exit 1 + cd .. + rm snappy-$installed_snappy_version-done + + if [ "$#" -eq 1 -a "$1" = "-r" ] ; then + # + # Get rid of the previously downloaded and unpacked version. + # + rm -rf snappy-$installed_snappy_version + rm -rf snappy-$installed_snappy_version.tar.gz + fi + + installed_snappy_version="" + fi +} + +install_libxml2() { + if [ "$LIBXML2_VERSION" -a ! -f libxml2-$LIBXML2_VERSION-done ] ; then + echo "Downloading, building, and installing libxml2:" + [ -f libxml2-$LIBXML2_VERSION.tar.gz ] || curl -L -O ftp://xmlsoft.org/libxml2/libxml2-$LIBXML2_VERSION.tar.gz || exit 1 + $no_build && echo "Skipping installation" && return + gzcat libxml2-$LIBXML2_VERSION.tar.gz | tar xf - || exit 1 + cd libxml2-$LIBXML2_VERSION + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1 + make $MAKE_BUILD_OPTS || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch libxml2-$LIBXML2_VERSION-done + fi +} + +uninstall_libxml2() { + if [ ! -z "$installed_libxml2_version" ] ; then + echo "Uninstalling libxml2:" + cd libxml2-$installed_libxml2_version + $DO_MAKE_UNINSTALL || exit 1 + make distclean || exit 1 + cd .. + rm libxml2-$installed_libxml2_version-done + + if [ "$#" -eq 1 -a "$1" = "-r" ] ; then + # + # Get rid of the previously downloaded and unpacked version. + # + rm -rf libxml2-$installed_libxml2_version + rm -rf libxml2-$installed_libxml2_version.tar.gz + fi + + installed_libxml2_version="" + fi +} + +install_lz4() { + if [ "$LZ4_VERSION" -a ! -f lz4-$LZ4_VERSION-done ] ; then + echo "Downloading, building, and installing lz4:" + [ -f lz4-$LZ4_VERSION.tar.gz ] || curl -L -o lz4-$LZ4_VERSION.tar.gz https://github.com/lz4/lz4/archive/$LZ4_VERSION.tar.gz || exit 1 + $no_build && echo "Skipping installation" && return + gzcat lz4-$LZ4_VERSION.tar.gz | tar xf - || exit 1 + cd lz4-$LZ4_VERSION + # CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1 + make $MAKE_BUILD_OPTS || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch lz4-$LZ4_VERSION-done + fi +} + +uninstall_lz4() { + if [ ! -z "$installed_lz4_version" ] ; then + echo "Uninstalling lz4:" + cd lz4-$installed_lz4_version + $DO_MAKE_UNINSTALL || exit 1 + make distclean || exit 1 + cd .. + rm lz4-$installed_lz4_version-done + + if [ "$#" -eq 1 -a "$1" = "-r" ] ; then + # + # Get rid of the previously downloaded and unpacked version. + # + rm -rf lz4-$installed_lz4_version + rm -rf lz4-$installed_lz4_version.tar.gz + fi + + installed_lz4_version="" + fi +} + +install_sbc() { + if [ "$SBC_VERSION" -a ! -f sbc-$SBC_VERSION-done ] ; then + echo "Downloading, building, and installing sbc:" + [ -f sbc-$SBC_VERSION.tar.gz ] || curl -L -O https://www.kernel.org/pub/linux/bluetooth/sbc-$SBC_VERSION.tar.gz || exit 1 + $no_build && echo "Skipping installation" && return + gzcat sbc-$SBC_VERSION.tar.gz | tar xf - || exit 1 + cd sbc-$SBC_VERSION + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure --disable-tools --disable-tester --disable-shared || exit 1 + make $MAKE_BUILD_OPTS || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch sbc-$SBC_VERSION-done + fi +} + +uninstall_sbc() { + if [ ! -z "$installed_sbc_version" ] ; then + echo "Uninstalling sbc:" + cd sbc-$installed_sbc_version + $DO_MAKE_UNINSTALL || exit 1 + make distclean || exit 1 + cd .. + rm sbc-$installed_sbc_version-done + + if [ "$#" -eq 1 -a "$1" = "-r" ] ; then + # + # Get rid of the previously downloaded and unpacked version. + # + rm -rf sbc-$installed_sbc_version + rm -rf sbc-$installed_sbc_version.tar.gz + fi + + installed_sbc_version="" + fi +} + install_geoip() { if [ "$GEOIP_VERSION" -a ! -f geoip-$GEOIP_VERSION-done ] ; then echo "Downloading, building, and installing GeoIP API:" @@ -1860,6 +1860,17 @@ install_all() { uninstall_geoip -r fi + if [ ! -z "$installed_sbc_version" -a \ + "$installed_sbc_version" != "$SBC_VERSION" ] ; then + echo "Installed SBC version is $installed_sbc_version" + if [ -z "$SBC_VERSION" ] ; then + echo "SBC is not requested" + else + echo "Requested SBC version is $SBC_VERSION" + fi + uninstall_sbc -r + fi + if [ ! -z "$installed_lz4_version" -a \ "$installed_lz4_version" != "$LZ4_VERSION" ] ; then echo "Installed LZ4 version is $installed_lz4_version" @@ -1871,17 +1882,6 @@ install_all() { uninstall_lz4 -r fi - if [ ! -z "$installed_snappy_version" -a \ - "$installed_snappy_version" != "$SNAPPY_VERSION" ] ; then - echo "Installed SNAPPY version is $installed_snappy_version" - if [ -z "$SNAPPY_VERSION" ] ; then - echo "SNAPPY is not requested" - else - echo "Requested SNAPPY version is $SNAPPY_VERSION" - fi - uninstall_snappy -r - fi - if [ ! -z "$installed_libxml2_version" -a \ "$installed_libxml2_version" != "$LIBXML2_VERSION" ] ; then echo "Installed libxml2 version is $installed_libxml2_version" @@ -1893,16 +1893,15 @@ install_all() { uninstall_libxml2 -r fi - - if [ ! -z "$installed_sbc_version" -a \ - "$installed_sbc_version" != "$SBC_VERSION" ] ; then - echo "Installed SBC version is $installed_sbc_version" - if [ -z "$SBC_VERSION" ] ; then - echo "SBC is not requested" + if [ ! -z "$installed_snappy_version" -a \ + "$installed_snappy_version" != "$SNAPPY_VERSION" ] ; then + echo "Installed SNAPPY version is $installed_snappy_version" + if [ -z "$SNAPPY_VERSION" ] ; then + echo "SNAPPY is not requested" else - echo "Requested SBC version is $SBC_VERSION" + echo "Requested SNAPPY version is $SNAPPY_VERSION" fi - uninstall_sbc -r + uninstall_snappy -r fi if [ ! -z "$installed_portaudio_version" -a \ |