#!/bin/sh

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

rm -f hal-doc.spec.tmp

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

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

echo Fixed up hal-doc.spec.

cp hal.changes hal-doc.changes

echo Copied hal.changes to hal-doc.changes

