File: INSTALL.lisp

package info (click to toggle)
cl-portable-aserve 20190720.gitcac1d69%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,244 kB
  • sloc: lisp: 22,571; makefile: 55; sh: 36
file content (104 lines) | stat: -rw-r--r-- 3,835 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: CL-USER; -*-

(in-package "CL-USER")

(cerror "Continue anyway."
        "QuickLisp (http://quicklisp.org) is the recommended way of installing Portable AllegroServe.")

(defun ensure-asdf ()
  #+asdf (return-from ensure-asdf t)
  #+sbcl (require :asdf)
  #-sbcl (let ((asdf-pathname
                (merge-pathnames (make-pathname
                                  :directory '(:relative "libs")
                                  :name "asdf"
                                  :case :local)
                                 *load-truename*)))
           (load asdf-pathname)))

(ensure-asdf)

(progn
  (flet ((find-or-load-system (system path)
           (let ((path (merge-pathnames path *load-truename*)))
             (unless (asdf:find-system system nil)
               (load path)))))
    (find-or-load-system :puri
                         (make-pathname
                          :directory '(:relative "libs" "puri-1.3.1")
                          :name "puri" :type "asd" :case :local))
    (find-or-load-system :cl-ppcre
                         (make-pathname
                          :directory '(:relative "libs" "cl-ppcre")
                          :name "cl-ppcre" :type "asd" :case :local))
    (find-or-load-system :acl-compat
                         (make-pathname
                          :directory '(:relative "acl-compat")
                          :name "acl-compat" :type "asd" :case :local))
    (find-or-load-system :htmlgen
                         (make-pathname
                          :directory '(:relative "aserve" "htmlgen")
                          :name "htmlgen" :type "asd" :case :local))
    (find-or-load-system :aserve
                         (make-pathname
                          :directory '(:relative "aserve")
                          :name "aserve" :type "asd" :case :local))
    (find-or-load-system :webactions
                         (make-pathname
                          :directory '(:relative "aserve" "webactions")
                          :name "webactions" :type "asd" :case :local)))
  ;; Compile and load the ASERVE system
  (asdf:operate 'asdf:load-op :aserve)
  (asdf:operate 'asdf:load-op :webactions)

  ;; Startup multiprocessing.
  ;;
  ;; this isn't strictly necessary, but scheduling feels very coarse
  ;; before the evaluation of (startup-idle-and-top-level-loops) --
  ;; answer delays of about 1s per http request.
  ;;
  ;; KLUDGE: startup-idle-and-top-level-loops can only be evaluated
  ;; once, so we look for something resembling an existing idle loop
  ;; before invoking it.
  #||
  #+mp
  (unless (find-if
           #'(lambda (proc) (string= (mp:process-name proc) "Idle Loop"))
           (mp:all-processes))
    (mp::startup-idle-and-top-level-loops))
  ||#
  ;; DOUBLE KLUDGE: The preceding (commented-out) form caused the
  ;; loading of INSTALL.lisp to abort silently (!), so we do the
  ;; following, pilfered from eclipse the window manager:
  #+(and cmu mp)
  (setf mp::*idle-process* mp::*initial-process*)

  )


#||
;;; To test the installation, evaluate the following:

;;; Load example.lisp in the aserve directory.
(load "aserve:example.cl")

;;; Select example package
(in-package :aserve-example)

;;; This option enables extended debug message output
(net.aserve::debug-on :info)

;;; This option enables to enter the debugger if an error
;;; occurs. (instead of simply logging and ignoring it)
(net.aserve::debug-on :notrap)

;;; Start example server (in multiprocessing) on port 2001
(start-server :port 2001)

;; SSL server example
(start-server :port 2443
              :ssl (lispworks:example-file "ssl/cert-and-key.pem")
              :ssl-password "123456")

;MCL/OpenMCL note: chunking is not yet implemented so use (start-server :port 2001 :chunking nil)
||#