#!/bin/bash

cp -a postgresql.changes postgresql-libs.changes
cp -a postgresql.spec postgresql-libs.spec

sed -i \
    -e 's/%define buildmain .*/%define buildmain 1/' \
    -e 's/%define buildlibs .*/%define buildlibs 0/' \
    postgresql.spec

sed -i \
    -e '/^Name:/s/postgresql/&-libs/g' \
    -e 's/%define buildmain .*/%define buildmain 0/' \
    -e 's/%define buildlibs .*/%define buildlibs 1/' \
    postgresql-libs.spec

diff -u postgresql.spec postgresql-libs.spec
