debian/spiv.manpages: +spiv.1
[gfxprim/pasky.git] / install.sh
bloba0f8d830db4faef176115fda1b2a5c8cd9dcb13c
1 #!/bin/sh
3 PREFIX="$1"
4 LIBDIR="$2"
5 BINDIR="$3"
6 INCLUDEDIR="$4"
8 HEADER_LOC="${DESTDIR}$PREFIX/$INCLUDEDIR"
9 LIB_LOC="${DESTDIR}$PREFIX/$LIBDIR"
10 BIN_LOC="${DESTDIR}$PREFIX/$BINDIR"
12 # Headers
13 echo "INSTALL headers ($HEADER_LOC)"
14 install -m 775 -d "${HEADER_LOC}/GP"
15 for i in `ls include/`; do
16 if [ -d "include/$i" ]; then
17 echo " $i"
18 install -m 775 -d "${HEADER_LOC}/GP/$i"
19 install -m 664 "include/$i/"*.h "${HEADER_LOC}/GP/$i"
20 else
21 if [ "$i" != "Makefile" ]; then
22 install -m 664 "include/$i" "${HEADER_LOC}/GP/$i"
25 done
27 # Library
28 echo "INSTALL libraries ($LIB_LOC)"
29 install -m 775 -d "$LIB_LOC"
31 for i in build/*.so build/*.so.* build/*.a; do
32 if [ -L "$i" ]; then
33 TARGET=`basename "$i"`
34 SOURCE=`readlink "$i"`
35 (cd "$LIB_LOC" && rm -f "$TARGET" && ln -s "$SOURCE" "$TARGET")
36 else
37 install "$i" "$LIB_LOC"
39 done
41 # Binaries
42 echo "INSTALL binaries"
43 install -m 775 -d "$BIN_LOC"
44 install -m 755 gfxprim-config "$BIN_LOC"