#!/bin/sh # ###################################################### # Build script for Core 11 # # # # 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 python-jinja2.tcz tce-load -wi libyaml-dev.tcz tce-load -wi python-pyyaml.tcz tce-load -wi python-ipaddress.tcz tce-load -wi python-enum34.tcz tce-load -wi python-six.tcz tce-load -wi python-asn1crypto.tcz tce-load -wi python-cffi-dev.tcz #tce-load -wi python-cffi.tcz tce-load -wi python-pycparser.tcz tce-load -wi python-cryptography.tcz # download and install other dependencies #tce-load -wi libffi.tcz # download and install the compile tools tce-load -wi git.tcz tce-load -wi compiletc.tcz tce-load -wi squashfs-tools.tcz ###################################################### # Configure extension creation parameters # ###################################################### # Variables TODAY=`date +%Y/%m/%d` NAME="ansible" PACKAGE="python-$NAME" VERSION="2.8.15" DESCRIPTION="Ansible is a simple, powerful, agentless IT automation tool" AUTHORS="Ansible, Inc." HOMEPAGE="https://ansible.com" LICENSE="GPLv3+" ME="rhermsen" TAGS="ansible automation python python2" DESTDIR=/tmp/dest/${PACKAGE} TMPDIR=/tmp/submit/${PACKAGE} # Workdir sudo rm -r /tmp/${NAME} 2>/dev/null mkdir /tmp/${NAME} cd /tmp # Source git clone https://github.com/ansible/ansible.git cd /tmp/${NAME} git checkout tags/v${VERSION} -b stable-${VERSION:0:3} ###################################################### # Compile extension # ###################################################### export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export LDFLAGS="-Wl,-O1" sudo rm -r ${DESTDIR}* 2>/dev/null python setup.py build mkdir -p ${DESTDIR} sudo python setup.py install --root=/${DESTDIR} sudo rm -r ${TMPDIR}* 2>/dev/null mkdir -p ${TMPDIR}/usr/local/lib/python2.7/site-packages/${NAME}-${VERSION}-py2.7.egg/${NAME} mkdir -p ${TMPDIR}/usr/local/lib/python2.7/site-packages/${NAME}-${VERSION}-py2.7.egg/EGG-INFO mkdir -p ${TMPDIR}/usr/local/bin mkdir -p $TMPDIR/usr/local/share/doc/${PACKAGE}/ mkdir -p $TMPDIR/usr/local/etc/${NAME}/ mkdir -p ${TMPDIR}/usr/local/tce.installed #cp -r ${DESTDIR}/* ${TMPDIR} cp ${DESTDIR}/usr/local/lib/python2.7/site-packages/${NAME}-${VERSION}-py2.7.egg-info/* ${TMPDIR}/usr/local/lib/python2.7/site-packages/${NAME}-${VERSION}-py2.7.egg/EGG-INFO/ cp -r ${DESTDIR}/usr/local/lib/python2.7/site-packages/${NAME} ${TMPDIR}/usr/local/lib/python2.7/site-packages/${NAME}-${VERSION}-py2.7.egg/ cp ${DESTDIR}/usr/local/bin/* ${TMPDIR}/usr/local/bin/ cp /tmp/${NAME}/COPYING $TMPDIR/usr/local/share/doc/${PACKAGE}/ cp /tmp/${NAME}/examples/ansible.cfg $TMPDIR/usr/local/etc/${NAME}/ansible.cfg.sample cp /tmp/${NAME}/examples/hosts $TMPDIR/usr/local/etc/${NAME}/hosts.sample cp /tmp/${NAME}/examples/hosts.yaml $TMPDIR/usr/local/etc/${NAME}/hosts.yml.sample find ${TMPDIR} -name "*.pyc" -type f -delete ################################################### # 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: Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications - automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. See /usr/local/etc/ansible/*.sample for example config files For Netconf support python-ncclient should be installed (tce-load -wi python-ncclient.tcz) Change-log: 2019/05/26 first verion, 2.8 (rhermsen) ${TODAY} Updated verion, ${VERSION} (rhermsen) Current: ${TODAY} Updated verion, ${VERSION} (rhermsen) EOF ################################################### # Create .dep file # ################################################### cat < ${PACKAGE}.tcz.dep python-paramiko.tcz python-jinja2.tcz python-pyyaml.tcz python-cryptography.tcz EOF ################################################### # Create install script file # ################################################### cat < $TMPDIR/usr/local/tce.installed/${PACKAGE} #!/bin/sh echo './ansible-2.8.15-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 sudo chown -R tc:staff $TMPDIR/usr/local/tce.installed/* sudo chmod -R 755 $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