#!/bin/sh # ###################################################### # Build script for Core 9.0 # # # # See .info for details # ###################################################### ###################################################### # Prepare extension creation # ###################################################### #download and install python tce-load -wi python.tcz #download and install other python dependencies tce-load -wi python-setuptools.tcz tce-load -wi libffi.tcz #tce-load -wi python-markupsafe.tcz #download and install the compile tools tce-load -wi compiletc.tcz tce-load -wi squashfs-tools.tcz ###################################################### # Configure extension creation parameters # ###################################################### # Variables TODAY=`date +%Y/%m/%d` PACKAGE="python-jinja2" VERSION="2.6" SHA256="" DESCRIPTION="full featured template engine for Python" AUTHORS="Armin Ronacher" HOMEPAGE="http://jinja.pocoo.org/" LICENSE="See Original-site" ME="rhermsen" TAGS="python jinja jinja2 templateengine" DESTDIR=/tmp/dest/${PACKAGE} TMPDIR=/tmp/submit/${PACKAGE} DOWNLOAD="25/c8/212b1c2fd6df9eaf536384b6c6619c4e70a3afd2dffdd00e5296ffbae940/Jinja2-$VERSION.tar.gz" # Workdir sudo rm -r /tmp/${PACKAGE} 2>/dev/null mkdir /tmp/${PACKAGE} cd /tmp/${PACKAGE} # Source wget https://files.pythonhosted.org/packages/$DOWNLOAD -O Jinja2-$VERSION.tar.gz tar xf /tmp/${PACKAGE}/Jinja2-${VERSION}.tar.gz cd /tmp/${PACKAGE}/Jinja2-${VERSION} ###################################################### # Compile extension # ###################################################### python setup.py build sudo python setup.py install sudo rm -r ${TMPDIR}* 2>/dev/null mkdir -p ${TMPDIR}/usr/local/lib/python2.7/site-packages mkdir -p ${TMPDIR}/usr/local/tce.installed cp -r /usr/local/lib/python2.7/site-packages/Jinja2-$VERSION-py2.7.egg ${TMPDIR}/usr/local/lib/python2.7/site-packages/ ################################################### # Create info file # ################################################### cd /tmp/submit/ cat < ${PACKAGE}.tcz.info Title: ${PACKAGE}.tcz Description: ${DESCRIPTION} Version: ${VERSION} Author: ${AUTHORS} Original-site: ${HOMEPAGE} Copying-policy: ${LICENSE} Size: ${size} Extension_by: ${ME} Tags: ${TAGS} Comments: Jinja2 Jinja2 is a full featured template engine for Python. It has full unicode support, an optional integrated sandboxed execution environment, widely used and BSD licensed. Change-log: ${TODAY} first verion, ${VERSION} Current: ${TODAY} first verion, ${VERSION} EOF ################################################### # Create .dep file # ################################################### cat < ${PACKAGE}.tcz.dep python.tcz EOF ################################################### # Create install script file # ################################################### cat < $TMPDIR/usr/local/tce.installed/${PACKAGE} #!/bin/sh echo './Jinja2-2.8-py2.7.egg' >> /usr/local/lib/python2.7/site-packages/easy-install.pth EOF find $TMPDIR/ -type d | xargs chmod -v 755; find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded cd $TMPDIR find $TMPDIR -perm 777 -exec chmod 755 {} \; find $TMPDIR -perm 555 -exec chmod 755 {} \; find $TMPDIR -perm 444 -exec chmod 644 {} \; find $TMPDIR -perm 666 -exec chmod 644 {} \; find $TMPDIR -perm 664 -exec chmod 644 {} \; sudo chown -R root:root $TMPDIR cd /tmp/submit/ mksquashfs $TMPDIR ${PACKAGE}.tcz cd $TMPDIR sudo sh -c "find usr -not -type d > ${PACKAGE}.tcz.list" sudo mv ../${PACKAGE}.tcz . sudo mv ../${PACKAGE}.tcz.dep . sudo mv ../${PACKAGE}.tcz.info . # Create md5 file sudo sh -c "md5sum ${PACKAGE}.tcz > ${PACKAGE}.tcz.md5.txt" # Cleanup temp directory sudo rm -r -f usr