# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 tce-load -wi compiletc cd /tmp wget --no-check-certificate https://github.com/jirka-h/haveged/archive/1.9.4.tar.gz tar zxf 1.9.4.tar.gz cd haveged-1.9.4 # for x86 #CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe" ./configure --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/share/man # for x86_64 CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" ./configure --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/share/man find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \; make # install to DESTDIR DESTDIR=`mktemp -d` chmod 755 ${DESTDIR} make DESTDIR=${DESTDIR} install-strip # add copyright files to $DESTDIR mkdir -p ${DESTDIR}/usr/local/share/doc/haveged cp -p COPYING ${DESTDIR}/usr/local/share/doc/haveged # create startup script mkdir -p ${DESTDIR}/usr/local/tce.installed vi ${DESTDIR}/usr/local/tce.installed/haveged - - - - #!/bin/sh haveged 1>/dev/null 2>&1 & - - - - chmod 775 ${DESTDIR}/usr/local/tce.installed chmod 755 ${DESTDIR}/usr/local/tce.installed/haveged # split header and static lib to haveged-dev DEV_DESTDIR=`mktemp -d` chmod 755 ${DEV_DESTDIR} tar -C ${DESTDIR} usr/local/include -cf - | ( cd ${DEV_DESTDIR} && tar xvf - ) rm -rf ${DESTDIR}/usr/local/include for i in libhavege.a libhavege.la; do tar -C ${DESTDIR} usr/local/lib/${i} -cf - | ( cd ${DEV_DESTDIR} && tar xvf - ) rm -f ${DESTDIR}/usr/local/lib/${i} done # split man doc to haveged-doc (COPYING is already in master haveged pkg DESTDIR) DOC_DESTDIR=`mktemp -d` chmod 755 ${DOC_DESTDIR} tar -C ${DESTDIR} usr/local/share/man -cf - | ( cd ${DOC_DESTDIR} && tar xvf - ) rm -rf ${DESTDIR}/usr/local/share # set permission sudo chown -R root:root ${DESTDIR} sudo chown root:staff ${DESTDIR}/usr/local/tce.installed sudo chown tc:staff ${DESTDIR}/usr/local/tce.installed/haveged sudo chown -R root:root ${DEV_DESTDIR} sudo chown -R root:root ${DOC_DESTDIR} # TCZ packaging tce-load -wi squashfs-tools submitqc # TCZ packaging -- ifplugd.tcz cd /tmp mksquashfs ${DESTDIR} haveged.tcz md5sum haveged.tcz > haveged.tcz.md5.txt find ${DESTDIR} -type f -o -type l | sed -e "s#^${DESTDIR}##" > haveged.tcz.list # no haveged.tcz.dep vi haveged.tcz.info (edit .info file) # do validation submitqc -c --libs haveged.tcz # TCZ packaging -- haveged-dev.tcz cd /tmp mksquashfs ${DEV_DESTDIR} haveged-dev.tcz md5sum haveged-dev.tcz > haveged-dev.tcz.md5.txt find ${DEV_DESTDIR} -type f | sed -e "s#^${DEV_DESTDIR}##" > haveged-dev.tcz.list vi haveged-dev.tcz.dep - - - - haveged.tcz - - - - vi haveged-dev.tcz.info (edit .info file) # do validation submitqc -c --libs haveged-dev.tcz # TCZ packaging -- haveged-doc.tcz cd /tmp mksquashfs ${DOC_DESTDIR} haveged-doc.tcz md5sum haveged-doc.tcz > haveged-doc.tcz.md5.txt find ${DOC_DESTDIR} -type f | sed -e "s#^${DOC_DESTDIR}##" > haveged-doc.tcz.list # no haveged-doc.tcz.dep is required vi haveged-doc.tcz.info (edit .info file) # do validation submitqc -c --libs haveged-doc.tcz # cleanup sudo rm -rf ${DESTDIR} ${DEV_DESTDIR} ${DOC_DESTDIR} rm -rf haveged-1.9.4