#!/bin/sh TMP=${TMP:-/tmp} CWD=`pwd` PKG=$TMP/package-mdadm VERSION=2.5.3 ARCH=${ARCH:-x86_64} BUILD=1 rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf mdadm-$VERSION tar xjvf $CWD/mdadm-$VERSION.tar.bz2 cd mdadm-$VERSION # Build this static... it's small enough. zcat $CWD/mdadm.static.small.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; make clean || exit 1 make || exit 1 #make mdadm.static make install DESTDIR=$PKG || exit 1 #cat mdadm.static > $PKG/sbin/mdadm mv $PKG/usr/share/man $PKG/usr rmdir $PKG/usr/share mkdir -p $PKG/etc cat mdadm.conf-example > $PKG/etc/mdadm.conf.new gzip -9 $PKG/usr/man/man?/*.? mkdir -p $PKG/usr/doc/mdadm-$VERSION cp -a \ ANNOUNCE-$VERSION COPYING ChangeLog INSTALL TODO \ $PKG/usr/doc/mdadm-$VERSION ( 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 ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cd $PKG makepkg -l y -c n ../mdadm-$VERSION-$ARCH-$BUILD.tgz