Browse Source

l/id3lib: Added.

slackware-14.2
Damien Goutte-Gattat 13 years ago
parent
commit
d918f86061
  1. 1
      l/id3lib/id3lib-3.8.3.tar.gz.sha1
  2. 164
      l/id3lib/id3lib.SlackBuild
  3. 40
      l/id3lib/patches/id3lib-3.8.3-UTF16_writing_bug.patch
  4. 50
      l/id3lib/patches/id3lib-3.8.3-security.patch
  5. 19
      l/id3lib/slack-desc

1
l/id3lib/id3lib-3.8.3.tar.gz.sha1

@ -0,0 +1 @@
c92c880da41d1ec0b242745a901702ae87970838 id3lib-3.8.3.tar.gz

164
l/id3lib/id3lib.SlackBuild

@ -0,0 +1,164 @@
#! /bin/sh
#
# 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:
#
# 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.
#
# 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}
# version on the tarball
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}
# target
ARCH=${ARCH:-i486}
TARGET=${TARGET:-i486}
BUILD=${BUILD:-2_SBn}
# set tarball download link
SOURCE=${SOURCE:-http://switch.dl.sourceforge.net/sourceforge/id3lib/id3lib-$VERSION.tar.gz}
ARCHIVE=$(basename $SOURCE)
# sanity checks
if [ "$(id -u)" = "0" ]; then
echo "Do not run this SlackBuild as ROOT !"
exit 1
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
# download the tarball if it's not found
if [ ! -r $ARCHIVE ]; then
echo "Downloading $ARCHIVE..."
rm -f $ARCHIVE.part
wget -vc $SOURCE -O $ARCHIVE.part
mv $ARCHIVE.part $ARCHIVE
fi
# 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
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
done
# configure
CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
./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
cd $PKG
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
"
if [ "$(which fakeroot 2> /dev/null)" ]; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi
exit 0

40
l/id3lib/patches/id3lib-3.8.3-UTF16_writing_bug.patch

@ -0,0 +1,40 @@
diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
--- id3lib-3.8.3.orig/ChangeLog 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/ChangeLog 2006-02-22 00:33:59.946214472 +0100
@@ -1,3 +1,8 @@
+2006-02-17 Jerome Couderc
+
+ * Patch from Spoon to fix UTF-16 writing bug
+ http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
+
2003-03-02 Sunday 17:38 Thijmen Klok <thijmen@id3lib.org>
* THANKS (1.20): added more people
diff -ruN id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
--- id3lib-3.8.3.orig/src/io_helpers.cpp 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/src/io_helpers.cpp 2006-02-22 00:35:02.926639992 +0100
@@ -363,11 +363,22 @@
// Write the BOM: 0xFEFF
unicode_t BOM = 0xFEFF;
writer.writeChars((const unsigned char*) &BOM, 2);
+ // Patch from Spoon : 2004-08-25 14:17
+ // http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
+ // Wrong code
+ //for (size_t i = 0; i < size; i += 2)
+ //{
+ // unicode_t ch = (data[i] << 8) | data[i+1];
+ // writer.writeChars((const unsigned char*) &ch, 2);
+ //}
+ // Right code
+ unsigned char *pdata = (unsigned char *) data.c_str();
for (size_t i = 0; i < size; i += 2)
{
- unicode_t ch = (data[i] << 8) | data[i+1];
+ unicode_t ch = (pdata[i] << 8) | pdata[i+1];
writer.writeChars((const unsigned char*) &ch, 2);
}
+ // End patch
}
return writer.getCur() - beg;
}

50
l/id3lib/patches/id3lib-3.8.3-security.patch

@ -0,0 +1,50 @@
diff -ur id3lib-3.8.3.orig/src/tag_file.cpp id3lib-3.8.3/src/tag_file.cpp
--- id3lib-3.8.3.orig/src/tag_file.cpp 2003-03-02 02:23:00.000000000 +0200
+++ id3lib-3.8.3/src/tag_file.cpp 2007-08-20 19:40:16.000000000 +0300
@@ -242,8 +242,8 @@
strcpy(sTempFile, filename.c_str());
strcat(sTempFile, sTmpSuffix.c_str());
-#if ((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
- // This section is for Windows folk && gcc 3.x folk
+#if !defined(HAVE_MKSTEMP)
+ // This section is for Windows folk
fstream tmpOut;
createFile(sTempFile, tmpOut);
@@ -257,7 +257,7 @@
tmpOut.write((char *)tmpBuffer, nBytes);
}
-#else //((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
+#else //!defined(HAVE_MKSTEMP)
// else we gotta make a temp file, copy the tag into it, copy the
// rest of the old file after the tag, delete the old file, rename
@@ -270,7 +270,7 @@
//ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
}
- ofstream tmpOut(fd);
+ ofstream tmpOut(sTempFile);
if (!tmpOut)
{
tmpOut.close();
@@ -285,14 +285,14 @@
uchar tmpBuffer[BUFSIZ];
while (file)
{
- file.read(tmpBuffer, BUFSIZ);
+ file.read((char *)tmpBuffer, BUFSIZ);
size_t nBytes = file.gcount();
- tmpOut.write(tmpBuffer, nBytes);
+ tmpOut.write((char *)tmpBuffer, nBytes);
}
close(fd); //closes the file
-#endif ////((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
+#endif ////!defined(HAVE_MKSTEMP)
tmpOut.close();
file.close();

19
l/id3lib/slack-desc

@ -0,0 +1,19 @@
# 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:
id3lib: id3lib is an open-source, cross-platform software development
id3lib: library for reading, writing, and manipulating ID3v1 and ID3v2 tags.
id3lib: It is an on-going project whose primary goals are full compliance
id3lib: with the ID3v2 standard, portability across several platforms,
id3lib: and providing a powerful and feature-rich API with a highly stable
id3lib: and efficient implementation.
id3lib:
id3lib:
id3lib:
Loading…
Cancel
Save