File: install-tidy.sh

package info (click to toggle)
utidylib 0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 216 kB
  • sloc: python: 428; makefile: 148; sh: 41
file content (28 lines) | stat: -rwxr-xr-x 593 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

set -e

if [ -z "$1" ] ; then
    echo "Usage: install-tidy.sh VERSION"
    exit 1
fi

CMAKE_ARGS=""
if which apt-get ; then
  if [ "$1" = "os" ] ; then
    sudo apt-get install -y libtidy5deb1
    exit 0
  else
    sudo apt-get purge libtidy5deb1 tidy libtidy-dev
  fi
  CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=/usr"
fi

wget -O tidy.tar.gz https://github.com/htacg/tidy-html5/archive/$1.tar.gz
mkdir tidy-source
tar xvf tidy.tar.gz --strip-components=1 -C tidy-source
rm tidy.tar.gz
cd tidy-source/build/cmake/
cmake ../.. -DCMAKE_BUILD_TYPE=Release $CMAKE_ARGS
make
sudo make install