1b266ab760aaf106cba8a393d51be4b308e07a69
[privoxy.git] / genclspec.sh
1 #!/bin/sh
2
3 VERSION=`cat privoxy-rh.spec | sed -n -e 's/^Version:[ ]*//p'`
4 RELEASE=`cat privoxy-rh.spec | sed -n -e 's/^Release:[ ]*//p'`
5 CLTAG=${VERSION}-${RELEASE}cl
6
7 PACKAGER=`rpm --eval "%{packager}"`
8 if [ "${PACKAGER}" = "%{packager}" ]; then
9         PACKAGER="genclspec script <developers@privoxy.org>"
10 fi
11
12 export LC_ALL=
13 export LANG=
14 DATETAG=`date "+%a %b %d %Y"`
15
16 if [ -r privoxy-cl.spec ]; then
17         echo Old CL specfile found. Removing it.
18 fi
19
20 cat privoxy-rh.spec | sed -e 's/^\(Release:[ ]*[^ ]\+\)[ ]*$/\1cl/' \
21                           -e "/^%changelog/a* ${DATETAG} ${PACKAGER}" \
22                           -e "/^%changelog/a+ privoxy-${CLTAG}" \
23                           -e "/^%changelog/a- Packaging for Conectiva Linux (automatic genarated specfile)" \
24                           -e '/^%changelog/a \
25 ' > privoxy-cl.spec
26