diff options
Diffstat (limited to 'alarm/node_modules/node-forge/setup')
-rw-r--r-- | alarm/node_modules/node-forge/setup/configure.ac | 202 | ||||
-rwxr-xr-x | alarm/node_modules/node-forge/setup/install-sh | 269 | ||||
-rw-r--r-- | alarm/node_modules/node-forge/setup/m4/as-python.m4 | 156 |
3 files changed, 627 insertions, 0 deletions
diff --git a/alarm/node_modules/node-forge/setup/configure.ac b/alarm/node_modules/node-forge/setup/configure.ac new file mode 100644 index 0000000..0d94441 --- /dev/null +++ b/alarm/node_modules/node-forge/setup/configure.ac @@ -0,0 +1,202 @@ +# Configure script for Digital Bazaar Bitmunk product line +# Usage: Run ./configure once +# Author: Manu Sporny + +AC_PREREQ([2.60]) +AC_INIT([forge],[0.1.0],[support@digitalbazaar.com]) +AC_CONFIG_AUX_DIR(setup) + +# Setup standard build environment variables +# FIXME: allow changing via configure option +FORGE_DIR=`(cd ${srcdir} && pwd)` +AC_SUBST(FORGE_DIR) +DATE_YMD=`date +%Y%m%d` +PACKAGE_DATE_VERSION=${PACKAGE_VERSION}-${DATE_YMD} +AC_SUBST(DATE_RFC_2822) +AC_SUBST(PACKAGE_DATE_VERSION) + +dnl ----------------- docs ----------------- + +AC_ARG_ENABLE([docs], + AS_HELP_STRING([--enable-docs], [build documentation [no]]), + [ + case "${enableval}" in + yes) BUILD_DOCS=yes ;; + no) BUILD_DOCS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs) ;; + esac + ], [BUILD_DOCS=no]) dnl Default value + +AC_SUBST(BUILD_DOCS) + +dnl ----------------- tests ----------------- + +AC_ARG_ENABLE([tests], + AC_HELP_STRING([--disable-tests], [disable building test apps [no]]), + [ + case "${enableval}" in + yes) BUILD_TESTS=yes ;; + no) BUILD_TESTS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;; + esac + ], [BUILD_TESTS=no]) dnl Default value + +AC_SUBST(BUILD_TESTS) + +dnl ----------------- build flash ----------------- + +AC_ARG_ENABLE([flash], + AC_HELP_STRING([--disable-flash], [disable building Flash [no]]), + [ + case "${enableval}" in + yes) BUILD_FLASH=yes ;; + no) BUILD_FLASH=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-flash) ;; + esac + ], [BUILD_FLASH=yes]) dnl Default value + +AC_ARG_ENABLE([pre-built-flash], + AC_HELP_STRING([--disable-pre-built-flash], + [disable use of pre-built Flash [no]]), + [ + case "${enableval}" in + yes) USE_PRE_BUILT_FLASH=yes ;; + no) USE_PRE_BUILT_FLASH=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-flash) ;; + esac + ], [USE_PRE_BUILT_FLASH=yes]) dnl Default value + +AC_SUBST(BUILD_FLASH) +AC_SUBST(USE_PRE_BUILT_FLASH) + +dnl ----------------- mxmlc ----------------- + +AC_ARG_WITH([mxmlc], + AC_HELP_STRING([--with-mxmlc=PATH], + [use PATH for mxmlc]), + [ + case "${withval}" in + yes|no) AC_MSG_ERROR(bad value ${withval} for --with-mxmlc) ;; + *) MXMLC="${withval}" ;; + esac + if test "x$MXMLC" = x -o ! -x "$MXMLC"; then + AC_MSG_ERROR([mxmlc not found at "$MXMLC"]) + fi + ]) + +if test "$BUILD_FLASH" = "yes" ; then + dnl Need to try to find mxmlc + if test "x$MXMLC" = x; then + AC_CHECK_PROGS(MXMLC, mxmlc /usr/lib/flex3/bin/mxmlc,, $PATH /) + fi + dnl Check that mxmlc was found + if test "x$MXMLC" = x; then + if test "$USE_PRE_BUILT_FLASH" = "yes"; then + dnl Check pre-built SWF is present + if test -r "$FORGE_DIR/swf/SocketPool.swf"; then + AC_MSG_NOTICE([Using pre-built Flash]) + BUILD_FLASH=no + else + AC_MSG_ERROR([mxmlc and pre-built Flash not found]) + fi + else + AC_MSG_ERROR([mxmlc not found, try --with-mxmlc]) + fi + fi +fi + +AC_SUBST(MXMLC) + +dnl ----------------- mxmlc debug ----------------- + +AC_ARG_ENABLE([mxmlc-debug], + AC_HELP_STRING([--enable-mxmlc-debug], [enable mxmlc debug mode [no]]), + [ + case "${enableval}" in + yes) MXMLC_DEBUG_MODE=yes ;; + no) MXMLC_DEBUG_MODE=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-mxmlc-debug) ;; + esac + ], [MXMLC_DEBUG_MODE=no]) dnl Default value + +AC_SUBST(MXMLC_DEBUG_MODE) + +dnl ----------------- end of options ----------------- + +echo -e "\n--------- Configuring Build Environment -----------" + +PKG_PROG_PKG_CONFIG + +# Checking for standard build tools +AC_PROG_CPP +AC_PROG_INSTALL +AS_PATH_PYTHON([2.7]) + +if test "x$PYTHON" != x; then + save_CPPFLAGS="$CPPFLAGS" + AC_CHECK_PROGS([PYTHON_CONFIG], [python-config]) + if test "x$PYTHON_CONFIG" != x; then + CPPFLAGS="$CPPFLAGS `$PYTHON_CONFIG --cflags`" + fi + AC_CHECK_HEADERS([Python.h], + [BUILD_PYTHON_MODULES=yes], + [BUILD_PYTHON_MODULES=no + AC_MSG_WARN([Python.h not found, SSL bindings will not be build.])]) + CPPFLAGS="$save_CPPFLAGS" +else + AC_MSG_WARN([Need at least Python 2.7 to build SSL bindings.]) +fi + +AC_SUBST(BUILD_PYTHON_MODULES) + +dnl ---------------------------------- + +dnl NOTE: +dnl This code was used previously to autogenerate the .gitignore file but due +dnl to the current more common use of just the js files, it's likely people +dnl who checkout the code will never run the build scripts. The files are now +dnl just hardcoded into .gitignore and should be updated by hand as needed. +dnl +dnl # Generating files +dnl AC_CONFIG_FILES([ +dnl .gitignore +dnl Makefile +dnl ]) +dnl +dnl # add newlines to internal output file list +dnl CONFIGURE_GENERATED_FILES="`echo $ac_config_files | tr ' ' '\n'`" +dnl AC_SUBST(CONFIGURE_GENERATED_FILES) + +AC_OUTPUT + +# Dump the build configuration + +echo -e "\n--------- Forge Build Environment -----------" +echo "Forge Version : $PACKAGE_NAME $PACKAGE_DATE_VERSION" + +if test "x$BUILD_FLASH" = "xyes" ; then + echo "Adobe Flash : Flash building enabled" + echo "MXMLC : $MXMLC" + echo "MXMLC Debug flags : $MXMLC_DEBUG_MODE" +else + echo "Adobe Flash : using pre-built Flash" +fi + +if test "x$BUILD_PYTHON_MODULES" = "xyes" ; then + echo "Python : $PYTHON (version $PYTHON_VERSION)" +else + echo "Python : development environment not found" +fi + +if test "x$BUILD_DOCS" = "xyes"; then + echo "Documentation : enabled" +else + echo "Documentation : disabled (use --enable-docs to enable)" +fi + +if test "x$BUILD_TESTS" = "xyes"; then + echo "Tests : enabled" +else + echo "Tests : disabled (use --enable-tests to enable)" +fi + diff --git a/alarm/node_modules/node-forge/setup/install-sh b/alarm/node_modules/node-forge/setup/install-sh new file mode 100755 index 0000000..d4744f0 --- /dev/null +++ b/alarm/node_modules/node-forge/setup/install-sh @@ -0,0 +1,269 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/alarm/node_modules/node-forge/setup/m4/as-python.m4 b/alarm/node_modules/node-forge/setup/m4/as-python.m4 new file mode 100644 index 0000000..84d4e36 --- /dev/null +++ b/alarm/node_modules/node-forge/setup/m4/as-python.m4 @@ -0,0 +1,156 @@ +## ------------------------ +## Python file handling +## From Andrew Dalke +## Updated by James Henstridge +## Updated by Andy Wingo to loop through possible pythons +## ------------------------ + +# AS_PATH_PYTHON([MINIMUM-VERSION]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AS_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + +# Updated to loop over all possible python binaries by Andy Wingo +# <wingo@pobox.com> +# Updated to only warn and unset PYTHON if no good one is found + +AC_DEFUN([AS_PATH_PYTHON], + [ + dnl Find a version of Python. I could check for python versions 1.4 + dnl or earlier, but the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5, and I don't want to maintain that logic. + + dnl should we do the version check? + PYTHON_CANDIDATES="$PYTHON python python2 \ + python2.7 python2.6 pyton2.5 python2.4 python2.3 \ + python2.2 python2.1 python2.0 \ + python1.6 python1.5" + dnl Declare PYTHON as a special var + AC_ARG_VAR([PYTHON], [path to Python interpreter]) + ifelse([$1],[], + [AC_PATH_PROG(PYTHON, $PYTHON_CANDIDATES)], + [ + AC_MSG_NOTICE(Looking for Python version >= $1) + changequote(<<, >>)dnl + prog=" +import sys, string +minver = '$1' +# split string by '.' and convert to numeric +minver_info = map(string.atoi, string.split(minver, '.')) +# we can now do comparisons on the two lists: +if sys.version_info >= tuple(minver_info): + sys.exit(0) +else: + sys.exit(1)" + changequote([, ])dnl + + python_good=false + for python_candidate in $PYTHON_CANDIDATES; do + unset PYTHON + AC_PATH_PROG(PYTHON, $python_candidate) 1> /dev/null 2> /dev/null + + if test "x$PYTHON" = "x"; then continue; fi + + if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then + AC_MSG_CHECKING(["$PYTHON":]) + AC_MSG_RESULT([okay]) + python_good=true + break; + else + dnl clear the cache val + unset ac_cv_path_PYTHON + fi + done + ]) + + if test "$python_good" != "true"; then + AC_MSG_WARN([No suitable version of python found]) + PYTHON= + else + + AC_MSG_CHECKING([local Python configuration]) + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. Need to change quote character because of [:3] + + AC_SUBST(PYTHON_VERSION) + changequote(<<, >>)dnl + PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` + changequote([, ])dnl + + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST(PYTHON_PREFIX) + PYTHON_PREFIX='${prefix}' + + AC_SUBST(PYTHON_EXEC_PREFIX) + PYTHON_EXEC_PREFIX='${exec_prefix}' + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_SUBST(PYTHON_PLATFORM) + PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"` + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behaviour + dnl is more consistent with lispdir.m4 for example. + dnl + dnl Also, if the package prefix isn't the same as python's prefix, + dnl then the old $(pythondir) was pretty useless. + + AC_SUBST(pythondir) + pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpythondir) + pkgpythondir=\${pythondir}/$PACKAGE + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) Was PYTHON_SITE_EXEC in previous betas. + + AC_SUBST(pyexecdir) + pyexecdir=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpyexecdir) + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + AC_MSG_RESULT([looks good]) + + fi +]) |