#!/bin/sh # # Configures to build rcdrecord # # This file is part of webCDwriter - Network CD/DVD Writing. # # Copyright (C) 2000-2005 Jörg P. M. Haeger # # webCDwriter is free software. See the README for details. # # directories BINDIR=/usr/bin HTTPDIR=/var/CDWserver/http # files CONFIGFILE=/etc/rcdrecord.conf # options cxx=g++ dir="" host=localhost port=12411 product=rcdrecord while [ -n "$1" ]; do case $1 in --bindir=*) BINDIR=`echo $1 | sed "s*--bindir=**g"` ;; --configfile=*) CONFIGFILE=`echo $1 | sed "s*--configfile=**g"` ;; --destDir=*) DESTDIR=`echo $1 | sed "s:--destDir=::g"` ;; --dir=*) dir=`echo $1 | sed "s*--dir=**g"` ;; --host=?*) host=`echo $1 | sed "s/--host=//g"` ;; --httpdir=*) HTTPDIR=`echo $1 | sed "s*--httpdir=**g"` ;; --port=?*) port=`echo $1 | sed "s/--port=//g"` ;; --product=?*) product=`echo $1 | sed "s/--product=//g"` ;; --server=?*) host=`echo $1 | sed "s/--server=//g"` ;; --help) HELP=yes ;; *) echo $1: unknown argument HELP=yes ;; esac shift done if [ "$HELP" = "yes" ]; then cat < config.h << EOF // defaults for the connection to CDWserver const char defaultHost[] = "$host"; const int defaultPort = $port; // filenames const char configFileName[] = "$CONFIGFILE", userFileName[] = ".rcdrecord"; EOF echo "Creating config" INSTALL="install" install -b README /tmp/README.CDWserver 2> /dev/null \ && INSTALL="$INSTALL -b" rm -f /tmp/README.CDWserver install -p README /tmp/README.CDWserver 2> /dev/null \ && INSTALL="$INSTALL -p" rm -f /tmp/README.CDWserver cat > config << EOF # compiler and linker options CXX=$cxx # install command and args INSTALL=$INSTALL INSTALL_FILE=$INSTALL -m 644 INSTALL_644=$INSTALL -m 644 # directories DESTDIR="$DESTDIR" BINDIR="\$(DESTDIR)$BINDIR" HTTPDIR="\$(DESTDIR)$HTTPDIR" # rcdrecord or webCDwriter (for use in the Makefile) PRODUCT=$product EOF if [ "$dir" = "" ]; then echo echo "rcdrecord is now configured for building. Just run make." echo fi