Browse Source

ap/id3v2: Updated for Slackware-13.0.

slackware-14.2
Damien Goutte-Gattat 12 years ago
parent
commit
6ae42eac94
  1. 220
      ap/id3v2/id3v2.SlackBuild
  2. 11
      ap/id3v2/slack-desc

220
ap/id3v2/id3v2.SlackBuild

@ -1,168 +1,118 @@
#! /bin/sh
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2007, 2008 H4kTeUr
# Copyright (C) 2010 Damien Goutte-Gattat
#
# by: H4kTeUr - http://www.slackbuilds.net < h4kteur at slackbuilds dot net >
# Copyright 2007, 2008 H4kTeUr. All rights reserved.
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
#
# Redistribution and use of this software, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this software must retain the above copyright
# 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
# 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,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 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, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest id3v2 sourcecode is available at:
# <http://id3v2.sourceforge.net/>.
#
# Latest id3v2 sourcecode is available at http://id3v2.sourceforge.net
# Depends: l/id3lib
set -e
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=${PKG:-$TMP/package-id3v2}
OUT=${OUT:-$TMP/build}
# version on the tarball
# Source package infos
NAMESRC=${NAMESRC:-id3v2}
VERSION=${VERSION:-0.1.11}
# version used in the source directory to cd into
DIRVER=${DIRVER:-0.1.11}
# version used for the Slackware package
PKGVER=${PKGVER:-0.1.11}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
WGET=${WGET:-http://downloads.sourceforge.net/id3v2/$ARCHIVE}
# target
ARCH=${ARCH:-i486}
BUILD=${BUILD:-2_SBn}
# Build infos
NAMEPKG=${NAMEPKG:-id3v2}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
# set tarball download link
SOURCE=${SOURCE:-http://switch.dl.sourceforge.net/sourceforge/id3v2/id3v2-$VERSION.tar.gz}
ARCHIVE=$(basename $SOURCE)
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# sanity checks
if [ "$(id -u)" = "0" ]; then
echo "Do not run this SlackBuild as ROOT !"
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
echo "$TMP does not exist or is not a directory!"
exit 1
fi
# download the tarball if it's not found
# Compilation flags
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
;;
*)
CPUOPT="-O2"
;;
esac
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
echo "Downloading $ARCHIVE..."
rm -f $ARCHIVE.part
wget -vc $SOURCE -O $ARCHIVE.part
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# check SHA1 sums
if [ -r $ARCHIVE.sha1 ]; then
sha1sum -c $ARCHIVE.sha1
else
echo "$ARCHIVE.sha1 SHA1 sums not found !"
exit 1
fi
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
# cleanup
rm -rf $PKG
mkdir -p $PKG
# extraction
# Compile
cd $TMP
rm -rf id3v2-$DIRVER
tar -xvf $CWD/id3v2-$VERSION.tar.gz
cd id3v2-$DIRVER
# make sure ownerships and permissions are sane
chmod -R a-s,u+rw,go-w+r .
for patch in fix-gcc-4.2 fix-segfault; do
if [ -r $CWD/patches/id3v2-$VERSION-$patch.patch ]; then
cat $CWD/patches/id3v2-$VERSION-$patch.patch | patch -p1
else
echo "ERROR: No id3v2-$VERSION-$patch.patch found!"
exit 1
fi
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
for patch in fix-gcc-4.2 fix-segfault ; do
patch -p 1 < $CWD/patches/$NAMESRC-$VERSION-$patch.patch
done
CXXFLAGS=$CPUOPT make PREFIX=/usr -j $JOBS
# build
CXXFLAGS=$SLKCFLAGS \
make PREFIX=/usr -j3
# add the install directories
mkdir -p $PKG/usr/bin
mkdir -p $PKG/usr/man/man1
# Install
install -D -s -m 755 id3v2 $PKG/usr/bin/id3v2
nroff -man id3v2.1 | gzip -c -9 > id3v2.1.gz
install -D -m 644 id3v2.1.gz $PKG/usr/man/man1/id3v2.1.gz
# install
install -m 755 id3v2 $PKG/usr/bin
nroff -man id3v2.1 > $PKG/usr/man/man1/id3v2.1
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 COPYING ChangeLog INSTALL README $PKG/usr/doc/$NAME
# strip binaries
echo "Stripping binaries..."
find $PKG -type f | xargs file | grep "LSB executable" | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || \
echo "No binaries to strip..."
# compress and link manpages, if any
echo "Compressing man pages..."
if [ -d $PKG/usr/man ]; then
find $PKG/usr/man -type f -name "*.?" -exec gzip -9 {} \;
for manpage in $(find $PKG/usr/man -type l) ; do
ln -s $(readlink $manpage).gz $manpage.gz
rm -f $manpage
done
fi
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# add a documentation directory
echo "Adding documentation package..."
mkdir -p $PKG/usr/doc/id3v2-$PKGVER
install -p -m 644 \
COPYING INSTALL README \
$PKG/usr/doc/id3v2-$PKGVER
# build the package
mkdir -p $PKG/install
if [ -r $CWD/slack-desc ]; then
install -m 644 $CWD/slack-desc $PKG/install
fi
if [ -r $CWD/doinst.sh ]; then
install -m 755 $CWD/doinst.sh $PKG/install
fi
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown -R root.root .
find . -perm 664 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
mkdir -p $OUT
rm -f $OUT/id3v2-$PKGVER-$ARCH-$BUILD.tgz
/sbin/makepkg -l y -c n $OUT/id3v2-$PKGVER-$ARCH-$BUILD.tgz
rm -rf $PKG
rm -rf $TMP/id3v2-$DIRVER
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/$NAME
"
if [ "$(which fakeroot 2> /dev/null)" ]; then
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi
exit 0

11
ap/id3v2/slack-desc

@ -1,14 +1,7 @@
# 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------------------------------------------------------|
id3v2: id3v2 (a command line editor for id3v2 tags)
id3v2: id3v2 (a command line id3v2 tag editor)
id3v2:
id3v2: id3v2 is a command line editor for id3v2 tags.
id3v2: id3v2 is a MP3 technical info viewer and ID3 tag editor.
id3v2:
id3v2:
id3v2:

Loading…
Cancel
Save