Patch title: Release 85 bulk changes
Abstract:
File: /pliant/install/pack-archive
Key:
    Removed line
    Added line
   
#!/bin/pliant
module "/pliant/language/context.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
module "/pliant/admin/execute.pli"
module "/pliant/admin/asciifile.pli"

(gvar AsciiFile current) load "/pliant/util/crypto/legal.pli"

(gvar AsciiFile legal) load "/pliant/util/crypto/legal.pli"
legal set "constant" "max_legal_key_bits" "constant max_legal_key_bits 128"
legal store

gvar Str release := string pliant_release_number
if pliant_root_path<>"/pliant/"
  error error_id_unexpected "Pliant path should be /pliant/"

file_tree_create "/archive/"
gvar Array:FileInfo files := file_list "/archive/" standard
for (gvar Int i) 0 files:size-1
  if files:i:extension=".tgz" or files:i:extension=".zip" or files:i:extension=".deb"
    file_delete files:i:name
file_tree_rights "/" 0 0 6*64+4*8+4 1*64+3*8+3 7*64+5*8+5 2*8+2
files := file_list "/binary/" standard
for i 0 files:size-1
  if files:i:extension=".exe"
    execute "strip --remove-section=.comment --remove-section=.note "+(file_os_name files:i:name)
    file_rights files:i:name undefined undefined 64+8+1 0
files := file_list "/pliant/install/" standard
for i 0 files:size-1
  if files:i:extension=""
    file_rights files:i:name undefined undefined 64+8+1 0
file_rights "/pliant/protocol/lpr/lpr" undefined undefined 64+8+1 0
file_rights "/pliant/sample/os_level_arguments.pli" undefined undefined 64+8+1 0

# Linux and posix
execute "tar -zcv -P -f /pliant/archive/pliant-"+release+".tgz /pliant/index.page /pliant/pliant/ /pliant/binary/pliant-debug0.exe /pliant/binary/pliant-debug1.exe /pliant/binary/pliant-debug2.exe /pliant/binary/forever.exe --exclude /pliant/pliant/install/pack-archive"

gvar Str deb := "file:/tmp/pliant/"
file_tree_delete deb
file_tree_create deb
file_tree_copy "/pliant/" deb+"usr/share/pliant/pliant/"
file_tree_create deb+"usr/share/pliant/binary/"
file_copy "/binary/pliant-debug0.exe" deb+"usr/share/pliant/binary/pliant-debug0.exe"
file_copy "/binary/pliant-debug1.exe" deb+"usr/share/pliant/binary/pliant-debug1.exe"
file_copy "/binary/pliant-debug2.exe" deb+"usr/share/pliant/binary/pliant-debug2.exe"
file_copy "/index.page" deb+"usr/share/pliant/index.page"
(gvar Stream s) open deb+"DEBIAN/control" out+safe+mkdir
s writeline "Package: pliant"
s writeline "Version: "+release
s writeline "Section: unknown"
s writeline "Priority: optional"
s writeline "Architecture: i386"
s writeline "Depends: libc6, zlib1g"
s writeline "Maintainer: Hubert Tonneau <hubert.tonneau@pliant.cx>"
s writeline "Description: The Pliant programming language and applications"
s writeline " Pliant is a efficient, extensible, dynamicaly compiled language."
s writeline " Build in applications include HTTP, SMTP, POP3, FTP, DNS servers,"
s writeline " a web mail, files browser, forums, etc."
s writeline " See http://pliant.cx/ for extra details."
s close
s open deb+"DEBIAN/postinst" out+safe
s writeline "#!/bin/sh"
s writeline "/usr/share/pliant/pliant/install/install root /usr/share/pliant/"
s close
file_rights deb+"DEBIAN/postinst" undefined undefined 8^2+8+1 0
s open deb+"DEBIAN/prerm" out+safe
s writeline "#!/bin/sh"
s writeline "rm /usr/share/pliant/binary/*.dump"
s close
file_rights deb+"DEBIAN/prerm" undefined undefined 8^2+8+1 0
file_tree_create deb+"etc/pliant/"
file_tree_create deb+"var/lib/pliant/"
execute "dpkg-deb -b "+file_os_name:deb+" /pliant/archive/pliant_"+release+".deb"
file_tree_delete deb

file_move "/binary/" "/archive/linux-i386"

# Win32
file_move "/archive/win32-i386/" "/binary"
execute "zip /pliant/archive/pliant-"+release+".zip -9 -r /pliant/index.page /pliant/pliant/ /pliant/binary/pliant-debug0.exe /pliant/binary/pliant-debug1.exe /pliant/binary/pliant-debug2.exe /pliant/binary/pliant-debug0.dll /pliant/binary/pliant-debug1.dll /pliant/binary/pliant-debug2.dll /pliant/binary/zlib.dll /pliant/binary/libjpeg.dll -x /pliant/pliant/install/pack-archive" path "file:/" quiet
file_move "/binary/" "/archive/win32-i386"

if (file_query "file:/pliant/archive/os2-i386/pliant-debug0.exe" standard)=defined
  # OS/2
  file_move "/archive/os2-i386" "/binary"
  execute "zip /pliant/archive/pliant-"+release+"-os2.zip -9 -r /pliant/index.page /pliant/pliant/ /pliant/binary/pliant-debug0.exe /pliant/binary/pliant-debug1.exe /pliant/binary/pliant-debug2.exe /pliant/binary/pliant-0.dll /pliant/binary/pliant-1.dll /pliant/binary/pliant-2.dll -x /pliant/pliant/install/pack-archive" path "file:/" quiet
  file_move "/binary/" "/archive/os2-i386"

file_move "/archive/linux-i386/" "/binary"
execute "chown -R me.users /pliant/"

current store

# file_tree_delete "file:/current/"
# file_extract "file:/pliant/archive/pliant-71.tgz" "file:/current/"