#!/bin/sh

# Topal: GPG/GnuPG and Alpine/Pine integration
# Copyright (C) 2001--2008  Phillip J. Brooke
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

	cat > help.ads <<EOF
-- Topal: GPG/GnuPG and Alpine/Pine integration
-- Copyright (C) 2001--2008  Phillip J. Brooke
-- 
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License version 3 as
-- published by the Free Software Foundation.
-- 
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
-- 
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.

-- Generated by a script.

package Help is

    procedure Message;
    procedure Disclaimer;

end Help;
EOF


	cat > help.adb <<EOF
-- Topal: GPG/GnuPG and Alpine/Pine integration
-- Copyright (C) 2001--2008  Phillip J. Brooke
-- 
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License version 3 as
-- published by the Free Software Foundation.
-- 
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
-- 
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.

-- Generated by a script.

with Ada.Text_IO;

package body Help is

    procedure Message is
       use Ada.Text_IO;
    begin
EOF

expand help.txt | sed 's/"/""/g' | sed 's/^/      Put_Line("/' | sed 's/$/");/' >> help.adb

	cat >> help.adb <<EOF
        Flush;
    exception
      when others =>
         Put_Line(Standard_Error,
                  "Exception raised in Help.Message");
         raise;
    end Message; 

    procedure Disclaimer is
       use Ada.Text_IO;
    begin
EOF
	sed '6,13 ! d; s/#//' < mkhelp | sed 's/^/      Put_Line("/' | sed 's/$/");/' >> help.adb
	cat >> help.adb <<EOF
        Flush;
    exception
      when others =>
         Put_Line(Standard_Error,
                  "Exception raised in Help.Disclaimer");
         raise;
    end Disclaimer; 

end Help;
EOF


