--- /dev/null
+#!/bin/sh
+
+name="nlsop"
+
+#defaults
+prefix=/usr
+dfblib=""
+dfbinc=""
+
+echo $run_cmd
+
+usage() {
+ echo "usage $0 <options>"
+ echo "options:"
+ echo "--prefix=PREFIX specify install prefix"
+ echo "--with-dfblib=DIR specify directfb lib dir"
+ echo "--with-dfbinc=DIR specify directfb include dir"
+ echo
+ }
+
+while [ "$1" ]; do
+ case "`echo $1 | awk -F= '{ print $1 }'`" in
+ --prefix) prefix=`echo $1 | awk -F= '{ print $2 }'`; shift;;
+ --help) usage; shift 1;;
+ --with-dfblib) dfblib=`echo $1 | awk -F= '{ print $2 }'`; shift;;
+ --with-dfbinc) dfbinc=`echo $1 | awk -F= '{ print $2 }'`; shift;;
+ esac
+done
+
+echo "checking for dfb stuff ..."
+dfb_inc_dir="0"
+if [ -z "$dfbinc" ]; then
+ for i in /usr/include /usr/local/include; do
+ if [ -d $i/directfb ]; then
+ dfb_inc_dir=$i/directfb
+ fi
+ done
+else
+ if [ -d $dfbinc/directfb ]; then
+ dfb_inc_dir=$dfbinc/directfb
+ fi
+fi
+if [ "$dfb_inc_dir" = "0" ]; then
+ echo "dfb includes missing ..."
+ exit 1
+fi
+dfb_lib_dir="0"
+if [ -z "$dfblib" ]; then
+ for i in /usr/lib /usr/local/lib; do
+ if [ -f $i/libdirectfb.so ]; then
+ dfb_lib_dir=$i
+ fi
+ done
+else
+ if [ -f $dfblib/libdirectfb.so ]; then
+ dfb_lib_dir=$dfblib
+ fi
+fi
+if [ "$dfb_lib_dir" = "0" ]; then
+ echo "dfb libs missing ..."
+ exit 1
+fi
+echo "directfb installation looks good :)"
+
+echo "creating Makefile"
+cat > Makefile << EOF
+# $name Makefile, created `date`
+
+INCLUDEDIR = /usr/include
+CFLAGS = -DDEBUG -DUSE_DFB_API -DFONT=\"$prefix/share/$name/decker.ttf\" -O3 -Wall -I$dfb_inc_dir
+LIBS = -L$dfb_lib_dir -ldirectfb
+
+OBJS = random.o dfbapi.o
+OBJS2 = $name
+
+$name: \$(OBJS)
+ \$(CC) \$(CFLAGS) -o \$@ \$(OBJS) \$(LIBS) ${name}.c
+
+all: $name
+
+clean:
+ rm \$(OBJS) \$(OBJS2)
+
+remake: clean all
+
+install:
+ mkdir -p $prefix/bin
+ cp $name $prefix/bin
+ chmod 755 $prefix/bin/$name
+ mkdir -p $prefix/share/$name
+ cp decker.ttf $prefix/share/$name
+ chmod 644 $prefix/share/$name/decker.ttf
+EOF
+
+echo "done"