#!/bin/tcsh

if ( $#argv == 0 ) then
  echo "usage: mkinfo <version> <revision>" 
  exit (1)
endif

if ($#argv == 1 ) then
   set revision = 1
else
   set revision = $2
endif

set versiondot = $1:s/_/./
set versionu = $1:s/./_/
set filename = acedb_$versiondot-$revision.info       # underscore to be consistent with .deb filename

echo "Package: acedb" >$filename
echo "Version: $versiondot" >>$filename
echo "Revision: $revision" >>$filename
echo "Source: http://www.acedb.org/Software/Downloads/MONTHLY/ACEDB-source.$versionu.tar.gz" >>$filename
cat >>$filename << EOF
NoSourceDirectory: true
CompileScript: <<
 make ACEDB_MACHINE=DARWIN_4
<<
InstallScript: <<
install -d %i/bin
install -o root -g wheel bin.DARWIN_4/xace %i/bin
install -o root -g wheel bin.DARWIN_4/tace %i/bin
install -o root -g wheel bin.DARWIN_4/giface %i/bin
install -o root -g wheel bin.DARWIN_4/acediff %i/bin
install -o root -g wheel bin.DARWIN_4/saceserver %i/bin
install -o root -g wheel bin.DARWIN_4/saceclient %i/bin
install -o root -g wheel bin.DARWIN_4/sxaceclient %i/bin
install -o root -g wheel bin.DARWIN_4/xremote %i/bin
install -d %i/share/acedb
mv whelp %i/share/acedb
mv wtools %i/share/acedb
mv wscripts %i/share/acedb
install -d %i/share/acedb/wspec
mv wspec/gtkrc wspec/displays.wrm wspec/cachesize.wrm %i/share/acedb/wspec
mv wspec/database.wrm wspec/psfonts.wrm %i/share/acedb/wspec
chown -R root %i/share/acedb
chgrp -R wheel %i/share/acedb
install -d %i/share/doc
mv wdoc %i/share/doc/acedb
chown -R root %i/share/doc/acedb
chgrp -R wheel %i/share/doc/acedb
<<
Description: Open Source genome database
<<
License: GPL/LGPL
Homepage: http://www.acedb.org/
Maintainer: Rob Clack <rnc@sanger.ac.
uk>
Depends: x11, readline, gtk+ 
EOF

