#!/bin/bash # packager : Frederic Boulet bipbiponlinux~AT~gmail.com # homepage : https://launchpad.net/deja-dup # source location : http://launchpadlibrarian.net/33384969/deja-dup-11.0.tar.bz2 # dep : duplicity,unique # last revised : 30.10.2009 softname='deja-dup' softversion='11.0' packageversion='1fb' arch='i486' cpu='i686' prefix=/usr # log ;) ( # parameters needed for the build process buildir=$(pwd) src="$buildir/$softname-$softversion" srcpkg="$buildir/$softname-$softversion.tar.bz2" package="$softname-$softversion-$arch-$packageversion" dest="$buildir/$package" source=http://launchpadlibrarian.net/34666862/$softname-$softversion.tar.bz2 # prepare the build result directory rm -rf $dest mkdir -p $dest mkdir -p $dest/install mkdir -p $dest/$prefix/bin mkdir -p $dest/usr/share/applications mkdir -p $dest/usr/share/icons/hicolor/48x48/apps mkdir -p $dest/usr/doc mkdir -p $dest/usr/src/$softname-$softversion # Slack-desc cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| deja-dup: deja-dup (A simple backup tool) deja-dup: deja-dup: Déjà Dup is a simple backup tool that hides the complexity of deja-dup: doing backups the 'right way' (encrypted, off-site, and regular) deja-dup: and uses duplicity as the backend. deja-dup: deja-dup: deja-dup: deja-dup: deja-dup: deja-dup: EOF # check if source is present if [ -f $softname-$softversion.tar.bz2 ]; then echo "Source file already here, no need to download"; else echo "Downloading source" wget -c --no-check-certificate $source fi # extract the source code cd $buildir tar xvf $srcpkg cd $src # build export CFLAGS="-O2 -march=$arch -mtune=$cpu" export CXXFLAGS="-O2 -march=$arch -mtune=$cpu" ./configure \ --program-prefix="" \ --program-suffix="" \ --prefix="/usr" \ --sysconfdir="/etc" \ --localstatedir="/var" \ --mandir="/usr/man" \ --infodir="/usr/info" \ --enable-static="no" \ --enable-shared="yes" \ --disable-schemas-install \ --with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" \ --build=$arch-slackware-linux || exit make make install DESTDIR=$dest # gconf stuff export GCONF_CONFIG_SOURCE="xml::$dest/etc/gconf/gconf.xml.defaults" if [ -d $dest/etc/gconf/schemas ]; then install -v -d -m755 $dest/etc/gconf/gconf.xml.defaults SCHEMAS=$dest/etc/gconf/schemas for schema in $SCHEMAS/*.schemas; do gconftool-2 --makefile-install-rule $schema done # reset / Verify correct permissions ( cd $dest/etc/gconf ; find . -type d -exec chmod 755 {} \; ) ( cd $dest/etc/gconf ; find . -type f -exec chmod 644 {} \; ) fi # make the .desktop file convert $dest/usr/share/icons/hicolor/scalable/apps/deja-dup.svg -resize 48x48 $dest/usr/share/icons/hicolor/48x48/apps/$softname.png # add 'default' files cd $src mkdir -p $dest/usr/doc/$softname-$softversion cp -a \ AUTHORS COPYING ChangeLog INSTALL NEWS README TODO\ $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 ) # SalixBuild cd $buildir cp 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.txz # computes the md5sum signature for the package cd $buildir md5sum $package.txz > $package.md5 # .dep cd $buildir echo -e "GConf,ORBit2,alsa-lib,atk,audiofile,cairo,dbus,dbus-glib,\ duplicity,e2fsprogs,esound,expat,fontconfig,freetype,glib2,gnome-keyring,\ gnome-vfs,gtk+2,libICE,libSM,libX11,libXau,libXcomposite,libXcursor,\ libXdamage,libXdmcp,libXext,libXfixes,libXi,libXinerama,libXrandr,\ libXrender,libart_lgpl,libbonobo,libbonoboui,libgnome,libgnomecanvas,\ libgnomeui,libnotify,libpng,libxcb,libxml2,openssl,pango,\ pixman,popt,libunique,zlib" > $package.dep # .src echo http://zenwalk.pinguix.com/user-accounts/bip/divers/salix/xap/deja-dup/build-deja-dup.sh > $package.src echo $source >> $package.src # erase rm -rf $src rm -rf $dest # log ;) ) 2>&1 | tee "$softname-$softversion-build.log"