Permalink
Browse files

requested ported commit

  • Loading branch information...
0 parents commit e1434f447c7247d5b4e8614cf12629939540a673 @jfclere jfclere committed Aug 5, 2009
Showing with 19,752 additions and 0 deletions.
  1. +146 −0 JBossORG-EULA.txt
  2. +344 −0 build/NMAKEcommon.inc
  3. +109 −0 build/build.txt
  4. +63 −0 build/daemon/buildall.bat
  5. +57 −0 build/daemon/buildall.sh
  6. +27 −0 build/daemon/release.sh
  7. +103 −0 build/daemon/unixbuild.sh
  8. +64 −0 build/daemon/windowsbuild.bat
  9. +307 −0 build/install/README
  10. +101 −0 build/install/installer/NMAKEmakefile
  11. +54 −0 build/install/installer/consts.h
  12. +64 −0 build/install/installer/crc32.c
  13. +227 −0 build/install/installer/crctab.c
  14. +583 −0 build/install/installer/crypt.c
  15. +175 −0 build/install/installer/crypt.h
  16. +358 −0 build/install/installer/dhtml.c
  17. +284 −0 build/install/installer/ebcdic.h
  18. +2,396 −0 build/install/installer/extract.c
  19. +2,575 −0 build/install/installer/fileio.c
  20. +215 −0 build/install/installer/globals.c
  21. +430 −0 build/install/installer/globals.h
  22. +322 −0 build/install/installer/gui.c
  23. +1,548 −0 build/install/installer/inflate.c
  24. +39 −0 build/install/installer/inflate.h
  25. +17 −0 build/install/installer/installers/jbossas/README
  26. +1 −0 build/install/installer/installers/jbossas/_install/README
  27. +225 −0 build/install/installer/installers/jbossas/_install/eula.htm
  28. +147 −0 build/install/installer/installers/jbossas/_install/eulamain.htm
  29. +122 −0 build/install/installer/installers/jbossas/_install/install.bat
  30. BIN build/install/installer/installers/jbossas/_install/jbosstop.png
  31. BIN build/install/installer/installers/jbossas/_install/redhat16.png
  32. +1,374 −0 build/install/installer/main.c
  33. +356 −0 build/install/installer/match.c
  34. +1,679 −0 build/install/installer/process.c
  35. +10 −0 build/install/installer/res/commonc.manifest
  36. +225 −0 build/install/installer/res/eula.htm
  37. +47 −0 build/install/installer/res/eula.rtf
  38. +147 −0 build/install/installer/res/eulamain.htm
  39. BIN build/install/installer/res/jboss.ico
  40. BIN build/install/installer/res/jbosstop.bmp
  41. BIN build/install/installer/res/jbosstop.png
  42. BIN build/install/installer/res/jbrhorg.png
  43. +590 −0 build/install/installer/res/lgpl.htm
  44. +85 −0 build/install/installer/res/lgpl.rtf
  45. +147 −0 build/install/installer/res/lgplmain.htm
  46. BIN build/install/installer/res/redhat.ico
  47. BIN build/install/installer/res/redhat16.png
  48. BIN build/install/installer/res/redhat32.png
  49. BIN build/install/installer/res/redhat48.png
  50. +88 −0 build/install/installer/res/splash.htm
  51. +147 −0 build/install/installer/sinstall.h
  52. +127 −0 build/install/installer/sinstall.rc
  53. +700 −0 build/install/installer/ttyio.c
  54. +227 −0 build/install/installer/ttyio.h
  55. +2,042 −0 build/install/installer/unzip.c
  56. +658 −0 build/install/installer/unzip.h
Sorry, we could not display the entire diff because too many files (684) changed.
146 JBossORG-EULA.txt
@@ -0,0 +1,146 @@
+LICENSE AGREEMENT
+JBOSS(r)
+
+This License Agreement governs the use of the Software Packages and any
+updates to the Software Packages, regardless of the delivery mechanism.
+Each Software Package is a collective work under U.S. Copyright Law.
+Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to the
+user ("Client") a license to the applicable collective work(s) pursuant
+to the GNU Lesser General Public License v. 2.1 except for the following
+Software Packages:
+
+(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is
+licensed pursuant to the GNU General Public License v.2;
+
+(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0;
+
+(c) an optional download for JBoss Cache for the Berkeley DB for Java
+database, which is licensed under the (open source) Sleepycat License
+(if Client does not wish to use the open source version of this database,
+it may purchase a license from Sleepycat Software);
+
+and (d) the BPEL extension for JBoss jBPM, which is licensed under the
+Common Public License v.1, and, pursuant to the OASIS BPEL4WS standard,
+requires parties wishing to redistribute to enter various royalty-free
+patent licenses.
+
+Each of the foregoing licenses is available at
+http://www.opensource.org/licenses/index.php.
+
+1. The Software. "Software Packages" refer to the various software
+modules that are created and made available for distribution by the
+JBoss.org open source community at http://www.jboss.org. Each of the
+Software Packages may be comprised of hundreds of software components.
+The end user license agreement for each component is located in the
+component's source code. With the exception of certain image files
+identified in Section 2 below, the license terms for the components
+permit Client to copy, modify, and redistribute the component, in both
+source code and binary code forms. This agreement does not limit
+Client's rights under, or grant Client rights that supersede, the
+license terms of any particular component.
+
+2. Intellectual Property Rights. The Software Packages are owned by Red
+Hat and others and are protected under copyright and other laws. Title
+to the Software Packages and any component, or to any copy,
+modification, or merged portion shall remain with the aforementioned,
+subject to the applicable license. The "JBoss" trademark, "Red Hat"
+trademark, the individual Software Package trademarks, and the
+"Shadowman" logo are registered trademarks of Red Hat and its affiliates
+in the U.S. and other countries. This agreement permits Client to
+distribute unmodified copies of the Software Packages using the Red Hat
+trademarks that Red Hat has inserted in the Software Packages on the
+condition that Client follows Red Hat's trademark guidelines for those
+trademarks located at http://www.redhat.com/about/corporate/trademark/.
+Client must abide by these trademark guidelines when distributing the
+Software Packages, regardless of whether the Software Packages have been
+modified. If Client modifies the Software Packages, then Client must
+replace all Red Hat trademarks and logos identified at
+http://www.jboss.com/company/logos, unless a separate agreement with Red
+Hat is executed or other permission granted. Merely deleting the files
+containing the Red Hat trademarks may corrupt the Software Packages.
+
+3. Limited Warranty. Except as specifically stated in this Paragraph 3
+or a license for a particular component, to the maximum extent permitted
+under applicable law, the Software Packages and the components are
+provided and licensed "as is" without warranty of any kind, expressed or
+implied, including the implied warranties of merchantability,
+non-infringement or fitness for a particular purpose. Red Hat warrants
+that the media on which Software Packages may be furnished will be free
+from defects in materials and manufacture under normal use for a period
+of 30 days from the date of delivery to Client. Red Hat does not warrant
+that the functions contained in the Software Packages will meet Client's
+requirements or that the operation of the Software Packages will be
+entirely error free or appear precisely as described in the accompanying
+documentation. This warranty extends only to the party that purchases
+the Services pertaining to the Software Packages from Red Hat or a Red
+Hat authorized distributor.
+
+4. Limitation of Remedies and Liability. To the maximum extent permitted
+by applicable law, the remedies described below are accepted by Client
+as its only remedies. Red Hat's entire liability, and Client's exclusive
+remedies, shall be: If the Software media is defective, Client may
+return it within 30 days of delivery along with a copy of Client's
+payment receipt and Red Hat, at its option, will replace it or refund
+the money paid by Client for the Software. To the maximum extent
+permitted by applicable law, Red Hat or any Red Hat authorized dealer
+will not be liable to Client for any incidental or consequential
+damages, including lost profits or lost savings arising out of the use
+or inability to use the Software, even if Red Hat or such dealer has
+been advised of the possibility of such damages. In no event shall Red
+Hat's liability under this agreement exceed the amount that Client paid
+to Red Hat under this Agreement during the twelve months preceding the
+action.
+
+5. Export Control. As required by U.S. law, Client represents and
+warrants that it:
+(a) understands that the Software Packages are subject to export
+controls under the U.S. Commerce Department's Export Administration
+Regulations ("EAR");
+
+(b) is not located in a prohibited destination country under the EAR or
+U.S. sanctions regulations (currently Cuba, Iran, Iraq, Libya, North
+Korea, Sudan and Syria);
+
+(c) will not export, re-export, or transfer the Software Packages to any
+prohibited destination, entity, or individual without the necessary
+export license(s) or authorizations(s) from the U.S. Government;
+
+(d) will not use or transfer the Software Packages for use in any
+sensitive nuclear, chemical or biological weapons, or missile technology
+end-uses unless authorized by the U.S. Government by regulation or
+specific license;
+
+(e) understands and agrees that if it is in the United States and
+exports or transfers the Software Packages to eligible end users, it
+will, as required by EAR Section 740.17(e), submit semi-annual reports
+to the Commerce Department's Bureau of Industry & Security (BIS), which
+include the name and address (including country) of each transferee;
+
+and (f) understands that countries other than the United States may
+restrict the import, use, or export of encryption products and that it
+shall be solely responsible for compliance with any such import, use, or
+export restrictions.
+
+6. Third Party Programs. Red Hat may distribute third party software
+programs with the Software Packages that are not part of the Software
+Packages and which Client must install separately. These third party
+programs are subject to their own license terms. The license terms
+either accompany the programs or can be viewed at
+http://www.redhat.com/licenses/. If Client does not agree to abide by
+the applicable license terms for such programs, then Client may not
+install them. If Client wishes to install the programs on more than one
+system or transfer the programs to another party, then Client must
+contact the licensor of the programs.
+
+7. General. If any provision of this agreement is held to be
+unenforceable, that shall not affect the enforceability of the remaining
+provisions. This License Agreement shall be governed by the laws of the
+State of North Carolina and of the United States, without regard to any
+conflict of laws provisions, except that the United Nations Convention
+on the International Sale of Goods shall not apply.
+
+Copyright 2006 Red Hat, Inc. All rights reserved.
+"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.
+All other trademarks are the property of their respective owners.
+
+Page 1 of 1 18 October 2006
344 build/NMAKEcommon.inc
@@ -0,0 +1,344 @@
+# Copyright 2001-2006 The Apache Software Foundation or its licensors, as
+# applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ====================================================================
+#
+# NMAKEcommon.inc Master makefile definitions.
+# This file defines CPU architecture and basic compiler
+# and linker parameters.
+# Common params:
+# CPU Compile for specified CPU. Supported CPU's are:
+# X86 (Common x86 architecture)
+# X64 (AMD64/EMT64 architecture)
+# I64 (Intel IA64 architecture)
+# If not specified it will default to the
+# PROCESSOR_ARCHITECTURE environment variable
+# or to the X86 if not specified.
+# WINVER Compile for specified Windows version
+# WINNT for Windows 2000 and up(default)
+# WINXP for Windows XP and up
+# WIN2003 for Windows 2003 and up
+# VSITA for Windows Vista and up
+# Deprecated targets (may not even compile):
+# NT4 for Windows NT4 and up
+# WIN9X for Windows 95, 98 and Me
+# BUILD Build version
+# RETAIL or RELEASE (default)
+# DEBUG
+# TARGET Build application target
+# EXE Console executable (default)
+# GUI Windows GUI executable
+# DLL Dynamic Link Library
+# LIB Static library
+# Environment variables used:
+# CFLAGS Added to the common CFLAGS
+# CPPFLAGS Added to the common CPPFLAGS
+# LIBS Added to the common LIBS
+# INCLUDES Added to the common INCLUDES
+# LFLAGS Added to the common LFLAGS
+# RCFLAGS Added to the common RCFLAGS
+#
+# Compiler tools environment variables:
+# CC C compiler (defaults to cl.exe)
+# LINK Linker (defaults to link.exe)
+# RC Resource compiler (defaults to rc.exe)
+# MT Manifest toolkit (defaults to mt.exe)
+# ML Assembler (defaults to ml.exe or ml64.exe)
+#
+# Originally contributed by Mladen Turk <mturk jboss.com>
+#
+# ====================================================================
+#
+
+!IF !DEFINED(CC) || "$(CC)" == ""
+CC = cl.exe
+!ENDIF
+
+!IF !DEFINED(LINK) || "$(LINK)" == ""
+LINK = link.exe
+!ENDIF
+
+!IF !DEFINED(RC) || "$(RC)" == ""
+RC = rc.exe
+!ENDIF
+
+!IF !DEFINED(MT) || "$(MT)" == ""
+MT = mt.exe
+!ENDIF
+
+# Read the PROCESSOR_ARCHITECTURE environment value for a CPU type
+
+!IF "$(BUILD_CPU)" == "i386" || "$(BUILD_CPU)" == "x86" || "$(BUILD_CPU)" == "i686"
+CPU=X86
+!ENDIF
+!IF "$(BUILD_CPU)" == "amd64" || "$(BUILD_CPU)" == "x86_64" || "$(BUILD_CPU)" == "x64"
+CPU=X64
+!ENDIF
+!IF "$(BUILD_CPU)" == "ia64" || "$(BUILD_CPU)" == "i64"
+CPU=I64
+!ENDIF
+
+!IF !DEFINED(CPU) || "$(CPU)" == ""
+!IF "$(PROCESSOR_ARCHITECTURE)" == ""
+!IF "$(PROCESSOR_ARCHITEW6432)" == ""
+CPU=X86
+!ELSE
+CPU=$(PROCESSOR_ARCHITEW6432)
+!ENDIF
+!ELSE
+CPU=$(PROCESSOR_ARCHITECTURE)
+!ENDIF
+!ENDIF
+
+
+!IF "$(CPU)" == "I386"
+CPU=X86
+!ENDIF
+!IF "$(CPU)" == "AMD64"
+CPU=X64
+!ENDIF
+!IF "$(CPU)" == "IA64"
+CPU=I64
+!ENDIF
+
+!IF "$(CPU)" != "X86"
+!IF "$(CPU)" != "X64"
+!IF "$(CPU)" != "I64"
+!ERROR Must specify CPU environment variable (X86, X64, I64) $(CPU)
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF !DEFINED(TARGET) || "$(TARGET)" == ""
+TARGET=EXE
+!ENDIF
+
+!IF "$(TARGET)" != "EXE"
+!IF "$(TARGET)" != "GUI"
+!IF "$(TARGET)" != "DLL"
+!IF "$(TARGET)" != "LIB"
+!ERROR Must specify TARGET environment variable (EXE, GUI, DLL, LIB)
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF !DEFINED(WINVER) || "$(WINVER)" == ""
+WINVER=WINXP
+!ENDIF
+
+
+!IF "$(WINVER)" != "WINNT"
+!IF "$(WINVER)" != "WINXP"
+!IF "$(WINVER)" != "WIN2003"
+!IF "$(WINVER)" != "NT4"
+!IF "$(WINVER)" != "WIN9X"
+!IF "$(WINVER)" != "WVSITA"
+!ERROR Must specify WINVER environment variable (WINNT, WINXP, WIN2003, VSITA, NT4, WIN9X)
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF "$(WINVER)" == "WINNT"
+NMAKE_WINVER = 0x0500
+_WIN32_IE = 0x0500
+!ELSEIF "$(WINVER)" == "WINXP"
+NMAKE_WINVER = 0x0501
+_WIN32_IE = 0x0600
+!ELSEIF "$(WINVER)" == "WIN2003"
+NMAKE_WINVER = 0x0502
+_WIN32_IE = 0x0600
+!ELSEIF "$(WINVER)" == "VSITA"
+NMAKE_WINVER = 0x0600
+_WIN32_IE = 0x0700
+!ELSEIF "$(WINVER)" == "NT4"
+NMAKE_WINVER = 0x0400
+_WIN32_IE = 0x0400
+!ELSE
+!ERROR Must specify WINVER environment variable (WINNT, WINXP, WIN2003, VSITA, NT4, WIN9X)
+!ENDIF
+
+!IF !DEFINED(NMAKE_WINVER) || "$(NMAKE_WINVER)" == ""
+NMAKE_WINVER = 0x0400
+_WIN32_IE = 0x0400
+NMAKE_WINNT = -D_WIN95 -D_WIN32_WINDOWS=$(NMAKE_WINVER) -DWINVER=$(NMAKE_WINVER) -D_WIN32_IE=$(_WIN32_IE)
+!ELSE
+NMAKE_WINNT = -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER) -DWINVER=$(NMAKE_WINVER) -D_WIN32_IE=$(_WIN32_IE)
+!ENDIF
+
+!IF !DEFINED(BUILD) || "$(BUILD)" == ""
+BUILD=RELEASE
+!ENDIF
+
+!IFDEF RELEASE
+BUILD=RELEASE
+!ENDIF
+
+!IFDEF DEBUG
+BUILD=DEBUG
+!ENDIF
+
+!IFDEF NODEBUG
+BUILD=RELEASE
+!ENDIF
+
+!IF "$(BUILD)" != "RELEASE"
+!IF "$(BUILD)" != "DEBUG"
+!ERROR Must specify BUILD environment variable (RELEASE, DEBUG)
+!ENDIF
+!ENDIF
+
+# Common flags for all platforms
+CMN_CFLAGS = -c -nologo -DWIN32 -D_WIN32 -D_WINDOWS $(NMAKE_WINNT) -W3
+!IF "$(TARGET)" == "EXE"
+CMN_CFLAGS = $(CMN_CFLAGS) -D_CONSOLE
+!ENDIF
+
+!IF "$(CPU)" == "X86"
+CPU_CFLAGS = -D_X86_=1
+MACHINE=X86
+!ELSEIF "$(CPU)" == "X64"
+CPU_CFLAGS = -D_AMD64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=AMD64
+!ELSEIF "$(CPU)" == "I64"
+CPU_CFLAGS = -D_IA64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=IA64
+!ENDIF
+
+!IF "$(INCLUDE_PRE64PRA)" == "1"
+!IF "$(CPU)" != "X86"
+CPU_CFLAGS = $(CPU_CFLAGS) /FIPRE64PRA.H
+!ENDIF
+!ENDIF
+
+!IF "$(BUILD)" == "RELEASE"
+!IF "$(CPU)" == "X86"
+OPT_CFLAGS = -O2 -Ob2 -Oy- -Zi -DNDEBUG
+!ELSE
+OPT_CFLAGS = -O2 -Ob2 -Zi -DNDEBUG
+!ENDIF
+!ELSE
+OPT_CFLAGS = -Od -Zi -DDEBUG -D_DEBUG
+!ENDIF
+
+!IF DEFINED(STATIC_CRT)
+CRT_CFLAGS = -D_MT -MT
+!ELSE
+CRT_CFLAGS = -D_MT -MD
+!ENDIF
+
+!IF "$(BUILD)" == "DEBUG"
+CRT_CFLAGS = $(CRT_CFLAGS)d
+!ENDIF
+
+CFLAGS = $(CMN_CFLAGS) $(CPU_CFLAGS) $(OPT_CFLAGS) $(CRT_CFLAGS) $(CFLAGS)
+
+!IF DEFINED(EXTRA_CFLAGS)
+CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
+!ENDIF
+
+
+# Linker section
+LIBS = kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib $(LIBS)
+!IF "$(INCLUDE_BUFFEROVERFLOWU)" == "1"
+!IF "$(CPU)" != "X86"
+LIBS = $(LIBS) bufferoverflowu.lib
+!ENDIF
+!ENDIF
+
+!IF DEFINED(EXTRA_LIBS)
+LIBS = $(LIBS) $(EXTRA_LIBS)
+!ENDIF
+
+COMMON_LFLAGS = /NOLOGO
+
+# Always add debugging to the linker
+OPT_LFLAGS = /INCREMENTAL:NO /DEBUG
+!IF "$(BUILD)" == "RELEASE"
+OPT_LFLAGS = /OPT:REF
+!ENDIF
+
+!IF "$(TARGET)" == "EXE"
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "GUI"
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "DLL"
+LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "LIB"
+LFLAGS = -lib $(COMMON_LFLAGS)
+!ENDIF
+
+!IF DEFINED(EXTRA_LFLAGS)
+LFLAGS = $(LFLAGS) $(EXTRA_LFLAGS)
+!ENDIF
+
+!IF "$(TARGET)" != "LIB"
+LFLAGS = $(LFLAGS) $(OPT_LFLAGS)
+!ENDIF
+
+# Resource compiler flags
+
+BASE_RCFLAGS=/l 0x409
+!IF "$(BUILD)" == "RELEASE"
+BASE_RCFLAGS = $(BASE_RCFLAGS) /d "NDEBUG"
+!ELSE
+BASE_RCFLAGS = $(BASE_RCFLAGS) /d "_DEBUG" /d "DEBUG"
+!ENDIF
+RCFLAGS = $(BASE_RCFLAGS) $(RCFLAGS)
+
+# Build Target dir e.g. WINNT_I386_RELEASE_DLL
+!IF !DEFINED(WORKDIR) || "$(WORKDIR)" == ""
+!IF !DEFINED(WORKDIR_EXT) || "$(WORKDIR_EXT)" == ""
+WORKDIR = $(WINVER)_$(CPU)_$(TARGET)_$(BUILD)
+WORKDIR_DLL = $(WINVER)_$(CPU)_DLL_$(BUILD)
+WORKDIR_LIB = $(WINVER)_$(CPU)_LIB_$(BUILD)
+WORKDIR_EXE = $(WINVER)_$(CPU)_EXE_$(BUILD)
+!ELSE
+WORKDIR = $(WINVER)_$(CPU)_$(BUILDIR_EXT)_$(BUILD)
+!ENDIF
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+CLEANTARGET=if exist "$(WORKDIR)\$(NULL)" rd /s /q $(WORKDIR)
+!ELSE
+CLEANTARGET=deltree /y $(BUILDIR)
+!ENDIF
+
+MAKEWORKDIR=if not exist "$(WORKDIR)\$(NULL)" mkdir $(WORKDIR)
+MAKEINSTALL=if not exist "$(INSTALLLOC)" mkdir $(INSTALLLOC)
+
+!IF DEFINED(JAVA_HOME) && "$(JAVA_HOME)" != ""
+JAVA_INCLUDES=-I "$(JAVA_HOME)\include"
+!IF "$(CPU)" != "X86"
+JAVA_INCLUDES=$(JAVA_INCLUDES) -I "$(JAVA_HOME)\include\win64"
+!ENDIF
+JAVA_INCLUDES=$(JAVA_INCLUDES) -I "$(JAVA_HOME)\include\win32"
+!ENDIF
+
+!IF !DEFINED(ML) || "$(ML)" == ""
+!IF "$(CPU)" == "X86"
+ML = ml.exe
+AFLAGS = /coff /Zi /c
+!ELSEIF "$(CPU)" == "X64"
+ML = ml64.exe
+AFLAGS = /Zi /c
+!ELSEIF "$(CPU)" == "I64"
+ML = ml64.exe
+AFLAGS = /coff /Zi /c
+!ENDIF
+!ENDIF
109 build/build.txt
@@ -0,0 +1,109 @@
+The subproject of jbossnative are build using the build.sh script
+
+Configuration file:
+The build.sh parses a file name pkg.list:
+jboss-native|2.0.0|1.2.9|1.2.8|0.9.8e|TOMCAT_NATIVE_1_1_11
+jboss-sight|1.0.0|1.2.9|1.2.8||trunk
+The first column is the package name.
+The 2d the version.
+The 3d is the APR version to use for this package.
+The 4th is the APR-UTIL version to use for this package.
+The 5th is the OpenSSL version to use for this package. A SSL and non-SSL
+ version of the package could be built in this case.
+The 6th is tag of the repos we are building.
+
+Parameters:
+The lastest description of the package is the one choosen to build the package.
+build.sh: Build.sh will check where it is located and will build the binary
+packages from the sources of its location. If it isn't in sources it will
+print an error message. A ssl version of the package will be build if the
+source directory is a ssl one.
+build.sh all: Build all the non-ssl version of the packages described in
+pkg.list.
+build.sh sources: Build only the sources tarballs.
+Modifers parameters.
+build jboss-sight: Build jboss-sight only. The lastest description of the
+package in pkg.list is use.
+build jboss-sight 1.0.0: Build the specified version of jboss-sight.
+Options parameters.
+-ssl: Build the SSL version of the package(s). If the package doesn't
+ use SSL an error will occur.
+default: Build only the non-SSL version of the package(s).
+
+Internals:
+The logic of build.sh uses hooks (sub shell) to process specific handling
+to a package. The sub shells are called with parameters.
+For example:
+buildsourcejboss_native.sh (all machines)
+buildsourcejboss_native.linux2.sh (only linux)
+buildsourcejboss_native.linux2.i686.sh (only linux running on i686 machines).
+build.sh will look for the most specific hook to create the sources tarball
+for jboss_native
+The exit code of the sub shell is use to control the main build.
+exit(2) Stop the main build without error (for not supported platforms).
+exit(1) Stop the main build with error (something wrong in build).
+exit(0) Success the main build process the next step.
+
+The download and build of APR and OpenSSL are cached when you start build.sh
+with -cache. A file named .cache contains the plaform information to prevent
+using wrong objects when using shared file system.
+
+Build.sh creates 3 directory and populates them:
+cache: contains the .cache file, a lock file to prevent having more that one
+build.sh running running at once on one system. It also contains the sources
+and a configured and compiled APR or OpenSSL it was run before on that
+machine.
+work: The work directory. This directory is temporary and it contains
+ the full package build.
+output: The result of build will be put in this directory.
+ (source and binary tarballs).
+ The produced archives has a common naming:
+ jboss-<Package Name>-<Package Version>-<Platform>-<Cpu>[-ssl]
+ jboss-<Package Name>-<Package Version>-src[-ssl]
+
+cache: Cache directory that contains platform specific builds.
+ Each platform has its own subdirectory in the format
+ <Operating System><Target CPU>
+ The common libraries will not be build once they are in cache,
+ so make sure the cache is purged if apr or openssl version is
+ changed.
+
+Windows build:
+For building on windows use cygwin and Microsoft compile tools.
+The build downloads apr and apr-util with .zip suffix instead .tar.gz
+The produced source and binary packages also have .zip suffix
+All downloaded sources via svn have the platform native line endings,
+in this case CRLF.
+Cygwin needs a minimum base system plus the folowing packages:
+- wget
+- w3m
+- perl
+- unzip and zip
+- subversion
+
+
+Windows build presumes few environment variables preset before
+calling build.sh. They are set within build.bat and are:
+BUILD_CPU (can be i686, amd64 or ia64)
+BUILD_SYS (always windows)
+
+Supported Windows compliers:
+- Visual C++ 6.0
+ Service Pack 6 for Visual C++ 6.0
+ Needs Platform SDK and Microsoft Assembler 6.11
+
+- Microsoft� Windows Server 2003 R2 Platform SDK - March 2006 Edition
+ Used for building amd64 and ia64 binaries.
+
+- Microsoft Visual Studio 2005
+
+Setting up the Windows environment:
+Before calling build.sh make sure you have cygwin\bin in
+the PATH.
+Microsoft Visual Studio 2005:
+1. Open cmd.exe and navigate to the build location
+2. call <Your Microsoft Visual Studio 2005 Install>\vc\bin\vcvars32.bat
+3. bash build.sh jboss-<package name> -cache [-ssl]
+
+On windows the build.sh does not calls configure, because all
+needed configuration is done via make files.
63 build/daemon/buildall.bat
@@ -0,0 +1,63 @@
+@echo off
+REM Copyright(c) 2007 Red Hat Middleware, LLC,
+REM and individual contributors as indicated by the @authors tag.
+REM See the copyright.txt in the distribution for a
+REM full listing of individual contributors.
+REM
+REM This library is free software; you can redistribute it and/or
+REM modify it under the terms of the GNU Lesser General Public
+REM License as published by the Free Software Foundation; either
+REM version 2 of the License, or (at your option) any later version.
+REM
+REM This library is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+REM Lesser General Public License for more details.
+REM
+REM You should have received a copy of the GNU Lesser General Public
+REM License along with this library in the file COPYING.LIB;
+REM if not, write to the Free Software Foundation, Inc.,
+REM 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+REM
+REM @author Mladen Turk
+REM
+
+@if not "%ECHO%" == "" echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+set "DIRNAME=%~dp0%"
+set "PROGNAME=%~nx0%"
+) else (
+set DIRNAME=.\
+set PROGNAME=buildall.bat
+)
+
+pushd %DIRNAME%..
+set BUILD_HOME=%CD%
+popd
+
+echo.
+echo Running : %PROGNAME% $LastChangedDate: 2008-07-23 10:17:15 -0400 (Wed, 23 Jul 2008) $
+echo.
+echo Started : %DATE% %TIME%
+echo.
+
+
+pushd %BUILD_HOME%\windows
+
+call build.bat sdk x86 jboss-native -ssl -cache
+call build.bat sdk x64 jboss-native -ssl -cache
+call build.bat sdk i64 jboss-native -ssl -cache
+
+REM build http using rhel repos
+call build.bat sdk x86 rhel-httpd -ssl -cache
+call build.bat sdk x64 rhel-httpd -ssl -cache
+call build.bat sdk i64 rhel-httpd -ssl -cache
+
+REM Uncomment for building sight
+REM call build.bat sdk x86 jboss-sight -cache
+REM call build.bat sdk x64 jboss-sight -cache
+REM call build.bat sdk i64 jboss-sight -cache
+
+popd
57 build/daemon/buildall.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# Copyright(c) 2007 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Mladen Turk
+#
+echo ""
+echo "Running `basename $0` $LastChangedDate: 2008-07-23 10:17:15 -0400 (Wed, 23 Jul 2008) $"
+echo ""
+echo "Started : `date`"
+echo "Params : $@"
+echo ""
+
+build_ssl=true
+
+while [ "x" != "x$1" ]
+do
+ case $1 in
+ -env)
+ echo "Dumping environment"
+ env
+ echo ""
+ ;;
+ -no-ssl)
+ build_ssl=false
+ ;;
+ esac
+ shift
+done
+
+(cd ../unix
+ if $build_ssl; then
+ ./build.sh jboss-native -ssl -cache
+ ./build.sh rhel-httpd -ssl -cache
+ fi
+ ./build.sh jboss-native -cache
+ ./build.sh rhel-httpd -cache
+ # Uncomment for building sight
+ # ./build.sh jboss-sight -cache
+)
27 build/daemon/release.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright(c) 2007 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+
+#
+# Do the binary build for the release.
+# That just a way to remember what was released.
+BASEDIR=`dirname $0`
+$BASEDIR/unixbuild.sh --with-openssl-version=0.9.8e --with-tcnative-version=1.1.11 --with-apr-version=1.2.8 --build-version=2.0.0
103 build/daemon/unixbuild.sh
@@ -0,0 +1,103 @@
+#!/bin/sh
+# Copyright(c) 2006 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Mladen Turk
+#
+
+BUILDNAM=jboss-native
+BUILDVER=2.0.0
+SIGHTNAM=jboss-sight
+SIGHTVER=1.0.0
+JBNATIVE_BASE=`pwd`
+
+# read the parameters
+PARAMETERS=
+while [ "x" != "x$1" ]
+do
+ PARAMETERS="$PARAMETERS $1"
+ case $1 in
+ --with-openssl-version=*)
+ SSLVER=`echo $1 | awk -F = '{ print $2 }'`
+ echo "Using openssl-$SSLVER"
+ ;;
+ --with-tcnative-version=*)
+ TCNVER=`echo $1 | awk -F = '{ print $2 }'`
+ ;;
+ --with-apr-version=*)
+ APRVER=`echo $1 | awk -F = '{ print $2 }'`
+ echo "Using apr-$APRVER"
+ ;;
+ --build-version=*)
+ BUILDVER=`echo $1 | awk -F = '{ print $2 }'`
+ echo "Build version $BUILDVER"
+ ;;
+ *)
+ echo "$1: not (yet) supported"
+ ;;
+ esac
+ shift
+done
+if [ "x" = "x$PARAMETERS" ]; then
+ echo "Using defaut values"
+else
+ echo "Using $PARAMETERS"
+fi
+
+rm -f ${BUILDNAM}-*.tar.gz
+rm -f ${SIGHTNAM}-*.tar.gz
+rm -rf ${BUILDNAM}-${BUILDVER}-src
+rm -rf ${BUILDNAM}-${BUILDVER}-src-ssl
+rm -rf ${SIGHTNAM}-${SIGHTVER}-src
+rm -rf jbossnative
+
+# JBATIVESVN=http://anonsvn.jboss.org/repos/jbossnative/tags/JBNATIVE_2_0_0
+JBNATIVESVN=http://anonsvn.jboss.org/repos/jbossnative/trunk/
+
+svn export ${JBNATIVESVN} jbossnative
+cd jbossnative/build
+./buildprep.sh $PARAMETERS
+if [ $? -ne 0 ]; then
+ echo "buildprep.sh failed"
+ exit 1
+fi
+cd ${JBNATIVE_BASE}
+cd ${BUILDNAM}-${BUILDVER}-src-ssl
+./buildworld.sh $PARAMETERS
+if [ $? -ne 0 ]; then
+ echo "buildworld.sh failed"
+ exit 1
+fi
+cd ${JBNATIVE_BASE}
+
+cd jbossnative/build
+./buildprep.sh --disable-openssl $PARAMETERS
+if [ $? -ne 0 ]; then
+ echo "no_SSL buildprep.sh failed"
+ exit 1
+fi
+
+cd ${JBNATIVE_BASE}
+cd ${BUILDNAM}-${BUILDVER}-src
+./buildworld.sh --disable-openssl $PARAMETERS
+if [ $? -ne 0 ]; then
+ echo "no_SSL buildworld.sh failed"
+ exit 1
+fi
64 build/daemon/windowsbuild.bat
@@ -0,0 +1,64 @@
+@echo off
+REM Copyright(c) 2006 Red Hat Middleware, LLC,
+REM and individual contributors as indicated by the @authors tag.
+REM See the copyright.txt in the distribution for a
+REM full listing of individual contributors.
+REM
+REM This library is free software; you can redistribute it and/or
+REM modify it under the terms of the GNU Lesser General Public
+REM License as published by the Free Software Foundation; either
+REM version 2 of the License, or (at your option) any later version.
+REM
+REM This library is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+REM Lesser General Public License for more details.
+REM
+REM You should have received a copy of the GNU Lesser General Public
+REM License along with this library in the file COPYING.LIB;
+REM if not, write to the Free Software Foundation, Inc.,
+REM 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+REM
+REM @author Mladen Turk
+REM
+@if "%OS%" == "Windows_NT" setlocal
+REM
+set BUILDNAM=jboss-native
+set BUILDVER=2.0.0
+set BUILDSRC=windows-src
+set BUILDROOT=%CD%
+REM
+@del /Q /F %BUILDNAM%-*.zip 2>NUL
+@rmdir /S /Q %BUILDNAM%-%BUILDVER%-%BUILDSRC% 2>NUL
+@rmdir /S /Q jbossnative 2>NUL
+REM set JBATIVESVN=http://anonsvn.jboss.org/repos/jbossnative/tags/JBNATIVE_2_0_0
+set JBNATIVESVN=http://anonsvn.jboss.org/repos/jbossnative/trunk/
+
+svn export %JBNATIVESVN% jbossnative
+cd jbossnative/build
+call buildprep.bat
+cd %BUILDROOT%
+cd %BUILDNAM%-%BUILDVER%-%BUILDSRC%
+call buildworld.bat sdk dll x86
+call buildworld.bat sdk dll amd64
+call buildworld.bat sdk dll ia64
+REM Make APR and OpenSSL static builds
+call buildworld.bat sdk lib x86
+call buildworld.bat sdk lib amd64
+call buildworld.bat sdk lib ia64
+cd %BUILDROOT%
+REM
+REM Second run for nossl
+REM
+@rmdir /S /Q %BUILDNAM%-%BUILDVER%-%BUILDSRC% 2>NUL
+cd jbossnative/build
+call buildprep.bat nossl
+cd %BUILDROOT%
+cd %BUILDNAM%-%BUILDVER%-%BUILDSRC%
+call buildworld.bat nossl sdk dll x86
+call buildworld.bat nossl sdk dll amd64
+call buildworld.bat nossl sdk dll ia64
+REM Make APR static builds
+call buildworld.bat nossl sdk lib x86
+call buildworld.bat nossl sdk lib amd64
+call buildworld.bat nossl sdk lib ia64
307 build/install/README
@@ -0,0 +1,307 @@
+The following was generated from http://www.megastep.org/makeself/
+-----------------------
+
+
+ #[1]Mobile/PDA
+
+ makeself - Make self-extractable archives on Unix
+
+ [2]makeself.sh is a small shell script that generates a self-extractable
+ tar.gz archive from a directory. The resulting file appears as a shell
+ script (many of those have a .run suffix), and can be launched as is. The
+ archive will then uncompress itself to a temporary directory and an optional
+ arbitrary command will be executed (for example an installation script).
+ This is pretty similar to archives generated with WinZip Self-Extractor in
+ the Windows world. Makeself archives also include checksums for integrity
+ self-validation (CRC and/or MD5 checksums).
+
+ The makeself.sh script itself is used only to create the archives from a
+ directory of files. The resultant archive is actually a compressed (using
+ gzip, bzip2, or compress) TAR archive, with a small shell script stub at the
+ beginning. This small stub performs all the steps of extracting the files,
+ running the embedded command, and removing the temporary files when it's all
+ over. All what the user has to do to install the software contained in such
+ an archive is to "run" the archive, i.e sh nice-software.run. I recommend
+ using the "run" (which was introduced by some Makeself archives released by
+ Loki Software) or "sh" suffix for such archives not to confuse the users,
+ since they know it's actually shell scripts (with quite a lot of binary data
+ attached to it though!).
+
+ I am trying to keep the code of this script as portable as possible, i.e
+ it's not relying on any bash-specific features and only calls commands that
+ are installed on any functioning UNIX-compatible system. This script as well
+ as the archives it generates should run on any Unix flavor, with any
+ compatible Bourne shell, provided of course that the compression programs
+ are available.
+
+ As of version 2.1, Makeself has been rewritten and tested on the following
+ platforms :
+ * Linux (all distributions)
+ * Sun Solaris (8 tested)
+ * HP-UX (tested on 11.0 and 11i on HPPA RISC)
+ * SCO OpenUnix and OpenServer
+ * IBM AIX 5.1L
+ * MacOS X (Darwin)
+ * SGI IRIX 6.5
+ * FreeBSD
+ * UnicOS / Cray
+
+ If you successfully run Makeself and/or archives created with it on another
+ system, then [3]let me know!
+
+ Examples of publicly available archives made using makeself are :
+ * Game patches and installers for [4]Id Software games like Quake 3 for
+ Linux or Return To Castle Wolfenstien ;
+ * All game patches released by [5]Loki Software for the Linux version of
+ popular games ;
+ * The [6]nVidia drivers for Linux
+ * The installer for the Linux version of [7]Google Earth
+ * The [8]Makeself distribution itself ;-)
+ * and countless others...
+
+ Important note for Apache users: By default, most Web servers will think
+ that Makeself archives are regular text files and thus they may show up as
+ text in a Web browser. The correct way to prevent this is to add a MIME type
+ for this file format, like so (in httpd.conf) :
+ AddType application/x-makeself .run
+
+ Important note for recent GNU/Linux distributions: Archives created with
+ Makeself prior to v2.1.2 were using an old syntax for the head and tail Unix
+ commands that is being progressively obsoleted in their GNU forms. Therefore
+ you may have problems uncompressing some of these archives. A workaround for
+ this is to set the environment variable $_POSIX2_VERSION to enable the old
+ syntax, i.e. :
+ export _POSIX2_VERSION=199209
+
+Usage
+
+ The syntax of makeself is the following:
+
+ makeself.sh [args] archive_dir file_name label startup_script [script_args]
+ * args are optional options for Makeself. The available ones are :
+ + --version : Prints the version number on stdout, then exits
+ immediately
+ + --gzip : Use gzip for compression (is the default on platforms on
+ which gzip is commonly available, like Linux)
+ + --bzip2 : Use bzip2 instead of gzip for better compression. The
+ bzip2 command must be available in the command path. I recommend
+ that you set the prefix to something like '.bz2.run' for the
+ archive, so that potential users know that they'll need bzip2 to
+ extract it.
+ + --compress : Use the UNIX "compress" command to compress the data.
+ This should be the default on all platforms that don't have gzip
+ available.
+ + --nocomp : Do not use any compression for the archive, which will
+ then be an uncompressed TAR.
+ + --notemp : The generated archive will not extract the files to a
+ temporary directory, but in a new directory created in the current
+ directory. This is better to distribute software packages that may
+ extract and compile by themselves (i.e. launch the compilation
+ through the embedded script).
+ + --current : Files will be extracted to the current directory,
+ instead of in a subdirectory. This option implies --notemp above.
+ + --follow : Follow the symbolic links inside of the archive
+ directory, i.e. store the files that are being pointed to instead
+ of the links themselves.
+ + --append (new in 2.1.x): Append data to an existing archive,
+ instead of creating a new one. In this mode, the settings from the
+ original archive are reused (compression type, label, embedded
+ script), and thus don't need to be specified again on the command
+ line.
+ + --header : Makeself 2.0 uses a separate file to store the header
+ stub, called "makeself-header.sh". By default, it is assumed that
+ it is stored in the same location as makeself.sh. This option can
+ be used to specify its actual location if it is stored someplace
+ else.
+ + --copy : Upon extraction, the archive will first extract itself to
+ a temporary directory. The main application of this is to allow
+ self-contained installers stored in a Makeself archive on a CD,
+ when the installer program will later need to unmount the CD and
+ allow a new one to be inserted. This prevents "Filesystem busy"
+ errors for installers that span multiple CDs.
+ + --nox11 : Disable the automatic spawning of a new terminal in X11.
+ + --nowait : When executed from a new X11 terminal, disable the user
+ prompt at the end of the script execution.
+ + --nomd5 and --nocrc : Disable the creation of a MD5 / CRC checksum
+ for the archive. This speeds up the extraction process if integrity
+ checking is not necessary.
+ + --lsm file : Provide and LSM file to makeself, that will be
+ embedded in the generated archive. LSM files are describing a
+ software package in a way that is easily parseable. The LSM entry
+ can then be later retrieved using the '-lsm' argument to the
+ archive. An exemple of a LSM file is provided with Makeself.
+ * archive_dir is the name of the directory that contains the files to be
+ archived
+ * file_name is the name of the archive to be created
+ * label is an arbitrary text string describing the package. It will be
+ displayed while extracting the files.
+ * startup_script is the command to be executed from within the directory
+ of extracted files. Thus, if you wish to execute a program contain in
+ this directory, you must prefix your command with "./". For example,
+ ./program will be fine. The script_args are additionnal arguments for
+ this command.
+
+ Here is an example, assuming the user has a package image stored in a
+ /home/joe/mysoft, and he wants to generate a self-extracting package named
+ mysoft.sh, which will launch the "setup" script initially stored in
+ /home/joe/mysoft :
+
+ makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup
+ Here is also how I created the [9]makeself.run archive which contains the
+ Makeself distribution :
+
+ makeself.sh --notemp makeself makeself.run "Makeself by Stephane Peter" echo
+ "Makeself has extracted itself"
+
+ Archives generated with Makeself 2.1 can be passed the following arguments:
+
+ * --keep : Prevent the files to be extracted in a temporary directory that
+ will be removed after the embedded script's execution. The files will
+ then be extracted in the current working directory and will stay here
+ until you remove them.
+ * --verbose : Will prompt the user before executing the embedded command
+ * --target dir : Allows to extract the archive in an arbitrary place.
+ * --nox11 : Do not spawn a X11 terminal.
+ * --confirm : Prompt the user for confirmation before running the embedded
+ command.
+ * --info : Print out general information about the archive (does not
+ extract).
+ * --lsm : Print out the LSM entry, if it is present.
+ * --list : List the files in the archive.
+ * --check : Check the archive for integrity using the embedded checksums.
+ Does not extract the archive.
+ * --nochown : By default, a "chown -R" command is run on the target
+ directory after extraction, so that all files belong to the current
+ user. This is mostly needed if you are running as root, as tar will then
+ try to recreate the initial user ownerships. You may disable this
+ behavior with this flag.
+ * --tar : Run the tar command on the contents of the archive, using the
+ following arguments as parameter for the command.
+ * --noexec : Do not run the embedded script after extraction.
+
+ Any subsequent arguments to the archive will be passed as additional
+ arguments to the embedded command. You should explicitly use the -- special
+ command-line construct before any such options to make sure that Makeself
+ will not try to interpret them.
+
+License
+
+ Makeself is covered by the [10]GNU General Public License (GPL) version 2
+ and above. Archives generated by Makeself don't have to be placed under this
+ license (although I encourage it ;-)), since the archive itself is merely
+ data for Makeself.
+
+Download
+
+ Get the latest official distribution [11]here (version 2.1.5).
+
+ The latest development version can be grabbed from the Loki Setup CVS
+ module, at [12]cvs.icculus.org.
+
+Version history
+
+ * v1.0: Initial public release
+ * v1.1: The archive can be passed parameters that will be passed on to the
+ embedded script, thanks to John C. Quillan
+ * v1.2: Cosmetic updates, support for bzip2 compression and non-temporary
+ archives. Many ideas thanks to Francois Petitjean.
+ * v1.3: More patches from Bjarni R. Einarsson and Francois Petitjean:
+ Support for no compression (--nocomp), script is no longer mandatory,
+ automatic launch in an xterm, optional verbose output, and -target
+ archive option to indicate where to extract the files.
+ * v1.4: Many patches from Francois Petitjean: improved UNIX compatibility,
+ automatic integrity checking, support of LSM files to get info on the
+ package at run time..
+ * v1.5.x: A lot of bugfixes, and many other patches, including automatic
+ verification through the usage of checksums. Version 1.5.5 was the
+ stable release for a long time, even though the Web page didn't get
+ updated ;-). Makeself was also officially made a part of the [13]Loki
+ Setup installer, and its source is being maintained as part of this
+ package.
+ * v2.0: Complete internal rewrite of Makeself. The command-line parsing
+ was vastly improved, the overall maintenance of the package was greatly
+ improved by separating the stub from makeself.sh. Also Makeself was
+ ported and tested to a variety of Unix platforms.
+ * v2.0.1: First public release of the new 2.0 branch. Prior versions are
+ officially obsoleted. This release introduced the '--copy' argument that
+ was introduced in response to a need for the [14]UT2K3 Linux installer.
+ * v2.1.0: Big change : Makeself can now support multiple embedded
+ tarballs, each stored separately with their own checksums. An existing
+ archive can be updated with the --append flag. Checksums are also better
+ managed, and the --nochown option for archives appeared.
+ * v2.1.1: Fixes related to the Unix compression (compress command). Some
+ Linux distributions made the insane choice to make it unavailable, even
+ though gzip is capable of uncompressing these files, plus some more
+ bugfixes in the extraction and checksum code.
+ * v2.1.2: Some bug fixes. Use head -n to avoid problems with POSIX
+ conformance.
+ * v2.1.3: Bug fixes with the command line when spawning terminals. Added
+ --tar, --noexec for archives. Added --nomd5 and --nocrc to avoid
+ creating checksums in archives. The embedded script is now run through
+ "eval". The --info output now includes the command used to create the
+ archive. A man page was contributed by Bartosz Fenski.
+ * v2.1.4: Fixed --info output. Generate random directory name when
+ extracting files to . to avoid problems. Better handling of errors with
+ wrong permissions for the directory containing the files. Avoid some
+ race conditions, Unset the $CDPATH variable to avoid problems if it is
+ set. Better handling of dot files in the archive directory.
+ * v2.1.5: Made the md5sum detection consistent with the header code. Check
+ for the presence of the archive directory. Added --encrypt for symmetric
+ encryption through gpg (Eric Windisch). Added support for the digest
+ command on Solaris 10 for MD5 checksums. Check for available disk space
+ before extracting to the target directory (Andreas Schweitzer). Allow
+ extraction to run asynchronously (patch by Peter Hatch). Use file
+ descriptors internally to avoid error messages (patch by Kay Tiong
+ Khoo).
+
+Links
+
+ * Check out the [15]"Loki setup" installer, used to install many Linux
+ games and other applications, and of which I am the co-author. Since the
+ demise of Loki, I am now the official maintainer of the project, and it
+ is now being hosted on [16]icculus.org, as well as a bunch of other
+ ex-Loki projects (and a lot of other good stuff!).
+ * Bjarni R. Einarsson also wrote the setup.sh installer script, inspired
+ by Makeself. [17]Check it out !
+
+Contact
+
+ This script was written by [18]Stéphane Peter (megastep at megastep.org) I
+ welcome any enhancements and suggestions.
+
+ Contributions were included from John C. Quillan, Bjarni R. Einarsson,
+ Francois Petitjean, and Ryan C. Gordon, thanks to them! If you think I
+ forgot your name, don't hesitate to contact me.
+
+ icculus.org also has a [19]Bugzilla server available that allows bug reports
+ to be submitted for Loki setup, and since Makeself is a part of Loki setup,
+ you can submit bug reports from there!
+ _________________________________________________________________
+
+
+ [20]Stéphane Peter
+
+ Last modified: Fri Jan 4 15:51:05 PST 2008
+
+References
+
+ 1. http://mowser.com/web/megastep.org/makeself/
+ 2. http://www.megastep.org/makeself/makeself.run
+ 3. mailto:megastep@REMOVEME.megastep.org
+ 4. http://www.idsoftware.com/
+ 5. http://www.lokigames.com/products/myth2/updates.php3
+ 6. http://www.nvidia.com/
+ 7. http://earth.google.com/
+ 8. http://www.megastep.org/makeself/makeself.run
+ 9. http://www.megastep.org/makeself/makeself.run
+ 10. http://www.gnu.org/copyleft/gpl.html
+ 11. http://www.megastep.org/makeself/makeself-2.1.5.run
+ 12. http://cvs.icculus.org/
+ 13. http://www.icculus.org/loki_setup/
+ 14. http://www.unrealtournament2003.com/
+ 15. http://www.icculus.org/loki_setup/
+ 16. http://www.icculus.org/
+ 17. http://www.mmedia.is/~bre/programs/setup.sh/
+ 18. mailto:megastep@@megastep.org
+ 19. https://bugzilla.icculus.org/
+ 20. mailto:megastep@@megastep.org
101 build/install/installer/NMAKEmakefile
@@ -0,0 +1,101 @@
+# Copyright(c) 2006 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Mladen Turk
+#
+
+!IF !DEFINED(TARGET) || "$(TARGET)" == ""
+TARGET = GUI
+!ENDIF
+PROJECT = sinstall
+!include <..\..\NMAKEcommon.inc>
+
+!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
+SRCDIR = .
+!ENDIF
+
+CFLAGS = $(CFLAGS) -DSFX -DASM_CRC -DMAIN=MAIN -DNO_ZIPINFO=1
+
+LFLAGS = $(LFLAGS) /version:1.0
+LFLAGS = $(LFLAGS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib
+LFLAGS = $(LFLAGS) shlwapi.lib netapi32.lib shell32.lib ole32.lib urlmon.lib
+LFLAGS = $(LFLAGS) oleaut32.lib psapi.lib
+
+INCLUDES = -I$(SRCDIR)\win32
+
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
+OBJECTS = \
+ $(WORKDIR)\crc32.obj \
+ $(WORKDIR)\crc_i386.obj \
+ $(WORKDIR)\crctab.obj \
+ $(WORKDIR)\crypt.obj \
+ $(WORKDIR)\extract.obj \
+ $(WORKDIR)\fileio.obj \
+ $(WORKDIR)\globals.obj \
+ $(WORKDIR)\inflate.obj \
+ $(WORKDIR)\match.obj \
+ $(WORKDIR)\nt.obj \
+ $(WORKDIR)\process.obj \
+ $(WORKDIR)\ttyio.obj \
+ $(WORKDIR)\unzip.obj \
+ $(WORKDIR)\win32.obj \
+ $(WORKDIR)\gui.obj \
+ $(WORKDIR)\dhtml.obj \
+ $(WORKDIR)\main.obj
+
+OBJDEPS = $(SRCDIR)\*.h \
+ $(SRCDIR)\win32\*.h \
+ NMAKEmakefile
+
+BUILDLOC = $(PREFIX)\bin
+BUILDEXE = $(WORKDIR)\$(PROJECT).exe
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMAN = $(BUILDEXE).manifest
+
+all : $(WORKDIR) $(BUILDEXE)
+
+$(BUILDLOC) :
+ @if not exist "$(BUILDLOC)\$(NULL)" mkdir "$(BUILDLOC)"
+
+$(WORKDIR) :
+ @$(MAKEWORKDIR)
+
+{$(SRCDIR)}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\win32}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+$(BUILDRES): $(SRCDIR)/$(PROJECT).rc
+ $(RC) $(RCFLAGS) /i "$(SRCDIR)" /fo $(BUILDRES) $(SRCDIR)/$(PROJECT).rc
+
+$(OBJECTS): $(OBJDEPS)
+
+$(BUILDEXE): $(WORKDIR) $(OBJECTS) $(BUILDRES)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDEXE)
+ IF EXIST $(BUILDMAN) \
+ mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDEXE);1
+
+clean:
+ @$(CLEANTARGET)
+
+install: $(BUILDLOC) $(WORKDIR) $(BUILDEXE)
+ @xcopy "$(WORKDIR)\*.exe" "$(BUILDLOC)" /Y /Q
54 build/install/installer/consts.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 1990-2001 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2000-Apr-09 or later
+ (the contents of which are also included in unzip.h) for terms of use.
+ If, for some reason, all these files are missing, the Info-ZIP license
+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
+*/
+/*---------------------------------------------------------------------------
+
+ consts.h
+
+ This file contains global, initialized variables that never change. It is
+ included by unzip.c and windll/windll.c.
+
+ ---------------------------------------------------------------------------*/
+
+
+/* And'ing with mask_bits[n] masks the lower n bits */
+ZCONST unsigned near mask_bits[17] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
+};
+
+ZCONST char Far VersionDate[] = UZ_VERSION_DATE; /* now defined in unzvers.h */
+
+#ifndef SFX
+ ZCONST char Far EndSigMsg[] =
+ "\nnote: didn't find end-of-central-dir signature at end of central dir.\n";
+#endif
+
+ZCONST char Far CentSigMsg[] =
+ "error: expected central file header signature not found (file #%lu).\n";
+ZCONST char Far SeekMsg[] =
+ "error [%s]: attempt to seek before beginning of zipfile\n%s";
+ZCONST char Far FilenameNotMatched[] = "caution: filename not matched: %s\n";
+ZCONST char Far ExclFilenameNotMatched[] =
+ "caution: excluded filename not matched: %s\n";
+
+#ifdef VMS
+ ZCONST char Far ReportMsg[] = "\
+ (please check that you have transferred or created the zipfile in the\n\
+ appropriate BINARY mode--this includes ftp, Kermit, AND unzip'd zipfiles)\n";
+#else
+ ZCONST char Far ReportMsg[] = "\
+ (please check that you have transferred or created the zipfile in the\n\
+ appropriate BINARY mode and that you have compiled UnZip properly)\n";
+#endif
+
+#ifndef SFX
+ ZCONST char Far Zipnfo[] = "zipinfo";
+ ZCONST char Far CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n";
+#endif
64 build/install/installer/crc32.c
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2000-Apr-09 or later
+ (the contents of which are also included in zip.h) for terms of use.
+ If, for some reason, all these files are missing, the Info-ZIP license
+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
+*/
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* $Id: crc32.c,v 1.5 1996/01/13 14:55:12 spc Exp $ */
+
+#define __CRC32_C /* identifies this source module */
+
+#include "zip.h"
+
+#ifndef USE_ZLIB
+#ifndef ASM_CRC
+
+#ifndef ZCONST
+# define ZCONST const
+#endif
+
+#ifdef CRC32
+# undef CRC32
+#endif
+#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
+#define DO1(buf) crc = CRC32(crc, *buf++)
+#define DO2(buf) DO1(buf); DO1(buf)
+#define DO4(buf) DO2(buf); DO2(buf)
+#define DO8(buf) DO4(buf); DO4(buf)
+
+/* ========================================================================= */
+ulg crc32(crc, buf, len)
+ register ulg crc; /* crc shift register */
+ register ZCONST uch *buf; /* pointer to bytes to pump through */
+ extent len; /* number of bytes in buf[] */
+/* Run a set of bytes through the crc shift register. If buf is a NULL
+ pointer, then initialize the crc shift register contents instead.
+ Return the current crc in either case. */
+{
+ register ZCONST ulg near *crc_table;
+
+ if (buf == NULL) return 0L;
+
+ crc_table = get_crc_table();
+
+ crc = crc ^ 0xffffffffL;
+#ifndef NO_UNROLLED_LOOPS
+ while (len >= 8) {
+ DO8(buf);
+ len -= 8;
+ }
+#endif
+ if (len) do {
+ DO1(buf);
+ } while (--len);
+ return crc ^ 0xffffffffL; /* (instead of ~c for 64-bit machines) */
+}
+#endif /* !ASM_CRC */
+#endif /* !USE_ZLIB */
227 build/install/installer/crctab.c
@@ -0,0 +1,227 @@
+/*
+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2000-Apr-09 or later
+ (the contents of which are also included in zip.h) for terms of use.
+ If, for some reason, all these files are missing, the Info-ZIP license
+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
+*/
+/* crctab.c -- supply the CRC table needed for CRC-32 calculations.
+ * Copyright (C) 1995 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* $Id: crctab.c,v 1.4 1996/01/08 14:55:12 jloup Exp $ */
+
+/*
+ Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
+ x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+ Polynomials over GF(2) are represented in binary, one bit per coefficient,
+ with the lowest powers in the most significant bit. Then adding polynomials
+ is just exclusive-or, and multiplying a polynomial by x is a right shift by
+ one. If we call the above polynomial p, and represent a byte as the
+ polynomial q, also with the lowest power in the most significant bit (so the
+ byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+ where a mod b means the remainder after dividing a by b.
+
+ This calculation is done using the shift-register method of multiplying and
+ taking the remainder. The register is initialized to zero, and for each
+ incoming bit, x^32 is added mod p to the register if the bit is a one (where
+ x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+ x (which is shifting right by one and adding x^32 mod p if the bit shifted
+ out is a one). We start with the highest power (least significant bit) of
+ q and repeat for all eight bits of q.
+
+ The table is simply the CRC of all possible eight bit values. This is all
+ the information needed to generate CRC's on data a byte at a time for all
+ combinations of CRC register values and incoming bytes.
+*/
+
+#define __CRCTAB_C /* identifies this source module */
+
+#include "zip.h"
+
+#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB))
+
+#ifndef ZCONST
+# define ZCONST const
+#endif
+
+#ifdef DYNAMIC_CRC_TABLE
+
+/* =========================================================================
+ * Make the crc table. This function is needed only if you want to compute
+ * the table dynamically.
+ */
+
+local void make_crc_table OF((void));
+
+#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT))
+ error: Dynamic allocation of CRC table not safe with reentrant code.
+#endif /* DYNALLOC_CRCTAB && REENTRANT */
+
+#ifdef DYNALLOC_CRCTAB
+ local ulg near *crc_table = NULL;
+# if 0 /* not used, since sizeof("near *") <= sizeof(int) */
+ /* Use this section when access to a "local int" is faster than access to
+ a "local pointer" (e.g.: i86 16bit code with far pointers). */
+ local int crc_table_empty = 1;
+# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0)
+# define MARK_CRCTAB_FILLED crc_table_empty = 0
+# define MARK_CRCTAB_EMPTY crc_table_empty = 1
+# else
+ /* Use this section on systems where the size of pointers and ints is
+ equal (e.g.: all 32bit systems). */
+# define CRC_TABLE_IS_EMPTY (crc_table == NULL)
+# define MARK_CRCTAB_FILLED crc_table = crctab_p
+# define MARK_CRCTAB_EMPTY crc_table = NULL
+# endif
+#else /* !DYNALLOC_CRCTAB */
+ local ulg near crc_table[256];
+ local int crc_table_empty = 1;
+# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0)
+# define MARK_CRCTAB_FILLED crc_table_empty = 0
+#endif /* ?DYNALLOC_CRCTAB */
+
+
+local void make_crc_table()
+{
+ ulg c; /* crc shift register */
+ int n; /* counter for all possible eight bit values */
+ int k; /* byte being shifted into crc apparatus */
+#ifdef DYNALLOC_CRCTAB
+ ulg near *crctab_p; /* temporary pointer to allocated crc_table area */
+#else /* !DYNALLOC_CRCTAB */
+# define crctab_p crc_table
+#endif /* DYNALLOC_CRCTAB */
+
+#ifdef COMPUTE_XOR_PATTERN
+ /* This piece of code has been left here to explain how the XOR pattern
+ * used in the creation of the crc_table values can be recomputed.
+ * For production versions of this function, it is more efficient to
+ * supply the resultant pattern at compile time.
+ */
+ ulg xor; /* polynomial exclusive-or pattern */
+ /* terms of polynomial defining this crc (except x^32): */
+ static uch p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+ /* make exclusive-or pattern from polynomial (0xedb88320L) */
+ xor = 0L;
+ for (i = 0; i < sizeof(p)/sizeof(uch); i++)
+ xor |= 1L << (31 - p[i]);
+#else
+# define xor 0xedb88320L
+#endif
+
+#ifdef DYNALLOC_CRCTAB
+ crctab_p = (ulg near *) nearmalloc (256*sizeof(ulg));
+ if (crctab_p == NULL) {
+ ziperr(ZE_MEM, "crc_table allocation");
+ }
+#endif /* DYNALLOC_CRCTAB */
+
+ for (n = 0; n < 256; n++) {
+ c = (ulg)n;
+ for (k = 8; k; k--)
+ c = c & 1 ? xor ^ (c >> 1) : c >> 1;
+ crctab_p[n] = c;
+ }
+ MARK_CRCTAB_FILLED;
+}
+
+#else /* !DYNAMIC_CRC_TABLE */
+
+#ifdef DYNALLOC_CRCTAB
+ error: Inconsistent flags, DYNALLOC_CRCTAB without DYNAMIC_CRC_TABLE.
+#endif
+
+/* ========================================================================
+ * Table of CRC-32's of all single-byte values (made by make_crc_table)
+ */
+local ZCONST ulg near crc_table[256] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+};
+#endif /* ?DYNAMIC_CRC_TABLE */
+
+/* use "OF((void))" here to work around a Borland TC++ 1.0 problem */
+#ifdef USE_ZLIB
+ZCONST uLongf *get_crc_table OF((void))
+#else
+ZCONST ulg near *get_crc_table OF((void))
+#endif
+{
+#ifdef DYNAMIC_CRC_TABLE
+ if (CRC_TABLE_IS_EMPTY)
+ make_crc_table();
+#endif
+#ifdef USE_ZLIB
+ return (ZCONST uLongf *)crc_table;
+#else
+ return (ZCONST ulg near *)crc_table;
+#endif
+}
+
+#ifdef DYNALLOC_CRCTAB
+void free_crc_table()
+{
+ if (!CRC_TABLE_IS_EMPTY)
+ {
+ nearfree((ulg near *)crc_table);
+ MARK_CRCTAB_EMPTY;
+ }
+}
+#endif
+
+#endif /* !USE_ZLIB || USE_OWN_CRCTAB */
583 build/install/installer/crypt.c
@@ -0,0 +1,583 @@
+/*
+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2000-Apr-09 or later
+ (the contents of which are also included in zip.h) for terms of use.
+ If, for some reason, all these files are missing, the Info-ZIP license
+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
+*/
+/*
+ crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h]
+
+ This encryption/decryption source code for Info-Zip software was
+ originally written in Europe. The whole source package can be
+ freely distributed, including from the USA. (Prior to January 2000,
+ re-export from the US was a violation of US law.)
+
+ NOTE on copyright history:
+ Previous versions of this source package (up to version 2.8) were
+ not copyrighted and put in the public domain. If you cannot comply
+ with the Info-Zip LICENSE, you may want to look for one of those
+ public domain versions.
+ */
+
+/*
+ This encryption code is a direct transcription of the algorithm from
+ Roger Schlafly, described by Phil Katz in the file appnote.txt. This
+ file (appnote.txt) is distributed with the PKZIP program (even in the
+ version without encryption capabilities).
+ */
+
+#define ZCRYPT_INTERNAL
+#include "zip.h"
+#include "crypt.h"
+#include "ttyio.h"
+
+#if CRYPT
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+#ifdef ZIP
+ /* For the encoding task used in Zip (and ZipCloak), we want to initialize
+ the crypt algorithm with some reasonably unpredictable bytes, see
+ the crypthead() function. The standard rand() library function is
+ used to supply these `random' bytes, which in turn is initialized by
+ a srand() call. The srand() function takes an "unsigned" (at least 16bit)
+ seed value as argument to determine the starting point of the rand()
+ pseudo-random number generator.
+ This seed number is constructed as "Seed = Seed1 .XOR. Seed2" with
+ Seed1 supplied by the current time (= "(unsigned)time()") and Seed2
+ as some (hopefully) nondeterministic bitmask. On many (most) systems,
+ we use some "process specific" number, as the PID or something similar,
+ but when nothing unpredictable is available, a fixed number may be
+ sufficient.
+ NOTE:
+ 1.) This implementation requires the availability of the following
+ standard UNIX C runtime library functions: time(), rand(), srand().
+ On systems where some of them are missing, the environment that
+ incorporates the crypt routines must supply suitable replacement
+ functions.
+ 2.) It is a very bad idea to use a second call to time() to set the
+ "Seed2" number! In this case, both "Seed1" and "Seed2" would be
+ (almost) identical, resulting in a (mostly) "zero" constant seed
+ number passed to srand().
+
+ The implementation environment defined in the "zip.h" header should
+ supply a reasonable definition for ZCR_SEED2 (an unsigned number; for
+ most implementations of rand() and srand(), only the lower 16 bits are
+ significant!). An example that works on many systems would be
+ "#define ZCR_SEED2 (unsigned)getpid()".
+ The default definition for ZCR_SEED2 supplied below should be regarded
+ as a fallback to allow successful compilation in "beta state"
+ environments.
+ */
+# include <time.h> /* time() function supplies first part of crypt seed */
+ /* "last resort" source for second part of crypt seed pattern */
+# ifndef ZCR_SEED2
+# define ZCR_SEED2 (unsigned)3141592654L /* use PI as default pattern */
+# endif
+# ifdef GLOBAL /* used in Amiga system headers, maybe others too */
+# undef GLOBAL
+# endif
+# define GLOBAL(g) g
+#else /* !ZIP */
+# define GLOBAL(g) G.g
+#endif /* ?ZIP */
+
+
+#ifdef UNZIP
+ /* char *key = (char *)NULL; moved to globals.h */
+# ifndef FUNZIP
+ local int testp OF((__GPRO__ ZCONST uch *h));
+ local int testkey OF((__GPRO__ ZCONST uch *h, ZCONST char *key));
+# endif
+#endif /* UNZIP */
+
+#ifndef UNZIP /* moved to globals.h for UnZip */
+ local ulg keys[3]; /* keys defining the pseudo-random sequence */
+#endif /* !UNZIP */
+
+#ifndef Trace
+# ifdef CRYPT_DEBUG
+# define Trace(x) fprintf x
+# else
+# define Trace(x)
+# endif
+#endif
+
+#ifndef CRC_32_TAB
+# define CRC_32_TAB crc_32_tab
+#endif
+
+#define CRC32(c, b) (CRC_32_TAB[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
+
+/***********************************************************************
+ * Return the next byte in the pseudo-random sequence
+ */
+int decrypt_byte(__G)
+ __GDEF
+{
+ unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
+ * unpredictable manner on 16-bit systems; not a problem
+ * with any known compiler so far, though */
+
+ temp = ((unsigned)GLOBAL(keys[2]) & 0xffff) | 2;
+ return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+/***********************************************************************
+ * Update the encryption keys with the next byte of plain text
+ */
+int update_keys(__G__ c)
+ __GDEF
+ int c; /* byte of plain text */
+{
+ GLOBAL(keys[0]) = CRC32(GLOBAL(keys[0]), c);
+ GLOBAL(keys[1]) += GLOBAL(keys[0]) & 0xff;
+ GLOBAL(keys[1]) = GLOBAL(keys[1]) * 134775813L + 1;
+ {
+ register int keyshift = (int)(GLOBAL(keys[1]) >> 24);
+ GLOBAL(keys[2]) = CRC32(GLOBAL(keys[2]), keyshift);
+ }
+ return c;
+}
+
+
+/***********************************************************************
+ * Initialize the encryption keys and the random header according to
+ * the given password.
+ */
+void init_keys(__G__ passwd)
+ __GDEF
+ ZCONST char *passwd; /* password string with which to modify keys */
+{
+ GLOBAL(keys[0]) = 305419896L;
+ GLOBAL(keys[1]) = 591751049L;
+ GLOBAL(keys[2]) = 878082192L;
+ while (*passwd != '\0') {
+ update_keys(__G__ (int)*passwd);
+ passwd++;
+ }
+}
+
+
+#ifdef ZIP
+
+/***********************************************************************
+ * Write encryption header to file zfile using the password passwd
+ * and the cyclic redundancy check crc.
+ */
+void crypthead(passwd, crc, zfile)
+ ZCONST char *passwd; /* password string */
+ ulg crc; /* crc of file being encrypted */
+ FILE *zfile; /* where to write header */
+{
+ int n; /* index in random header */
+ int t; /* temporary */
+ int c; /* random byte */
+ int ztemp; /* temporary for zencoded value */
+ uch header[RAND_HEAD_LEN-2]; /* random header */
+ static unsigned calls = 0; /* ensure different random header each time */
+
+ /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
+ * output of rand() to get less predictability, since rand() is
+ * often poorly implemented.
+ */
+ if (++calls == 1) {
+ srand((unsigned)time(NULL) ^ ZCR_SEED2);
+ }
+ init_keys(passwd);
+ for (n = 0; n < RAND_HEAD_LEN-2; n++) {
+ c = (rand() >> 7) & 0xff;
+ header[n] = (uch)zencode(c, t);
+ }
+ /* Encrypt random header (last two bytes is high word of crc) */
+ init_keys(passwd);
+ for (n = 0; n < RAND_HEAD_LEN-2; n++) {
+ ztemp = zencode(header[n], t);
+ putc(ztemp, zfile);
+ }
+ ztemp = zencode((int)(crc >> 16) & 0xff, t);
+ putc(ztemp, zfile);
+ ztemp = zencode((int)(crc >> 24) & 0xff, t);
+ putc(ztemp, zfile);
+}
+
+
+#ifdef UTIL
+
+/***********************************************************************
+ * Encrypt the zip entry described by z from file source to file dest
+ * using the password passwd. Return an error code in the ZE_ class.
+ */
+int zipcloak(z, source, dest, passwd)
+ struct zlist far *z; /* zip entry to encrypt */
+ FILE *source, *dest; /* source and destination files */
+ ZCONST char *passwd; /* password string */
+{
+ int c; /* input byte */
+ int res; /* result code */
+ ulg n; /* holds offset and counts size */
+ ush flag; /* previous flags */
+ int t; /* temporary */
+ int ztemp; /* temporary storage for zencode value */
+
+ /* Set encrypted bit, clear extended local header bit and write local
+ header to output file */
+ if ((n = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP;
+ z->off = n;
+ flag = z->flg;
+ z->flg |= 1, z->flg &= ~8;
+ z->lflg |= 1, z->lflg &= ~8;
+ z->siz += RAND_HEAD_LEN;
+ if ((res = putlocal(z, dest)) != ZE_OK) return res;
+
+ /* Initialize keys with password and write random header */
+ crypthead(passwd, z->crc, dest);
+
+ /* Skip local header in input file */
+ if (fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext),
+ SEEK_CUR)) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+
+ /* Encrypt data */
+ for (n = z->siz - RAND_HEAD_LEN; n; n--) {
+ if ((c = getc(source)) == EOF) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+ ztemp = zencode(c, t);
+ putc(ztemp, dest);
+ }
+ /* Skip extended local header in input file if there is one */
+ if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+ if (fflush(dest) == EOF) return ZE_TEMP;
+ return ZE_OK;
+}
+
+/***********************************************************************
+ * Decrypt the zip entry described by z from file source to file dest
+ * using the password passwd. Return an error code in the ZE_ class.
+ */
+int zipbare(z, source, dest, passwd)
+ struct zlist far *z; /* zip entry to encrypt */
+ FILE *source, *dest; /* source and destination files */
+ ZCONST char *passwd; /* password string */
+{
+ int c0, c1; /* last two input bytes */
+ ulg offset; /* used for file offsets */
+ ulg size; /* size of input data */
+ int r; /* size of encryption header */
+ int res; /* return code */
+ ush flag; /* previous flags */
+
+ /* Save position and skip local header in input file */
+ if ((offset = (ulg)ftell(source)) == (ulg)-1L ||
+ fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext),
+ SEEK_CUR)) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+ /* Initialize keys with password */
+ init_keys(passwd);
+
+ /* Decrypt encryption header, save last two bytes */
+ c1 = 0;
+ for (r = RAND_HEAD_LEN; r; r--) {
+ c0 = c1;
+ if ((c1 = getc(source)) == EOF) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+ Trace((stdout, " (%02x)", c1));
+ zdecode(c1);
+ Trace((stdout, " %02x", c1));
+ }
+ Trace((stdout, "\n"));
+
+ /* If last two bytes of header don't match crc (or file time in the
+ * case of an extended local header), back up and just copy. For
+ * pkzip 2.0, the check has been reduced to one byte only.
+ */
+#ifdef ZIP10
+ if ((ush)(c0 | (c1<<8)) !=
+ (z->flg & 8 ? (ush) z->tim & 0xffff : (ush)(z->crc >> 16))) {
+#else
+ c0++; /* avoid warning on unused variable */
+ if ((ush)c1 != (z->flg & 8 ? (ush) z->tim >> 8 : (ush)(z->crc >> 24))) {
+#endif
+ if (fseek(source, offset, SEEK_SET)) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+ if ((res = zipcopy(z, source, dest)) != ZE_OK) return res;
+ return ZE_MISS;
+ }
+
+ /* Clear encrypted bit and local header bit, and write local header to
+ output file */
+ if ((offset = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP;
+ z->off = offset;
+ flag = z->flg;
+ z->flg &= ~9;
+ z->lflg &= ~9;
+ z->siz -= RAND_HEAD_LEN;
+ if ((res = putlocal(z, dest)) != ZE_OK) return res;
+
+ /* Decrypt data */
+ for (size = z->siz; size; size--) {
+ if ((c1 = getc(source)) == EOF) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+ zdecode(c1);
+ putc(c1, dest);
+ }
+ /* Skip extended local header in input file if there is one */
+ if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) {
+ return ferror(source) ? ZE_READ : ZE_EOF;
+ }
+ if (fflush(dest) == EOF) return ZE_TEMP;
+
+ return ZE_OK;
+}
+
+
+#else /* !UTIL */
+
+/***********************************************************************
+ * If requested, encrypt the data in buf, and in any case call fwrite()
+ * with the arguments to zfwrite(). Return what fwrite() returns.
+ */
+unsigned zfwrite(buf, item_size, nb, f)
+ zvoid *buf; /* data buffer */
+ extent item_size; /* size of each item in bytes */
+ extent nb; /* number of items */
+ FILE *f; /* file to write to */
+{
+ int t; /* temporary */
+
+ if (key != (char *)NULL) { /* key is the global password pointer */
+ ulg size; /* buffer size */
+ char *p = (char*)buf; /* steps through buffer */
+
+ /* Encrypt data in buffer */
+ for (size = item_size*(ulg)nb; size != 0; p++, size--) {
+ *p = (char)zencode(*p, t);
+ }
+ }
+ /* Write the buffer out */
+ return fwrite(buf, item_size, nb, f);
+}
+
+#endif /* ?UTIL */
+#endif /* ZIP */
+
+
+#if (defined(UNZIP) && !defined(FUNZIP))
+
+/***********************************************************************
+ * Get the password and set up keys for current zipfile member.
+ * Return PK_ class error.
+ */
+int decrypt(__G__ passwrd)
+ __GDEF
+ ZCONST char *passwrd;
+{
+ ush b;
+ int n, r;
+ uch h[RAND_HEAD_LEN];
+
+ Trace((stdout, "\n[incnt = %d]: ", GLOBAL(incnt)));
+
+ /* get header once (turn off "encrypted" flag temporarily so we don't
+ * try to decrypt the same data twice) */
+ GLOBAL(pInfo->encrypted) = FALSE;
+ defer_leftover_input(__G);
+ for (n = 0; n < RAND_HEAD_LEN; n++) {
+ b = NEXTBYTE;
+ h[n] = (uch)b;
+ Trace((stdout, " (%02x)", h[n]));
+ }
+ undefer_input(__G);
+ GLOBAL(pInfo->encrypted) = TRUE;
+
+ if (GLOBAL(newzip)) { /* this is first encrypted member in this zipfile */
+ GLOBAL(newzip) = FALSE;
+ if (passwrd != (char *)NULL) { /* user gave password on command line */
+ if (!GLOBAL(key)) {
+ if ((GLOBAL(key) = (char *)malloc(strlen(passwrd)+1)) ==
+ (char *)NULL)
+ return PK_MEM2;
+ strcpy(GLOBAL(key), passwrd);
+ GLOBAL(nopwd) = TRUE; /* inhibit password prompting! */
+ }
+ } else if (GLOBAL(key)) { /* get rid of previous zipfile's key */
+ free(GLOBAL(key));
+ GLOBAL(key) = (char *)NULL;
+ }
+ }
+
+ /* if have key already, test it; else allocate memory for it */
+ if (GLOBAL(key)) {
+ if (!testp(__G__ h))
+ return PK_COOL; /* existing password OK (else prompt for new) */
+ else if (GLOBAL(nopwd))
+ return PK_WARN; /* user indicated no more prompting */
+ } else if ((GLOBAL(key) = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL)
+ return PK_MEM2;
+
+ /* try a few keys */
+ n = 0;
+ do {
+ r = (*G.decr_passwd)((zvoid *)&G, &n, GLOBAL(key), IZ_PWLEN+1,
+ GLOBAL(zipfn), GLOBAL(filename));
+ if (r == IZ_PW_ERROR) { /* internal error in fetch of PW */
+ free (GLOBAL(key));
+ GLOBAL(key) = NULL;
+ return PK_MEM2;
+ }
+ if (r != IZ_PW_ENTERED) { /* user replied "skip" or "skip all" */
+ *GLOBAL(key) = '\0'; /* We try the NIL password, ... */
+ n = 0; /* and cancel fetch for this item. */
+ }
+ if (!testp(__G__ h))
+ return PK_COOL;
+ if (r == IZ_PW_CANCELALL) /* User replied "Skip all" */
+ GLOBAL(nopwd) = TRUE; /* inhibit any further PW prompt! */
+ } while (n > 0);
+
+ return PK_WARN;
+
+} /* end function decrypt() */
+
+
+
+/***********************************************************************
+ * Test the password. Return -1 if bad, 0 if OK.
+ */
+local int testp(__G__ h)
+ __GDEF
+ ZCONST uch *h;
+{
+ int r;
+ char *key_translated;
+
+ /* On systems with "obscure" native character coding (e.g., EBCDIC),
+ * the first test translates the password to the "main standard"
+ * character coding. */
+
+#ifdef STR_TO_CP1
+ /* allocate buffer for translated password */
+ if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL)
+ return -1;
+ /* first try, test password translated "standard" charset */
+ r = testkey(__G__ h, STR_TO_CP1(key_translated, GLOBAL(key)));
+#else /* !STR_TO_CP1 */
+ /* first try, test password as supplied on the extractor's host */
+ r = testkey(__G__ h, GLOBAL(key));
+#endif /* ?STR_TO_CP1 */
+
+#ifdef STR_TO_CP2
+ if (r != 0) {
+#ifndef STR_TO_CP1
+ /* now prepare for second (and maybe third) test with translated pwd */
+ if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL)
+ return -1;
+#endif
+ /* second try, password translated to alternate ("standard") charset */
+ r = testkey(__G__ h, STR_TO_CP2(key_translated, GLOBAL(key)));
+#ifdef STR_TO_CP3
+ if (r != 0)
+ /* third try, password translated to another "standard" charset */
+ r = testkey(__G__ h, STR_TO_CP3(key_translated, GLOBAL(key)));
+#endif
+#ifndef STR_TO_CP1
+ free(key_translated);
+#endif
+ }
+#endif /* STR_TO_CP2 */
+
+#ifdef STR_TO_CP1
+ free(key_translated);
+ if (r != 0) {
+ /* last resort, test password as supplied on the extractor's host */
+ r = testkey(__G__ h, GLOBAL(key));
+ }
+#endif /* STR_TO_CP1 */
+
+ return r;
+
+} /* end function testp() */
+
+
+local int testkey(__G__ h, key)
+ __GDEF
+ ZCONST uch *h; /* decrypted header */
+ ZCONST char *key; /* decryption password to test */
+{
+ ush b;
+#ifdef ZIP10
+ ush c;
+#endif
+ int n;
+ uch *p;
+ uch hh[RAND_HEAD_LEN]; /* decrypted header */
+
+ /* set keys and save the encrypted header */
+ init_keys(__G__ key);
+ memcpy(hh, h, RAND_HEAD_LEN);
+
+ /* check password */
+ for (n = 0; n < RAND_HEAD_LEN; n++) {
+ zdecode(hh[n]);
+ Trace((stdout, " %02x", hh[n]));
+ }
+
+ Trace((stdout,
+ "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n",
+ GLOBAL(lrec.crc32), GLOBAL(pInfo->crc),
+ GLOBAL(pInfo->ExtLocHdr) ? "true":"false"));
+ Trace((stdout, " incnt = %d unzip offset into zipfile = %ld\n",
+ GLOBAL(incnt),
+ GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr)-GLOBAL(inbuf))));
+
+ /* same test as in zipbare(): */
+
+#ifdef ZIP10 /* check two bytes */
+ c = hh[RAND_HEAD_LEN-2], b = hh[RAND_HEAD_LEN-1];
+ Trace((stdout,
+ " (c | (b<<8)) = %04x (crc >> 16) = %04x lrec.time = %04x\n",
+ (ush)(c | (b<<8)), (ush)(GLOBAL(lrec.crc32) >> 16),
+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff))));
+ if ((ush)(c | (b<<8)) != (GLOBAL(pInfo->ExtLocHdr) ?
+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff) :
+ (ush)(GLOBAL(lrec.crc32) >> 16)))
+ return -1; /* bad */
+#else
+ b = hh[RAND_HEAD_LEN-1];
+ Trace((stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n",
+ b, (ush)(GLOBAL(lrec.crc32) >> 24),
+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff));
+ if (b != (GLOBAL(pInfo->ExtLocHdr) ?
+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff :
+ (ush)(GLOBAL(lrec.crc32) >> 24)))
+ return -1; /* bad */
+#endif
+ /* password OK: decrypt current buffer contents before leaving */
+ for (n = (long)GLOBAL(incnt) > GLOBAL(csize) ?
+ (int)GLOBAL(csize) : GLOBAL(incnt),
+ p = GLOBAL(inptr); n--; p++)
+ zdecode(*p);
+ return 0; /* OK */
+
+} /* end function testkey() */
+
+#endif /* UNZIP && !FUNZIP */
+
+#else /* !CRYPT */
+
+/* something "externally visible" to shut up compiler/linker warnings */
+int zcr_dummy;
+
+#endif /* ?CRYPT */
175 build/install/installer/crypt.h
@@ -0,0 +1,175 @@
+/*
+ Copyright (c) 1990-2004 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2000-Apr-09 or later
+ (the contents of which are also included in zip.h) for terms of use.
+ If, for some reason, all these files are missing, the Info-ZIP license
+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
+*/
+/*
+ crypt.h (full version) by Info-ZIP. Last revised: [see CR_VERSION_DATE]
+
+ This encryption/decryption source code for Info-Zip software was
+ originally written in Europe. The whole source package can be
+ freely distributed, including from the USA. (Prior to January 2000,
+ re-export from the US was a violation of US law.)
+
+ NOTE on copyright history:
+ Previous versions of this source package (up to version 2.8) were
+ not copyrighted and put in the public domain. If you cannot comply
+ with the Info-Zip LICENSE, you may want to look for one of those
+ public domain versions.
+ */
+
+#ifndef __crypt_h /* don't include more than once */
+#define __crypt_h
+
+#ifdef CRYPT
+# undef CRYPT
+#endif
+/*
+ Logic of selecting "full crypt" code:
+ a) default behaviour:
+ - dummy crypt code when compiling UnZipSFX stub, to minimize size
+ - full crypt code when used to compile Zip, UnZip and fUnZip
+ b) USE_CRYPT defined:
+ - always full crypt code
+ c) NO_CRYPT defined:
+ - never full crypt code
+ NO_CRYPT takes precedence over USE_CRYPT
+ */
+#if defined(NO_CRYPT)
+# define CRYPT 0 /* dummy version */
+#else
+#if defined(USE_CRYPT)
+# define CRYPT 1 /* full version */
+#else
+#if !defined(SFX)
+# define CRYPT 1 /* full version for zip and main unzip*/
+#else
+# define CRYPT 0 /* dummy version for unzip sfx */
+#endif
+#endif /* ?USE_CRYPT */
+#endif /* ?NO_CRYPT */
+
+#if CRYPT
+/* full version */
+
+#ifdef CR_BETA
+# undef CR_BETA /* this is not a beta release */
+#endif
+
+#define CR_MAJORVER 2
+#define CR_MINORVER 9
+#ifdef CR_BETA
+# define CR_BETA_VER "a BETA"
+# define CR_VERSION_DATE "05 May 2000" /* last real code change */
+#else
+# define CR_BETA_VER ""
+# define CR_VERSION_DATE "05 May 2000" /* last public release date */
+# define CR_RELEASE
+#endif
+
+#ifndef __G /* UnZip only, for now (DLL stuff) */
+# define __G
+# define __G__
+# define __GDEF
+# define __GPRO void
+# define __GPRO__
+#endif
+
+#if defined(MSDOS) || defined(OS2) || defined(WIN32)
+# ifndef DOS_OS2_W32
+# define DOS_OS2_W32
+# endif
+#endif
+
+#if defined(DOS_OS2_W32) || defined(__human68k__)
+# ifndef DOS_H68_OS2_W32
+# define DOS_H68_OS2_W32
+# endif
+#endif
+
+#if defined(VM_CMS) || defined(MVS)
+# ifndef CMS_MVS
+# define CMS_MVS
+# endif
+#endif
+
+/* To allow combining of Zip and UnZip static libraries in a single binary,
+ * the Zip and UnZip versions of the crypt core functions have to be named
+ * differently.
+ */
+#ifdef ZIP
+# ifdef REALLY_SHORT_SYMS
+# define decrypt_byte zdcrby
+# else
+# define decrypt_byte zp_decrypt_byte
+# endif
+# define update_keys zp_update_keys
+# define init_keys zp_init_keys
+#else /* !ZIP */
+# ifdef REALLY_SHORT_SYMS
+# define decrypt_byte dcrbyt
+# endif
+#endif /* ?ZIP */
+
+#define IZ_PWLEN 80 /* input buffer size for reading encryption key */
+#ifndef PWLEN /* for compatibility with previous zcrypt release... */
+# define PWLEN IZ_PWLEN
+#endif
+#define RAND_HEAD_LEN 12 /* length of encryption random header */
+
+/* the crc_32_tab array has to be provided externally for the crypt calculus */
+#ifndef CRC_32_TAB /* UnZip provides this in globals.h */
+# if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB))
+ extern ZCONST ulg near *crc_32_tab;
+# else
+ extern ZCONST ulg Far *crc_32_tab;
+# endif
+#endif /* !CRC_32_TAB */
+
+/* encode byte c, using temp t. Warning: c must not have side effects. */
+#define zencode(c,t) (t=decrypt_byte(__G), update_keys(c), t^(c))
+
+/* decode byte c in place */
+#define zdecode(c) update_keys(__G__ c ^= decrypt_byte(__G))
+
+int decrypt_byte OF((__GPRO));
+int update_keys OF((__GPRO__ int c));
+void init_keys OF((__GPRO__ ZCONST char *passwd));
+
+#ifdef ZIP
+ void crypthead OF((ZCONST char *, ulg, FILE *));
+# ifdef UTIL
+ int zipcloak OF((struct zlist far *, FILE *, FILE *, ZCONST char *));
+ int zipbare OF((struct zlist far *, FILE *, FILE *, ZCONST char *));
+# else
+ unsigned zfwrite OF((zvoid *, extent, extent, FILE *));
+ extern char *key;
+# endif
+#endif /* ZIP */
+
+#if (defined(UNZIP) && !defined(FUNZIP))
+ int decrypt OF((__GPRO__ ZCONST char *passwrd));
+#endif
+
+#ifdef FUNZIP
+ extern int encrypted;
+# ifdef NEXTBYTE
+# undef NEXTBYTE
+# endif
+# define NEXTBYTE \
+ (encrypted? update_keys(__G__ getc(G.in)^decrypt_byte(__G)) : getc(G.in))
+#endif /* FUNZIP */
+