#!/bin/sh

function fail {
    echo Something failed.  Too bad.
    exit 1
}

rm -f PolicyKit-doc.spec.tmp

cat PolicyKit.spec \
    | sed 's/^Name: *PolicyKit/Name:           PolicyKit-doc/g' \
    | sed 's/^%define *build_doc 0/%define         build_doc 1/g' \
    > PolicyKit-doc.spec.tmp || fail

mv PolicyKit-doc.spec.tmp PolicyKit-doc.spec || fail

echo Fixed up PolicyKit-doc.spec.

cp PolicyKit.changes PolicyKit-doc.changes

echo Copied PolicyKit.changes to PolicyKit-doc.changes

