rendered paste body#!/bin/bash# packager : Romain G <Shai> (Shaihuld~AT~gmail.com)# source location : www.playonlinux.com# last revised : 27/12/07softname='subtitleeditor'softversion='0.13.6'packageversion='48.1'arch='i486'cpu='i686'prefix=/usr# log ;)(# parameters needed for the build processbuildir=$(pwd)srcpkg="$buildir/$softname-$softversion.tar.gz"src="$buildir/$softname-$softversion"package="$softname-$softversion-$arch-$packageversion"dest="$buildir/$package"# prepare the build result directorydest="$buildir/$package"rm -rf $destmkdir -p $destmkdir -p $dest/installmkdir -p $dest/usr/doc/$softname-$softversionmkdir -p $dest/usr/src/$softname-$softversion# Slack-desccat <<EOF > $dest/install/slack-desc |-----handy-ruler------------------------------------------------------|subtitleeditor: subtitleeditor 0.13.6 subtitle editorsubtitleeditor:subtitleeditor: Subtitle Editor is a little program which allow everybodysubtitleeditor: to make or edit quickly subtitles files (*.str)subtitleeditor:subtitleeditor:subtitleeditor:subtitleeditor:subtitleeditor:subtitleeditor:subtitleeditor:subtitleeditor:subtitleeditor:EOF# extract the source codecd $buildirtar xvzf $srcpkgcd $src# build export CFLAGS="-O2 -march=$arch -mtune=$cpu" export CXXFLAGS="-O2 -march=$arch -mtune=$cpu" ./configure \ --prefix=$prefix \ --mandir=$prefix/man \ --enable-static=no \ --build=$arch-slackware-linux make make install DESTDIR=$dest# add 'default' files cp -a \ AUTHORS COPYING INSTALL README ChangeLog \ $dest/usr/doc/$softname-$softversion # Strip( cd $dest find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null)# Compress Man Pages( cd $dest/$prefix/man find . -name "*.?" | xargs gzip -9)# .desktop filecat << "EOF" > $dest/usr/share/applications/$softname.desktop [Desktop Entry]Encoding=UTF-8Name=subtitle editorName[fr]=editeur de sous titreComment=In the NameComment[fr]=dans le nomExec=SubtitleeditorIcon=SubtitleeditorTerminal=falseType=ApplicationCategories=Application;Video;StartupNotify=trueEOF# Make the package freedesktop compliantcp $buildir/$softname-$softversion/pixmaps/$softname.png $dest/usr/share/icons/hicolor/48x48/apps/$softname.png# ZenBuildcp $buildir/build-$softname.sh $dest/$prefix/src/$softname-$softversion# set target permissionschown -R root:root $destcd $destfind . -perm 664 -exec chmod 644 {} \;find . -perm 600 -exec chmod 644 {} \;find . -perm 444 -exec chmod 644 {} \;find . -perm 400 -exec chmod 644 {} \;find . -perm 440 -exec chmod 644 {} \;find . -perm 777 -exec chmod 755 {} \;find . -perm 775 -exec chmod 755 {} \;find . -perm 511 -exec chmod 755 {} \;find . -perm 711 -exec chmod 755 {} \;find . -perm 555 -exec chmod 755 {} \;# real packaging workcd $destmakepkg -l y -c n $dest.tgz# md5sum signaturecd $buildirmd5sum $package.tgz > $package.md5# log ;)) 2>&1 | tee "$softname-$softversion-build.log"