Hello community,
here is the log from the commit of package libdiscid for openSUSE:Factory checked in at 2013-01-20 07:55:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libdiscid (Old)
and /work/SRC/openSUSE:Factory/.libdiscid.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdiscid", Maintainer is "VDziewiecki@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libdiscid/libdiscid.changes 2012-07-31 13:58:41.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libdiscid.new/libdiscid.changes 2013-01-20 07:55:20.000000000 +0100
@@ -1,0 +2,10 @@
+Mon Jan 14 18:14:36 UTC 2013 - Johannes Dewender
+
+- updated to 0.3.0
+ - Fixed reading of 99 track CDs on Mac OS X.
+ - Added API for reading ISRCs and MCNs (implemented on Windows and Mac OS X).
+ - Added Solaris, OpenBSD and kFreeBSD support.
+- libdiscid-visibility.patch, libdiscid-no-crypto.patch
+ Adapted to the 0.3 release
+
+-------------------------------------------------------------------
Old:
----
libdiscid-0.2.1-visibility.patch
libdiscid-0.2.2.tar.gz
libdiscid-no-cryptoplz.patch
New:
----
libdiscid-0.3.0.tar.gz
libdiscid-no-crypto.patch
libdiscid-visibility.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libdiscid.spec ++++++
--- /var/tmp/diff_new_pack.GSiWuP/_old 2013-01-20 07:55:22.000000000 +0100
+++ /var/tmp/diff_new_pack.GSiWuP/_new 2013-01-20 07:55:22.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package libdiscid
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,15 @@
Name: libdiscid
-Version: 0.2.2
+Version: 0.3.0
Release: 0
Summary: Library for creating MusicBrainz DiscIDs from audio CDs
License: LGPL-2.1+
Group: Development/Libraries/C and C++
Url: http://musicbrainz.org/doc/libdiscid
-Source: http://users.musicbrainz.org/~matt/%{name}-%{version}.tar.gz
-Patch0: libdiscid-0.2.1-visibility.patch
-Patch1: libdiscid-no-cryptoplz.patch
+Source: http://ftp.musicbrainz.org/pub/musicbrainz/libdiscid/%{name}-%{version}.tar.gz
+Patch0: libdiscid-visibility.patch
+Patch1: libdiscid-no-crypto.patch
BuildRequires: libtool
BuildRequires: openssl-devel
BuildRequires: pkg-config
@@ -82,7 +82,7 @@
%prep
%setup -q
-%patch0
+%patch0 -p1
%patch1 -p1
%build
++++++ libdiscid-0.2.2.tar.gz -> libdiscid-0.3.0.tar.gz ++++++
++++ 69126 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/AUTHORS new/libdiscid-0.3.0/AUTHORS
--- old/libdiscid-0.2.2/AUTHORS 2008-03-09 14:37:30.000000000 +0100
+++ new/libdiscid-0.3.0/AUTHORS 2013-01-01 10:57:08.000000000 +0100
@@ -17,8 +17,14 @@
- Invented and originally implemented the DiscID algorithm.
- Ported the darwin code.
- Patrick Hurrelmann <outi at bytephobia.de>
+ Patrick Hurrelmann <outi at bytephobia dot de>
- Implemented and tested FreeBSD support.
+ Anton Yabchinskiy <arn at bestmx dot ru>
+ - Implemented and tested OpenBSD support.
+
+ Shunsuke Kuroda
+ - Implemented and tested Solaris/OpenSolaris support.
+
--
-$Id: AUTHORS 9736 2008-03-09 13:37:29Z matt $
+$Id$
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/CMakeLists.txt new/libdiscid-0.3.0/CMakeLists.txt
--- old/libdiscid-0.2.2/CMakeLists.txt 2008-01-12 12:19:14.000000000 +0100
+++ new/libdiscid-0.3.0/CMakeLists.txt 2013-01-01 10:57:08.000000000 +0100
@@ -1,16 +1,22 @@
+cmake_minimum_required(VERSION 2.6)
+
PROJECT(libdiscid)
-SET(PROJECT_VERSION 0.1.1)
+SET(PROJECT_VERSION 0.3.0)
# 1. If the library source code has changed at all since the last update, then increment revision.
# 2. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
# 3. If any interfaces have been added since the last public release, then increment age.
# 4. If any interfaces have been removed since the last public release, then set age to 0.
-SET(libdiscid_SOVERSION_CURRENT 0)
-SET(libdiscid_SOVERSION_REVISION 1)
-SET(libdiscid_SOVERSION_AGE 0)
+SET(libdiscid_SOVERSION_CURRENT 3)
+SET(libdiscid_SOVERSION_REVISION 0)
+SET(libdiscid_SOVERSION_AGE 3)
+
+math(EXPR libdiscid_SOVERSION_MAJOR "${libdiscid_SOVERSION_CURRENT} - ${libdiscid_SOVERSION_AGE}")
+math(EXPR libdiscid_SOVERSION_MINOR "${libdiscid_SOVERSION_AGE}")
+math(EXPR libdiscid_SOVERSION_PATCH "${libdiscid_SOVERSION_REVISION}")
-SET(libdiscid_VERSION ${libdiscid_SOVERSION_CURRENT}.${libdiscid_SOVERSION_AGE}.${libdiscid_SOVERSION_REVISION})
-SET(libdiscid_SOVERSION ${libdiscid_SOVERSION_CURRENT})
+set(libdiscid_VERSION ${libdiscid_SOVERSION_MAJOR}.${libdiscid_SOVERSION_MINOR}.${libdiscid_SOVERSION_PATCH})
+set(libdiscid_SOVERSION ${libdiscid_SOVERSION_MAJOR})
SET(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
SET(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix for executables and object code libraries" FORCE)
@@ -52,6 +58,9 @@
ADD_EXECUTABLE(discid examples/discid.c)
TARGET_LINK_LIBRARIES(discid libdiscid)
+ADD_EXECUTABLE(discisrc examples/discisrc.c)
+TARGET_LINK_LIBRARIES(discisrc libdiscid)
+
ADD_EXECUTABLE(test_discid test/test_discid.c)
TARGET_LINK_LIBRARIES(test_discid libdiscid)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/ChangeLog new/libdiscid-0.3.0/ChangeLog
--- old/libdiscid-0.2.2/ChangeLog 2008-08-04 18:31:45.000000000 +0200
+++ new/libdiscid-0.3.0/ChangeLog 2013-01-01 10:57:08.000000000 +0100
@@ -1,6 +1,12 @@
libdiscid ChangeLog:
--------------------
+libdiscid-0.3.0:
+
+ - Fixed reading of 99 track CDs on Mac OS X.
+ - Added API for reading ISRCs and MCNs (implemented on Windows and Mac OS X).
+ - Added Solaris, OpenBSD and kFreeBSD support.
+
libdiscid-0.2.2:
- Set libtool version number to 2:1:2 because it is backwards compatible
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/Makefile.am new/libdiscid-0.3.0/Makefile.am
--- old/libdiscid-0.2.2/Makefile.am 2008-01-12 12:19:14.000000000 +0100
+++ new/libdiscid-0.3.0/Makefile.am 2013-01-01 10:57:08.000000000 +0100
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# $Id: Makefile.am 9183 2007-06-16 11:52:50Z luks $
+# $Id$
#
AUTOMAKE_OPTIONS = foreign
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/README new/libdiscid-0.3.0/README
--- old/libdiscid-0.2.2/README 2006-09-04 18:07:50.000000000 +0200
+++ new/libdiscid-0.3.0/README 2013-01-01 10:57:08.000000000 +0100
@@ -19,16 +19,16 @@
Please report all bugs you find via the MusicBrainz bug tracker:
- http://bugs.musicbrainz.org/
+ http://tickets.musicbrainz.org/
Questions about this package may be posted to the MusicBrainz
development mailing list (mb-devel):
- http://musicbrainz.org/list.html
+ http://musicbrainz.org/doc/Communication/Mailing_Lists
More information can be found at the package's official homepage:
- http://musicbrainz.org/products/libdiscid/
+ http://musicbrainz.org/doc/libdiscid
--
-$Id: README 7789 2006-06-04 11:54:42Z matt $
+$Id$
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/config.h.in new/libdiscid-0.3.0/config.h.in
--- old/libdiscid-0.2.2/config.h.in 2008-05-25 08:46:54.000000000 +0200
+++ new/libdiscid-0.3.0/config.h.in 2013-01-01 11:41:14.000000000 +0100
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
@@ -30,6 +33,10 @@
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Name of package */
#undef PACKAGE
@@ -45,6 +52,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -57,6 +67,14 @@
/* Version number of package */
#undef VERSION
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/configure.ac new/libdiscid-0.3.0/configure.ac
--- old/libdiscid-0.2.2/configure.ac 2008-05-25 08:44:17.000000000 +0200
+++ new/libdiscid-0.3.0/configure.ac 2013-01-01 10:57:08.000000000 +0100
@@ -5,7 +5,7 @@
dnl The libtool version number has to be changed ALWAYS, no matter how
dnl small the change to the source code was!
dnl
-AC_INIT(libdiscid, 0.2.2)
+AC_INIT(libdiscid, 0.3.0)
AC_CONFIG_SRCDIR(src/disc.c)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
@@ -18,12 +18,13 @@
*-mingw*) os=win32; LIBS='-lwinmm' ;;
*-cygwin*) os=win32; LIBS='-lwinmm' ;;
*-freebsd*) os=freebsd ;;
+ *-kfreebsd*) os=freebsd ;;
*-darwin*) os=darwin; LIBS='-framework CoreFoundation -framework IOKit';;
*-linux*) os=linux ;;
- #*-netbsd*) os=netbsd ;;
- #*-openbsd*) os=openbsd ;;
+ *-netbsd*) os=openbsd ;;
+ *-openbsd*) os=openbsd ;;
#*-os2_emx*) os=os2 ;;
- #*-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
+ *-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
#*-qnx*) os=qnx; LIBS='-lsocket' ;;
*) AC_MSG_ERROR([unsupported operating system]) ;;
esac
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/examples/Makefile.am new/libdiscid-0.3.0/examples/Makefile.am
--- old/libdiscid-0.2.2/examples/Makefile.am 2006-09-04 18:07:50.000000000 +0200
+++ new/libdiscid-0.3.0/examples/Makefile.am 2013-01-01 10:57:08.000000000 +0100
@@ -1,8 +1,10 @@
-noinst_PROGRAMS = discid
+noinst_PROGRAMS = discid discisrc
AM_CPPFLAGS = -I$(top_srcdir)/include
discid_SOURCES = discid.c
discid_LDADD = $(top_builddir)/src/libdiscid.la
+discisrc_SOURCES = discisrc.c
+discisrc_LDADD = $(top_builddir)/src/libdiscid.la
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/examples/discid.c new/libdiscid-0.3.0/examples/discid.c
--- old/libdiscid-0.2.2/examples/discid.c 2008-01-12 12:19:14.000000000 +0100
+++ new/libdiscid-0.3.0/examples/discid.c 2013-01-01 10:57:08.000000000 +0100
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: discid.c 9569 2007-10-26 22:04:08Z robert $
+ $Id$
--------------------------------------------------------------------------- */
#include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/examples/discisrc.c new/libdiscid-0.3.0/examples/discisrc.c
--- old/libdiscid-0.2.2/examples/discisrc.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libdiscid-0.3.0/examples/discisrc.c 2013-01-01 10:57:08.000000000 +0100
@@ -0,0 +1,56 @@
+/* --------------------------------------------------------------------------
+
+ MusicBrainz -- The Internet music metadatabase
+
+ Copyright (C) 2006 Matthias Friedrich
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ $Id$
+
+--------------------------------------------------------------------------- */
+#include
+#include
+
+
+int main(int argc, char *argv[]) {
+ DiscId *disc = discid_new();
+ int i;
+ char *device = NULL;
+
+ /* If we have an argument, use it as the device name */
+ if (argc > 1)
+ device = argv[1];
+
+ /* read the disc in the default disc drive */
+ if ( discid_read(disc, device) == 0 ) {
+ fprintf(stderr, "Error: %s\n", discid_get_error_msg(disc));
+ return 1;
+ }
+
+ printf("MCN : %s\n", discid_get_mcn(disc));
+
+ for ( i = discid_get_first_track_num(disc);
+ i <= discid_get_last_track_num(disc); i++ ) {
+
+ printf("Track %-2d : %s\n", i, discid_get_track_isrc(disc, i));
+ }
+
+ discid_free(disc);
+
+ return 0;
+}
+
+/* EOF */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/include/Makefile.am new/libdiscid-0.3.0/include/Makefile.am
--- old/libdiscid-0.2.2/include/Makefile.am 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.3.0/include/Makefile.am 2013-01-01 10:57:08.000000000 +0100
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# $Id: Makefile.am 8505 2006-09-30 00:02:18Z luks $
+# $Id$
#
SUBDIRS = discid
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/include/discid/Makefile.am new/libdiscid-0.3.0/include/discid/Makefile.am
--- old/libdiscid-0.2.2/include/discid/Makefile.am 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.3.0/include/discid/Makefile.am 2013-01-01 10:57:08.000000000 +0100
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# $Id: Makefile.am 8505 2006-09-30 00:02:18Z luks $
+# $Id$
#
discid_incdir = $(includedir)/discid
discid_inc_HEADERS = discid.h
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/include/discid/discid.h new/libdiscid-0.3.0/include/discid/discid.h
--- old/libdiscid-0.2.2/include/discid/discid.h 2008-01-12 12:19:12.000000000 +0100
+++ new/libdiscid-0.3.0/include/discid/discid.h 2013-01-01 10:57:08.000000000 +0100
@@ -18,13 +18,13 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: discid.h 9569 2007-10-26 22:04:08Z robert $
+ $Id$
--------------------------------------------------------------------------- */
#ifndef MUSICBRAINZ_DISC_ID_H
#define MUSICBRAINZ_DISC_ID_H
-#ifdef WIN32
+#if (defined(_WIN32) || defined(_WIN64))
# ifdef libdiscid_EXPORTS
# define LIBDISCID_API __declspec(dllexport)
# else
@@ -277,6 +277,26 @@
*/
LIBDISCID_API int discid_get_track_length(DiscId *d, int track_num);
+/**
+ * Return the Media Catalogue Number for the disc.
+ *
+ * @param d a DiscId object created by discid_new()
+ * @return a string containing an Media Catalogue Number of the disk
+ */
+LIBDISCID_API char* discid_get_mcn(DiscId *d);
+
+/**
+ * Return the ISRC for a track.
+ *
+ * Only track numbers between (and including) discid_get_first_track_num()
+ * and discid_get_last_track_num() may be used.
+ *
+ * @param d a DiscId object created by discid_new()
+ * @param track_num the number of a track
+ * @return a string containing an ISRC for the specified track
+ */
+LIBDISCID_API char* discid_get_track_isrc(DiscId *d, int track_num);
+
#ifdef __cplusplus
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/include/discid/discid_private.h new/libdiscid-0.3.0/include/discid/discid_private.h
--- old/libdiscid-0.2.2/include/discid/discid_private.h 2008-01-12 12:19:12.000000000 +0100
+++ new/libdiscid-0.3.0/include/discid/discid_private.h 2013-01-01 10:57:08.000000000 +0100
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: discid_private.h 9569 2007-10-26 22:04:08Z robert $
+ $Id$
--------------------------------------------------------------------------- */
/*
@@ -46,6 +46,12 @@
/* The URL that can be used for retrieving XML for a CD */
#define MB_WEBSERVICE_URL "http://mm.musicbrainz.org/ws/1/release"
+/* Maximum length of a Media Catalogue Number string */
+#define MCN_STR_LENGTH 13
+
+/* Maximum length of a ISRC code string */
+#define ISRC_STR_LENGTH 12
+
/*
* This data structure represents an audio disc.
*
@@ -62,6 +68,8 @@
char submission_url[MB_MAX_URL_LENGTH+1];
char webservice_url[MB_MAX_URL_LENGTH+1];
char error_msg[MB_ERROR_MSG_LENGTH+1];
+ char isrc[100][ISRC_STR_LENGTH+1];
+ char mcn[MCN_STR_LENGTH+1];
int success;
} mb_disc_private;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/missing new/libdiscid-0.3.0/missing
--- old/libdiscid-0.2.2/missing 2007-04-28 03:21:47.000000000 +0200
+++ new/libdiscid-0.3.0/missing 2012-09-20 01:43:36.000000000 +0200
@@ -1,10 +1,10 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2003-09-02.23
+scriptversion=2012-01-06.13; # UTC
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
@@ -18,9 +18,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# along with this program. If not, see http://www.gnu.org/licenses/.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -33,6 +31,8 @@
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -44,7 +44,7 @@
msg="missing on your system"
-case "$1" in
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -60,11 +60,6 @@
msg="probably too old"
fi
;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
-h|--h|--he|--hel|--help)
echo "\
@@ -82,20 +77,25 @@
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
Send bug reports to ."
+ exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
+ exit $?
;;
-*)
@@ -104,12 +104,40 @@
exit 1
;;
- aclocal*)
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ *)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
fi
+ ;;
+esac
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
@@ -118,12 +146,7 @@
touch aclocal.m4
;;
- autoconf)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
+ autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
@@ -132,12 +155,7 @@
touch configure
;;
- autoheader)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
+ autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
@@ -147,7 +165,7 @@
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -157,11 +175,6 @@
;;
automake*)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
@@ -172,12 +185,7 @@
while read f; do touch "$f"; done
;;
- autom4te)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
+ autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
@@ -185,8 +193,8 @@
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -200,90 +208,78 @@
fi
;;
- bison|yacc)
+ bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
- lex|flex)
+ lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
- help2man)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
+ help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
- exit 1
+ exit $?
fi
;;
- makeinfo)
- if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
- # We have makeinfo, but it failed.
- exit 1
- fi
-
+ makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -291,53 +287,27 @@
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
- fi
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
touch $file
;;
- tar)
- shift
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- fi
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case "$firstarg" in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case "$firstarg" in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
@@ -356,5 +326,6 @@
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/Makefile.am new/libdiscid-0.3.0/src/Makefile.am
--- old/libdiscid-0.2.2/src/Makefile.am 2008-05-25 08:51:38.000000000 +0200
+++ new/libdiscid-0.3.0/src/Makefile.am 2013-01-01 10:57:08.000000000 +0100
@@ -17,13 +17,14 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# $Id: Makefile.am 9850 2008-05-25 06:51:32Z matt $
+# $Id$
#
lib_LTLIBRARIES = libdiscid.la
libdiscid_la_SOURCES = base64.c sha1.c disc.c
EXTRA_libdiscid_la_SOURCES = \
- disc_linux.c disc_win32.c disc_win32_new.c disc_darwin.c disc_freebsd.c
+ disc_linux.c disc_win32.c disc_win32_new.c \
+ disc_darwin.c disc_freebsd.c disc_solaris.c disc_openbsd.c
AM_CPPFLAGS = -I$(top_srcdir)/include
libdiscid_la_LIBADD = @DISC_OS_OBJ@
@@ -43,6 +44,6 @@
# increment age.
# 6. If any interfaces have been removed since the last public release, then
# set age to 0.
-libdiscid_la_LDFLAGS = -version-info 2:1:2 -no-undefined
+libdiscid_la_LDFLAGS = -version-info 3:0:3 -no-undefined
EXTRA_DIST = base64.h sha1.h
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/base64.c new/libdiscid-0.3.0/src/base64.c
--- old/libdiscid-0.2.2/src/base64.c 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.3.0/src/base64.c 2013-01-01 10:57:08.000000000 +0100
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: base64.c 8505 2006-09-30 00:02:18Z luks $
+ $Id$
----------------------------------------------------------------------------*/
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/base64.h new/libdiscid-0.3.0/src/base64.h
--- old/libdiscid-0.2.2/src/base64.h 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.3.0/src/base64.h 2013-01-01 10:57:08.000000000 +0100
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: base64.h 8505 2006-09-30 00:02:18Z luks $
+ $Id$
----------------------------------------------------------------------------*/
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc.c new/libdiscid-0.3.0/src/disc.c
--- old/libdiscid-0.2.2/src/disc.c 2008-01-12 12:19:13.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc.c 2013-01-01 10:57:08.000000000 +0100
@@ -20,7 +20,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: disc.c 9569 2007-10-26 22:04:08Z robert $
+ $Id$
--------------------------------------------------------------------------- */
#include
@@ -172,7 +172,6 @@
return mb_disc_get_default_device_unportable();
}
-
int discid_get_first_track_num(DiscId *d) {
mb_disc_private *disc = (mb_disc_private *) d;
@@ -228,6 +227,27 @@
return disc->track_offsets[0] - disc->track_offsets[i];
}
+char *discid_get_mcn(DiscId *d) {
+ mb_disc_private *disc = (mb_disc_private *) d;
+
+ assert( disc != NULL );
+
+ return disc->mcn;
+}
+
+char* discid_get_track_isrc(DiscId *d, int i) {
+ mb_disc_private *disc = (mb_disc_private *) d;
+
+ assert( disc != NULL );
+ assert( TRACK_NUM_IS_VALID(disc, i) );
+
+ if ( ! TRACK_NUM_IS_VALID(disc, i) || i == 0)
+ return NULL;
+
+ return disc->isrc[i];
+}
+
+
/****************************************************************************
*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc_darwin.c new/libdiscid-0.3.0/src/disc_darwin.c
--- old/libdiscid-0.2.2/src/disc_darwin.c 2008-03-12 07:27:09.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc_darwin.c 2013-01-01 10:57:08.000000000 +0100
@@ -46,7 +46,7 @@
#include "discid/discid_private.h"
-#define TOC_BUFFER_LEN 1024
+#define TOC_BUFFER_LEN 2048
#define MAXPATHLEN 1024
static char defaultDevice[MAXPATHLEN] = "\0";
@@ -113,6 +113,33 @@
return kernResult;
}
+static void read_disc_mcn(int fd, mb_disc_private *disc)
+{
+ dk_cd_read_mcn_t cd_read_mcn;
+ bzero(&cd_read_mcn, sizeof(cd_read_mcn));
+
+ if(ioctl(fd, DKIOCCDREADMCN, &cd_read_mcn) == -1) {
+ fprintf(stderr, "Warning: Unable to read the disc's media catalog number.\n");
+ } else {
+ strncpy( disc->mcn, cd_read_mcn.mcn, MCN_STR_LENGTH );
+ }
+}
+
+static void read_disc_isrc(int fd, mb_disc_private *disc, int track)
+{
+ dk_cd_read_isrc_t cd_read_isrc;
+ bzero(&cd_read_isrc, sizeof(cd_read_isrc));
+ cd_read_isrc.track = track;
+
+ if(ioctl(fd, DKIOCCDREADISRC, &cd_read_isrc) == -1) {
+ fprintf(stderr, "Warning: Unable to read the international standard recording code (ISRC) for track %i\n", track);
+ return;
+ } else {
+ strncpy( disc->isrc[track], cd_read_isrc.isrc, ISRC_STR_LENGTH );
+ }
+}
+
+
char *mb_disc_get_default_device_unportable(void)
{
kern_return_t kernResult;
@@ -168,6 +195,9 @@
free(toc.buffer);
return 0;
}
+
+ // Read in the media catalogue number
+ read_disc_mcn( fd, disc );
cdToc = (CDTOC *)toc.buffer;
int numDesc = CDTOCGetDescriptorCount(cdToc);
@@ -183,11 +213,18 @@
if (desc->point == 0xA2 && desc->adr == 1)
disc->track_offsets[0] = CDConvertMSFToLBA(desc->p) + 150;
- if (desc->point <= 99 && desc->adr == 1)
- disc->track_offsets[1 + numTracks++] = CDConvertMSFToLBA(desc->p) + 150;
+ if (desc->point <= 99 && desc->adr == 1) {
+ disc->track_offsets[1 + numTracks] = CDConvertMSFToLBA(desc->p) + 150;
+
+ // Read in the IRSC codes for tracks
+ read_disc_isrc( fd, disc, 1 + numTracks );
+
+ numTracks++;
+ }
}
disc->first_track_num = 1;
disc->last_track_num = numTracks;
+
close(fd);
free(toc.buffer);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc_freebsd.c new/libdiscid-0.3.0/src/disc_freebsd.c
--- old/libdiscid-0.2.2/src/disc_freebsd.c 2008-01-12 12:41:51.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc_freebsd.c 2013-01-01 10:57:08.000000000 +0100
@@ -21,7 +21,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: disc_freebsd.c 9646 2008-01-12 11:41:50Z matt $
+ $Id$
--------------------------------------------------------------------------- */
#include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc_linux.c new/libdiscid-0.3.0/src/disc_linux.c
--- old/libdiscid-0.2.2/src/disc_linux.c 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc_linux.c 2013-01-01 10:57:08.000000000 +0100
@@ -20,7 +20,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: disc_linux.c 8505 2006-09-30 00:02:18Z luks $
+ $Id$
--------------------------------------------------------------------------- */
#include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc_openbsd.c new/libdiscid-0.3.0/src/disc_openbsd.c
--- old/libdiscid-0.2.2/src/disc_openbsd.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc_openbsd.c 2013-01-01 10:57:08.000000000 +0100
@@ -0,0 +1,147 @@
+/* --------------------------------------------------------------------------
+
+ MusicBrainz -- The Internet music metadatabase
+
+ Copyright (C) 2009 Anton Yabchinskiy
+ Copyright (C) 2006 Matthias Friedrich
+ Copyright (C) 2000 Robert Kaye
+ Copyright (C) 1999 Marc E E van Woerkom
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ $Id$
+
+--------------------------------------------------------------------------- */
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include "discid/discid_private.h"
+
+#define MB_DEFAULT_DEVICE "/dev/rcd0c"
+
+#ifdef __NetBSD__
+ #define CD_TRACK_LEADOUT 0xAA
+ #ifdef __i386__
+ #define MB_DEFAULT_DEVICE "/dev/rcd0d"
+ #endif/* __i386__ */
+#endif/* __NetBSD__ */
+
+static int
+read_toc_entry (int fd, int track, struct cd_toc_entry *te)
+{
+ struct ioc_read_toc_entry rte;
+
+ rte.address_format = CD_LBA_FORMAT;
+ rte.data = te;
+ rte.data_len = sizeof (*te);
+ rte.starting_track = track;
+
+ if (ioctl (fd, CDIOREADTOCENTRYS, &rte) == -1) {
+ return errno;
+ }
+
+ return 0;
+}
+
+static inline int
+is_data_track (const struct cd_toc_entry *te)
+{
+ return (te->control & 0x4) != 0;
+}
+
+int
+mb_disc_read_unportable (mb_disc_private *disc, const char *device)
+{
+ struct cd_toc_entry te;
+ struct ioc_toc_header th;
+ int fd, i, rc;
+
+ fd = open (device, O_RDONLY | O_NONBLOCK);
+ if (fd == -1) {
+ snprintf (disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "could not open device '%s' (errno %i, '%s')", device, errno,
+ strerror (errno));
+ return 0;
+ }
+
+ rc = ioctl (fd, CDIOREADTOCHEADER, &th);
+ if (rc == -1) {
+ snprintf (disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "could not read table of contents (errno %i, '%s')", errno,
+ strerror (errno));
+ close (fd);
+ return 0;
+ }
+
+ if (th.ending_track == 0) {
+ snprintf (disc->error_msg, MB_ERROR_MSG_LENGTH, "disc has no tracks");
+ close (fd);
+ return 0;
+ }
+
+ disc->first_track_num = th.starting_track;
+ disc->last_track_num = th.ending_track;
+
+ rc = read_toc_entry (fd, CD_TRACK_LEADOUT, &te);
+ if (rc != 0) {
+ snprintf (disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "could not read TOC entry for lead-out track (errno %i, '%s')",
+ rc, strerror (rc));
+ close (fd);
+ return 0;
+ }
+ disc->track_offsets [0] = (int) te.addr.lba + 150;
+
+ for (i = th.starting_track; i <= th.ending_track; ++i) {
+ rc = read_toc_entry (fd, i, &te);
+ if (rc != 0) {
+ snprintf (disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "could not read TOC entry for track %i (errno %i, '%s')", i,
+ rc, strerror (rc));
+ close (fd);
+ return 0;
+ }
+
+ if (is_data_track (&te)) {
+ if (i == th.starting_track) {
+ snprintf (disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "disc has no audio tracks");
+ close (fd);
+ return 0;
+ }
+ break;
+ }
+
+ disc->track_offsets [i] = (int) te.addr.lba + 150;
+ }
+
+ close (fd);
+
+ return 1;
+}
+
+char *
+mb_disc_get_default_device_unportable (void)
+{
+ return MB_DEFAULT_DEVICE;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc_solaris.c new/libdiscid-0.3.0/src/disc_solaris.c
--- old/libdiscid-0.2.2/src/disc_solaris.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc_solaris.c 2013-01-01 10:57:08.000000000 +0100
@@ -0,0 +1,189 @@
+/* --------------------------------------------------------------------------
+
+ MusicBrainz -- The Internet music metadatabase
+
+ Copyright (C) 2009 Shunsuke Kuroda
+ Copyright (C) 2006 Matthias Friedrich
+ Copyright (C) 2000 Robert Kaye
+ Copyright (C) 1999 Marc E E van Woerkom
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA
+
+ $Id$
+
+--------------------------------------------------------------------------- */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#include "discid/discid_private.h"
+
+
+#define MB_DEFAULT_DEVICE "/vol/dev/aliases/cdrom0"
+
+#define CD_FRAMES 75
+#define XA_INTERVAL ((60 + 90 + 2) * CD_FRAMES)
+
+
+/* TODO: make sure it's available */
+int snprintf(char *str, size_t size, const char *format, ...);
+
+
+static int read_toc_header(int fd, int *first, int *last) {
+ int ret;
+ unsigned long ms_offset;
+
+ struct cdrom_tochdr th;
+ struct cdrom_tocentry te;
+
+ ret = ioctl(fd, CDROMREADTOCHDR, &th);
+
+ if ( ret < 0 )
+ return ret; /* error */
+
+ *first = th.cdth_trk0;
+ *last = th.cdth_trk1;
+
+ /*
+ * Hide the last track if this is a multisession disc.
+ *
+ * te.cdte_addr.lba is the absolute CD-ROM address of the first
+ * track in the FIRST SESSION. ms_offset is the absolute CD-ROM
+ * address of the first track in the LAST SESSION.
+ *
+ * If ms_offset differs from te.cdte_addr.lba, CD-ROM is multi-
+ * session.
+ *
+ * Note that currently only dual-session discs with one track
+ * in the second session are handled correctly.
+ */
+ te.cdte_track = 1;
+ te.cdte_format = CDROM_LBA;
+
+ ret = ioctl(fd, CDROMREADTOCENTRY, &te);
+ ret = ioctl(fd, CDROMREADOFFSET, &ms_offset);
+
+ if ( ms_offset != te.cdte_addr.lba )
+ (*last)--;
+
+ return ret;
+}
+
+
+static int read_toc_entry(int fd, int track_num, unsigned long *lba) {
+ struct cdrom_tocentry te;
+ int ret;
+
+ te.cdte_track = track_num;
+ te.cdte_format = CDROM_LBA;
+
+ ret = ioctl(fd, CDROMREADTOCENTRY, &te);
+ assert( te.cdte_format == CDROM_LBA );
+
+ /* in case the ioctl() was successful */
+ if ( ret == 0 )
+ *lba = te.cdte_addr.lba;
+
+ return ret;
+}
+
+
+static int read_leadout(int fd, unsigned long *lba) {
+ int ret;
+ unsigned long ms_offset;
+
+ struct cdrom_tocentry te;
+
+ te.cdte_track = 1;
+ te.cdte_format = CDROM_LBA;
+
+ ret = ioctl(fd, CDROMREADTOCENTRY, &te);
+ ret = ioctl(fd, CDROMREADOFFSET, &ms_offset);
+
+ if ( ms_offset != te.cdte_addr.lba ) {
+ *lba = ms_offset - XA_INTERVAL;
+ return ret;
+ }
+
+ return read_toc_entry(fd, CDROM_LEADOUT, lba);
+}
+
+
+char *mb_disc_get_default_device_unportable(void) {
+ return MB_DEFAULT_DEVICE;
+}
+
+
+int mb_disc_read_unportable(mb_disc_private *disc, const char *device) {
+ int fd;
+ unsigned long lba;
+ int first, last;
+ int i;
+
+ if ( (fd = open(device, O_RDONLY | O_NONBLOCK)) < 0 ) {
+ snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "cannot open device `%s'", device);
+ return 0;
+ }
+
+ /*
+ * Find the numbers of the first track (usually 1) and the last track.
+ */
+ if ( read_toc_header(fd, &first, &last) < 0 ) {
+ snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "cannot read table of contents");
+ close(fd);
+ return 0;
+ }
+
+ /* basic error checking */
+ if ( last == 0 ) {
+ snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "this disc has no tracks");
+ close(fd);
+ return 0;
+ }
+
+ disc->first_track_num = first;
+ disc->last_track_num = last;
+
+
+ /*
+ * Get the logical block address (lba) for the end of the audio data.
+ * The "LEADOUT" track is the track beyond the final audio track, so
+ * we're looking for the block address of the LEADOUT track.
+ */
+ read_leadout(fd, &lba);
+ disc->track_offsets[0] = lba + 150;
+
+ for (i = first; i <= last; i++) {
+ read_toc_entry(fd, i, &lba);
+ disc->track_offsets[i] = lba + 150;
+ }
+
+ close(fd);
+
+ return 1;
+}
+
+/* EOF */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc_win32.c new/libdiscid-0.3.0/src/disc_win32.c
--- old/libdiscid-0.2.2/src/disc_win32.c 2008-01-12 12:19:13.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc_win32.c 2013-01-01 10:57:08.000000000 +0100
@@ -19,7 +19,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: disc_win32.c 9184 2007-06-17 15:46:00Z luks $
+ $Id$
----------------------------------------------------------------------------*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/disc_win32_new.c new/libdiscid-0.3.0/src/disc_win32_new.c
--- old/libdiscid-0.2.2/src/disc_win32_new.c 2008-01-12 12:19:13.000000000 +0100
+++ new/libdiscid-0.3.0/src/disc_win32_new.c 2013-01-01 10:57:08.000000000 +0100
@@ -2,7 +2,7 @@
MusicBrainz -- The Internet music metadatabase
- Copyright (C) 2007 Lukas Lalinsky
+ Copyright (C) 2007-2008 Lukas Lalinsky
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: disc_win32_new.c 9184 2007-06-17 15:46:00Z luks $
+ $Id$
----------------------------------------------------------------------------*/
@@ -34,36 +34,121 @@
#define XA_INTERVAL ((60 + 90 + 2) * CD_FRAMES)
#define IOCTL_CDROM_READ_TOC 0x24000
+#define IOCTL_CDROM_READ_Q_CHANNEL 0x2402c
#define IOCTL_CDROM_GET_LAST_SESSION 0x24038
typedef struct {
- UCHAR Reserved;
- UCHAR Control : 4;
- UCHAR Adr : 4;
- UCHAR TrackNumber;
- UCHAR Reserved1;
- UCHAR Address[4];
+ UCHAR Reserved;
+ UCHAR Control : 4;
+ UCHAR Adr : 4;
+ UCHAR TrackNumber;
+ UCHAR Reserved1;
+ UCHAR Address[4];
} TRACK_DATA;
typedef struct {
- UCHAR Length[2];
- UCHAR FirstTrack;
- UCHAR LastTrack;
- TRACK_DATA TrackData[100];
+ UCHAR Length[2];
+ UCHAR FirstTrack;
+ UCHAR LastTrack;
+ TRACK_DATA TrackData[100];
} CDROM_TOC;
typedef struct _CDROM_TOC_SESSION_DATA {
- UCHAR Length[2];
- UCHAR FirstCompleteSession;
- UCHAR LastCompleteSession;
- TRACK_DATA TrackData[1];
+ UCHAR Length[2];
+ UCHAR FirstCompleteSession;
+ UCHAR LastCompleteSession;
+ TRACK_DATA TrackData[1];
} CDROM_TOC_SESSION_DATA;
+#define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
+#define IOCTL_CDROM_CURRENT_POSITION 0x01
+#define IOCTL_CDROM_MEDIA_CATALOG 0x02
+#define IOCTL_CDROM_TRACK_ISRC 0x03
+
+typedef struct _CDROM_SUB_Q_DATA_FORMAT {
+ UCHAR Format;
+ UCHAR Track;
+} CDROM_SUB_Q_DATA_FORMAT;
+
+typedef struct _SUB_Q_HEADER {
+ UCHAR Reserved;
+ UCHAR AudioStatus;
+ UCHAR DataLength[2];
+} SUB_Q_HEADER;
+
+typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
+ SUB_Q_HEADER Header;
+ UCHAR FormatCode;
+ UCHAR Reserved[3];
+ UCHAR Reserved1 : 7;
+ UCHAR Mcval :1;
+ UCHAR MediaCatalog[15];
+} SUB_Q_MEDIA_CATALOG_NUMBER;
+
+typedef struct _SUB_Q_TRACK_ISRC {
+ SUB_Q_HEADER Header;
+ UCHAR FormatCode;
+ UCHAR Reserved0;
+ UCHAR Track;
+ UCHAR Reserved1;
+ UCHAR Reserved2 : 7;
+ UCHAR Tcval : 1;
+ UCHAR TrackIsrc[15];
+} SUB_Q_TRACK_ISRC;
+
+typedef union _SUB_Q_CHANNEL_DATA {
+ /*SUB_Q_CURRENT_POSITION CurrentPosition;*/
+ SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog;
+ SUB_Q_TRACK_ISRC TrackIsrc;
+} SUB_Q_CHANNEL_DATA;
+
int AddressToSectors(UCHAR address[4])
{
return address[1] * 4500 + address[2] * 75 + address[3];
}
+static void read_disc_mcn(HANDLE hDevice, mb_disc_private *disc)
+{
+ DWORD dwReturned;
+ BOOL bResult;
+ CDROM_SUB_Q_DATA_FORMAT format;
+ SUB_Q_CHANNEL_DATA data;
+
+ format.Track = 0;
+ format.Format = IOCTL_CDROM_MEDIA_CATALOG;
+ bResult = DeviceIoControl(hDevice, IOCTL_CDROM_READ_Q_CHANNEL,
+ &format, sizeof(format),
+ &data, sizeof(data),
+ &dwReturned, NULL);
+ if (bResult == FALSE) {
+ fprintf(stderr, "Warning: Unable to read the disc's media catalog number.\n");
+ }
+ else {
+ strncpy(disc->mcn, data.MediaCatalog.MediaCatalog, MCN_STR_LENGTH);
+ }
+}
+
+static void read_disc_isrc(HANDLE hDevice, mb_disc_private *disc, int track)
+{
+ DWORD dwReturned;
+ BOOL bResult;
+ CDROM_SUB_Q_DATA_FORMAT format;
+ SUB_Q_CHANNEL_DATA data;
+
+ format.Track = track;
+ format.Format = IOCTL_CDROM_TRACK_ISRC;
+ bResult = DeviceIoControl(hDevice, IOCTL_CDROM_READ_Q_CHANNEL,
+ &format, sizeof(format),
+ &data, sizeof(data),
+ &dwReturned, NULL);
+ if (bResult == FALSE) {
+ fprintf(stderr, "Warning: Unable to read the international standard recording code (ISRC) for track %i\n", track);
+ }
+ else {
+ strncpy(disc->isrc[track], data.TrackIsrc.TrackIsrc, ISRC_STR_LENGTH);
+ }
+}
+
int mb_disc_read_unportable_nt(mb_disc_private *disc, const char *device)
{
HANDLE hDevice;
@@ -80,8 +165,6 @@
len = colon - device + 1;
}
strncat(filename, device, len > 120 ? 120 : len);
- printf("%s\n", device);
- printf("%s\n", filename);
hDevice = CreateFile(filename, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
@@ -114,7 +197,7 @@
return 0;
}
- CloseHandle(hDevice);
+ read_disc_mcn(hDevice, disc);
disc->first_track_num = toc.FirstTrack;
disc->last_track_num = toc.LastTrack;
@@ -133,8 +216,10 @@
for (i = disc->first_track_num; i <= disc->last_track_num; i++) {
disc->track_offsets[i] = AddressToSectors(toc.TrackData[i - 1].Address);
+ read_disc_isrc(hDevice, disc, i);
}
+ CloseHandle(hDevice);
return 1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/sha1.c new/libdiscid-0.3.0/src/sha1.c
--- old/libdiscid-0.2.2/src/sha1.c 2006-09-04 18:07:50.000000000 +0200
+++ new/libdiscid-0.3.0/src/sha1.c 2013-01-01 10:57:08.000000000 +0100
@@ -10,7 +10,7 @@
*
* This code is in the public domain
*
- * $Id: sha1.c 7777 2006-06-01 17:37:15Z matt $
+ * $Id$
*/
#include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/src/sha1.h new/libdiscid-0.3.0/src/sha1.h
--- old/libdiscid-0.2.2/src/sha1.h 2006-09-04 18:07:50.000000000 +0200
+++ new/libdiscid-0.3.0/src/sha1.h 2013-01-01 10:57:08.000000000 +0100
@@ -3,7 +3,7 @@
/* from Peter C. Gutmann's implementation as found in */
/* Applied Cryptography by Bruce Schneier */
/* This code is in the public domain */
-/* $Id: sha1.h 7777 2006-06-01 17:37:15Z matt $ */
+/* $Id$ */
#ifndef SHA_H
#define SHA_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.2.2/test/test_discid.c new/libdiscid-0.3.0/test/test_discid.c
--- old/libdiscid-0.2.2/test/test_discid.c 2007-04-12 11:40:32.000000000 +0200
+++ new/libdiscid-0.3.0/test/test_discid.c 2013-01-01 10:57:08.000000000 +0100
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: test_discid.c 8505 2006-09-30 00:02:18Z luks $
+ $Id$
--------------------------------------------------------------------------- */
#include
++++++ libdiscid-no-cryptoplz.patch -> libdiscid-no-crypto.patch ++++++
--- /work/SRC/openSUSE:Factory/libdiscid/libdiscid-no-cryptoplz.patch 2012-07-31 13:58:41.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libdiscid.new/libdiscid-no-crypto.patch 2013-01-20 07:55:20.000000000 +0100
@@ -1,7 +1,27 @@
-Index: libdiscid-0.2.2/src/disc.c
-===================================================================
---- libdiscid-0.2.2.orig/src/disc.c
-+++ libdiscid-0.2.2/src/disc.c
+diff --git a/src/Makefile.am b/src/Makefile.am
+index c8fbee3..62a27f5 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -21,13 +21,13 @@
+ #
+ lib_LTLIBRARIES = libdiscid.la
+
+-libdiscid_la_SOURCES = base64.c sha1.c disc.c
++libdiscid_la_SOURCES = base64.c disc.c
+ EXTRA_libdiscid_la_SOURCES = \
+ disc_linux.c disc_win32.c disc_win32_new.c \
+ disc_darwin.c disc_freebsd.c disc_solaris.c disc_openbsd.c
+
+ AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include
+-libdiscid_la_LIBADD = @DISC_OS_OBJ@
++libdiscid_la_LIBADD = @DISC_OS_OBJ@ -lcrypto
+ libdiscid_la_DEPENDENCIES = @DISC_OS_OBJ@
+
+ # Here are a set of rules to help you update your library version information:
+diff --git a/src/disc.c b/src/disc.c
+index f6cb3dd..d6de86b 100644
+--- a/src/disc.c
++++ b/src/disc.c
@@ -25,8 +25,8 @@
--------------------------------------------------------------------------- */
#include
@@ -12,7 +32,7 @@
#include "base64.h"
#include "discid/discid.h"
-@@ -240,35 +240,38 @@ int discid_get_track_length(DiscId *d, i
+@@ -260,35 +260,38 @@ char* discid_get_track_isrc(DiscId *d, int i) {
* The DiscID is placed in the provided string buffer.
*/
static void create_disc_id(mb_disc_private *d, char buf[]) {
@@ -46,14 +66,13 @@
- sha_update(&sha, (unsigned char *) tmp, strlen(tmp));
+ EVP_DigestUpdate(sha, (unsigned char *) tmp, strlen(tmp));
}
-+
-+ EVP_DigestFinal_ex(sha, digest, &sha_len);
-+ EVP_MD_CTX_destroy(sha);
- sha_final(digest, &sha);
-
- base64 = rfc822_binary(digest, sizeof(digest), &size);
--
++ EVP_DigestFinal_ex(sha, digest, &sha_len);
++ EVP_MD_CTX_destroy(sha);
+
+ base64 = rfc822_binary(digest, sha_len , &size);
memcpy(buf, base64, size);
buf[size] = '\0';
@@ -63,22 +82,3 @@
}
-Index: libdiscid-0.2.2/src/Makefile.am
-===================================================================
---- libdiscid-0.2.2.orig/src/Makefile.am
-+++ libdiscid-0.2.2/src/Makefile.am
-@@ -21,12 +21,12 @@
- #
- lib_LTLIBRARIES = libdiscid.la
-
--libdiscid_la_SOURCES = base64.c sha1.c disc.c
-+libdiscid_la_SOURCES = base64.c disc.c
- EXTRA_libdiscid_la_SOURCES = \
- disc_linux.c disc_win32.c disc_win32_new.c disc_darwin.c disc_freebsd.c
-
- AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include
--libdiscid_la_LIBADD = @DISC_OS_OBJ@
-+libdiscid_la_LIBADD = @DISC_OS_OBJ@ -lcrypto
- libdiscid_la_DEPENDENCIES = @DISC_OS_OBJ@
-
- # Here are a set of rules to help you update your library version information:
++++++ libdiscid-visibility.patch ++++++
diff --git a/configure.ac b/configure.ac
index c44a656..40b49d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,8 +39,10 @@ AC_MSG_NOTICE([using discid implementation disc_${os}.c])
dnl Checks for programs.
-AC_PROG_CC
-AM_PROG_LIBTOOL
+AC_PROG_CC_STDC
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
+LT_INIT([disable-static pic-only])
AC_SUBST(LIBTOOL_DEPS)
AC_PROG_INSTALL
@@ -50,9 +52,44 @@ AC_C_BIGENDIAN
AC_CHECK_SIZEOF(long)
-if test "$GCC" = yes; then
- CFLAGS="$CFLAGS -Wall -O2"
-fi
+dnl ************************************************************
+dnl Enable hiding of internal symbols in library to reduce its size and
+dnl speed dynamic linking of applications. This currently is only supported
+dnl on gcc >= 4.0 and SunPro C.
+dnl
+AC_MSG_CHECKING([whether to enable hidden symbols in the library])
+AC_ARG_ENABLE(hidden-symbols,
+AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
+AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
+[ case "$enableval" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_CHECKING([whether $CC supports it])
+ if test "$GCC" = yes ; then
+ if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(LIBDISCID_API, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ else
+ dnl Test for SunPro cc
+ if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(LIBDISCID_API, [__global], [to make a symbol visible])
+ CFLAGS="$CFLAGS -xldscope=hidden"
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ ;;
+ esac ],
+ AC_MSG_RESULT(no)
+)
AC_OUTPUT([
diff --git a/include/discid/discid.h b/include/discid/discid.h
index 9425689..ad5a210 100644
--- a/include/discid/discid.h
+++ b/include/discid/discid.h
@@ -24,13 +24,7 @@
#ifndef MUSICBRAINZ_DISC_ID_H
#define MUSICBRAINZ_DISC_ID_H
-#if (defined(_WIN32) || defined(_WIN64))
-# ifdef libdiscid_EXPORTS
-# define LIBDISCID_API __declspec(dllexport)
-# else
-# define LIBDISCID_API __declspec(dllimport)
-# endif
-#else
+#ifndef LIBDISCID_API
# define LIBDISCID_API
#endif
diff --git a/src/Makefile.am b/src/Makefile.am
index b59991d..c8fbee3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,7 +26,7 @@ EXTRA_libdiscid_la_SOURCES = \
disc_linux.c disc_win32.c disc_win32_new.c \
disc_darwin.c disc_freebsd.c disc_solaris.c disc_openbsd.c
-AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include
libdiscid_la_LIBADD = @DISC_OS_OBJ@
libdiscid_la_DEPENDENCIES = @DISC_OS_OBJ@
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org