#!/bin/bash

# We need bash for read -p.

set -x
git clone ../groff
git clone ../gnulib
cd groff/
./bootstrap --copy --gnulib-srcdir=../gnulib
./configure
make -j1
make dist-xz
mv groff*.tar.xz ..
cd ../
read -p "rm -rf groff? "
rm -rf groff
tar xf groff*.tar.xz
read -p "rm -r groff*.tar.xz? "
rm -r groff*.tar.xz
mv groff* groff
read -p "rm -rf groff/.git? "
rm -rf groff/.git
tar czf groff.tar.gz groff
read -p "rm -rf groff? "
rm -rf groff
tar xf groff.tar.gz
cd groff/
PAGE=letter ./configure --prefix=/usr
make -j1
