#!/bin/bash # # source: http://download.gtk3-nocsd.org/ # # maintainer: me # NAME='gtk3-nocsd' VERSION='26112015' packageversion='1jp' 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" LIBDIRSUFFIX="64" ;; esac export CFLAGS="$SLKCFLAGS" export CXXFLAGS="$SLKCFLAGS" export LDFLAGS="$SLKLDFLAGS" buildir=$(pwd) srcpkg="$buildir/gtk3-nocsd-master.zip" src="$buildir/gtk3-nocsd-master" package="$NAME-$VERSION-$arch-$packageversion" PKG="/tmp/$package" cd $buildir rm -rf $src unzip $srcpkg rm -f $PKG.txz rm -rf $PKG cd $src 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 {} \; make DESTDIR=$PKG prefix=/usr libdir=/usr/lib64 mandir=/usr/man make install DESTDIR=$PKG prefix=/usr libdir=/usr/lib64 mandir=/usr/man find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) # Documentation mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS ChangeLog COPYING INSTALL HACKING NEWS README* THANKS TODO \ $PKG/usr/doc/$NAME-$VERSION # Description file mkdir -p $PKG/install cat << EOF > $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-----------------------------------------------------| gtk3-nocsd: gtk3-nocsd workaround for CSD bullshit gtk3-nocsd: gtk3-nocsd: gtk3-nocsd is a small module used to disable the client side gtk3-nocsd: decoration of gtk+ 3. gtk3-nocsd: gtk3-nocsd: gtk3-nocsd: gtk3-nocsd: gtk3-nocsd: gtk3-nocsd: gtk3-nocsd: EOF mkdir -p $PKG/etc/profile.d/ cat << EOF > $PKG/etc/profile.d/gtk3-nocsd.sh export GTK_CSD=0 export LD_PRELOAD=/usr/lib64/libgtk3-nocsd.so.0 EOF chmod 755 $PKG/etc/profile.d/gtk3-nocsd.sh mkdir -p $PKG/usr/src/$NAME-$VERSION cp $buildir/build-$NAME.sh $PKG/usr/src/$NAME-$VERSION # Packaging cd $PKG makepkg -l y -c n $PKG.txz cd $buildir