#!/bin/bash # packager : Frederic Boulet bipbiponlinux~AT~gmail.com # original build script from Fred. Galusik (fred~AT~zenwalk.fr) # source location : http://www.pidgin.im/ # last revised : 3/3/08 softname='pidgin' softversion='2.4.0' packageversion='52.1' arch='i486' cpu='i686' prefix=/usr # # log # ( # parameters needed for the build process buildir=$(pwd) srcpkg="$buildir/$softname-$softversion.tar.bz2" src="$buildir/$softname-$softversion" package="$softname-$softversion-$arch-$packageversion" dest="$buildir/$package" source=http://surfnet.dl.sourceforge.net/sourceforge/pidgin/$softname-$softversion.tar.bz2 # 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 # put slack-desc in place cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| $softname: Multi-protocol instant messaging client $softname: $softname: Pidgin is a multi-protocol Instant Messaging client that $softname: allows you to use all of your IM accounts at once. $softname: $softname: $softname: $softname: $softname: $softname: $softname: 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 xjvf $srcpkg cd $src # configure package for compilation export CFLAGS="-O2 -march=$arch -mtune=$cpu" export CXXFLAGS="-O2 -march=$arch -mtune=$cpu" ./configure \ --prefix=$prefix \ --sysconfdir=/etc \ --localstatedir=/var/lib \ --mandir=/usr/man \ --enable-cyrus-sasl \ --enable-dbus \ --disable-gstreamer \ --disable-perl \ --disable-tcl \ --disable-tk \ --disable-doxygen \ --disable-gtkspell \ --disable-gevolution \ --disable-cap \ --enable-dot=no \ --program-prefix="" \ --program-suffix="" \ --disable-schemas-install \ --with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" \ # make package and install it to the target directory 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 # add 'default' files cp -a \ PLUGIN_HOWTO AUTHORS COPYING COPYRIGHT ChangeLog README* ChangeLog.API INSTALL NEWS HACKING \ $dest/usr/doc/$softname-$softversion # Strip Executables ( 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 ) # make the .desktop file cat << "EOF" > $dest/usr/share/applications/$softname.desktop [Desktop Entry] Encoding=UTF-8 Categories=Application;Network; Exec=pidgin Icon=pidgin StartupNotify=true Terminal=false Type=Application Name=Pidgin Internet Messenger Name[ca]=Missatger d'Internet Pidgin Name[cs]=Pidgin Internet Messenger Name[da]=Pidgin - internet beskeder Name[de]=Pidgin Internet Messenger Name[es]=Pidgin - cliente de mensajería de Internet Name[fr]=Messagerie Internet Pidgin Name[hu]=Pidgin azonnali üzenetküldő Name[it]=Pidgin Internet Messenger Name[ja]=Pidgin インターネット・メッセンジャー Name[ko]=게임 메신저 Name[nb]=Pidgin lynmeldingsklient Name[nl]=Pidgin - Expresberichten Name[pl]=Komunikator Internetowy Pidgin Name[pt_BR]=Mensageiro via Internet Pidgin Name[pt]=Mensageiro Internet Pidginm Name[ro]=Mesagerul Pidgin Name[ru]=Pidgin - клиент обмена мгновенными сообщениями Name[sl]=Pidgin - spletni sel Name[sq]=Lajmësjellësi Internet Pidgin Name[sv]=Pidgin Internet Messenger Name[zh_CN]=Pidgin 互联网通讯程序 Name[zh_TW]=Pidgin 網路即時通 GenericName=Internet Messenger GenericName[ca]=Missatger d'Internet GenericName[cs]=Internet Messenger GenericName[da]=Internet beskeder GenericName[de]=Internet Messenger GenericName[es]=Cliente de mensajería de Internet GenericName[fr]=Messagerie internet GenericName[hu]=Azonnali üzenetküldő GenericName[it]=Internet Messenger GenericName[ja]=インターネット・メッセンジャー GenericName[ko]=메신저 GenericName[nb]=Lynmeldingsklient GenericName[nl]=Expresberichten GenericName[pl]=Komunikator Internetowy GenericName[pt_BR]=Mensageiro via Internet GenericName[pt]=Mensageiro Internet GenericName[ro]=Client de mesagerie GenericName[ru]=Клиент обмена мгновенными сообщениями GenericName[sl]=Spletni sel GenericName[sq]=Lajmësjellës Internet GenericName[sv]=Meddelandeklient GenericName[zh_CN]=互联网通讯程序 GenericName[zh_TW]=網路即時通 Comment=Send instant messages over multiple protocols Comment[ca]=Envieu missatges instantanis en múltiples protocols Comment[cs]=Posílat instant message různými protokoly Comment[da]=Send beskeder over flere protokoller Comment[de]=Multi-Protokoll Instant Messenger Client Comment[es]=Cliente de mensajería instantánea multiprotocolo Comment[fr]=Envoie des messages instantanés en utilisant divers protocoles Comment[hu]=Azonnali üzenetküldés többféle protokoll használatával Comment[it]=Client multiprotocollo per messaggi immediati Comment[ja]=複数のプロトコルを介してインスタント・メッセージを送信します Comment[ko]=다중 프로토콜 메신저 Comment[nb]=Send lynmeldinger over flere protokoller Comment[nl]=Multi-protocol programma voor expresberichten Comment[pl]=Komunikator internetowy obsługujący kilka protokołów Comment[pt_BR]=Mande mensagens instantâneas por múltiplos protocolos Comment[pt]=Envie mensagens instantâneas sobre vários protocolos Comment[ro]=Trimiteţi mesaje instant în orice reţea Comment[ru]=Обмен мгновенными сообщениями с использованием множества протоколов Comment[sl]=Pošiljajte neposredna sporočila prek različnih protokolovs Comment[sq]=Dërgoni mesazhe të atypëratyshëm protokollesh të ndryshëm Comment[sv]=Sänder snabbmeddelande över många protokoll Comment[zh_CN]=通过多种协议发送即时消息 Comment[zh_TW]=透過多種通訊協定發送即時訊息 EOF # put the ZenWalk build in the right directory 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 # computes the md5sum signature for the package cd $buildir md5sum $package.tgz > $package.md5 #dep file echo -e "atk,avahi,coreutils,cyrus-sasl,dbus,dbus-glib,expat,fontconfig,freetype,gcc,\ glib2,gnutls,gtk+2,libgadu,libgcrypt,libgpg-error,libpng,libxml2,meanwhile,ncurses,\ nss-nspr,pango,python,startup-notification,xorg,zlib" > $package.dep # erase source rm -rf $src rm -rf $dest # # log # ) 2>&1 | tee "$softname-$softversion-build.log"