summaryrefslogtreecommitdiffstats
path: root/pearup
blob: e25635176cc4b3edd02448ed27c19f9dbc8fbb10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

vendor="Remi Collet <remi@fedoraproject.org>"
rpmdate=$(LC_ALL="C" date +"%a %b %d %Y")

if [ $# -lt 2 ]; then
    echo "usage $0 old new"
    exit 1
fi

if ! grep -q pecl_name *spec; then
sed -e '/^Release:/s/[0-9].*$/1%{?dist}/' \
    -i *spec
fi
sed -e "/^Version:/s/$1/$2/" \
    -e "s/%changelog/%changelog\n* $rpmdate $vendor - $2-1\n- Update to $2\n/" \
    -e 's/\$RPM_BUILD_ROOT/%{buildroot}/' \
    -e '/Conflicts:/s/>=/< /' \
    -e 's/Conflicts:/Requires: /' \
    -i *spec

spectool -g -S *spec

tar xf *-$1.tgz package.xml && mv package.xml package-$1.xml
tar xf *-$2.tgz package.xml && mv package.xml package-$2.xml

colordiff -u package-$1.xml package-$2.xml