removed make-archive, fixed some typos

svn: r4121
This commit is contained in:
Eli Barzilay 2006-08-23 04:46:42 +00:00
parent 7bb28055f4
commit 5c46f725c8
2 changed files with 11 additions and 158 deletions

View File

@ -21,10 +21,10 @@ _mzssl.ss_ library
The variables below are provided the by "mzssl.ss" library.
> ssl-available?
> ssl-available?
A boolean value which says whether the system openssl library was
successfully loaded. Calling `ssl-connect', etc. when this value is
successfully loaded. Calling `ssl-connect', etc when this value is
#f (library not loaded) will raise an error.
> ssl-load-failure-reason
@ -56,7 +56,7 @@ the server. See also `ports->ssl-ports'.
> (ssl-connect/enable-break hostname port-k [client-context-or-protocol-symbol])
Like `ssl-connect', but breaking is enabled while trying to connect.
Like `ssl-connect', but breaking is enabled while trying to connect.
> (ssl-make-client-context [protocol-symbol])
@ -146,17 +146,17 @@ otherwise.
Returns two values --- an input port and an output port --- that
implement the SSL protocol over the given input and output port. (The
given ports should be connected to another process that runs the SLL
given ports should be connected to another process that runs the SSL
protocol.)
The `mod-symbol' argument can be 'connect or 'accept, and it defaults
to `accept. The mode determines how the SSL protocol is initialized
over the ports, either as a client or as a server. As with
`ssl-listen', in 'accept mode supply a `context' that has been
initialized with `ssl-load-certificate-chain!' and
`ssl-load-private-key!' to avoid a _no shared cipher_ error.
The `mode-symbol' argument can be 'connect or 'accept (defaults to
'accept). The mode determines how the SSL protocol is initialized over
the ports, either as a client or as a server. As with `ssl-listen', in
'accept mode supply a `context' that has been initialized with
`ssl-load-certificate-chain!' and `ssl-load-private-key!' to avoid a
_no shared cipher_ error.
The `context' argument should be a client context for 'connect more or
The `context' argument should be a client context for 'connect mode or
a server context for 'accept mode. If it is not supplied, a context is
created using the protocol specified by a `protocol-symbol' argument.

View File

@ -1,147 +0,0 @@
;; This module creates openssl-<version>.<platform>.plt.
;;
;; For Windows and Mac OS X, it creates an archive
;; with a "precompiled" subdirectory containing
;; the compiled extension.
;;
;; For Windows, it also arranges for
;; {lib,sll}eay32<version>.dll
;; to be in the archive, and it mangles the extension
;; to replace references to
;; {lib,sll}eay32xxxxxxx.dll
;; to the versioned names. The xxxxxxx DLLs must
;; be in the PLT directory (two levels up from here)
;; to be compied and version-mangled.
(module make-archive mzscheme
(require (lib "pack.ss" "setup")
(lib "file.ss")
(lib "cmdline.ss"))
(define target-sys-type (system-type))
(command-line
"make-archive"
(current-command-line-arguments)
(once-each
[("-s" "--src") "Make source bundle"
(set! target-sys-type 'unix)]))
(define tmp-dir (find-system-path 'temp-dir))
(define work-dir (build-path tmp-dir "mk-openssl-plt"))
(when (directory-exists? work-dir)
(error 'make-archive "please delete leftover work directory: ~a"
work-dir))
(make-directory work-dir)
(printf "Working in ~a~n" work-dir)
(define ssl-target-dir (build-path work-dir "collects" "openssl"))
(make-directory* ssl-target-dir)
(define (copy-files from to re)
(for-each (lambda (f)
(when (and (file-exists? (build-path from f))
(regexp-match re f)
(not (regexp-match #rx"~$" f))
(not (regexp-match #rx"[.]plt$" f))
(not (regexp-match #rx"^#.*#$" f))
(not (regexp-match #rx"^[.]#" f)))
(copy-file (build-path from f) (build-path to f))))
(directory-list from)))
(copy-files (collection-path "openssl") ssl-target-dir #rx".")
(unless (eq? target-sys-type 'unix)
(let ()
(define pre-dir (build-path ssl-target-dir "precompiled" "native" (system-library-subpath)))
(make-directory* pre-dir)
(copy-files (build-path (collection-path "openssl")
"compiled"
"native"
(system-library-subpath))
pre-dir
(if (eq? target-sys-type 'windows)
#rx"[.]dll$"
#rx"[.]so$"))
(when (eq? target-sys-type 'windows)
;; Assume that the xxxx-ized versions of the DLLs are in
;; the plt directory:
(let* ([new-version (substring
(regexp-replace*
"alpha"
(format "~a_000000000" (version))
"a")
0
7)]
[target-name
(lambda (x)
(format "~aeay32~a.dll" x new-version))]
[move-dll
(lambda (x)
(copy-file (build-path (collection-path "openssl")
'up 'up
(format "~aeay32xxxxxxx.dll" x))
(build-path pre-dir
(target-name x))))])
(move-dll "lib")
(move-dll "ssl")
;; Mangle xxxxxxxx to a version:
(let ([fixup
(lambda (f)
(let ([p (build-path pre-dir f)])
(let ([i (open-input-file p)]
[o (open-output-file p 'append)])
(let loop ()
(file-position i 0)
;; This is a poor technique for updating the files, but
;; it works well enough.
(let ([m (regexp-match-positions #rx"[eE][aA][yY]32xxxxxxx" i)])
(when m
(file-position o (+ (caar m) 5))
(display new-version o)
(loop))))
(close-input-port i)
(close-output-port o))))])
(fixup "mzssl.dll")
(fixup (target-name "lib"))
(fixup (target-name "ssl")))))
'done))
(parameterize ([current-directory work-dir])
(pack "openssl.plt"
"OpenSSL for PLT"
(list (build-path "collects" "openssl"))
'(("openssl"))
(lambda (x) #t) ; filter nothing
#t
'file
#f
#t ;; plt-relative
null ;; FIXME - we need better version tracking!
'(("openssl"))
#t)) ;; rel to PLTHOME
(define dest (format "openssl-~a.~a.plt"
(version)
(case target-sys-type
[(windows) "i386-win32"]
[(macosx) "ppc-macosx"]
[else "src"])))
(when (file-exists? dest)
(delete-file dest))
(copy-file (build-path work-dir "openssl.plt") dest)
(delete-directory/files work-dir)
(printf "Output to ~a~n" dest))