diff options
author | Eric Hameleers <alien@slackware.com> | 2007-02-05 14:14:39 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2007-02-05 14:14:39 +0000 |
commit | 18e70168b5954931777a6d526badc8b86e90ae42 (patch) | |
tree | ef1896a33790fcea5fad0ff21e0cfb31f4bd3421 /fuse/build/fuse.SlackBuild | |
parent | 3b774fb5c7e450083655e42f89fc43fa7e358fe3 (diff) | |
download | asb-18e70168b5954931777a6d526badc8b86e90ae42.tar.gz asb-18e70168b5954931777a6d526badc8b86e90ae42.tar.xz |
New release, some improvements to the SlackBuild (like better detection of the correct rc.modules , configurability of the suid-bit of the fusermount binary.
Diffstat (limited to 'fuse/build/fuse.SlackBuild')
-rwxr-xr-x | fuse/build/fuse.SlackBuild | 132 |
1 files changed, 59 insertions, 73 deletions
diff --git a/fuse/build/fuse.SlackBuild b/fuse/build/fuse.SlackBuild index cced23e3..2489bb62 100755 --- a/fuse/build/fuse.SlackBuild +++ b/fuse/build/fuse.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# -# Copyright (c) 2006 Eric Hameleers <alien@slackware.com> +# Copyright (c) 2006,2007 Eric Hameleers <alien@slackware.com> +# $Id$ # ----------------------------------------------------------------------------- # # Slackware SlackBuild script @@ -9,7 +9,7 @@ # For: fuse # Descr: Filesystem in Userspace # URL: http://fuse.sourceforge.net/ -# Needs: +# Needs: # Changelog: # 2.2-1: 04/mar/2005 by Eric Hameleers <alien@sox.homeip.net> # * Initial build. @@ -26,6 +26,10 @@ # in the "--cleanup" section. # 2.5.3-1: 01/Sep/2006 by Eric Hameleers <alien@slackware.com> # * Used new SlackBuild template. +# 2.6.3-1: 05/feb/2007 by Eric Hameleers <alien@slackware.com> +# * Update so I can use it on 2.6.19+ kernels. Also, better detection +# of the correct rc.modules to use. Make 'suid-root'ing the +# fusermount binary configurable high up in the SlackBuild. # # Run 'sh SlackBuild --cleanup' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . @@ -38,10 +42,20 @@ PRGNAM=fuse PRGNAM2=fuse-module -VERSION=${VERSION:-2.5.3} +VERSION=${VERSION:-2.6.3} ARCH=${ARCH:-i486} BUILD=1 +DOCS="AUTHORS COPYING COPYING.LIB ChangeLog FAQ Filesystems \ + NEWS README README-2.4 README.NFS doc/how-fuse-works doc/kernel.txt" + +# ----------------------------------------------------------------------- +# If you do *not* want non-root users to be able mount a fuse filesystem, +# you should remove the suid bit from fusermount: in that case, set +# BINPERM=0750 +BINPERM=4755 +# ----------------------------------------------------------------------- + # Where do we look for sources? CWD=`pwd` SRCDIR=`dirname $0` @@ -55,7 +69,7 @@ OUTPUT=${OUTPUT:-/tmp} # Exit the script on errors: set -e -trap 'echo "$0 FAILED!" | tee $OUTPUT/error-${PRGNAM}.log' ERR +trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR # Catch unitialized variables: set -u P1=${1:-1} @@ -66,11 +80,8 @@ KSRC=${KSRC:-/lib/modules/${KVER}/build} PATCHLEVEL=`echo $KVER|cut -f 2 -d '.'` [ $PATCHLEVEL -eq 4 ] && MODCONFFILE=modules.conf || MODCONFFILE=modprobe.conf -DOCS="AUTHORS COPYING COPYING.LIB ChangeLog FAQ Filesystems \ - NEWS README README-2.4 README.NFS doc/how-fuse-works doc/kernel.txt" - #Input URL: http://surfnet.dl.sourceforge.net/sourceforge/fuse/fuse-2.5.3.tar.gz -SOURCE="${PRGNAM}-${VERSION}.tar.gz" +SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" SRCURL="http://dl.sourceforge.net/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz" ## @@ -132,17 +143,20 @@ fi # --- SOURCE FILE AVAILABILITY --- -if ! [ -f ${SRCDIR}/${SOURCE} ]; then +if ! [ -f ${SOURCE} ]; then if ! [ "x${SRCURL}" == "x" ]; then - echo "Source '${SOURCE}' not available yet... will download now:" - wget -nv -O "${SRCDIR}/${SOURCE}" "${SRCURL}" || true + # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT + [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/`basename $SOURCE`" + echo "Source '${SOURCE}' not available yet..." + echo "Will download file to `dirname $SOURCE`" + wget -nv -O "${SOURCE}" "${SRCURL}" || true if [ $? -ne 0 ]; then - echo "Downloading '${SOURCE}' failed... aborting the build." - mv -f "${SRCDIR}/${SOURCE}" "${SRCDIR}/${SOURCE}".FAIL + echo "Downloading '`basename ${SOURCE}`' failed... aborting the build." + mv -f "${SOURCE}" "${SOURCE}".FAIL exit 1 fi else - echo "File '${SOURCE}' not available... aborting the build." + echo "File '`basename ${SOURCE}`' not available... aborting the build." exit 1 fi fi @@ -158,33 +172,17 @@ echo "++" echo "|| $PRGNAM-$VERSION" echo "++" -cd $PKG - -# Explode the package framework: -if [ -f $SRCDIR/_$PRGNAM.tar.gz ]; then - explodepkg $SRCDIR/_$PRGNAM.tar.gz -fi - cd $TMP/tmp-$PRGNAM - -# --- TARBALL EXTRACTION,PATCH,MODIFY --- - echo "Extracting the source archive(s) for $PRGNAM..." -if `file $SRCDIR/${SOURCE} | grep -q ": bzip2"`; then - tar -xjvf $SRCDIR/${SOURCE} || true +if `file ${SOURCE} | grep -q ": bzip2"`; then + tar -xjvf ${SOURCE} else - tar -xzvf $SRCDIR/${SOURCE} || true -fi -if [ $? -ne 0 ]; then - echo "Error in unpacking '${SOURCE}!' Aborting..." - exit $? + tar -xzvf ${SOURCE} fi cd ${PRGNAM}-${VERSION} - -chown -R root.root * -find . -perm 777 -exec chmod 755 {} \; -find . -perm 666 -exec chmod 644 {} \; +chown -R root:root . +chmod -R u+w,go+r-w,a-s . # --- BUILDING --- @@ -197,6 +195,7 @@ CFLAGS="$SLKCFLAGS" \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --localstatedir=/var \ --sysconfdir=/etc \ + --disable-static \ --enable-kernel-module \ --with-kernel=${KSRC} \ --enable-lib \ @@ -222,15 +221,12 @@ fi # Add this to the doinst.sh ! [ -d $PKG/install ] && mkdir -p $PKG/install cat <<-EEOOTT >> $PKG/install/doinst.sh - # Only run depmod on matching running kernel - # Slackware will run depmod anyway on reboot): - MYMODVER=$KVER - MYKERNEL=\`uname -r\` - if [ "\$MYKERNEL" = "\$MYMODVER" ]; then - if [ -x sbin/depmod ]; then - chroot . /sbin/depmod -a \$MYKERNEL 1> /dev/null 2> /dev/null - fi - fi + # Some people might find this a security risk. + # The fuse documentation thinks it is wrapped in adequate safety guards. + # If you do not make fusermount setuid root, then the normal user + # will not be able to mount a fuse filesystem. + + chmod $BINPERM usr/bin/fusermount EEOOTT @@ -241,13 +237,6 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* -# Move incorrectly installed man pages, if any -[ -d $PKG/usr/share/man ] && \ - mv $PKG/usr/share/man $PKG/usr/ && rmdir $PKG/usr/share || true -# Compress the man page(s) -[ -d $PKG/usr/man ] && \ - find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; - # Strip binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null @@ -255,20 +244,13 @@ chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* ) # Compress the kernel modules -[ $PATCHLEVEL -eq 4 ] && \ - find $PKG/lib/modules -type f -name "*.?" -exec gzip -9 {} \; +[ $PATCHLEVEL -eq 4 ] && find $PKG/lib/modules -type f -name "*.?" -exec gzip -9 {} \; # --- OWNERSHIP, RIGHTS --- chmod -R o-w $PKG -# Some people might find this a security risk. The fuse documentation thinks it -# is wrapped in adequate safety guards. If you do not make fusermount setuid -# root, then the normal user will not be able to mount a fuse filesystem. - -chmod 4755 $PKG/usr/bin/fusermount - # --- PACKAGE DESCRIPTION --- @@ -277,9 +259,6 @@ cat $SRCDIR/slack-desc > $PKG/install/slack-desc if [ -f $SRCDIR/doinst.sh ]; then cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh fi -if [ -f $SRCDIR/slack-required ]; then - cat $SRCDIR/slack-required > $PKG/install/slack-required -fi # --- BUILDING --- @@ -291,14 +270,28 @@ mv lib $PKG2/ makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log (cd $OUTPUT && md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz.md5) cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txt -if [ -f $PKG/install/slack-required ]; then - cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.dep -fi # Create the module package cd $PKG2 mkdir -p $PKG2/install cat <<-EEOOTT > $PKG2/install/doinst.sh + # Determine the rc.modules to use: + if [ -f etc/rc.d/rc.modules.local ]; then + RCMODULES="etc/rc.d/rc.modules.local" + elif [ -f etc/rc.d/rc.modules-$(uname -r) ]; then + RCMODULES="etc/rc.d/rc.modules-$(uname -r)" + else + RCMODULES="etc/rc.d/rc.modules" + fi + + # Update rc.modules so that fuse will be loaded on boot + if ! grep "^/sbin/modprobe fuse" \${RCMODULES} 1>/dev/null 2>&1 ; then + cat <<_EOM_ >> \${RCMODULES} + # Load fuse + /sbin/modprobe fuse + _EOM_ + fi + # Only run depmod on matching running kernel # Slackware will run depmod anyway on reboot): MYMODVER=$KVER @@ -310,13 +303,6 @@ cat <<-EEOOTT > $PKG2/install/doinst.sh fi fi - # Update rc.modules so that fuse will be loaded on boot - if ! grep "^/sbin/modprobe fuse" etc/rc.d/rc.modules 1>/dev/null 2>&1 ; then - cat <<_EOM_ >> etc/rc.d/rc.modules - # Load fuse - /sbin/modprobe fuse - _EOM_ - fi EEOOTT cat $SRCDIR/${PRGNAM2}.slack-desc > $PKG2/install/slack-desc |