#!/bin/bash # # source: http://ftp.gnome.org/pub/gnome/sources/gnome-disk-utility/ # # maintainer: me # NAME=gnome-disk-utility VERSION=${VERSION:-$(echo $NAME-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} BUILD=${BUILD:-2jp} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) export ARCH=i486 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; esac fi CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-$NAME if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi rm -rf $PKG mkdir -p $TMP $PKG cd $TMP rm -rf $NAME-$VERSION tar xvf $CWD/$NAME-$VERSION.tar.xz || exit 1 cd $NAME-$VERSION || exit 1 #cat $CWD/gnome-disk-utility-3.8.2-format.patch | patch -p1 --verbose #cat $CWD/Be-more-careful-with-XIDs.patch | patch -p1 --verbose #cat $CWD/Make-dialog-work-with-xid-again.patch | patch -p1 --verbose chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --disable-static \ --disable-schemas-compile \ --disable-gsd-plugin \ --disable-libsystemd-login \ --build=$ARCH-slackware-linux make -j6 || make || exit 1 make install DESTDIR=$PKG || exit 1 find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true # Desktop cooking # sed -i 's|^Exec=\(.*\)$|Exec=pkexec /usr/bin/gnome-disks|g' $PKG/usr/share/applications/org.gnome.DiskUtility.desktop sed -i 's|^Categories=\(.*\)$|Categories=\1Settings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;|g' $PKG/usr/share/applications/org.gnome.DiskUtility.desktop mv $PKG/usr/share/applications/org.gnome.DiskUtility.desktop $PKG/usr/share/applications/gnome-disks.desktop # Compress and link manpages, if any: if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man for manpagedir in $(find . -type d -name "man*") ; do ( cd $manpagedir for eachpage in $( find . -type l -maxdepth 1) ; do ln -s $( readlink $eachpage ).gz $eachpage.gz rm $eachpage done gzip -9 *.? ) done ) fi mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a \ AUTHORS COPYING INSTALL NEWS README TODO \ $PKG/usr/doc/$NAME-$VERSION # Description file mkdir -p $PKG/install cat << EODESC > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler---------------------------------------------------| gnome-disk-utility: gnome-disk-utility - is gnome disk tools gnome-disk-utility: gnome-disk-utility: gnome-disk-utility provides libraries and applications for dealing gnome-disk-utility: with storage devices gnome-disk-utility: gnome-disk-utility: gnome-disk-utility: gnome-disk-utility: gnome-disk-utility: gnome-disk-utility: gnome-disk-utility: EODESC cat << DOINST > $PKG/install/doinst.sh if [ -x /usr/bin/update-desktop-database ]; then usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 fi if [ -x /usr/bin/gtk-update-icon-cache ]; then usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 fi if [ -x /usr/bin/glib-compile-schemas ]; then usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1 fi DOINST # Policykit mkdir -p $PKG/usr/share/polkit-1/actions cat << EOS > $PKG/usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.$NAME.policy Run $NAME Authentication is required to run $NAME as Root no no auth_admin_keep /usr/bin/gnome-disks TRUE EOS mkdir -p $PKG/usr/src/$NAME-$VERSION cp $CWD/build-$NAME.sh $PKG/usr/src/$NAME-$VERSION cd $PKG /sbin/makepkg -l y -c n $TMP/${NAME}-$VERSION-$ARCH-$BUILD.txz