dockapps (1408B)
1 #!/bin/sh 2 # dockapps SRC OUT: builds the dock apps from the tarballs in SRC into OUT, for a system that has none packaged 3 set -e 4 src=$(cd "$1" && pwd) out=$2 here=$(cd "$(dirname "$0")" && pwd) 5 mkdir -p "$out" 6 out=$(cd "$out" && pwd) 7 w=$(mktemp -d) 8 trap 'rm -rf "$w"' EXIT 9 export CFLAGS="${CFLAGS:--O2 -pipe} -std=gnu17 -fcommon" PKG_CONFIG_PATH="$out/usr/lib/pkgconfig" CPPFLAGS="-I$out/usr/include" LDFLAGS="-L$out/usr/lib" 10 gnu() { 11 n=$1 12 shift 13 mkdir "$w/$n" && tar -C "$w/$n" -xf "$src/$n"-*.tar.gz 14 cd "$(dirname "$(find "$w/$n" -name configure.ac -o -name configure.in | sort | head -1)")" 15 re= 16 for p in "$here"/patches/"$n"-*.patch; do [ -f "$p" ] && patch -p1 < "$p" && re=1; done 17 [ -x configure ] && [ -z "$re" ] || autoreconf -fi >/dev/null 2>&1 18 ./configure -q --prefix=/usr --sysconfdir=/etc "$@" >/dev/null 19 make -s 20 make -s DESTDIR="$out" install 21 } 22 gnu libdockapp --disable-static 23 for a in wmclock wmcpuload wmmemload wmix wmbattery wmsystemtray; do (gnu $a); done 24 cd "$w" && tar -xf "$src"/wmnet-*.tar.gz && cd wmnet-*/ 25 sed -i '/define USE_LINUX_PPP/d' config.h 26 xmkmf >/dev/null 2>&1 || true 27 if [ -f Makefile ]; then make -s CDEBUGFLAGS="$CFLAGS"; else ${CC:-cc} $CFLAGS -o wmnet wmnet.c drivers.c -lX11 -lXext; fi 28 install -Dm755 wmnet "$out/usr/bin/wmnet" 29 rm -rf "$out/usr/lib/pkgconfig" "$out/usr/include" "$out/usr/lib"/*.la "$out/usr/share/doc" "$out/usr/share/fonts/X11/misc/fonts.dir"