File ant-antlr-prepare.sh of Package ant-antlr

#!/bin/sh

# This script is based on log4j's jpackage-mini-prepare (thanks to sbrabec@suse.cz)
# create an ant-antlr spec for build of aditional ant plugins
#
#Usage:
# 1.) add these two lines below into the spec file including hash sign (#)
#     behind the Name: tag
#   # This line is not a comment, please do not remove it!
#   #%(sh %{_sourcedir}/ant-antlr-prepare.sh %{_sourcedir} %{name})
# 2.) you need to define a bootstrap macro with value 1
#
# How it works:
# 1.) Was called by rpmbuild (or Re, or should be invoked manually from command line)
# 2.) Rename the package name to ant-antlr
# 3.) Redefine the bootstrap macro to 0
# 4.) Add an explicit Provides to real name


ORIG_SPEC=${2%-antlr}
# Never update -antlr 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. Use the ${ORIG_SPEC}.spec! #####\n"
sed "s/^%define bootstrap.*$/${EDIT_WARNING}%define bootstrap 0/;
     s/^\(Name:.*\)$/\1-antlr/;
    " < ${1}/${ORIG_SPEC}.spec > ${1}/${ORIG_SPEC}-antlr.spec

#cp -a ${1}/${ORIG_SPEC}.changes ${1}/${ORIG_SPEC}-mini.changes
openSUSE Build Service is sponsored by