diff options
Diffstat (limited to 'source/a/udisks2/udisks2.SlackBuild')
-rwxr-xr-x | source/a/udisks2/udisks2.SlackBuild | 125 |
1 files changed, 60 insertions, 65 deletions
diff --git a/source/a/udisks2/udisks2.SlackBuild b/source/a/udisks2/udisks2.SlackBuild index 78e61e73..8886f015 100755 --- a/source/a/udisks2/udisks2.SlackBuild +++ b/source/a/udisks2/udisks2.SlackBuild @@ -1,8 +1,7 @@ #!/bin/bash -# Slackware build script for udisks - -# Copyright 2010, 2011 Robby Workman, Northport, Alabama, USA +# Copyright 2010, 2011, 2018 Robby Workman, Tuscaloosa, Alabama, USA +# Copyright 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -11,7 +10,7 @@ # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, @@ -22,27 +21,22 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Modified 2012 by Eric Hameleers <alien at slackware.com> for ARM port. - cd $(dirname $0) ; CWD=$(pwd) PKGNAM=udisks2 SRCNAM=udisks -VERSION=${VERSION:-$(echo $SRCNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-3} - -NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} +VERSION=${VERSION:-$(echo $SRCNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: -MARCH=$( uname -m ) if [ -z "$ARCH" ]; then - case "$MARCH" in - i?86) export ARCH=i586 ;; - armv7hl) export ARCH=$MARCH ;; - arm*) export ARCH=arm ;; + case "$(uname -m)" in + i?86) ARCH=i586 ;; + arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;; # Unless $ARCH is already set, use uname -m for all other archs: - *) export ARCH=$MARCH ;; + *) ARCH=$(uname -m) ;; esac + export ARCH fi # If the variable PRINT_PACKAGE_NAME is set, then this script will report what @@ -53,95 +47,96 @@ if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then exit 0 fi +NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "} + if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" + SLKCFLAGS="-O2 -march=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" elif [ "$ARCH" = "armv7hl" ]; then - SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" + SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16" LIBDIRSUFFIX="" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi -case "$ARCH" in - arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; - *) TARGET=$ARCH-slackware-linux ;; -esac - TMP=${TMP:-/tmp} PKG=$TMP/package-$PKGNAM rm -rf $PKG mkdir -p $TMP $PKG + cd $TMP rm -rf $SRCNAM-$VERSION -tar xvf $CWD/$SRCNAM-$VERSION.tar.xz || exit 1 +tar xvf $CWD/$SRCNAM-$VERSION.tar.?z || exit 1 cd $SRCNAM-$VERSION || exit 1 + 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 {} \+ - -# Temporarily omit LVM2 support since it uses a removed API. We'll upgrade -# udisks2 soon (and add newly required deps) to handle this, but since it -# was broken after the LVM2 upgrade recently and nobody noticed yet it's -# probably OK for it to be like this for a little while. -if [ "$VERSION" = "2.6.5" ]; then - LVM2_SUPPORT="--disable-lvm2" -else - LVM2_SUPPORT="--enable-lvm2" + \( -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 {} \+ + +# Configure, build, and install: +if [ ! -r configure ]; then + if [ -x ./autogen.sh ]; then + NOCONFIGURE=1 ./autogen.sh + else + autoreconf -vif + fi fi - CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ +# --enable-zram (removed since it appears to require systemd... but perhaps there's a way around that) ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ - --disable-static \ - --mandir=/usr/man \ --docdir=/usr/doc/$PKGNAM-$VERSION \ - $LVM2_SUPPORT \ - --build=$TARGET || exit 1 - + --mandir=/usr/man \ + --disable-static \ + --enable-lvm2 \ + --enable-btrfs \ + --enable-bcache \ + --build=$ARCH-slackware-linux || exit 1 make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 # Don't ship .la files: -rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la - -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -# 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 +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +# Don't overwrite config file, but leave mount_options.conf.example alone +mv $PKG/etc/udisks2/udisks2.conf $PKG/etc/udisks2/udisks2.conf.new + +# Strip binaries: +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null -mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +# Compress manual pages: +find $PKG/usr/man -type f -exec gzip -9 {} \+ +for i in $( find $PKG/usr/man -type l ) ; do + ln -s $( readlink $i ).gz $i.gz + rm $i +done + +# Add a documentation directory: +mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION cp -a \ - AUTHORS COPYING* HACKING INSTALL NEWS README* \ - $PKG/usr/doc/$PKGNAM-$VERSION + AUTHORS* ChangeLog CHANGES COPYING* HACKING* LICENSE* NEWS* README* THANKS* TODO* \ + $PKG/usr/doc/${PKGNAM}-$VERSION +if [ -d $PKG/usr/share/gtk-doc/html/$PKGNAM ]; then + ln -s /usr/share/gtk-doc/html/$PKGNAM $PKG/usr/doc/$PKGNAM-$VERSION/html +fi # If there's a ChangeLog, installing at least part of the recent history # is useful, but don't let it get totally out of control: |