#!/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 # download and install dependencies tce-load -wi python-docutils.tcz tce-load -wi Pygments.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-sphinx" # https://pypi.org/project/Sphinx/ VERSION="1.2" SHA256="" DESCRIPTION="a tool to create documentation for Python" AUTHORS="Georg Brandl" HOMEPAGE="http://sphinx-doc.org/" LICENSE="See Original-site" ME="rhermsen" TAGS="python sphinx" DESTDIR=/tmp/dest/${PACKAGE} TMPDIR=/tmp/submit/${PACKAGE} DOWNLOAD="99/18/b3910d3e6078727e2545bd1522c6bd018c1f1d552dcff9df2c2bcd658066/Sphinx-$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 tar xf /tmp/${PACKAGE}/Sphinx-${VERSION}.tar.gz cd /tmp/${PACKAGE}/Sphinx-${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/bin mkdir -p ${TMPDIR}/usr/local/tce.installed cp -r /usr/local/lib/python2.7/site-packages/Sphinx-$VERSION-py2.7.egg ${TMPDIR}/usr/local/lib/python2.7/site-packages/ cp -r /usr/local/bin/sphinx-apidoc ${TMPDIR}/usr/local/bin/ cp -r /usr/local/bin/sphinx-build ${TMPDIR}/usr/local/bin/ cp -r /usr/local/bin/sphinx-quickstart ${TMPDIR}/usr/local/bin/ cp -r /usr/local/bin/sphinx-autogen ${TMPDIR}/usr/local/bin/ ################################################### # 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: Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license. Change-log: ${TODAY} first verion, ${VERSION} Current: ${TODAY} first verion, ${VERSION} EOF ################################################### # Create .dep file # ################################################### cat < ${PACKAGE}.tcz.dep python.tcz python-docutils.tcz Pygments.tcz python-jinja2.tcz EOF ################################################### # Create install script file # ################################################### cat < $TMPDIR/usr/local/tce.installed/${PACKAGE} #!/bin/sh echo './Sphinx-$VERSION-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