#!/bin/sh #script by kingdomcome modified by jls_legalize . /etc/init.d/tc-functions checkroot TODAY=`date +%Y/%m/%d` PACKAGE="google-talkplugin" VERSION="4.8.3.0" SEP=_ MIRROR="http://dl.google.com/linux/talkplugin/deb/pool/main/g/$PACKAGE" DEPS="gtk2.tcz fontconfig.tcz libasound.tcz" BUILDDEPS="" TCUSER=`cat /etc/sysconfig/tcuser` SRC=$PACKAGE$SEP$VERSION-1_i386.deb THISDIR=`pwd` PKGDIR="${THISDIR}/${PACKAGE}" SRCDIR="${PKGDIR}/${PACKAGE}${SEP}${VERSION}" TCEDIR=/etc/sysconfig/tcedir CURRENT="${TODAY} Updated to $VERSION" clean(){ rm -rf ${THISDIR}/${PACKAGE} } environment(){ for each in ${DEPS} ${BUILDDEPS}; do APPNAME=$(getbasefile "$each" 1) if [ ! -f /usr/local/tce.installed/"${APPNAME}" ]; then if [ ! -e ${TCEDIR}/optional/${each} ]; then sudo -u ${TCUSER} tce-load -w ${each} fi sudo -u ${TCUSER} tce-load -i ${TCEDIR}/optional/${each} fi done [ -e ${PKGDIR}/tmp ] || mkdir -p ${PKGDIR}/tmp cd ${PKGDIR} wget ${MIRROR}/${SRC} } unpackit() { cd $PKGDIR ar -x ${SRC} cd $PKGDIR/tmp tar -zxf ../data.tar.gz } workit(){ cd ${PKGDIR}/tmp rm -r usr/share mkdir -pm 775 usr/local/tce.installed echo "echo /opt/google/talkplugin/lib >> /etc/ld.so.conf" > \ usr/local/tce.installed/$PACKAGE echo "ldconfig" >> usr/local/tce.installed/$PACKAGE chmod 775 usr/local/tce.installed/${PACKAGE} } getinfo(){ cd ${PKGDIR} [ -e ${PACKAGE}.tcz.info ] && rm ${PACKAGE}.tcz.info tce-fetch.sh $PACKAGE.tcz.info } packageit(){ if [ ! -f /usr/local/tce.installed/squashfs-tools-4.x ]; then if [ ! -e ${TCEDIR}/optional/squashfs-tools-4.x.tcz ]; then sudo -u ${TCUSER} tce-load -w squashfs-tools-4.x.tcz fi su ${TCUSER} -c "tce-load -is squashfs-tools-4.x.tcz" fi cd ${PKGDIR}/tmp [ -e ../${PACKAGE}.tcz ] && rm ../${PACKAGE}.tcz mksquashfs . ../${PACKAGE}.tcz cd ${PKGDIR} md5sum ${PACKAGE}.tcz > ${PACKAGE}.tcz.md5.txt [ -e ${PACKAGE}.tcz.dep ] && rm ${PACKAGE}.tcz.dep for each in ${DEPS}; do echo ${each} >> ${PACKAGE}.tcz.dep; done size=`du -h ${PACKAGE}.tcz | cut -f 1` sed -i "s/Version:.*/Version: ${VERSION}/" ${PACKAGE}.tcz.info sed -i "s/Size:.*/Size: ${size}/" ${PACKAGE}.tcz.info sed -i "s/Current:/ /" $PACKAGE.tcz.info echo "Current: $CURRENT" >> $PACKAGE.tcz.info } checkit(){ sudo chown ${TCUSER}:staff ${THISDIR} cd ${PKGDIR} if [ ! -f /usr/local/tce.installed/submitqc5 ]; then if [ ! -e ${TCEDIR}/optional/submitqc5 ]; then sudo -u ${TCUSER} tce-load -w submitqc5 fi su ${TCUSER} -c "tce-load -is submitqc5" fi submitqc5 } copy2tce(){ cd ${PKGDIR} cp ${PACKAGE}.tcz "${TCEDIR}"/optional cp ${PACKAGE}.tcz.md5.txt "${TCEDIR}"/optional cp ${PACKAGE}.tcz.dep "${TCEDIR}"/optional } tarit(){ cd ${PKGDIR} cp ../${PACKAGE}.tcbuild . if [ ! -f /usr/local/tce.installed/xz ]; then if [ ! -e ${TCEDIR}/optional/xz ]; then sudo -u ${TCUSER} tce-load -w xz fi su ${TCUSER} -c "tce-load -is xz" fi [ -e ../${PACKAGE}.tar ] && rm ../${PACKAGE}.tar tar cvf ../${PACKAGE}$SEP$VERSION.tar \ ${PACKAGE}.tcz* \ ${PACKAGE}.tcbuild cd ${THISDIR} [ -f ${PACKAGE}$SEP$VERSION.tar.xz ] && rm ${PACKAGE}$SEP$VERSION.tar.xz xz ${PACKAGE}$SEP$VERSION.tar } #here we go clean environment #echo -n "Next step unpack. Press Enter key." #read gagme unpackit #echo -n "Next step workit. Press Enter key." #read gagme workit #echo -n "Next step getinfo. Press Enter key." #read gagme getinfo #echo -n "Next step packageit. Press Enter key." #read gagme packageit echo -n "Next step checkit. Press Enter key." read gagme checkit copy2tce tarit