2007-10-11 18:55:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Autobuild doesn't support package names with macros. This script will update versions in package names.
|
|
|
|
|
|
|
|
ORIG_SPEC=${2%-mono}
|
2008-03-10 02:27:42 +01:00
|
|
|
ORIG_SPEC=${ORIG_SPEC%-qt4}
|
2007-10-11 18:55:38 +02:00
|
|
|
# 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
|
|
|
|
|
2008-03-10 02:27:42 +01:00
|
|
|
for PKGNAME in avahi-client avahi-common avahi-core avahi-ui avahi-glib avahi-gobject avahi-qt4 ; do
|
2007-10-11 18:55:38 +02:00
|
|
|
# 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 '
|
2008-10-23 22:26:18 +02:00
|
|
|
s/spec file for package avahi/spec file for package avahi-mono/;
|
2008-03-10 02:27:42 +01:00
|
|
|
s/build_core\ 1/build_core 0/;
|
2007-10-11 18:55:38 +02:00
|
|
|
s/build_mono\ 0/build_mono 1/;
|
|
|
|
s/^.ame:.*/&-mono/;
|
|
|
|
# No more needed.
|
|
|
|
#s/^..hangelog.*/& mono/;
|
2008-03-10 02:27:42 +01:00
|
|
|
/^# WARNING: After editing/,/^# to update spec files/d
|
|
|
|
/^%define[[:space:]]*_name/i \
|
|
|
|
# Do not edit this auto generated file! Edit avahi.spec.
|
2009-08-17 14:20:47 +02:00
|
|
|
' <$1/$ORIG_SPEC.spec >$1/$ORIG_SPEC-mono.spec.new
|
|
|
|
perl $1/update_spec.pl $1/$ORIG_SPEC-mono.spec.new attributes > $1/$ORIG_SPEC-mono.spec
|
|
|
|
rm $1/$ORIG_SPEC-mono.spec.new
|
2007-10-11 18:55:38 +02:00
|
|
|
|
2008-07-18 22:22:24 +02:00
|
|
|
# Edit file to fit -glib2 build needs:
|
|
|
|
sed '
|
2008-10-23 22:26:18 +02:00
|
|
|
s/spec file for package avahi/spec file for package avahi-glib2/;
|
2008-07-18 22:22:24 +02:00
|
|
|
s/build_core\ 1/build_core 0/;
|
|
|
|
s/build_glib2\ 0/build_glib2 1/;
|
|
|
|
s/^.ame:.*/&-glib2/;
|
|
|
|
# No more needed.
|
|
|
|
#s/^..hangelog.*/& qt/;
|
|
|
|
/^# WARNING: After editing/,/^# to update spec files/d
|
|
|
|
/^%define[[:space:]]*_name/i \
|
|
|
|
# Do not edit this auto generated file! Edit avahi.spec.
|
2009-08-17 14:20:47 +02:00
|
|
|
' <$1/$ORIG_SPEC.spec >$1/$ORIG_SPEC-glib2.spec.new
|
|
|
|
perl $1/update_spec.pl $1/$ORIG_SPEC-glib2.spec.new attributes > $1/$ORIG_SPEC-glib2.spec
|
|
|
|
rm $1/$ORIG_SPEC-glib2.spec.new
|
2008-07-18 22:22:24 +02:00
|
|
|
|
2008-03-10 02:27:42 +01:00
|
|
|
# Edit file to fit -qt4 build needs:
|
|
|
|
sed '
|
2008-10-23 22:26:18 +02:00
|
|
|
s/spec file for package avahi/spec file for package avahi-qt4/;
|
2008-03-10 02:27:42 +01:00
|
|
|
s/build_core\ 1/build_core 0/;
|
|
|
|
s/build_qt4\ 0/build_qt4 1/;
|
|
|
|
s/^.ame:.*/&-qt4/;
|
|
|
|
# No more needed.
|
|
|
|
#s/^..hangelog.*/& qt/;
|
|
|
|
/^# WARNING: After editing/,/^# to update spec files/d
|
|
|
|
/^%define[[:space:]]*_name/i \
|
|
|
|
# Do not edit this auto generated file! Edit avahi.spec.
|
2009-08-17 14:20:47 +02:00
|
|
|
' <$1/$ORIG_SPEC.spec >$1/$ORIG_SPEC-qt4.spec.new
|
|
|
|
perl $1/update_spec.pl $1/$ORIG_SPEC-qt4.spec.new attributes > $1/$ORIG_SPEC-qt4.spec
|
|
|
|
rm $1/$ORIG_SPEC-qt4.spec.new
|
|
|
|
|
2008-03-10 02:27:42 +01:00
|
|
|
|
2007-10-11 18:55:38 +02:00
|
|
|
# Not wanted for avahi:
|
2008-07-18 22:22:24 +02:00
|
|
|
#cp -a $1/$ORIG_SPEC.changes $1/$ORIG_SPEC-glib2.changes
|
2007-10-11 18:55:38 +02:00
|
|
|
#cp -a $1/$ORIG_SPEC.changes $1/$ORIG_SPEC-mono.changes
|
2008-03-10 02:27:42 +01:00
|
|
|
#cp -a $1/$ORIG_SPEC.changes $1/$ORIG_SPEC-qt.changes
|