aboutsummaryrefslogtreecommitdiff
path: root/multimedia/k9copy/k9copy.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/k9copy/k9copy.SlackBuild')
-rw-r--r--multimedia/k9copy/k9copy.SlackBuild65
1 files changed, 42 insertions, 23 deletions
diff --git a/multimedia/k9copy/k9copy.SlackBuild b/multimedia/k9copy/k9copy.SlackBuild
index 5f9ad08f91247..dc63eaf928470 100644
--- a/multimedia/k9copy/k9copy.SlackBuild
+++ b/multimedia/k9copy/k9copy.SlackBuild
@@ -22,56 +22,75 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-if [ "$(id -u)" != "0" ]; then
- echo "This script must be run as root!"
- exit 1
-fi
+# Modified by Roberto Neri <rneri@libero.it> for version 2 (KDE 4)
+# Project Homepage: http://k9copy.sourceforge.net/
PRGNAM=k9copy
-VERSION=1.1.1.3
-SRCDIR=1.1.1-3
+VERSION=${VERSION:-2.3.5}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-PDOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO"
-
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"
fi
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$SRCDIR
-tar -xzvf $CWD/$PRGNAM-$SRCDIR.tar.gz || exit 1
-cd $PRGNAM-$SRCDIR
+rm -rf $PRGNAM-$VERSION-Source
+tar xvf $CWD/$PRGNAM-$VERSION-Source.tar.gz
+cd $PRGNAM-$VERSION-Source
chown -R root:root .
-chmod -R u+w,go+r-w,a-s .
-
-KDEPREF=$(kde-config --prefix) || true
+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=$KDEPREF \
- || exit 1
+mkdir build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DMAN_INSTALL_DIR=/usr/man \
+ -DSYSCONF_INSTALL_DIR=/etc/kde \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ ..
+ make
+ make install DESTDIR=$PKG
+cd ..
-make || exit 1
-make install-strip DESTDIR=$PKG || exit 1
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null || true
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null || true
+)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $PDOCS $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}