#!/bin/sh -e

export CVSROOT="$1"

if [ -z "$CVSROOT" ]; then
	echo "Usage: ${0##*/} <cvs-root>" >&2
	exit 1
fi

cvs init
cd "$CVSROOT"
install -d -m 2750 -g cvs .
chgrp -R cvsadmin CVSROOT ||:
chmod 2775 CVSROOT
touch CVSROOT/{history,val-tags,commitlog,taglog} ||:
chgrp cvs CVSROOT/{history,val-tags,commitlog,taglog} ||:
chmod 664 CVSROOT/{history,val-tags,commitlog,taglog} ||:
chattr +a CVSROOT/{history,commitlog,taglog} ||:
