#!/bin/bash # Autobuild doesn't support package names with macros. This script will update versions in package names. ORIG_SPEC=${2%-mono} # Never update -mono file when it is already opened. It will break advanced build scripts: if test "$2" != "$ORIG_SPEC" ; then exit fi if ! test -f $1/$ORIG_SPEC.spec ; then exit fi for PKGNAME in avahi-client avahi-common avahi-core avahi-ui avahi-glib avahi-gobject avahi-qt3 avahi-qt4 ; do # Packages with name ending by number needs separator if test x`echo $PKGNAME | sed "s/.*[0-9]$//"` = x ; then SEPARATOR=- else SEPARATOR= fi sed -i " 1,/%changelog/ { # Copy ${PKGNAME//-/_}_soname to hold space /^%define ${PKGNAME//-/_}_soname / { h; s/^%define ${PKGNAME//-/_}_soname //; x; }; # Update ${PKGNAME}_soname everywhere /$PKGNAME$SEPARATOR[0-9][0-9]*\([[:space:]].*\|\)\$/ { G; s/$PKGNAME$SEPARATOR[0-9][0-9]*\([[:space:]].*\|\)\n\(.*\)/$PKGNAME$SEPARATOR\2\1/; }; };" $1/$ORIG_SPEC.spec done # Edit file to fit -mono build needs: sed ' s/build_mono\ 0/build_mono 1/; s/^.ame:.*/&-mono/; # No more needed. #s/^..hangelog.*/& mono/; s/^\(# WARNING:\).*After editing.*/\1 Do not edit this auto generated file./ ' <$1/$ORIG_SPEC.spec >$1/$ORIG_SPEC-mono.spec # Not wanted for avahi: #cp -a $1/$ORIG_SPEC.changes $1/$ORIG_SPEC-mono.changes