Browse Source

l/id3lib: Updated for Slackware-13.0.

slackware-14.2
Damien Goutte-Gattat 12 years ago
parent
commit
b055983994
  1. 226
      l/id3lib/id3lib.SlackBuild
  2. 82
      l/id3lib/patches/id3lib-3.8.3-headers.patch
  3. 7
      l/id3lib/slack-desc

226
l/id3lib/id3lib.SlackBuild

@ -1,164 +1,124 @@
#! /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 software, with or without modification, 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
# 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.
#
# Latest id3lib sourcecode is available at http://id3lib.sourceforge.net
set -e
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=${PKG:-$TMP/package-id3lib}
OUT=${OUT:-$TMP/build}
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest id3lib sourcecode is available at:
# <http://id3lib.sourceforge.net/>.
# version on the tarball
# Source package infos
NAMESRC=${NAMESRC:-id3lib}
VERSION=${VERSION:-3.8.3}
# version used in the source directory to cd into
DIRVER=${DIRVER:-3.8.3}
# version used for the Slackware package
PKGVER=${PKGVER:-3.8.3}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
WGET=${WGET:-http://downloads.sourceforge.net/id3lib/$ARCHIVE}
# target
ARCH=${ARCH:-i486}
TARGET=${TARGET:-i486}
BUILD=${BUILD:-2_SBn}
# Build infos
NAMEPKG=${NAMEPKG:-id3lib}
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/id3lib/id3lib-$VERSION.tar.gz}
ARCHIVE=$(basename $SOURCE)
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$TMP/$NAMEPKG}
CWD=$(pwd)
# sanity checks
if [ "$(id -u)" = "0" ]; then
echo "Do not run this SlackBuild as ROOT !"
set -e # Quit if a command returns non-zero
# 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
LIBDIRSUFFIX=""
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
LIBDIRSUFFIX="64"
;;
*)
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 id3lib-$DIRVER
tar -xvf $CWD/id3lib-$VERSION.tar.gz
cd id3lib-$DIRVER
# make sure ownerships and permissions are sane
chmod -R a-s,u+rw,go-w+r .
for patch in UTF16_writing_bug security; do
if [ -r $CWD/patches/id3lib-$VERSION-$patch.patch ]; then
cat $CWD/patches/id3lib-$VERSION-$patch.patch | patch -p1
else
echo "ERROR: No id3lib-$VERSION-$patch.patch found!"
exit 1
fi
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
for patch in UTF16_writing_bug security headers ; do
patch -p 1 < $CWD/patches/$NAMESRC-$VERSION-$patch.patch
done
# configure
CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-static=no \
--enable-debug=no \
--build=$TARGET-slackware-linux
# build and install
make -j3
make DESTDIR=$PKG install
# 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..."
find $PKG -type f | xargs file | grep "shared object" | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || \
echo "No shared objects to strip..."
# add a documentation directory
echo "Adding documentation package..."
mkdir -p $PKG/usr/doc/id3lib-$PKGVER
install -p -m 644 \
AUTHORS ChangeLog COPYING HISTORY INSTALL NEWS THANKS TODO \
$PKG/usr/doc/id3lib-$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
--libdir=/usr/lib$LIBDIRSUFFIX \
--disable-static \
--disable-debug
make -j $JOBS
make install-strip DESTDIR=$PKG
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -p -m 644 AUTHORS COPYING ChangeLog HISTORY INSTALL NEWS \
README THANKS TODO doc/id3guide.html doc/id3lib.css \
doc/id3v2.3.0.html doc/id3v2.3.0.txt doc/index.html \
$PKG/usr/doc/$NAME
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# 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/id3lib-$PKGVER-$ARCH-$BUILD.tgz
/sbin/makepkg -l y -c n $OUT/id3lib-$PKGVER-$ARCH-$BUILD.tgz
rm -rf $PKG
rm -rf $TMP/id3lib-$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

82
l/id3lib/patches/id3lib-3.8.3-headers.patch

@ -0,0 +1,82 @@
diff -Naur id3lib-3.8.3.orig/configure id3lib-3.8.3/configure
--- id3lib-3.8.3.orig/configure 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/configure 2010-05-02 14:27:04.741770991 +0200
@@ -10296,7 +10296,6 @@
for ac_header in \
string \
- iomanip.h \
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff -Naur id3lib-3.8.3.orig/examples/demo_convert.cpp id3lib-3.8.3/examples/demo_convert.cpp
--- id3lib-3.8.3.orig/examples/demo_convert.cpp 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/examples/demo_convert.cpp 2010-05-02 14:27:39.946507169 +0200
@@ -84,7 +84,7 @@
}
}
-int main( unsigned int argc, char * const argv[])
+int main( int argc, char * const argv[])
{
flags_t ulFlag = ID3TT_ALL;
gengetopt_args_info args;
diff -Naur id3lib-3.8.3.orig/examples/demo_copy.cpp id3lib-3.8.3/examples/demo_copy.cpp
--- id3lib-3.8.3.orig/examples/demo_copy.cpp 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/examples/demo_copy.cpp 2010-05-02 14:27:46.792764486 +0200
@@ -81,7 +81,7 @@
}
}
-int main( unsigned int argc, char * const argv[])
+int main( int argc, char * const argv[])
{
int ulFlag = ID3TT_ID3;
ID3D_INIT_DOUT();
diff -Naur id3lib-3.8.3.orig/examples/demo_info.cpp id3lib-3.8.3/examples/demo_info.cpp
--- id3lib-3.8.3.orig/examples/demo_info.cpp 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/examples/demo_info.cpp 2010-05-02 14:27:52.527783738 +0200
@@ -309,7 +309,7 @@
#define DEBUG
-int main( unsigned int argc, char * const argv[])
+int main( int argc, char * const argv[])
{
ID3D_INIT_DOUT();
diff -Naur id3lib-3.8.3.orig/examples/demo_tag.cpp id3lib-3.8.3/examples/demo_tag.cpp
--- id3lib-3.8.3.orig/examples/demo_tag.cpp 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/examples/demo_tag.cpp 2010-05-02 14:28:06.897591172 +0200
@@ -46,7 +46,7 @@
os << "v2";
}
-int main( unsigned int argc, char * const argv[])
+int main( int argc, char * const argv[])
{
int ulFlag = ID3TT_ID3;
ID3D_INIT_DOUT();
diff -Naur id3lib-3.8.3.orig/include/id3/id3lib_strings.h id3lib-3.8.3/include/id3/id3lib_strings.h
--- id3lib-3.8.3.orig/include/id3/id3lib_strings.h 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/include/id3/id3lib_strings.h 2010-05-02 14:27:29.055190943 +0200
@@ -30,6 +30,7 @@
#define _ID3LIB_STRINGS_H_
#include <string>
+#include <string.h>
#if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
namespace std
diff -Naur id3lib-3.8.3.orig/include/id3/writers.h id3lib-3.8.3/include/id3/writers.h
--- id3lib-3.8.3.orig/include/id3/writers.h 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/include/id3/writers.h 2010-05-02 14:27:17.161744298 +0200
@@ -30,7 +30,7 @@
#include "id3/writer.h"
#include "id3/id3lib_streams.h"
-//#include <string.h>
+#include <string.h>
class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer
{

7
l/id3lib/slack-desc

@ -1,10 +1,3 @@
# 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------------------------------------------------------|
id3lib: id3lib (library for manipulating ID3v1 and ID3v2 tags)
id3lib:

Loading…
Cancel
Save