Skip to content

Commit

Permalink
packaging changes. self installer builds on linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
weyrick committed May 23, 2007
1 parent 7c08689 commit 7afe71b
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 124 deletions.
9 changes: 4 additions & 5 deletions Makefile
Expand Up @@ -122,11 +122,10 @@ install:
@echo "sorry, there is no 'make install' right now - you should run pcc from the source directory"
@echo "the binary is located at compiler/pcc - you should put the compiler/ directory into your PATH"
@echo "you also need bigloo and other items in your path: see the wiki online at http://code.roadsend.com/"
@echo ".. a real 'make install' is under development"

#install: unsafe
# ./install.sh $(INSTALL_ROOT) $(INSTALL_PREFIX)
package-install: unsafe
./install.sh $(INSTALL_ROOT) $(INSTALL_PREFIX)

#install-runtime: unsafe
# ./install-runtime.sh $(INSTALL_ROOT) $(INSTALL_PREFIX)
package-install-runtime: unsafe
./install-runtime.sh $(INSTALL_ROOT) $(INSTALL_PREFIX)

20 changes: 10 additions & 10 deletions install-runtime.sh
Expand Up @@ -16,21 +16,21 @@ install_prefix=$2
pcc_home=$PCC_HOME
lib_dir=$install_root/$install_prefix/libs
module_root=$install_root/$install_prefix/modules
apache1_dir=$module_root/apache1.3.x
apache2_dir=$module_root/apache2.x
#apache1_dir=$module_root/apache1.3.x
#apache2_dir=$module_root/apache2.x
fcgi_dir=$module_root/fastcgi

echo "Installing runtime into $install_root with prefix $install_prefix."
echo "lib_dir : $lib_dir"
echo "apache1_dir: $apache1_dir"
echo "apache2_dir: $apache2_dir"
#echo "apache1_dir: $apache1_dir"
#echo "apache2_dir: $apache2_dir"
echo "fcgi_dir : $fcgi_dir"

## the libraries, headers, heaps, and init files
echo "installing libraries"
$debug install -m 755 -d $lib_dir
$debug install -m 644 -s $pcc_home/libs/*_u.so $lib_dir
$debug install -m 644 $pcc_home/libs/*_u.a $lib_dir
$debug install -m 644 -s $pcc_home/libs/*_u*.so $lib_dir
$debug install -m 644 $pcc_home/libs/*_u*.a $lib_dir
$debug install -m 644 $pcc_home/libs/*.sch $lib_dir
$debug install -m 644 $pcc_home/libs/*.heap $lib_dir
$debug install -m 644 $pcc_home/libs/*.init $lib_dir
Expand All @@ -45,10 +45,10 @@ $debug install -m 644 $pcc_home/support-libs/*.h $lib_dir
echo "installing web modules"
$debug install -m 755 -d $module_root
$debug install -m 755 -d $fcgi_dir
$debug install -m 755 -d $apache1_dir
$debug install -m 755 -d $apache2_dir
#$debug install -m 755 -d $apache1_dir
#$debug install -m 755 -d $apache2_dir
$debug install -m 755 -s $pcc_home/webconnect/fastcgi/pcc.fcgi $fcgi_dir/pcc.fcgi
[ -e $pcc_home/webconnect/apache1/mod_pcc.so ] && $debug install -m 644 $pcc_home/webconnect/apache1/mod_pcc.so $apache1_dir/mod_pcc.so
[ -e $pcc_home/webconnect/apache2/mod_pcc2.so ] && $debug install -m 644 $pcc_home/webconnect/apache2/mod_pcc2.so $apache2_dir/mod_pcc2.so
#[ -e $pcc_home/webconnect/apache1/mod_pcc.so ] && $debug install -m 644 $pcc_home/webconnect/apache1/mod_pcc.so $apache1_dir/mod_pcc.so
#[ -e $pcc_home/webconnect/apache2/mod_pcc2.so ] && $debug install -m 644 $pcc_home/webconnect/apache2/mod_pcc2.so $apache2_dir/mod_pcc2.so

echo "done"
32 changes: 13 additions & 19 deletions packages/packages.mk
@@ -1,24 +1,29 @@
## directory where rpm keeps its package "database"
RPM_DB_DIR = /usr/src/rpm

## current version of bigloo
BIGLOO_VERSION = 2.6f
BIGLOO_VERSION = 2.9a

## current version of pcc
PCC_VERSION = $(shell $(PCC_HOME)/compiler/pcc --version)

## path to the bigloo source directory
BIGLOO_SOURCE = $(HOME)/bigloo/bigloo$(BIGLOO_VERSION)

########################################################################
BIGLOO_SOURCE = $(HOME)/src/bigloo$(BIGLOO_VERSION)

## the top level of the packages subtree
PACKAGES_ROOT = $(PCC_HOME)/packages
## temporary directory where packages get built (note that this directory
## will be removed! don't set it to your homedir or anything)
BUILD_ROOT = /tmp/roadsend-pcc-build-root

## the prefix directory we want everything installed into (e.g. /usr)
## -- currently this is also hardcoded in the output in the *.template files in selfs/
INSTALL_PREFIX = /opt/roadsend/pcc

########################################################################

## directory where rpm keeps its package "database"
RPM_DB_DIR = /usr/src/rpm

## the top level of the packages subtree
PACKAGES_ROOT = $(PCC_HOME)/packages

## directory to place the rpm files in
RPM_OUT_DIR = $(PACKAGES_ROOT)

Expand All @@ -31,16 +36,6 @@ SELF_OUT_DIR = $(PACKAGES_ROOT)
## text string to be replaced by the pcc version in various files
PCC_VERSION_TAG = PCC_VERSION_HERE

## path of the license file
LICENSE_FILE = $(PACKAGES_ROOT)/LICENSE

## text string to be replaced by the license in various install scripts
LICENSE_TAG = LICENSE_HERE

## temporary directory where packages get built (note that this directory
## will be removed! don't set it to your homedir or anything)
BUILD_ROOT = /tmp/roadsend-pcc-build-root

## text string to be replaced by the build-root directory in various files
BUILD_ROOT_TAG = BUILD_ROOT_HERE

Expand All @@ -52,4 +47,3 @@ BIGLOO_INSTALLER = $(SCRIPT_DIR)/install-bigloo-$(BIGLOO_VERSION).sh

## path to the makeself script
MAKESELF = $(SCRIPT_DIR)/makeself/makeself.sh

50 changes: 50 additions & 0 deletions packages/scripts/install-bigloo-2.9a.sh
@@ -0,0 +1,50 @@
#!/bin/bash
#
# note this relies on *bash* not just sh (for example on freebsd)
# therefor /bin/bash has to exist

if [ $# -ne 3 ]
then
echo "Usage: $0 <source-root> <install-root> <install-prefix>"
exit 1
fi

source_root=$1
install_root=$2
install_prefix=$3

pushd $source_root > /dev/null

if [ `which gmake` ]; then MAKE=gmake; else MAKE=make; fi

## note!! we specify --libdir because we use libs and bigloo uses lib by default
./configure --prefix=$install_prefix --libdir=$install_prefix/libs --jvm=no && $MAKE

popd > /dev/null

install -m 755 -d $install_root
install -m 755 -d $install_root/$install_prefix/bin
install -m 755 -d $install_root/$install_prefix/libs/bigloo/2.9a

install -m 755 -s $source_root/bin/bigloo $install_root/$install_prefix/bin/bigloo
install -m 755 $source_root/runtime/Include/bigloo.h $install_root/$install_prefix/libs/bigloo/2.9a/bigloo.h
install -m 755 $source_root/lib/2.9a/bigloo.h $install_root/$install_prefix/libs/bigloo/2.9a/bigloo.h
install -m 755 $source_root/lib/2.9a/bigloo_config.h $install_root/$install_prefix/libs/bigloo/2.9a/bigloo_config.h
install -m 755 $source_root/lib/2.9a/bigloo.heap $install_root/$install_prefix/libs/bigloo/2.9a/bigloo.heap
install -m 755 -s $source_root/lib/2.9a/libbigloo_u-2.9a.so $install_root/$install_prefix/libs/bigloo/2.9a/libbigloo_u-2.9a.so
install -m 755 -s $source_root/gc-boehm/libgc.so $install_root/$install_prefix/libs/bigloo/2.9a/libbigloogc-2.9a.so
install -m 755 -s $source_root/lib/2.9a/libbigloogc-2.9a.so $install_root/$install_prefix/libs/bigloo/2.9a/libbigloogc-2.9a.so

install -m 755 $source_root/lib/2.9a/libbigloo_u-2.9a.a $install_root/$install_prefix/libs/bigloo/2.9a/libbigloo_u-2.9a.a
ranlib $install_root/$install_prefix/libs/bigloo/2.9a/libbigloo_u-2.9a.a

install -m 755 $source_root/lib/2.9a/libbigloogc-2.9a.a $install_root/$install_prefix/libs/bigloo/2.9a/libbigloogc-2.9a.a
ranlib $install_root/$install_prefix/libs/bigloo/2.9a/libbigloogc-2.9a.a

pushd $install_root/$install_prefix > /dev/null

ln -s bigloo/2.9a/libbigloo_u-2.9a.so $install_root/$install_prefix/libs/libbigloo_u-2.9a.so
ln -s bigloo/2.9a/libbigloogc-2.9a.so $install_root/$install_prefix/libs/libbigloogc-2.9a.so

popd > /dev/null

30 changes: 5 additions & 25 deletions packages/self/Makefile
@@ -1,14 +1,13 @@
## common makefile variables for the packages subtree
include ../packages.mk

all: compiler runtime #prereqs
all: compiler runtime

clean:
-rm -rf $(BUILD_ROOT)
-rm -f $(SELF_OUT_DIR)/roadsend-pcc*.bin
-rm -f install-compiler.sh
-rm -f install-runtime.sh
# -rm -f install-prereqs.sh

###
### the compiler package
Expand All @@ -18,15 +17,14 @@ compiler: install-compiler.sh
@echo "Building compiler self-installer package."
-rm -rf $(BUILD_ROOT)
(cd $(PCC_HOME) && $(MAKE) docs)
(cd $(PCC_HOME) && $(MAKE) INSTALL_ROOT=$(BUILD_ROOT)/install-root INSTALL_PREFIX=$(INSTALL_PREFIX) install)
(cd $(PCC_HOME) && $(MAKE) INSTALL_ROOT=$(BUILD_ROOT)/install-root INSTALL_PREFIX=$(INSTALL_PREFIX) package-install)
install -m 0755 -d $(BUILD_ROOT)
install -m 0755 install-compiler.sh $(BUILD_ROOT)/install-compiler.sh
$(MAKESELF) $(BUILD_ROOT) $(SELF_OUT_DIR)/roadsend-pcc-$(PCC_VERSION).bin \
"The Roadsend PCC Compiler for PHP" ./install-compiler.sh
"Roadsend PHP" ./install-compiler.sh

install-compiler.sh: install-compiler.sh.template
@echo "Creating installer script for compiler self-installer package."
# $(SCRIPT_DIR)/replace-tag-with-file.sh $(LICENSE_TAG) $(LICENSE_FILE) install-compiler.sh.template > install-compiler.sh
cp install-compiler.sh.template install-compiler.sh

###
Expand All @@ -36,32 +34,14 @@ install-compiler.sh: install-compiler.sh.template
runtime: install-runtime.sh
@echo "Building runtime self-installer package."
-rm -rf $(BUILD_ROOT)
(cd $(PCC_HOME) && $(MAKE) INSTALL_ROOT=$(BUILD_ROOT)/install-root INSTALL_PREFIX=$(INSTALL_PREFIX) install-runtime)
(cd $(PCC_HOME) && $(MAKE) INSTALL_ROOT=$(BUILD_ROOT)/install-root INSTALL_PREFIX=$(INSTALL_PREFIX) package-install-runtime)
$(BIGLOO_INSTALLER) $(BIGLOO_SOURCE) $(BUILD_ROOT)/install-root $(INSTALL_PREFIX)
install -m 0755 -d $(BUILD_ROOT)
install -m 0755 install-runtime.sh $(BUILD_ROOT)/install-runtime.sh
$(MAKESELF) $(BUILD_ROOT) $(SELF_OUT_DIR)/roadsend-pcc-runtime-$(PCC_VERSION).bin \
"The Roadsend PCC Compiler for PHP - Runtime Environment" ./install-runtime.sh
"Roadsend PHP - Runtime Environment" ./install-runtime.sh

install-runtime.sh: install-runtime.sh.template
@echo "Creating installer script for runtime self-installer package."
# $(SCRIPT_DIR)/replace-tag-with-file.sh $(LICENSE_TAG) $(LICENSE_FILE) install-runtime.sh.template > install-runtime.sh
cp install-runtime.sh.template install-runtime.sh

###
### the prerequisites package
### =========================

# prereqs: install-prereqs.sh
# @echo "Building prereqs self-installer package."
# -rm -rf $(BUILD_ROOT)
# $(BIGLOO_INSTALLER) $(BIGLOO_SOURCE) $(BUILD_ROOT)/install-root $(INSTALL_PREFIX)
# $(BIGLIB_INSTALLER) $(BIGLIB_SOURCE) $(BUILD_ROOT)/install-root $(INSTALL_PREFIX) $(BIGLOO_VERSION)
# install -m 0755 -d $(BUILD_ROOT)
# install -m 0755 install-prereqs.sh $(BUILD_ROOT)/install-prereqs.sh
# $(MAKESELF) $(BUILD_ROOT) $(SELF_OUT_DIR)/roadsend-pcc-prereqs-$(PCC_VERSION).bin \
# "The Roadsend PCC Compiler for PHP - Prerequisites" ./install-prereqs.sh

# install-prereqs.sh: install-prereqs.sh.template
# @echo "Creating installer script for prereqs self-installer package."
# cp install-prereqs.sh.template install-prereqs.sh
36 changes: 7 additions & 29 deletions packages/self/install-compiler.sh.template
Expand Up @@ -21,28 +21,6 @@ then
exit 1
fi

###
### make sure user agrees to license
### ================================

# cat <<EOF | more
# LICENSE_HERE
# EOF

# agreed=
# while [ x$agreed = x ]; do
# echo
# echo "Do you agree to the above license terms? [yes or no] "
# read reply leftover
# case $reply in
# y* | Y*)
# agreed=1;;
# n* | N*)
# echo "If you don't agree to the license you can't install this software";
# exit 1;;
# esac
# done

###
### start the uninstaller script
### ============================
Expand All @@ -52,7 +30,7 @@ cat <<EOF > $UNINSTALLER
#!/bin/sh
#
# This is an automatically generated uninstaller script for the
# Roadsend PHP Compiler package
# Roadsend PHP package
## require root
me=\`id -u\`
Expand All @@ -62,16 +40,16 @@ then
exit 1
fi
echo "Uninstalling Roadsend Compiler Binaries..."
echo "Uninstalling Roadsend PHP Binaries..."
EOF

###
### install files
### =============

echo "Roadsend Compiler for PHP"
echo "http://www.roadsend.com/"
echo "Roadsend PHP"
echo "http://code.roadsend.com/"
echo
echo "Installing Compiler binaries... "
echo "installation root directory is $TARGET_ROOT"
Expand Down Expand Up @@ -103,15 +81,15 @@ fi
agreed=
while [ x$agreed = x ]; do
echo
echo -n "Do you want to symlink the Roadsend binaries to the system path? [y/n/?]: "
echo -n "Do you want to symlink the Roadsend PHP binaries to the system path? [y/n/?]: "
read reply leftover
case $reply in
y* | Y*)
agreed=y;;
n* | N*)
agreed=n;;
?)
echo "Your system will need to know where to find the Roadsend binaries.";
echo "Your system will need to know where to find the Roadsend PHP binaries.";
echo "If you plan to manually add $TARGET_ROOT/bin to your system's PATH";
echo "then you should say N here.";
echo "";
Expand Down Expand Up @@ -149,7 +127,7 @@ if [ -z $? ]; then

cat <<EOF
WARNING: The Roadsend Compiler has been installed in
WARNING: Roadsend PHP has been installed in
/opt/roadsend/pcc, but your configuration file is from an older
version of the compiler that was previously installed elsewhere.
Please update the home directive in /etc/pcc.conf to:
Expand Down
34 changes: 6 additions & 28 deletions packages/self/install-runtime.sh.template
Expand Up @@ -21,28 +21,6 @@ then
exit 1
fi

###
### make sure user agrees to license
### ================================

# cat <<EOF | more
# LICENSE_HERE
# EOF

# agreed=
# while [ x$agreed = x ]; do
# echo
# echo "Do you agree to the above license terms? [yes or no] "
# read reply leftover
# case $reply in
# y* | Y*)
# agreed=1;;
# n* | N*)
# echo "If you don't agree to the license you can't install this software";
# exit 1;;
# esac
# done

###
### start the uninstaller script
### ============================
Expand All @@ -52,7 +30,7 @@ cat <<EOF > $UNINSTALLER
#/bin/sh
#
# This is an automatically generated uninstaller script for the
# Roadsend PHP Compiler package
# Roadsend PHP package
#
## require root
Expand All @@ -63,16 +41,16 @@ then
exit 1
fi
echo "Uninstalling Roadsend Compiler Runtime..."
echo "Uninstalling Roadsend PHP Runtime..."
EOF

###
### install files
### =============

echo "Roadsend Compiler for PHP"
echo "http://www.roadsend.com/"
echo "Roadsend PHP"
echo "http://code.roadsend.com/"
echo
echo "Installing Runtime Environment... "
echo "The installation root directory is $TARGET_ROOT"
Expand All @@ -91,15 +69,15 @@ done
agreed=
while [ x$agreed = x ]; do
echo
echo -n "Do you want to symlink the Roadsend runtime libraries to the system library path? [y/n/?]: "
echo -n "Do you want to symlink the Roadsend PHP runtime libraries to the system library path? [y/n/?]: "
read reply leftover
case $reply in
y* | Y*)
agreed=y;;
n* | N*)
agreed=n;;
?)
echo "Your system will need to know where to find the Roadsend runtime libraries.";
echo "Your system will need to know where to find the Roadsend PHP runtime libraries.";
echo "If you plan to manually add $TARGET_ROOT/libs to your system's dynamic";
echo "library load path, you should say N here.";
echo "";
Expand Down

0 comments on commit 7afe71b

Please sign in to comment.