#!/bin/bash # # source: http://people.debian.org/~kov/gksu/gksu-2.0.2.tar.gz # http://people.debian.org/~kov/gksu/libgksu-2.0.12.tar.gz # # # softname='gksu' #softversion='' tarball=$(ls ${softname}*tar*);softversion=${tarball%.*};softversion=${softversion%.*}; softversion=${softversion##*-} packageversion=2jp arch=${arch:-x86_64} case "$arch" in i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686" SLKLDFLAGS="" LIBDIRSUFFIX="" ;; x86_64) SLKCFLAGS="-O2 -fPIC" SLKLDFLAGS="-L/usr/lib64 -lX11 -lgtk-x11-2.0" LIBDIRSUFFIX="64" ;; esac export CFLAGS="$SLKCFLAGS" export CXXFLAGS="$SLKCFLAGS" export LDFLAGS="$SLKLDFLAGS" PKGBUILD=$(pwd) package="$softname-$softversion-$arch-$packageversion" PKG="/tmp/$package" rm -rf $PKG rm -f $PKG.txz mkdir -p $PKG TMP="$PKGBUILD/tmp" rm -rf $TMP cd $PKGBUILD sources="\ libgksu \ gksu " for source in $sources ; do echo -n "Checking $source : " cd $PKGBUILD tarball="$(ls ${source}*tar* 2>/dev/null)" if [ "$tarball" == "" ] ; then echo "not found :(" exit 1 else echo "found $tarball :)" fi done for source in $sources ; do cd $PKGBUILD tarball="$(ls ${source}*tar* )" rm -rf $TMP mkdir -p $TMP if [ "$(echo $tarball | grep ".tar.bz2" )" ]; then tar jxvf $tarball -C $TMP elif [ "$(echo $tarball | grep ".tar.gz" )" ]; then tar zxvf $tarball -C $TMP fi SRC=$(ls -d $TMP/*/) cd $SRC # [ "$source" == "thunar" ] && ( cd thunar ; sed -i 's/inode\/directory/directory/g' * ) [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.0-fbsd.patch | patch -p1 --verbose [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.7-libs.patch | patch -p1 --verbose [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.7-polinguas.patch | patch -p1 --verbose [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.12-revert-forkpty.patch | patch -p1 --verbose [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.12-fix-make-3.82.patch | patch -p0 --verbose [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.12-notests.patch | patch -p1 --verbose [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.12-automake-1.11.2.patch | patch -p1 --verbose [ "$source" == "libgksu" ] && cat $PKGBUILD/libgksu-2.0.12-lib64.patch | patch -p1 --verbose chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; [ "$source" == "libgksu" ] && intltoolize --force --copy --automake [ "$source" == "libgksu" ] && autoreconf -fi ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --mandir=/usr/man \ --localstatedir=/var \ --enable-static=no \ --enable-nautilus-extension=no \ --enable-gtk-doc=no \ --disable-schemas-install \ --with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" make -j2 || exit 1 # make install make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/$(basename $SRC) cp -f AUTHORS INSTALL README TODO NEWS ChangeLog $PKG/usr/doc/$(basename $SRC) # Striptease ( cd $PKG 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 find . -name *.la | xargs rm -f for mandir in $(find ./usr/share/man -name man* -type d) ; do mkdir -p ./usr/man/$(basename $mandir) mv $mandir/*.? ./usr/man/$(basename $mandir) done rm -rf ./usr/share/man for mandir in $(find . -name man -type d) ; do if [ -d $mandir ]; then ( cd $mandir find . -type f -name "*.?" -exec gzip -9 {} \; ) fi done ) ######## ( cd $PKG ; makepkg -l y -c n $PKG.tgz ) removepkg $softname installpkg $PKG.tgz rm -f $PKG.tgz ######### done cd $PKGBUILD # gconf stuff export GCONF_CONFIG_SOURCE="xml::$PKG/etc/gconf/gconf.xml.defaults" if [ -d $PKG/etc/gconf/schemas ]; then install -v -d -m755 $PKG/etc/gconf/gconf.xml.defaults SCHEMAS=$PKG/etc/gconf/schemas for schema in $SCHEMAS/*.schemas; do gconftool-2 --makefile-install-rule $schema done # Reset / Verify correct permissions ( cd $PKG/etc/gconf ; find . -type d -exec chmod 755 {} \; ) ( cd $PKG/etc/gconf ; find . -type f -exec chmod 644 {} \; ) fi rm $PKG/usr/share/applications/gksu-properties.desktop cat << EOF > $PKG/usr/share/applications/gksu-properties.desktop [Desktop Entry] Name=Privilege granting Name[eu]=Pribilegioa ematea Name[fr]=Gestion des privilčges Name[hu]=Jogosultság megadása Name[it]=Concessione privilegi Name[sv]=Rättighetstilldelning Comment=Configure behavior of the privilege-granting tool Comment[eu]=konfiguratu pribilegioak emateko tresnaren portaera Comment[fr]=Configurer la gestion des privilčges super utilisateur Comment[it]=Configura il comportamento dello strumento di concessione privilegi Comment[sv]=Konfigurera beteendet för verktyget för rättighetstilldelning Exec=gksu-properties Icon=gksu StartupNotify=true Terminal=false Type=Application NoDisplay=false Categories=Application;System;Settings;X-Zenpanel;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; EOF rm $PKG/usr/share/applications/gksu.desktop cat << EOF > $PKG/usr/share/applications/gksu.desktop [Desktop Entry] Name=Root Terminal Name[ca]=Terminal root Name[da]=Root-terminal Name[es]=Terminal de «Root» Name[eu]=Root terminala Name[fr]=Terminal administrateur Name[gl]=Terminal de root Name[hu]=Rendszergazda terminál Name[it]=Terminale root Name[lt]=Administratoriaus terminalas Name[nl]=Terminal als root Name[pt_BR]=Terminal como Root Name[sv]=Root-terminal Comment=Opens a terminal as the root user, using gksu to ask for the password Comment[ca]=Obre un terminal com a l'usuari root, utilitzat gksu per a demanar la contrasenya Comment[de]=Öffnet ein Terminal als Benutzer 'root' unter Verwendung von gksu zur Passwortabfrage Comment[es]=Abre un terminal como el usuario «root» utilizando gksu para preguntar la contraseńa. Comment[eu]=Root erabiltzaile gisa terminal bat irekitzen du pasahitza eskatzeko gksu erabiliaz Comment[fr]=Ouvrir un terminal en tant qu'administrateur, en utilisant gksu pour demander le mot de passe Comment[gl]=Abre un terminal como usuario root, usando gksu para preguntar polo contrasinal Comment[hu]=Megnyit egy rendszergazda terminált, a gksu-t használva a jelszó bekérésére Comment[it]=Apre un terminale come root, usando gksu per la richiesta della password Comment[nl]=Start een terminal als de root-gebruiker waarbij gksu gebruikt wordt om het wachtwoord te vragen. Comment[pt_BR]=Abre um terminal como usuário root, usando o gksu para pedir a senha Comment[sv]=Öppnar en terminal som root-användaren och använder gksu för att frĺga efter lösenordet Encoding=UTF-8 Exec=gksu /usr/bin/xfce4-terminal Icon=gksu StartupNotify=true Terminal=false X-MultipleArgs=false Type=Application Categories=GTK;Utility;TerminalEmulator; EOF # slack-desc mkdir -p $PKG/install cat > $PKG/install/slack-desc << END $softname: gksu - is a Gtk+ frontend to su and sudo $softname: $softname: GKSu is a library that provides a Gtk+ frontend to su and sudo. It $softname: supports login shells and preserving environment when acting as a su $softname: frontend. It is useful to menu items or other graphical programs that $softname: need to ask a user's password to run another program as another user $softname: $softname: $softname: $softname: $softname: END mkdir -p $PKG/usr/src/$softname-$softversion cp $PKGBUILD/build-$softname.sh $PKG/usr/src/$softname-$softversion/ removepkg $softname cd $PKG makepkg -l y -c n $PKG.txz # Cleanup cd $PKGBUILD rm -rf $PKG rm -rf $TMP