[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: forwarded message from Stephan Kulow



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

torsdagen den 15 maj 2003 10.58 skrev Daniel Stone:

> OTOH, if someone made a patch to make admin/debianrules work in shell
> mode as well, with a given argument, I'd certainly commit that.

I don't have a patch to your admin/debianrules, but I have my own version,
that I have been using, which is the same thing written as a shell script
instead of perl, and containing other things that often are in the rules file
in KDE builds.

I have changed it (took me about 10 minutes), so that
	debianrules echodirs
gives the directories in bash format and
	debianrules echomacros
gives the helper macros for debian/rules and make

I usually put the whole thing in debian/debianrules, as admin/debianrules
normally supply something else.

Karolina

#!/bin/bash

kde_prefix="/usr"
kde_htmldir="$kde_prefix/share/doc/kde/HTML"
kde_appsdir="$kde_prefix/share/applnk"
kde_icondir="$kde_prefix/share/icons"
kde_sounddir="$kde_prefix/share/sounds"
kde_datadir="$kde_prefix/share/apps"
kde_locale="$kde_prefix/share/locale"
kde_cgidir="$kde_prefix/lib/cgi-bin"
kde_confdir="/etc/kde3"
kde_mimedir="$kde_prefix/share/mimelnk"
kde_toolbardir="$kde_prefix/share/toolbar"
kde_wallpaperdir="$kde_prefix/share/wallpapers"
kde_templatesdir="$kde_prefix/share/templates"
kde_bindir="$kde_prefix/bin"
kde_servicesdir="$kde_prefix/share/services"
kde_servicetypesdir="$kde_prefix/share/servicetypes"
kde_includedir="$kde_prefix/include/kde"
kde_libdir="$kde_prefix/lib"
kde_moduledir="$kde_libdir/kde3"
kde_styledir="$kde_libdir/kde3/plugins/styles"
kde_widgetdir="$kde_libdir/kde3/plugins/designer"

mandir="$kde_prefix/share/man"
infodir="$kde_prefix/share/info"
sysconfdir="/etc"

QTDIR="/usr/share/qt"
IDL="$kde_bindir/cuteidl"
DCOPIDL="$kde_bindir/dcopidl"
DCOPIDL2CPP="$kde_bindir/dcopidl2cpp"
KDB2HTML="$kde_bindir/kdb2html"
MCOPIDL="$kde_bindir/mcopidl"
ARTSCCONFIG="$kde_bindir/artsc-config"

INSTALL_DATA="install -p -c -m 644"
INSTALL_BIN="install -p -o root -g root -m 755"
INSTALL_DIR="install -p -d -o root -g root -m 755"
INSTALL_FILE="install -p -o root -g root -m 644"
INSTALL_SCRIPT="install -p -o root -g root -m 755"

lintian_overrides='$(tmp)/usr/share/lintian/overrides'
linda_overrides='$(tmp)/usr/share/linda/overrides'

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
if [ "X$DEB_HOST_GNU_TYPE" == "X" ]; then
    DEB_HOST_GNU_TYPE=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
fi
if [ "X$DEB_BUILD_GNU_TYPE" == "X" ]; then
    DEB_BUILD_GNU_TYPE=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)
fi

if [ "X$ARCH" == "X" ]; then
    ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
fi

# Set compilation options depending on architecture
if [ "$ARCH" == "alpha" ]; then
    CFLAGS="-O0 -mieee" CXXFLAGS="-O0 -mieee"
elif [ "$ARCH" == "hppa" ]; then
    CFLAGS="-Os -ffunction-sections -Wl,--stub-group-size=50000" CXXFLAGS="-Os -ffunction-sections -Wl,--stub-group-size=50000"
else
    COMPILER_FLAGS='CXX=g++ CC=gcc'
fi

if [ "${DEB_BUILD_GNU_TYPE}" == "i386-linux" ]; then
    # Uncomment the following 2 lines to enable i686 optimziation
    # You may want to tweak the settings to your likings
    #CFLAGS='-O3 -march=i686 -ffast-math -finline-functions'
    #CXXFLAGS='-O3 -march=i686 -ffast-math -finline-functions'
    # We choose i686 optimization, but still with only i386 instructions
    CFLAGS='-O3 -mcpu=i686 -ffast-math'
    CXXFLAGS='-O3 -mcpu=i686 -ffast-math'
    XINERAMA=--with-xinerama
    FAST_MALLOC=--enable-fast-malloc=full

    # This we need to select the old c++ compiler
    #COMPILER_FLAGS='CXX=g++-2.95 CC=gcc-2.95 CPP=cpp-2.95'
    COMPILER_FLAGS=''
fi

if [ "${DEB_BUILD_OPTIONS}" != "${DEB_BUILD_OPTIONS/debug/}" ]; then
    enable_debug="--enable-debug"
    CFLAGS="$CFLAGS -g"
    ENABLE_FINAL=""
else
    enable_debug="--disable-debug"
    ENABLE_FINAL="--enable-final"
fi

# Assemble the final compiler flags
COMPILER_FLAGS="$COMPILER_FLAGS CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\""

if [ ${DEB_BUILD_OPTIONS} = ${DEB_BUILD_OPTIONS/nostrip/} ]; then
    INSTALL_BIN="$INSTALL_BIN -s"
fi

if [ "$1" == "echodirs" ]; then
    echo "export kde_confdir=$kde_confdir"
    echo "export kde_prefix=$kde_prefix"
    echo "export kde_bindir=$kde_bindir"
    echo "export kde_includedir=$kde_includedir"
    echo "export kde_libdir=$kde_libdir"
    echo "export kde_cgidir=$kde_cgidir"
    echo "export kde_moduledir=$kde_moduledir"
    echo "export kde_styledir=$kde_styledir"
    echo "export kde_widgetdir=$kde_widgetdir"
    echo "export kde_appsdir=$kde_appsdir"
    echo "export kde_datadir=$kde_datadir"
    echo "export kde_htmldir=$kde_htmldir"
    echo "export kde_icondir=$kde_icondir"
    echo "export kde_locale=$kde_locale"
    echo "export kde_mimedir=$kde_mimedir"
    echo "export kde_servicesdir=$kde_servicesdir"
    echo "export kde_servicetypesdir=$kde_servicetypesdir"
    echo "export kde_sounddir=$kde_sounddir"
    echo "export kde_templatesdir=$kde_templatesdir"
    echo "export kde_wallpaperdir=$kde_wallpaperdir"
    echo "export kde_toolbardir=$kde_toolbardir"

    echo "export mandir=$mandir"
    echo "export infodir=$infodir"
    echo "export sysconfdir=$sysconfdir"

    echo "export QTDIR=$QTDIR"
    echo "export IDL=$IDL"
    echo "export DCOPIDL=$DCOPIDL"
    echo "export DCOPIDL2CPP=$DCOPIDL2CPP"
    echo "export KDB2HTML=$KDB2HTML"
    echo "export MCOPIDL=$MCOPIDL"
    echo "export ARTSCCONFIG=$ARTSCCONFIG"
    echo "export FAST_MALLOC=\"$FAST_MALLOC\""
    echo "export ENABLE_FINAL=\"$ENABLE_FINAL\""
    echo "export CFLAGS=\"$CFLAGS\""
    echo "export CXXFLAGS=\"$CXXFLAGS\""

    echo "export DEB_HOST_GNU_TYPE=\"$DEB_HOST_GNU_TYPE\""
    echo "export DEB_BUILD_GNU_TYPE=\"$DEB_BUILD_GNU_TYPE\""
    echo "export ARCH=$ARCH"

elif [ "$1" == "echomacros" ]; then
    echo "INSTALL_DATA = $INSTALL_DATA"
    echo "INSTALL_BIN = $INSTALL_BIN"
    echo "INSTALL_DIR = $INSTALL_DIR"
    echo "INSTALL_FILE = $INSTALL_FILE"
    echo "INSTALL_SCRIPT = $INSTALL_SCRIPT"

    echo "COMPILER_FLAGS = $COMPILER_FLAGS"

    echo "lintian_overrides = $lintian_overrides"
    echo "linda_overrides = $linda_overrides"

    echo '# for installing multiple lintian overrides.'
    echo 'define INSTALL_LINTIAN_OVERRIDES'
    echo '    for p in `dh_listpackages`; do \'
    echo '        if test -f debian/$$p.override; then \'
    echo '            $(INSTALL_DIR) $(lintian_overrides); \'
    echo '            $(INSTALL_FILE) debian/$$p.override $(lintian_overrides)/$$p; \'
    echo '        fi; \'
    echo '    done '
    echo 'endef'

    echo '# for installing a single package lintian and/or linda override.'
    echo 'define INSTALL_OVERRIDE'
    echo '    if test -f debian/override; then \'
    echo '        $(INSTALL_DIR) $(lintian_overrides); \'
    echo '        $(INSTALL_FILE) debian/override $(lintian_overrides)/$(package); \'
    echo '    fi; \'
    echo '    if test -f debian/linda; then \'
    echo '        $(INSTALL_DIR) $(linda_overrides); \'
    echo '        $(INSTALL_FILE) debian/linda $(linda_overrides)/$(package); \'
    echo '    fi'
    echo 'endef'

    echo '# for installing multiple lintian and linda overrides.'
    echo 'define INSTALL_OVERRIDES'
    echo '    for p in `dh_listpackages`; do \'
    echo '        if test -f debian/$$p.override; then \'
    echo '            $(INSTALL_DIR) $(lintian_overrides); \'
    echo '            $(INSTALL_FILE) debian/$$p.override $(lintian_overrides)/$$p; \'
    echo '        fi; \'
    echo '        if test -f debian/$$p.linda; then \'
    echo '            $(INSTALL_DIR) $(linda_overrides); \'
    echo '            $(INSTALL_FILE) debian/$$p.linda $(linda_overrides)/$$p; \'
    echo '        fi; \'
    echo '    done '
    echo 'endef'

    echo '# Make common links for docs.'
    echo 'define MAKE_COMMON_DOC_LINKS'
    echo '    for p in `dh_listpackages`; do \'
    echo '        for i in `find $(tmp)/$(kde_htmldir) -type d -name $$p`; do \'
    echo '            ln -v -f -n -s ../common $$i/common; \'
    echo '        done; \'
    echo '    done'
    echo 'endef'

    echo '# Make standard documentation links.'
    echo 'define MAKE_STANDARD_DOC_LINKS'
    echo '    for p in `dh_listpackages`; do \'
    echo '        if [ -d debian/$$p/usr/share/doc/kde/HTML/en/$$p ]; then \'
    echo '            dh_link -p$$p  usr/share/doc/kde/HTML/en/$$p usr/share/doc/$$p/html; \'
    echo '        fi; \'
    echo '    done'
    echo 'endef'

    echo '# Generate HTML docs.'
    echo 'define GENERATE_HTML_DOCS'
    echo '    for f in `find $(tmp) -name "index.docbook"`; do \'
    echo '        (cd `dirname $$f`; KDEROOTHOME=$${KDEHOME:-~/.kde} meinproc `basename $$f`); \'
    echo '    done'
    echo 'endef'

    echo "configkde=$enable_debug --disable-rpath --with-pic --prefix=\$(kde_prefix) --libexecdir=\$(kde_bindir) --sysconfdir=\$(sysconfdir) --libdir=\$(kde_libdir) --includedir=\$(kde_includedir) --with-qt-includes=/usr/include/qt3 --with-qt-libraries=/usr/lib --mandir=\$(mandir) --infodir=\$(infodir) $XINERAMA"
    #echo "configkdevelop=$enable_debug --disable-rpath --enable-docbase --enable-kdoc2 --libdir=\$(kde_libdir) --includedir=\$(kde_includedir) --with-qt-includes=/usr/include/qt3 --mandir=\$(mandir) --with-kdelibsdoc-dir=/usr/share/doc/kdelibs3-doc/html"
elif [ "$1" == "echoglobals" ]; then
    echo "[Directories]"
    echo "dir_config=$kde_confdir"
    echo "dir_tmp=/tmp"
    echo "dir_socket=/tmp"
    echo "dir_exe=$kde_bindir"
    echo "dir_lib=$kde_libdir"
    echo "dir_cgi=$kde_cgidir"
    echo "dir_module=$kde_moduledir"
    echo "dir_style=$kde_styledir"
    echo "dir_widget=$kde_widgetdir"
    echo "dir_apps=$kde_appsdir"
    echo "dir_data=$kde_datadir"
    echo "dir_html=$kde_htmldir"
    echo "dir_icon=$kde_icondir"
    echo "dir_locale=$kde_locale"
    echo "dir_mime=$kde_mimedir"
    echo "dir_services=$kde_servicesdir"
    echo "dir_servicetypes=$kde_servicetypesdir"
    echo "dir_sound=$kde_sounddir"
    echo "dir_templates=$kde_templatesdir"
    echo "dir_wallpaper=$kde_wallpaperdir"
    echo "dir_toolbar=$kde_toolbardir"
    echo "[General]"
    echo "TerminalApplication=x-terminal-emulator"
fi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+w9MGMtlM9PL9yocRAl6JAKCOD6A432OzOhiIF9WFhbOszxyogQCeKpqG
MF2s8xZHOTr7t1aIw/KK4XE=
=czRo
-----END PGP SIGNATURE-----



Reply to: