#!/bin/bash # packager : Romain G (Shaihuld~AT~gmail.com) # source location : www.playonlinux.com # last revised : 27/12/07 softname='subtitleeditor' softversion='0.13.6' packageversion='48.1' arch='i486' cpu='i686' prefix=/usr # log ;) ( # parameters needed for the build process buildir=$(pwd) srcpkg="$buildir/$softname-$softversion.tar.gz" src="$buildir/$softname-$softversion" package="$softname-$softversion-$arch-$packageversion" dest="$buildir/$package" # prepare the build result directory dest="$buildir/$package" rm -rf $dest mkdir -p $dest mkdir -p $dest/install mkdir -p $dest/usr/doc/$softname-$softversion mkdir -p $dest/usr/src/$softname-$softversion # Slack-desc cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| subtitleeditor: subtitleeditor 0.13.6 subtitle editor subtitleeditor: subtitleeditor: Subtitle Editor is a little program which allow everybody to make or subtitleeditor: edit quickly subtitles files (*.str) subtitleeditor: subtitleeditor: subtitleeditor: subtitleeditor: subtitleeditor: subtitleeditor: subtitleeditor: subtitleeditor: subtitleeditor: EOF # extract the source code cd $buildir tar xvzf $srcpkg cd $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 file cat << "EOF" > $dest/usr/share/applications/$softname.desktop [Desktop Entry] Encoding=UTF-8 Name=subtitle editor Name[fr]=editeur de sous titre Exec=Subtitleeditor Icon=Subtitleeditor Terminal=false Type=Application Categories=Application;Video; StartupNotify=true EOF # Make the package freedesktop compliant cp $buildir/$softname-$softversion/pixmaps/$softname.png $dest/usr/share/icons/hicolor/48x48/apps/$softname.png # ZenBuild cp $buildir/build-$softname.sh $dest/$prefix/src/$softname-$softversion # set target permissions chown -R root:root $dest cd $dest find . -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 work cd $dest makepkg -l y -c n $dest.tgz # md5sum signature cd $buildir md5sum $package.tgz > $package.md5 # log ;) ) 2>&1 | tee "$softname-$softversion-build.log"