123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- #!/bin/sh
- # Slackware LibreOffice Dependency Check - swlodc
- # A simple shell script to check if the dependency autodetection
- # variables for the LibreOffice slackbuild are still sane.
- # Copyright 2015-2019 Hunter Sezen California, USA
- # All rights reserved.
- #
- # Redistribution and use of this script, with or without modification, is
- # permitted provided that the following conditions are met:
- #
- # 1. Redistributions of this script must retain the above copyright
- # notice, this list of conditions and the following disclaimer.
- #
- # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
- # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- PKGDIR=${PKGDIR:-/var/log/packages}
- set -eu
- exists () {
- v=1
- while [ $# -gt 0 ]; do
- arg="$1"; shift
- case "$arg" in ''|*/) continue ;; esac
- x="${arg##*/}" z="${arg%/*}"
- [ ! -f "$z/$x" ] || [ ! -x "$z/$x" ] && [ "$z/$x" = "$arg" ] && continue
- [ "$x" = "$z" ] && [ -x "$z/$x" ] && [ ! -f "$arg" ] && z=
- p=":$z:$PATH"
- while [ "$p" != "${p#*:}" ]; do
- p="${p#*:}"; d="${p%%:*}"
- if [ -f "$d/$x" ] && [ -x "$d/$x" ]; then
- printf %s\\n "$d/$x"
- v=0
- break
- fi
- done
- done
- return $v
- }
- check_type () {
- case "$1" in
- -b )
- exists "$PKG" >/dev/null 2>&1 && return 0
- TYPE="bin/$PKG"
- CMD="printf %s\\n \"warning: binary file for \$PRGNAM not found\""
- ;;
- -i )
- [ -d "/usr/include/$PKG" ] && return 0
- TYPE="include/$PKG"
- CMD="printf %s\\n \"warning: include directory for \$PRGNAM not found\""
- ;;
- -l )
- ldconfig -p | grep -q "$PKG" && return 0
- TYPE="$PKG"
- CMD="printf %s\\n \"warning: shared library for \$PRGNAM not found\""
- ;;
- -p )
- pkg-config --exists "$PKG" && return 0
- TYPE="$PKG.pc"
- CMD="grep pkgconfig/.*.pc \$PKGDIR/$PRGNAM-[0-9]*"
- ;;
- esac
- return 1
- }
- check_pkg () {
- PRGNAM="$2"
- case "$3" in
- '' ) PKG="$2" ;;
- * ) eval "PKG=$3" ;;
- esac
- if check_type "$1"; then
- printf %s\\n "$PRGNAM: ok"
- else
- printf %s\\n "$PRGNAM: not found" "warning: $TYPE is missing" >&2
- set -- "${PKGDIR}/${PRGNAM}*"
- if [ -r "$1" ]; then
- eval "$CMD" >&2
- else
- printf %s\\n "warning: $PRGNAM is not installed" >&2
- fi
- fi
- }
- # Check dependencies
- check_pkg -p apr \$PRGNAM-1
- check_pkg -p bluez ''
- check_pkg -i boost ''
- check_pkg -b bzip2 ''
- check_pkg -p cairo ''
- check_pkg -p clucene lib\$PRGNAM-core
- check_pkg -p coinmp ''
- check_pkg -p cppunit ''
- check_pkg -p curl lib\$PRGNAM
- check_pkg -p epoxy ''
- check_pkg -p expat ''
- check_pkg -p gc atomic_ops
- check_pkg -i glm ''
- check_pkg -p graphite2 ''
- check_pkg -p gstreamer \$PRGNAM-1.0
- check_pkg -p harfbuzz ''
- check_pkg -p hunspell ''
- check_pkg -p icu4c icu-i18n
- check_pkg -p lcms2 ''
- check_pkg -p libabw \$PRGNAM-0.1
- check_pkg -p libcdr \$PRGNAM-0.1
- check_pkg -p libcmis \$PRGNAM-0.5
- check_pkg -p libe-book \$PRGNAM-0.1
- check_pkg -p libeot ''
- check_pkg -p libepubgen \$PRGNAM-0.1
- check_pkg -p libetonyek \$PRGNAM-0.1
- check_pkg -p libexttextcat ''
- check_pkg -p libfreehand \$PRGNAM-0.1
- check_pkg -p libiodbc ''
- check_pkg -p liblangtag ''
- check_pkg -p libmspub \$PRGNAM-0.1
- check_pkg -p libmwaw \$PRGNAM-0.3
- check_pkg -p libnumbertext ''
- check_pkg -p libodfgen \$PRGNAM-0.1
- check_pkg -p liborcus \$PRGNAM-0.15
- check_pkg -p libpagemaker \$PRGNAM-0.0
- check_pkg -p libpng "\${PRGNAM}16"
- check_pkg -p libqxp \$PRGNAM-0.0
- check_pkg -p librevenge \$PRGNAM-0.0
- check_pkg -p libstaroffice \$PRGNAM-0.0
- check_pkg -l libtommath \$PRGNAM.so.1
- check_pkg -p libvisio \$PRGNAM-0.1
- check_pkg -p libwpd \$PRGNAM-0.10
- check_pkg -p libwpg \$PRGNAM-0.3
- check_pkg -p libwps \$PRGNAM-0.4
- check_pkg -p libxml \$PRGNAM-2.0
- check_pkg -p libzmf \$PRGNAM-0.0
- check_pkg -b lpsolve lp_solve
- check_pkg -b mariadb mysql
- check_pkg -p mdds \$PRGNAM-1.5
- check_pkg -p mozilla-nss ''
- check_pkg -p mythes ''
- check_pkg -p neon ''
- check_pkg -p openjpeg libopenjp2
- check_pkg -b openldap ldapurl
- check_pkg -p openssl ''
- check_pkg -p poppler ''
- check_pkg -p postgresql libpq
- check_pkg -p python3 ''
- check_pkg -p redland ''
- check_pkg -p sane \$PRGNAM-backends
- check_pkg -p serf \$PRGNAM-1
- check_pkg -p ucpp lib\$PRGNAM
- check_pkg -p xmlsec "\${PRGNAM}1-nss"
- check_pkg -p zlib ''
|