some refactoring and UI tweaking, just OpenSRF at the moment
authorJason Etheridge <jason@equinoxinitiative.org>
Thu, 3 Jan 2019 19:50:08 +0000 (14:50 -0500)
committerJason Etheridge <jason@equinoxinitiative.org>
Thu, 3 Jan 2019 19:50:08 +0000 (14:50 -0500)
installer/stretch/eg_stretch_installer.sh
installer/stretch/ejabberd.EG.patch
qa/test_output.css
qa/test_output_webifier.pl

index 44f4348..89e5af7 100755 (executable)
@@ -26,20 +26,108 @@ do
 done
 
 function my_init {
+
+    echo __--== Setup
+
     date
     init_variables
     configure_timezone
     configure_cpan
     build_essentials
-    setting_up_opensrf_env
-    cloning_git_repos
+
+    echo __--== Installing OpenSRF
+    echo __--==2 1. Preamble: referenced user accounts
+
+    setting_up_test_user_env
+
+    echo __--==2 2. Download and unpack the code
+
+    cloning_opensrf_git_repos
+
+    echo __--==2 3. Installing prerequisites
+
     opensrf_prereqs
-    evergreen_prereqs
-    evergreen_db_prereqs
-    setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd
+
+    echo __--==2 4. Preamble: Developer instructions
+
+    opensrf_developer_steps
+
+    echo __--==2 5. Configuration and compilation instructions
+
     build_opensrf
     test_opensrf_build
+
+    echo __--==2 6. Installation instructions
+
     install_opensrf
+
+    echo __--==2 7. Create and set up the opensrf Unix user environment
+
+    setting_up_opensrf_env
+
+    echo __--==2 8. Define your public and private OpenSRF domains
+
+    set_domains 
+
+    echo __--==2 9. Adjust the system dynamic library path
+
+    adjust_dynamic_library_path
+
+    echo __--==2 10. Configure the ejabberd server
+
+    configure_ejabberd
+
+    echo __--==2 11. Create the OpenSRF Jabber users
+
+    create_jabber_users
+
+    echo __--==2 12. Update the OpenSRF configuration files
+    echo __--==3 12.1. About the OpenSRF configuration files
+
+    echo __--==3 12.2. Updating the OpenSRF configuration files
+
+    set_opensrf_config
+
+    echo __--==2 13. Starting and stopping OpenSRF services
+
+    start_opensrf
+    sleep 10
+    stop_opensrf
+    sleep 10
+
+    echo __--==2 14. Testing the default OpenSRF services
+
+    start_opensrf
+    sleep 10
+    test_srfsh
+
+    echo __--==2 15. Optional: Websockets installation instructions
+
+    configure_websockets
+
+    echo __--==2 16. Optional: Using a web proxy
+
+    echo __--==2 17. Optional: Using NGINX as a proxy
+
+    echo __--==2 18. Optional: Using HAProxy as a proxy
+
+    echo __--==2 19. Troubleshooting note for Python users
+
+    echo __--==2 20. Getting help
+
+    echo __--== Miscellaneous
+
+    get_opensrf_tip
+
+    #setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd
+
+    exit 0;
+
+    # Evergreen install
+
+    cloning_evergreen_git_repos
+    evergreen_prereqs
+    evergreen_db_prereqs
     build_evergreen
     test_evergreen_build
     test_and_build_eg_browser_client
@@ -184,6 +272,262 @@ function build_essentials {
     echo End of Installing some build essentials  =~-._
 }
 
+function setting_up_test_user_env {
+    echo _.-~= creating test user and environment
+    date
+    # Create test user and set up environment
+    if [ ! "$(grep ^test: /etc/passwd)" ]; then
+        useradd -m -s /bin/bash test
+        echo Return Value = $?
+    fi;
+    echo end of creating test user and environment =~-._
+}
+
+function cloning_opensrf_git_repos {
+    echo _.-~= cloning OpenSRF git repository
+    date
+    TEST_COMMAND="
+    cd /home/test;
+    git clone --depth 1 --branch $OPENSRF_BRANCH $OPENSRF_REPO OpenSRF;
+    "
+    su - test sh -c "$TEST_COMMAND";
+    echo Return Value = $?
+
+    echo End of cloning OpenSRF git repository =~-._
+}
+
+function opensrf_prereqs {
+    echo _.-~= Installing OpenSRF pre-requisites
+    date
+    # Install pre-reqs
+    apt-get -yq install make
+    cd /home/test/OpenSRF/
+    if [ $YES ]; then
+        yes | make -f src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
+    else
+        make -f src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
+    fi;
+    echo Return Value = $?
+    echo End of Installing OpenSRF pre-requisites =~-._
+}
+
+function opensrf_developer_steps {
+    echo _.-~= OpenSRF developer steps
+    apt-get -yq install autoconf automake libtool
+    echo Return Value = $?
+    cd /home/test/OpenSRF/
+    autoreconf -i
+    echo Return Value = $?
+    echo End of OpenSRF developer steps =~-._
+}
+
+function build_opensrf {
+    # Build and install OpenSRF
+    echo _.-~= Building OpenSRF
+    date
+    TEST_COMMAND='
+    cd /home/test/OpenSRF;
+    ./configure --prefix=/openils --sysconfdir=/openils/conf;
+    make;'
+    su - test sh -c "$TEST_COMMAND"
+    echo Return Value = $?
+    echo End of Building OpenSRF =~-._
+}
+
+function test_opensrf_build {
+    echo _.-~= Running OpenSRF build tests
+    date
+    cd /home/test/OpenSRF;
+    make check
+    echo Return Value = $?
+    echo End of OpenSRF build tests =~-._
+}
+
+function install_opensrf {
+    echo _.-~= Installing OpenSRF
+    date
+    make install
+    echo Return Value = $?
+    echo End of Installing OpenSRF =~-._
+}
+
+function setting_up_opensrf_env {
+    echo _.-~= creating opensrf user and environment
+    date
+    # Create opensrf user and set up environment
+    if [ ! "$(grep ^opensrf: /etc/passwd)" ]; then
+        useradd -m -s /bin/bash opensrf
+        echo Return Value = $?
+        echo 'export PATH=/openils/bin:$PATH' >> /home/opensrf/.bashrc
+        chown -R opensrf:opensrf /openils
+    fi;
+    echo end of creating opensrf user and environment =~-._
+}
+
+function set_domains {
+    echo _.-~= updating /etc/hosts
+    if [ ! "$(grep 'public.localhost' /etc/hosts)" ]; then
+
+        if [ $YES ]; then
+            echo 'Adding public.localhost and private.localhost to /etc/hosts'
+            echo '127.0.1.2    public.localhost     public' >> /etc/hosts
+            echo '127.0.1.3    private.localhost    private' >> /etc/hosts
+        else
+
+        cat <<EOF
+
+    * Add these lines to /etc/hosts.
+
+    127.0.1.2   public.localhost    public
+    127.0.1.3   private.localhost   private
+
+EOF
+        fi;
+
+    else
+        echo "INFO: /etc/hosts already has public.localhost line";
+    fi
+    echo Return Value = $?
+    echo End of updating /etc/hosts =~-._
+}
+
+function adjust_dynamic_library_path {
+    echo _.-~= setting ld.so.conf.d
+    #echo 'export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH' >> /home/opensrf/.bashrc
+    echo /openils/lib > /etc/ld.so.conf.d/opensrf.conf
+    ldconfig
+    echo end of setting ld.so.conf.d =~-._
+}
+
+function configure_ejabberd {
+    echo _.-~= configuring ejabberd
+    echo stopping ejabberd
+    systemctl stop ejabberd.service
+    if [ ! "$(grep 'public.localhost' /etc/ejabberd/ejabberd.yml)" ]; then
+        cd /etc/ejabberd/
+        cp ejabberd.yml /root/ejabberd.yml
+        patch -p0 < $BASE_DIR/ejabberd.EG.patch
+        chown ejabberd:ejabberd ejabberd.yml
+    fi;
+    echo starting ejabberd after patching
+    date
+    systemctl start ejabberd.service
+    echo Return Value = $?
+    sleep 10;
+    echo End of configuring ejabberd =~-._
+}
+
+function create_jabber_users {
+    echo _.-~= creating jabber users
+    ejabberdctl register router  private.localhost $JABBER_PASSWORD
+    echo Return Value = $?
+    ejabberdctl register opensrf private.localhost $JABBER_PASSWORD
+    echo Return Value = $?
+    ejabberdctl register router  public.localhost  $JABBER_PASSWORD
+    echo Return Value = $?
+    ejabberdctl register opensrf public.localhost  $JABBER_PASSWORD
+    echo Return Value = $?
+    echo End of creating jabber users =~-._
+}
+
+function set_opensrf_config {
+    echo _.-~= configuring OpenSRF
+
+    cd /openils/conf/
+    cp opensrf_core.xml.example opensrf_core.xml
+    cp opensrf.xml.example opensrf.xml
+
+    chown -R opensrf:opensrf /openils/conf
+
+    cp srfsh.xml.example /home/opensrf/.srfsh.xml
+
+    chown opensrf:opensrf /home/opensrf/.srfsh.xml
+
+    echo End of configuring OpenSRF =~-._
+}
+
+function start_opensrf {
+    echo _.-~= start opensrf
+    OSRF_COMMAND='PATH=/openils/bin:$PATH osrf_control --localhost --start-all'
+    su - opensrf sh -c "$OSRF_COMMAND"
+    echo Return Value = $?
+    echo End of start opensrf =~-._
+}
+
+function stop_opensrf {
+    echo _.-~= stop opensrf
+    OSRF_COMMAND='PATH=/openils/bin:$PATH osrf_control --localhost --stop-all'
+    su - opensrf sh -c "$OSRF_COMMAND"
+    echo Return Value = $?
+    echo End of stop opensrf =~-._
+}
+
+function test_srfsh {
+    echo _.-~= test opensrf
+    OSRF_COMMAND='echo request opensrf.math add 2,2 | PATH=/openils/bin:$PATH srfsh'
+    su - opensrf sh -c "$OSRF_COMMAND"
+    echo Return Value = $?
+    echo End of test opensrf =~-._
+}
+
+function configure_websockets {
+    echo _.-~= configuring websockets
+
+    echo Install git if not already present:
+    apt-get install git-core
+
+    echo Install the apache-websocket module:
+    cd /tmp
+    git clone https://github.com/disconnect/apache-websocket
+    cd apache-websocket
+    apxs2 -i -a -c mod_websocket.c
+    echo Return Value = $?
+
+    echo Create the websocket Apache instance
+    sh /usr/share/doc/apache2/examples/setup-instance websockets
+    echo Return Value = $?
+
+    echo Change to the directory into which you unpacked OpenSRF, then copy into place the config files
+    cd ~test/OpenSRF
+    cp examples/apache_24/websockets/apache2.conf /etc/apache2-websockets/
+
+    echo OPTIONAL: add these configuration variables to /etc/apache2-websockets/envvars and adjust as needed.
+    echo 'export OSRF_WEBSOCKET_IDLE_TIMEOUT=120' >> /etc/apache2-websockets/envvars
+    echo 'export OSRF_WEBSOCKET_IDLE_CHECK_INTERVAL=5' >> /etc/apache2-websockets/envvars
+    echo 'export OSRF_WEBSOCKET_CONFIG_FILE=/openils/conf/opensrf_core.xml' >> /etc/apache2-websockets/envvars
+    echo 'export OSRF_WEBSOCKET_CONFIG_CTXT=gateway' >> /etc/apache2-websockets/envvars
+    echo 'export OSRF_WEBSOCKET_MAX_REQUEST_WAIT_TIME=600' >> /etc/apache2-websockets/envvars
+
+    echo Before you can start websockets, you must install a valid SSL certificate in /etc/apache2/ssl/
+
+    mkdir -p /etc/apache2/ssl;
+    if [ ! -f /etc/apache2/ssl/server.key ] ; then
+        echo -e "\n\nConfiguring a new temporary SSL certificate....\n";
+        if [ $YES ]; then
+           yes "" | openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
+        else
+           openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
+        fi;
+    else
+        echo -e "\nkeeping existing ssl/server.key file\n";
+    fi
+
+    a2enmod ssl  
+    echo Return Value = $?
+
+    echo After OpenSRF is up and running, fire up the secondary Apache instance. 
+    #/etc/init.d/apache2-websockets start
+    systemctl start apache2@websockets.service
+    echo Return Value = $?
+
+    echo End of configuring websockets =~-._
+}
+
+function get_opensrf_tip {
+    cd /home/test/OpenSRF/
+    echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
+}
+
 function docs_builder_prereqs {
     echo _.-~= Installing prereqs for building the documentation formats
     date
@@ -207,54 +551,27 @@ function build_the_docs {
     echo End of Building the AsciiDoc output formats =~-._
 }
 
-function setting_up_opensrf_env {
-    echo _.-~= creating opensrf user and environment
+function cloning_evergreen_git_repos {
+    echo _.-~= cloning Evergreen git repository
     date
-    # Create opensrf user and set up environment
-    if [ ! "$(grep ^opensrf: /etc/passwd)" ]; then
-        useradd -m -s /bin/bash opensrf
-        echo Return Value = $?
-        echo 'export PATH=/openils/bin:$PATH' >> /home/opensrf/.bashrc
-        echo 'export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH' >> /home/opensrf/.bashrc
-    fi;
-    echo end of creating opensrf user and environment =~-._
-}
-
-function cloning_git_repos {
-    echo _.-~= cloning git repositories
-    date
-    OSRF_COMMAND="
-    cd /home/opensrf;
-    git clone --depth 1 --branch $OPENSRF_BRANCH $OPENSRF_REPO OpenSRF;
+    TEST_COMMAND="
+    cd /home/test;
     git clone --depth 1 --branch $EVERGREEN_BRANCH $EVERGREEN_REPO Evergreen;
     "
-    rm -rf /home/opensrf/Evergreen /home/opensrf/OpenSRF
-    su - opensrf sh -c "$OSRF_COMMAND";
+    su - test sh -c "$TEST_COMMAND";
     echo Return Value = $?
 
+    echo End of cloning Evergreen git repository =~-._
+}
+
+function show_git_tips {
     # Show tips
-    cd /home/opensrf/OpenSRF/
+    cd /home/test/OpenSRF/
     echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
-    cd /home/opensrf/Evergreen/
+    cd /home/test/Evergreen/
     echo 'Tip of Evergreen:' `git log --format=oneline | head -1`
-
-    echo End of cloning git repositories =~-._
 }
 
-function opensrf_prereqs {
-    echo _.-~= Installing OpenSRF pre-requisites
-    date
-    # Install pre-reqs
-    mkdir -p /usr/src/evergreen; 
-    cd /usr/src/evergreen;
-    if [ $YES ]; then
-        yes | make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
-    else
-        make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
-    fi;
-    echo Return Value = $?
-    echo End of Installing OpenSRF pre-requisites =~-._
-}
 
 function evergreen_prereqs {
     echo _.-~= Installing Evergreen pre-requisites
@@ -290,28 +607,6 @@ function setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd {
     cp /home/opensrf/Evergreen/Open-ILS/examples/evergreen-rsyslog.conf /etc/rsyslog.d/evergreen.conf
     /etc/init.d/rsyslog restart
     echo Return Value = $?
-    if [ ! "$(grep 'public.localhost' /etc/hosts)" ]; then
-
-        if [ $YES ]; then
-            echo 'Adding public.localhost and private.localhost to /etc/hosts'
-            echo '127.0.1.2    public.localhost     public' >> /etc/hosts
-            echo '127.0.1.3    private.localhost    private' >> /etc/hosts
-        else
-
-        cat <<EOF
-
-    * Add these lines to /etc/hosts.
-
-    127.0.1.2   public.localhost    public
-    127.0.1.3   private.localhost   private
-
-EOF
-        fi;
-
-    else
-        echo "INFO: /etc/hosts already has public.localhost line";
-    fi
-    echo Return Value = $?
     # Patch Ejabberd and register users
     if [ ! "$(grep 'public.localhost' /etc/ejabberd/ejabberd.yml)" ]; then
         cd /etc/ejabberd/
@@ -337,37 +632,6 @@ EOF
     echo End of setting ld.so.conf and rsyslog and /etc/hosts and ejabberd =~-._
 }
 
-function build_opensrf {
-    # Build and install OpenSRF
-    echo _.-~= Building OpenSRF
-    date
-    OSRF_COMMAND='
-    cd /home/opensrf/OpenSRF;
-    autoreconf -i;
-    ./configure --prefix=/openils --sysconfdir=/openils/conf;
-    make;'
-    su - opensrf sh -c "$OSRF_COMMAND"
-    echo Return Value = $?
-    echo End of Building OpenSRF =~-._
-}
-
-function test_opensrf_build {
-    echo _.-~= Running OpenSRF build tests
-    date
-    cd /home/opensrf/OpenSRF;
-    make check
-    echo Return Value = $?
-    echo End of OpenSRF build tests =~-._
-}
-
-function install_opensrf {
-    echo _.-~= Installing OpenSRF
-    date
-    make install
-    echo Return Value = $?
-    echo End of Installing OpenSRF =~-._
-}
-
 function build_evergreen {
     echo _.-~= Building Evergreen
     date
index 52c34a5..be9ba1d 100644 (file)
@@ -1,12 +1,12 @@
---- ejabberd.yml.orig   2018-12-12 08:54:43.000000000 -0500
-+++ ejabberd.yml        2018-12-12 09:03:38.000000000 -0500
+--- ejabberd.yml.orig  2019-01-03 13:39:08.933987000 -0500
++++ ejabberd.yml       2019-01-03 13:41:18.261987000 -0500
 @@ -82,6 +82,8 @@
  ##
  hosts:
    - "localhost"
 +  - "private.localhost"
 +  - "public.localhost"
-
  ##
  ## route_subdomains: Delegate subdomains to other XMPP servers.
 @@ -248,7 +250,7 @@
    ##
 -  normal: 1000
 +  normal: 500000
-
    ##
    ## The "fast" shaper limits traffic speed to 50000 B/s
    ##
 -  fast: 50000
 +  fast: 500000
-
  ##
  ## This option specifies the maximum number of elements in the queue
 @@ -473,7 +475,7 @@
-
  shaper_rules:
    ## Maximum number of simultaneous sessions allowed for a single user:
 -  max_user_sessions: 10
@@ -46,9 +46,9 @@
    ## mod_muc_log: {}
    mod_muc_admin: {}
    ## mod_multicast: {}
--  mod_offline:
+-  mod_offline: 
 -    access_max_user_messages: max_user_offline_messages
-+  ##mod_offline:
++  ##mod_offline: 
 +  ##access_max_user_messages: max_user_offline_messages
    mod_ping: {}
    ## mod_pres_counter:
index 60f92d9..e0f9126 100644 (file)
@@ -6,3 +6,532 @@
 .notok { color: red; font-weight: bold; }
 .pass { color: green; font-weight: bold; }
 .fail { color: red; font-weight: bold; }
+
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
+
+/* Default font. */
+body {
+  font-family: Georgia,serif;
+}
+
+/* Title font. */
+h1, h2, h3, h4, h5, h6,
+div.title, caption.title,
+thead, p.table.header,
+#toctitle,
+#author, #revnumber, #revdate, #revremark,
+#footer {
+  font-family: Arial,Helvetica,sans-serif;
+}
+
+body {
+  margin: 1em 5% 1em 5%;
+}
+
+a {
+  color: blue;
+  text-decoration: underline;
+}
+a:visited {
+  color: fuchsia;
+}
+
+em {
+  font-style: italic;
+  color: navy;
+}
+
+strong {
+  font-weight: bold;
+  color: #083194;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  color: #527bbd;
+  margin-top: 1.2em;
+  margin-bottom: 0.5em;
+  line-height: 1.3;
+}
+
+h1, h2, h3 {
+  border-bottom: 2px solid silver;
+}
+h2 {
+  padding-top: 0.5em;
+}
+h3 {
+  float: left;
+}
+h3 + * {
+  clear: left;
+}
+h5 {
+  font-size: 1.0em;
+}
+
+div.sectionbody {
+  margin-left: 0;
+}
+
+hr {
+  border: 1px solid silver;
+}
+
+p {
+  margin-top: 0.5em;
+  margin-bottom: 0.5em;
+}
+
+ul, ol, li > p {
+  margin-top: 0;
+}
+ul > li     { color: #aaa; }
+ul > li > * { color: black; }
+
+.monospaced, code, pre {
+  font-family: "Courier New", Courier, monospace;
+  font-size: inherit;
+  color: navy;
+  padding: 0;
+  margin: 0;
+}
+pre {
+  white-space: pre-wrap;
+}
+
+#author {
+  color: #527bbd;
+  font-weight: bold;
+  font-size: 1.1em;
+}
+#email {
+}
+#revnumber, #revdate, #revremark {
+}
+
+#footer {
+  font-size: small;
+  border-top: 2px solid silver;
+  padding-top: 0.5em;
+  margin-top: 4.0em;
+}
+#footer-text {
+  float: left;
+  padding-bottom: 0.5em;
+}
+#footer-badges {
+  float: right;
+  padding-bottom: 0.5em;
+}
+
+#preamble {
+  margin-top: 1.5em;
+  margin-bottom: 1.5em;
+}
+div.imageblock, div.exampleblock, div.verseblock,
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
+div.admonitionblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+div.admonitionblock {
+  margin-top: 2.0em;
+  margin-bottom: 2.0em;
+  margin-right: 10%;
+  color: #606060;
+}
+
+div.content { /* Block element content. */
+  padding: 0;
+}
+
+/* Block element titles. */
+div.title, caption.title {
+  color: #527bbd;
+  font-weight: bold;
+  text-align: left;
+  margin-top: 1.0em;
+  margin-bottom: 0.5em;
+}
+div.title + * {
+  margin-top: 0;
+}
+
+td div.title:first-child {
+  margin-top: 0.0em;
+}
+div.content div.title:first-child {
+  margin-top: 0.0em;
+}
+div.content + div.title {
+  margin-top: 0.0em;
+}
+
+div.sidebarblock > div.content {
+  background: #ffffee;
+  border: 1px solid #dddddd;
+  border-left: 4px solid #f0f0f0;
+  padding: 0.5em;
+}
+
+div.listingblock > div.content {
+  border: 1px solid #dddddd;
+  border-left: 5px solid #f0f0f0;
+  background: #f8f8f8;
+  padding: 0.5em;
+}
+
+div.quoteblock, div.verseblock {
+  padding-left: 1.0em;
+  margin-left: 1.0em;
+  margin-right: 10%;
+  border-left: 5px solid #f0f0f0;
+  color: #888;
+}
+
+div.quoteblock > div.attribution {
+  padding-top: 0.5em;
+  text-align: right;
+}
+
+div.verseblock > pre.content {
+  font-family: inherit;
+  font-size: inherit;
+}
+div.verseblock > div.attribution {
+  padding-top: 0.75em;
+  text-align: left;
+}
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
+div.verseblock + div.attribution {
+  text-align: left;
+}
+
+div.admonitionblock .icon {
+  vertical-align: top;
+  font-size: 1.1em;
+  font-weight: bold;
+  text-decoration: underline;
+  color: #527bbd;
+  padding-right: 0.5em;
+}
+div.admonitionblock td.content {
+  padding-left: 0.5em;
+  border-left: 3px solid #dddddd;
+}
+
+div.exampleblock > div.content {
+  border-left: 3px solid #dddddd;
+  padding-left: 0.5em;
+}
+
+div.imageblock div.content { padding-left: 0; }
+span.image img { border-style: none; vertical-align: text-bottom; }
+a.image:visited { color: white; }
+
+dl {
+  margin-top: 0.8em;
+  margin-bottom: 0.8em;
+}
+dt {
+  margin-top: 0.5em;
+  margin-bottom: 0;
+  font-style: normal;
+  color: navy;
+}
+dd > *:first-child {
+  margin-top: 0.1em;
+}
+
+ul, ol {
+    list-style-position: outside;
+}
+ol.arabic {
+  list-style-type: decimal;
+}
+ol.loweralpha {
+  list-style-type: lower-alpha;
+}
+ol.upperalpha {
+  list-style-type: upper-alpha;
+}
+ol.lowerroman {
+  list-style-type: lower-roman;
+}
+ol.upperroman {
+  list-style-type: upper-roman;
+}
+
+div.compact ul, div.compact ol,
+div.compact p, div.compact p,
+div.compact div, div.compact div {
+  margin-top: 0.1em;
+  margin-bottom: 0.1em;
+}
+
+tfoot {
+  font-weight: bold;
+}
+td > div.verse {
+  white-space: pre;
+}
+
+div.hdlist {
+  margin-top: 0.8em;
+  margin-bottom: 0.8em;
+}
+div.hdlist tr {
+  padding-bottom: 15px;
+}
+dt.hdlist1.strong, td.hdlist1.strong {
+  font-weight: bold;
+}
+td.hdlist1 {
+  vertical-align: top;
+  font-style: normal;
+  padding-right: 0.8em;
+  color: navy;
+}
+td.hdlist2 {
+  vertical-align: top;
+}
+div.hdlist.compact tr {
+  margin: 0;
+  padding-bottom: 0;
+}
+
+.comment {
+  background: yellow;
+}
+
+.footnote, .footnoteref {
+  font-size: 0.8em;
+}
+
+span.footnote, span.footnoteref {
+  vertical-align: super;
+}
+
+#footnotes {
+  margin: 20px 0 20px 0;
+  padding: 7px 0 0 0;
+}
+
+#footnotes div.footnote {
+  margin: 0 0 5px 0;
+}
+
+#footnotes hr {
+  border: none;
+  border-top: 1px solid silver;
+  height: 1px;
+  text-align: left;
+  margin-left: 0;
+  width: 20%;
+  min-width: 100px;
+}
+
+div.colist td {
+  padding-right: 0.5em;
+  padding-bottom: 0.3em;
+  vertical-align: top;
+}
+div.colist td img {
+  margin-top: 0.3em;
+}
+
+@media print {
+  #footer-badges { display: none; }
+}
+
+#toc {
+  margin-bottom: 2.5em;
+}
+
+#toctitle {
+  color: #527bbd;
+  font-size: 1.1em;
+  font-weight: bold;
+  margin-top: 1.0em;
+  margin-bottom: 0.1em;
+}
+
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+  margin-top: 0;
+  margin-bottom: 0;
+}
+div.toclevel2 {
+  margin-left: 2em;
+  font-size: 0.9em;
+}
+div.toclevel3 {
+  margin-left: 4em;
+  font-size: 0.9em;
+}
+div.toclevel4 {
+  margin-left: 6em;
+  font-size: 0.9em;
+}
+
+span.aqua { color: aqua; }
+span.black { color: black; }
+span.blue { color: blue; }
+span.fuchsia { color: fuchsia; }
+span.gray { color: gray; }
+span.green { color: green; }
+span.lime { color: lime; }
+span.maroon { color: maroon; }
+span.navy { color: navy; }
+span.olive { color: olive; }
+span.purple { color: purple; }
+span.red { color: red; }
+span.silver { color: silver; }
+span.teal { color: teal; }
+span.white { color: white; }
+span.yellow { color: yellow; }
+
+span.aqua-background { background: aqua; }
+span.black-background { background: black; }
+span.blue-background { background: blue; }
+span.fuchsia-background { background: fuchsia; }
+span.gray-background { background: gray; }
+span.green-background { background: green; }
+span.lime-background { background: lime; }
+span.maroon-background { background: maroon; }
+span.navy-background { background: navy; }
+span.olive-background { background: olive; }
+span.purple-background { background: purple; }
+span.red-background { background: red; }
+span.silver-background { background: silver; }
+span.teal-background { background: teal; }
+span.white-background { background: white; }
+span.yellow-background { background: yellow; }
+
+span.big { font-size: 2em; }
+span.small { font-size: 0.6em; }
+
+span.underline { text-decoration: underline; }
+span.overline { text-decoration: overline; }
+span.line-through { text-decoration: line-through; }
+
+div.unbreakable { page-break-inside: avoid; }
+
+
+/*
+ * xhtml11 specific
+ *
+ * */
+
+div.tableblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+div.tableblock > table {
+  border: 3px solid #527bbd;
+}
+thead, p.table.header {
+  font-weight: bold;
+  color: #527bbd;
+}
+p.table {
+  margin-top: 0;
+}
+/* Because the table frame attribute is overriden by CSS in most browsers. */
+div.tableblock > table[frame="void"] {
+  border-style: none;
+}
+div.tableblock > table[frame="hsides"] {
+  border-left-style: none;
+  border-right-style: none;
+}
+div.tableblock > table[frame="vsides"] {
+  border-top-style: none;
+  border-bottom-style: none;
+}
+
+
+/*
+ * html5 specific
+ *
+ * */
+
+table.tableblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+thead, p.tableblock.header {
+  font-weight: bold;
+  color: #527bbd;
+}
+p.tableblock {
+  margin-top: 0;
+}
+table.tableblock {
+  border-width: 3px;
+  border-spacing: 0px;
+  border-style: solid;
+  border-color: #527bbd;
+  border-collapse: collapse;
+}
+th.tableblock, td.tableblock {
+  border-width: 1px;
+  padding: 4px;
+  border-style: solid;
+  border-color: #527bbd;
+}
+
+table.tableblock.frame-topbot {
+  border-left-style: hidden;
+  border-right-style: hidden;
+}
+table.tableblock.frame-sides {
+  border-top-style: hidden;
+  border-bottom-style: hidden;
+}
+table.tableblock.frame-none {
+  border-style: hidden;
+}
+
+th.tableblock.halign-left, td.tableblock.halign-left {
+  text-align: left;
+}
+th.tableblock.halign-center, td.tableblock.halign-center {
+  text-align: center;
+}
+th.tableblock.halign-right, td.tableblock.halign-right {
+  text-align: right;
+}
+
+th.tableblock.valign-top, td.tableblock.valign-top {
+  vertical-align: top;
+}
+th.tableblock.valign-middle, td.tableblock.valign-middle {
+  vertical-align: middle;
+}
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {
+  vertical-align: bottom;
+}
+
+
+/*
+ * manpage specific
+ *
+ * */
+
+body.manpage h1 {
+  padding-top: 0.5em;
+  padding-bottom: 0.5em;
+  border-top: 2px solid silver;
+  border-bottom: 2px solid silver;
+}
+body.manpage h2 {
+  border-style: none;
+}
+body.manpage div.sectionbody {
+  margin-left: 3em;
+}
+
+@media print {
+  body.manpage div#toc { display: none; }
+}
+
index f0416f0..35a4446 100755 (executable)
@@ -27,6 +27,34 @@ print MAIN_PAGE "<ul>\n";
 
 open PASS_FAIL, ">pass_fail.txt";
 
+my $subpage_open = 1;
+
+sub open_subpage {
+    my $s = shift;
+    if ($s) {
+        $prev_subpage = $subpage;
+        $prev_subpage_count = $subpage_count;
+        $subpage = $s;
+        $subpage_count++;
+        $subpage_open = 1;
+        $state = 'outputting';
+        print MAIN_PAGE qq^\n<li><a href="test.$subpage_count.html">$subpage</a>^;
+        open  SUB_PAGE, ">test.$subpage_count.html";
+        print SUB_PAGE html_header($subpage);
+        print SUB_PAGE "<h1>$subpage</h1>\n<pre>";
+    }
+}
+
+sub close_subpage {
+    if ($subpage_open) {
+        $subpage_open = 0;
+        $state = 'skipping';
+        print STDOUT "outputting $prev_subpage with error_count = $error_count\n";
+        print_pass_or_fail($subpage,$subpage_count,$error_count,$subpage_return_value);
+        $error_count = 0;
+    }
+}
+
 while (my $line = <>) {
     push @all_lines, $line;
     if ($line =~ /Tip of OpenSRF: (.*)/) {
@@ -35,19 +63,24 @@ while (my $line = <>) {
     if ($line =~ /Tip of Evergreen: (.*)/) {
         $evergreen_tip = $1;
     }
+    if ($line =~ /__--== (.*)$/) {
+        close_subpage();
+        print STDOUT "outputting section header $1\n";
+        print MAIN_PAGE "</ul><h1>$1</h1><ul>\n";
+    }
+    if ($line =~ /__--==2 (.*)$/) {
+        close_subpage();
+        print STDOUT "outputting section header $1\n";
+        print MAIN_PAGE "</ul><h2>$1</h2><ul>\n";
+    }
+    if ($line =~ /__--==3 (.*)$/) {
+        close_subpage();
+        print STDOUT "outputting section header $1\n";
+        print MAIN_PAGE "</ul><h3>$1</h3><ul>\n";
+    }
     if ($line =~ /_\.-~= (.*)$/) {
-        $prev_subpage = $subpage;
-        $prev_subpage_count = $subpage_count;
-        $state = 'outputting';
-        print STDOUT "outputting $prev_subpage with error_count = $error_count\n";
-        print_pass_or_fail($prev_subpage,$prev_subpage_count,$error_count,$subpage_return_value);
-        $error_count = 0;
-        $subpage = $1;
-        $subpage_count++;
-        print MAIN_PAGE qq^\n<li><a href="test.$subpage_count.html">$subpage</a>^;
-        open  SUB_PAGE, ">test.$subpage_count.html";
-        print SUB_PAGE html_header($subpage);
-        print SUB_PAGE "<h1>$subpage</h1>\n<pre>";
+        close_subpage();
+        open_subpage($1);
     }
     if ($state eq 'outputting') {
         my $class = 'output ';
@@ -69,6 +102,7 @@ while (my $line = <>) {
             || ($line =~ /ERROR:/ && !($line =~ /ERROR: 0/))
             || $line =~ /ERROR LOG:/
             || $line =~ /Please install/
+            || $line =~ /No such file or directory/
         ) {
             $class .= 'notok ';
             $error_count++;
@@ -155,8 +189,9 @@ sub print_pass_or_fail {
     my $p_error_count = shift;
     my $p_subpage_return_value = shift;
     my $exception = {}; # keyed on subpage, value = # of expected errors
-    $exception{'Log Output: osrfsys.log'} = 3; # open-ils.cstore ERROR from live_t/08-lp1366964-libdbi-error.t (and related)
-    $exception{'Running Evergreen browser client build/test'} = 6; # Cannot connect to offline DB: Error: http://google.github.io/lovefield/error_lookup/src/error_lookup.html
+    #$exception{'Log Output: osrfsys.log'} = 3; # open-ils.cstore ERROR from live_t/08-lp1366964-libdbi-error.t (and related)
+    #$exception{'Running Evergreen browser client build/test'} = 6; # Cannot connect to offline DB: Error: http://google.github.io/lovefield/error_lookup/src/error_lookup.html
+    $exception{'Installing OpenSRF'} = 1 ; # grep: /etc/apache2/httpd.conf: No such file or directory
     if (! defined $exception{$p_subpage}) {
         $exception{$p_subpage} = 0;
     }