Skip to content
Browse files

Remove some unusued files

Added some additional parts: Nginx build, and updated the Redis stuff
Some presets and config files
  • Loading branch information...
1 parent 3ff1d80 commit 2953aeb823e36e7f1f8eb92a1a4dc5e76c168223 Alvaro Saurin committed
Showing with 117 additions and 463 deletions.
  1. +17 −0 .gitignore
  2. +88 −29 buildout.cfg
  3. +3 −4 buildout.deploy.cfg
  4. +8 −13 buildout.devel.cfg
  5. +0 −150 buildout/packaging/package.sh
  6. +0 −252 buildout/packaging/rpm.spec.in
  7. +0 −14 buildout/packaging/vcs_version.sh
  8. +1 −1 buildout/presets.cfg
View
17 .gitignore
@@ -58,3 +58,20 @@ RELEASE
/temp/
+.idea/
+
+## nginx stuff
+conf/fastcgi.conf.default
+conf/fastcgi_params
+conf/fastcgi_params.default
+conf/koi-utf
+conf/koi-win
+conf/mime.types
+conf/mime.types.default
+conf/nginx.conf.default
+conf/nginx.conf.in
+conf/scgi_params
+conf/scgi_params.default
+conf/uwsgi_params
+conf/uwsgi_params.default
+conf/win-utf
View
117 buildout.cfg
@@ -8,30 +8,29 @@ relative-paths = true
develop = sources
-virtualenv = ${buildout:directory}
conf-directory = ${buildout:directory}/conf
-dcache-directory = ${buildout:directory}/downloads
-
-download-cache = ${buildout:dcache-directory}
-
-verbosity = 5
-log-level = 25
+download-cache = ${buildout:directory}/downloads
+verbosity = 5
+log-level = 25
socket-timeout = 120
-## base eggs we will always need
-eggs = setproctitle
- configparser
- fabric
-
parts =
eggs
rc-script-conf
XXXX-conf
+# redis-build
+# redis-conf
+# nginx-build
+# nginx-conf
+## base eggs we will always need
+eggs = setproctitle
+ configparser
+ circus
[versions]
-zc.buildout = 2.0.0
+#zc.buildout = 2.0.0
@@ -42,6 +41,7 @@ zc.buildout = 2.0.0
[eggs]
recipe = zc.recipe.egg
eggs = ${buildout:eggs}
+relative-paths = true
########################
# Configuration files
@@ -65,21 +65,80 @@ mode = 0644
########################
-# Build redis
+# Redis
########################
-#
-#[redis-package]
-#recipe = hexagonit.recipe.cmmi
-#url = http://redis.googlecode.com/files/redis-2.4.17.tar.gz
-#configure-command = true
-#strip-top-level-dir = true
-#keep-compile-dir = true
-#ignore-existing = true
-#make-options =
-# PREFIX=${buildout:virtualenv}
-#[redis-conf]
-#recipe = z3c.recipe.template
-#input = ${buildout:conf-directory}/redis.conf.in
-#output = ${buildout:conf-directory}/redis.conf
-#mode = 0644
+
+## enable the Redis build by adding 'redis-build' and 'redis-conf' to the 'buldout/parts'
+
+[redis-build]
+recipe = hexagonit.recipe.cmmi
+url = http://redis.googlecode.com/files/redis-2.6.11.tar.gz
+configure-command = true
+strip-top-level-dir = true
+keep-compile-dir = true
+ignore-existing = true
+make-options =
+ PREFIX=${buildout:directory}
+output =
+ ${buildout:directory}/bin/redis-server
+ ${buildout:directory}/bin/redis-cli
+ ${buildout:directory}/bin/redis-check-aof
+
+[redis-conf]
+recipe = z3c.recipe.template
+input = ${buildout:conf-directory}/redis.conf.in
+output = ${buildout:conf-directory}/redis.conf
+mode = 0644
+
+########################
+# Nginx
+########################
+
+## enable the Redis build by adding 'redis-package' and 'redis-conf' to the 'buldout/parts'
+
+[nginx-build]
+recipe = hexagonit.recipe.cmmi
+url = http://nginx.org/download/nginx-1.3.10.tar.gz
+configure-options =
+ --with-debug
+ --sbin-path=${buildout:directory}/bin
+ --with-rtsig_module
+ --without-select_module
+ --with-ipv6
+ --with-http_stub_status_module
+ --with-http_sub_module
+ --with-http_realip_module
+ --with-http_secure_link_module
+ --with-http_degradation_module
+ --with-http_ssl_module
+ --with-http_gzip_static_module
+ --without-http_geo_module
+ --without-mail_pop3_module
+ --without-mail_imap_module
+ --without-mail_smtp_module
+# --add-module=${nginx-addition:location}
+# --with-file-aio
+ignore-existing = true
+prefix = ${buildout:directory}
+output =
+ ${buildout:directory}/bin/nginx
+ ${buildout:directory}/conf/fastcgi.conf.default
+ ${buildout:directory}/conf/mime.types
+ ${buildout:directory}/conf/uwsgi_params
+ ${buildout:directory}/conf/fastcgi_params
+ ${buildout:directory}/conf/koi-utf
+ ${buildout:directory}/conf/mime.types.default
+ ${buildout:directory}/conf/scgi_params
+ ${buildout:directory}/conf/uwsgi_params.default
+ ${buildout:directory}/conf/fastcgi.conf
+ ${buildout:directory}/conf/fastcgi_params.default
+ ${buildout:directory}/conf/koi-win
+ ${buildout:directory}/conf/scgi_params.default
+ ${buildout:directory}/conf/win-utf
+
+[nginx-conf]
+recipe = z3c.recipe.template
+input = ${buildout:conf-directory}/nginx.conf.in
+output = ${buildout:conf-directory}/nginx.conf
+mode = 0644
View
7 buildout.deploy.cfg
@@ -18,13 +18,12 @@ pkg-packager = My Company
pkg-url = http://www.mycomp.com
pkg-license = GPL
pkg-deps = libevent
-pkg-prefix = /opt/testapp
+pkg-prefix = /opt/XXXX
-install-prefix = /opt/testapp
+install-prefix = /opt/XXXX
eggs = ${buildout:eggs}
-
-sys-python = /usr/lib/python2.6
+ XXXX
scripts =
testapp
View
21 buildout.devel.cfg
@@ -1,24 +1,19 @@
[buildout]
extends = buildout.cfg
-parts +=
- python-venv
-
-develop += sources/
+eggs +=
+ fabric
+ sphinx
+ funkload
+ bottle
+ nose
################################################################################
# virtualenv contents
################################################################################
-[python-venv]
+[eggs]
recipe = zc.recipe.egg
-interpreter = python-venv
eggs = ${buildout:eggs}
- sphinx
- funkload
- bottle
- nose
- XXXX
-
+interpreter = python-venv
relative-paths = true
-
View
150 buildout/packaging/package.sh
@@ -1,150 +0,0 @@
-#!/bin/sh
-
-PREFIX=.
-BASE=$(dirname $0)
-
-## directories we need in the RPM for running the software
-RUN_DIRS="\
- logs \
- run \
- var var/lib"
-
-## some things we need to put in the RPM for 'building'
-RPM_FILES="VERSION \
- RELEASE \
- README.md"
-RPM_DIRS="\
- $RUN_DIRS \
- bin conf include lib sbin share share/doc \
- scripts"
-
-
-## some building stuff...
-RPM_TAR=$PREFIX/pkg.tar
-IN_RPM_TAR=/inexistent
-RPM_BUILD_ROOT=/tmp/XXXX-buildroot
-SPEC=
-OUT_DIR=
-
-while [ "$1" ]
-do
- case $1 in
- --prefix)
- PREFIX=$2
- BASE=$PREFIX/tools/packaging
- shift
- ;;
- --build-root)
- RPM_BUILD_ROOT=$2
- shift
- ;;
- --out-dir)
- OUT_DIR=$2
- shift
- ;;
- --tar)
- RPM_TAR=$2
- shift
- ;;
- --in-tar)
- IN_RPM_TAR=$2
- shift
- ;;
- --spec)
- SPEC=$2
- shift
- ;;
- --help)
- echo "usage: $(basename $0) ARGS"
- echo "where ARGS can be:"
- cat << EOF
- --prefix PREFIX top installation prefix (default: $PREFIX)
- --build-root DIR the build root (default: $RPM_BUILD_ROOT)
- --out-dir DIR directory where the rpm/tgz files will be left (default: the same as the prefix)
- --tar FILE output RPM tar file (default: $RPM_TAR)
- --spec FILE RPM spec file
- --in-tar FILE input tar file that will be expanded in the PREFIX (optional)
-
-EOF
- exit 0
- ;;
- *)
- echo "!!! ERROR: unknown parameter $1. Run $(basename $0) --help for getting the command line args"
- exit 1
- ;;
- esac
- shift
-done
-
-
-
-
-################################################################################
-
-[ "x$SPEC" != "x" ] || { echo "!!! ERROR: spec file not given. Run $(basename $0) --help for help" ; exit 1 ; }
-[ -f $SPEC ] || { echo "!!! ERROR: $SPEC not found. Run $(basename $0) --help for help" ; exit 1 ; }
-
-
-echo ">>> Saving release number..."
-RELEASE=$($PREFIX/buildout/packaging/vcs_version.sh $PREFIX)
-echo ">>> ... number: $RELEASE"
-echo $RELEASE > $PREFIX/RELEASE
-
-echo ">>> Creating TAR..."
-rm -f $RPM_TAR
-if [ -f $IN_RPM_TAR ] ; then
- echo ">>> ... untar'ing the input tar file"
- cd $PREFIX && tar -xpf $IN_RPM_TAR
-fi
-
-echo ">>> ... copying spec file"
-cp $SPEC $PREFIX/
-
-echo ">>> ... making sure everything is readable by this user..."
-find $PREFIX ! -perm -u=r -type f -exec chmod +r '{}' \;
-
-if [ -f $IN_RPM_TAR ] ; then
- echo ">>> ... tar'ing everything"
- cd $PREFIX && tar -cpf $RPM_TAR *
- RETVAL=$?
- [ $RETVAL -ne 0 ] && exit $RETVAL
-else
- for i in $RPM_DIRS ; do
- echo ">>> ... checking directory $i"
- [ -f $i ] || mkdir -p $i
- done
-
- echo ">>> ... tar'ing rpm directories"
- cd $PREFIX && tar -cpf $RPM_TAR $RPM_DIRS $RPM_FILES `basename $SPEC`
- RETVAL=$?
- [ $RETVAL -ne 0 ] && exit $RETVAL
-fi
-
-echo ">>> Launching rpmbuild..."
-cd $PREFIX && rpmbuild --buildroot $RPM_BUILD_ROOT -v -tb $RPM_TAR
-RETVAL=$?
-[ $RETVAL -ne 0 ] && exit $RETVAL
-
-echo ">>> Saving TAR file..."
-rm -f `basename $SPEC`
-for i in *.rpm ; do gzip -qc $RPM_TAR > `basename $i .rpm`.tgz ; done
-RETVAL=$?
-[ $RETVAL -ne 0 ] && exit $RETVAL
-
-rm -f $RPM_TAR
-rm -f $PREFIX/$SPEC
-
-if [ "x$OUT_DIR" != "x" ] ; then
- cp $PREFIX/*.rpm $PREFIX/*.tgz $OUT_DIR/
-fi
-
-
-echo ">>> rpm creation has been SUCCESSFUL !!"
-exit 0
-
-
-
-
-
-
-
View
252 buildout/packaging/rpm.spec.in
@@ -1,252 +0,0 @@
-
-# RPM spec
-
-
-%define name ${presets:pkg-name}
-%define desc_name ${presets:pkg-desc-name}
-%define version %(cat VERSION)
-%define release %(cat RELEASE)
-%define prefix /opt/${presets:pkg-name}
-
-%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
-
-
-Summary: XXXX
-Name: %{name}
-Version: %{version}
-Release: %{release}
-License: BSD
-Group: Applications/Networking
-URL: http://www.XXXX.com/
-Vendor: unknown
-Packager: unknown
-
-Prefix: %{prefix}
-Source: $RPM_SOURCE_DIR/pkg.tar
-Provides: %{name}
-
-#Requires: zeromq
-
-
-####################################################################################################
-%description
-
-XXXX software distribution
-
-####################################################################################################
-%prep
-
-echo ">>> Preparing the build..."
-echo ">>> RPM_BUILD_DIR = $RPM_BUILD_DIR"
-[ "$RPM_BUILD_DIR" != "" ] || { echo "ERROR: RPM_BUILD_DIR is empty" ; exit 1 ; }
-[ -d $RPM_BUILD_DIR ] || { echo "ERROR: $RPM_BUILD_DIR not found" ; exit 1 ; }
-[ "$RPM_SOURCE_DIR" != "" ] || { echo "ERROR: RPM_SOURCE_DIR is empty" ; exit 1 ; }
-[ -d $RPM_SOURCE_DIR ] || { echo "ERROR: $RPM_SOURCE_DIR not found" ; exit 1 ; }
-
-rm -rf $RPM_BUILD_DIR/%{name}-*
-rm -rf $RPM_BUILD_DIR/../RPMS/*/%{name}*.rpm
-cat $RPM_SOURCE_DIR/pkg.tar | tar -xpf -
-
-####################################################################################################
-%build
-
-
-if [ "$RPM_BUILD_ROOT" = "" ] ; then
- RPM_BUILD_ROOT=$RPM_BUILD_DIR/../BUILDROOT
- echo ">>> Creating build root on $RPM_BUILD_ROOT..."
- [ -d $RPM_BUILD_ROOT ] || mkdir -p $RPM_BUILD_ROOT
-else
- echo ">>> Building on $RPM_BUILD_ROOT..."
-fi
-
-[ "$RPM_BUILD_ROOT" != "" ] || { echo "ERROR: RPM_BUILD_ROOT is empty" ; exit 1 ; }
-rm -rf $RPM_BUILD_ROOT/*
-
-[ -d $RPM_BUILD_ROOT ] || mkdir -p $RPM_BUILD_ROOT
-[ -d $RPM_BUILD_ROOT/%{prefix} ] || mkdir -p $RPM_BUILD_ROOT/%{prefix}
-
-RPM_BUILD_TARGET=$RPM_BUILD_ROOT/%{prefix}
-
-echo ">>> Moving everything to $RPM_BUILD_TARGET..."
-mv -f $RPM_BUILD_DIR/* $RPM_BUILD_TARGET
-
-echo ">>> Removing some files we don't need in the RPM..."
-
-REGS="${rpm-spec:cleanup-files}"
-REGS_S=`echo $REGS | sed -e 's/\n/\ /g'`
-for i in $REGS_S ; do rm -rf $RPM_BUILD_TARGET/$i ; done
-
-REGS="${rpm-spec:cleanup-packages}"
-REGS_S=`echo $REGS | sed -e 's/\n/\ /g'`
-for i in $REGS_S ; do $RPM_BUILD_TARGET/bin/pip uninstall -q -y $i || true ; done
-
-## note: pip does not work here (I don't know why) - use easy_install!
-echo ">>> Installing our software as a package..."
-cd $RPM_BUILD_TARGET && $RPM_BUILD_TARGET/bin/easy_install -v -O2 -Z $RPM_SOURCE_DIR/sources
-
-rm -f $RPM_BUILD_TARGET/VERSION $RPM_BUILD_TARGET/RELEASE
-
-####################################################################################################
-%clean
-
-echo ">>> Copying RPM to $RPM_SOURCE_DIR..."
-cp -f $RPM_BUILD_DIR/../RPMS/*/%{name}*.rpm $RPM_SOURCE_DIR/
-rm -rf $RPM_BUILD_ROOT/*
-
-####################################################################################################
-%files
-
-# documentation
-%doc %{prefix}/README.md
-%docdir %{prefix}/share/doc
-%{prefix}/share/doc
-
-%defattr(-,${presets:system-user-name},${presets:system-user-name})
-
-# config files
-%attr(0755,${presets:system-user-name},${presets:system-user-name}) %{prefix}/conf/init.d/*
-%config(noreplace) %{prefix}/conf/*
-
-%defattr(-,${presets:system-user-name},${presets:system-user-name})
-
-# other
-%attr(0755,${presets:system-user-name},${presets:system-user-name}) %{prefix}/bin/*
-%attr(0755,${presets:system-user-name},${presets:system-user-name}) %{prefix}/lib/*
-%attr(0755,${presets:system-user-name},${presets:system-user-name}) %{prefix}/var/*
-
-
-####################################################################################################
-%preun
-# anything to do before uninstalling
-
-PREFIX=%{prefix}
-NAME="XXXX"
-
-if [ "$1" = "1" ] ; then
- # Start the uninstallation of the old software when upgrading
- echo
-elif [ "$1" = "0" ] ; then
- # The software is really being uninstalled, no upgrade
- echo ">>> Stopping and removing old service..."
- if [ -f /etc/init.d/$NAME ] ; then
- /etc/init.d/$NAME stop
-
- sleep 5
-
- echo ">>> Removing $NAME service..."
- /sbin/chkconfig --del $NAME
- rm -f /etc/init.d/$NAME
- fi
-fi
-
-
-####################################################################################################
-%postun
-# anything to do after uninstalling
-
-PREFIX=%{prefix}
-
-if [ "$1" = "1" ] ; then
- # Finishes the uninstallation of the old software when upgrading
- echo
-elif [ "$1" = "0" ] ; then
- # The software is really going to be uninstalled, no upgrade
-
- if [ -f /etc/ld.so.conf.d/XXXX.conf ] ; then
- echo -n ">>> Removing ld.so configuration..."
- rm -f /etc/ld.so.conf.d/XXXX.conf
- /sbin/ldconfig
- fi
-fi
-
-####################################################################################################
-%pre
-# anything to do before installing/upgrading
-
-PREFIX=%{prefix}
-
-if [ "$1" = "1" ] ; then
- # Perform tasks to prepare for the initial installation
- echo
-elif [ "$1" = "2" ] ; then
- # Perform whatever maintenance must occur before the upgrade begins
- echo
-fi
-
-####################################################################################################
-%post
-
-DESC_NAME=%{desc_name}
-PREFIX=%{prefix}
-NAME="XXXX"
-SYS_USER_NAME=${presets:system-user-name}
-SYS_USER_PASS=${presets:system-user-pass}
-
-LOCAL_PYTHON=$PREFIX/bin/python
-
-
-for FILE in $PREFIX/bin/XXXX-* ; do
- if [ -x $FILE ] ; then
- echo ">>> Fixing path in $FILE script..."
-
- rm -f $FILE.new
- echo "#! $LOCAL_PYTHON" > $FILE.new
- tail -n +2 $FILE >> $FILE.new
- mv -f $FILE.new $FILE
-
- chmod 755 $FILE
- fi
-done
-
-if [ -d /etc/ld.so.conf.d ] ; then
- echo ">>> Adding ld.so configuration..."
- echo "$PREFIX/lib" > /etc/ld.so.conf.d/XXXX.conf
- /sbin/ldconfig
-fi
-
-echo ">>> Checking user \"$SYS_USER_NAME\" exists..."
-id $SYS_USER_NAME >/dev/null 2>/dev/null
-if [ $? -eq 1 ] ; then
- echo ">>> ... creating user"
- /usr/sbin/adduser --home $PREFIX $SYS_USER_NAME
-
- echo ">>> ... setting password"
- echo "$SYS_USER_NAME:$SYS_USER_PASS" | /usr/sbin/chpasswd
-fi
-
-echo ">>> Linking $NAME startup script: $PREFIX/conf/init.d/$NAME.rc..."
-if [ -x $PREFIX/conf/init.d/$NAME.rc ] ; then
- rm -f /etc/init.d/$NAME
- cd /etc/init.d/ && ln -sf $PREFIX/conf/init.d/$NAME.rc $NAME
-
- echo ">>> Adding $NAME service..."
- /sbin/chkconfig --add $NAME
- /sbin/chkconfig $NAME on
-
- sleep 2
-fi
-echo ">>> ... done!"
-echo
-
-
-if [ "$1" = "1" ] ; then
- # Perform tasks to prepare for the initial installation
- touch $PREFIX/.first_install
-
- echo ">>> $NAME has been installed. Now you must:"
- echo ">>> 1. configure the services you want to run in $PREFIX/conf/XXXX.conf"
- echo ">>> 2. start the services with: /etc/init.d/XXXX start"
- echo
-
-elif [ "$1" = "2" ] ; then
- # Perform whatever maintenance must occur before the upgrade begins
-
- echo
- echo ">>> $NAME has been upgraded. Now you must:"
- echo ">>> 1. check $PREFIX/conf/XXXX.conf (and maybe a new $PREFIX/conf/XXXX.conf.rpmnew)"
- echo ">>> 2. re-start the services with: /etc/init.d/$NAME restart"
- echo
-fi
-
-
-
View
14 buildout/packaging/vcs_version.sh
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-PREFIX=$1
-
-if [ -d $PREFIX/.hg ] ; then
- cd $PREFIX && echo $(hg summary | grep parent | cut -d ':' -f 2 | sed -e 's/\ //g')
-elif [ -d $PREFIX/.git ] ; then
- cd $PREFIX && echo $(git log --oneline | wc -l)
- #FULL_REL=$(git describe --all --abbrev=4 HEAD^ | sed -e 's/tags\///g')
- #REL=$(echo $FULL_REL | sed -s 's/-/\ /g' | awk '{ print $3 }')
- #echo $REL
-else
- echo ''
-fi
View
2 buildout/presets.cfg
@@ -26,4 +26,4 @@ system-group-name = XXXX
# default ports
http-port = 80
https-port = 443
-
+uwsgi-port = 18080

0 comments on commit 2953aeb

Please sign in to comment.
Something went wrong with that request. Please try again.