#!/bin/sh # ###################################################### # Build script for Core 10 # # # # 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 other dependencies # 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-asn1crypto" VERSION="0.24.0" DESCRIPTION="Fast ASN.1 parser and serializer for Python" AUTHORS="wbond" HOMEPAGE="https://github.com/wbond/asn1crypto" LICENSE="MIT" ME="rhermsen" TAGS="python asn1crypto asn1 crypto pki x509 certificate rsa dsa ec dh" DESTDIR=/tmp/dest/${PACKAGE} TMPDIR=/tmp/submit/${PACKAGE} DOWNLOAD="fc/f1/8db7daa71f414ddabfa056c4ef792e1461ff655c2ae2928a2b675bfed6b4/asn1crypto-$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 asn1crypto-$VERSION.tar.gz tar xf /tmp/${PACKAGE}/asn1crypto-${VERSION}.tar.gz cd /tmp/${PACKAGE}/asn1crypto-${VERSION} ###################################################### # Compile extension # ###################################################### python setup.py build sudo python setup.py install cd /usr/local/lib/python2.7/site-packages/ sudo unzip -oq asn1crypto-${VERSION}-py2.7.egg sudo rm -r ${TMPDIR}* 2>/dev/null mkdir -p ${TMPDIR}/usr/local/lib/python2.7/site-packages/asn1crypto-${VERSION}-py2.7.egg/asn1crypto/_perf mkdir -p ${TMPDIR}/usr/local/lib/python2.7/site-packages/asn1crypto-${VERSION}-py2.7.egg/EGG-INFO mkdir -p $TMPDIR/usr/local/share/doc/python-asn1crypto/ mkdir -p ${TMPDIR}/usr/local/tce.installed cp -r /usr/local/lib/python2.7/site-packages/asn1crypto/*.py ${TMPDIR}/usr/local/lib/python2.7/site-packages/asn1crypto-${VERSION}-py2.7.egg/asn1crypto/ cp -r /usr/local/lib/python2.7/site-packages/asn1crypto/_perf/*.py ${TMPDIR}/usr/local/lib/python2.7/site-packages/asn1crypto-${VERSION}-py2.7.egg/asn1crypto/_perf/ cp -r /usr/local/lib/python2.7/site-packages/EGG-INFO/* ${TMPDIR}/usr/local/lib/python2.7/site-packages/asn1crypto-${VERSION}-py2.7.egg/EGG-INFO/ cp /tmp/${PACKAGE}/asn1crypto-${VERSION}/LICENSE $TMPDIR/usr/local/share/doc/python-asn1crypto/ ################################################### # 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: asn1crypto Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP Docs for this project are maintained at https://github.com/wbond/asn1crypto#readme 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 './asn1crypto-0.24.0-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 sudo chown -R root:staff $TMPDIR/usr/local/tce.installed sudo chmod -R 775 $TMPDIR/usr/local/tce.installed 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