File eclipse-prepare.sh of Package eclipse-archdep
#!/bin/sh
# Based on libcdio_spec-prepare.sh (thanks to sbrabec@suse.cz)
#
# usage - add the two lines below into the spec file including hash sign (#)
# This line is not a comment, please do not remove it!
#%(sh %{_sourcedir}/eclipse-prepare.sh %{_sourcedir} %{name})
ORIG_SPEC=${2%-archdep}
# Never update -mini file when it is already opened. It will break advanced build scripts:
if [[ "${2}" != "${ORIG_SPEC}" ]]; then
exit
fi
if [[ ! -f ${1}/${ORIG_SPEC}.spec ]] ; then
exit
fi
EDIT_WARNING="# WARNING: please do not edit this auto generated spec file. See ${ORIG_SPEC}.spec!\n"
sed "s/^%define build_archdep.*$/${EDIT_WARNING}%define build_archdep 1/" ${1}/${ORIG_SPEC}.spec | sed 's/^\(Name:.*\)$/\1-archdep/' > ${1}/${ORIG_SPEC}-archdep.spec
cp -a $1/$ORIG_SPEC.changes $1/$ORIG_SPEC-archdep.changes