Accepting request 939046 from multimedia:libs

OBS-URL: https://build.opensuse.org/request/show/939046
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libid3tag?expand=0&rev=26
This commit is contained in:
Dominique Leuenberger 2021-12-12 20:27:13 +00:00 committed by Git OBS Bridge
commit 3f50945aca
14 changed files with 46 additions and 723 deletions

View File

@ -1,3 +1 @@
libid3tag0
provides "libid3tag = %version-%release"
obsoletes "libid3tag < %version-%release"
libid3tag%lver

View File

@ -1,25 +0,0 @@
Index: libid3tag-0.15.1b/compat.h
===================================================================
--- libid3tag-0.15.1b.orig/compat.h
+++ libid3tag-0.15.1b/compat.h
@@ -34,7 +34,7 @@ struct id3_compat {
};
struct id3_compat const *id3_compat_lookup(register char const *,
- register unsigned int);
+ register size_t);
int id3_compat_fixup(struct id3_tag *);
Index: libid3tag-0.15.1b/frametype.h
===================================================================
--- libid3tag-0.15.1b.orig/frametype.h
+++ libid3tag-0.15.1b/frametype.h
@@ -37,6 +37,6 @@ extern struct id3_frametype const id3_fr
extern struct id3_frametype const id3_frametype_obsolete;
struct id3_frametype const *id3_frametype_lookup(register char const *,
- register unsigned int);
+ register size_t);
#pragma GCC visibility pop
# endif

View File

@ -1,212 +0,0 @@
--- id3tag.h-dist 2004-02-26 12:40:29.000000000 +0100
+++ id3tag.h 2004-02-26 12:40:36.000000000 +0100
@@ -273,7 +273,7 @@
signed long id3_tag_query(id3_byte_t const *, id3_length_t);
struct id3_tag *id3_tag_parse(id3_byte_t const *, id3_length_t);
-id3_length_t id3_tag_render(struct id3_tag const *, id3_byte_t *);
+id3_length_t id3_tag_render(struct id3_tag *, id3_byte_t *);
/* frame interface */
--- tag.c-dist 2004-02-26 12:40:29.000000000 +0100
+++ tag.c 2004-02-26 12:40:36.000000000 +0100
@@ -45,6 +45,12 @@
# include "field.h"
# include "util.h"
+/* If a v2 tag is too small to fit and the file needs to be rewritten, add at least
+ * TAG_PADDING number of bytes to hopefully prevent having to rewrite the file
+ * in the future.
+ */
+#define TAG_PADDING 256
+
/*
* NAME: tag->new()
* DESCRIPTION: allocate and return a new, empty tag
@@ -765,7 +771,10 @@
* NAME: tag->render()
* DESCRIPTION: render a complete ID3 tag
*/
-id3_length_t id3_tag_render(struct id3_tag const *tag, id3_byte_t *buffer)
+/* RAK: Note: This file used to be const, but since the padding might be
+ * adjusted by this function, we can't do that anymore.
+ */
+id3_length_t id3_tag_render(struct id3_tag *tag, id3_byte_t *buffer)
{
id3_length_t size = 0;
id3_byte_t **ptr,
@@ -876,6 +885,9 @@
/* padding */
if (!(flags & ID3_TAG_FLAG_FOOTERPRESENT)) {
+ if (size > tag->paddedsize)
+ tag->paddedsize += TAG_PADDING + size;
+
if (size < tag->paddedsize)
size += id3_render_padding(ptr, 0, tag->paddedsize - size);
else if (tag->options & ID3_TAG_OPTION_UNSYNCHRONISATION) {
--- file.c-dist 2004-02-26 12:40:29.000000000 +0100
+++ file.c 2004-02-26 12:43:11.000000000 +0100
@@ -42,6 +42,10 @@
# include "tag.h"
# include "field.h"
+#define TMP_SUFFIX ".temp"
+#define OLD_SUFFIX ".old"
+#define COPY_BUFFER_SIZE 4096
+
struct filetag {
struct id3_tag *tag;
unsigned long location;
@@ -575,6 +579,11 @@
int v2_write(struct id3_file *file,
id3_byte_t const *data, id3_length_t length)
{
+ FILE *out;
+ char *newpath = NULL, *buffer = NULL, *oldpath = NULL;
+ int numread = 0, numwritten = 0;
+ struct id3_file *newfile = NULL;
+
assert(!data || length > 0);
if (data &&
@@ -592,8 +601,137 @@
}
/* hard general case: rewrite entire file */
+ newpath = malloc(strlen(file->path) + sizeof(TMP_SUFFIX) + 1);
+ if (! newpath)
+ return -1;
+ strcpy(newpath, file->path);
+ strcat(newpath, TMP_SUFFIX);
+ out = fopen(newpath, "wb");
+ if (out == NULL)
+ {
+ free(newpath);
+ return -1;
+ }
- /* ... */
+ /* Write the new tag out */
+ if (fwrite(data, length, 1, out) == 0)
+ {
+ fclose(out);
+ unlink(newpath);
+ free(newpath);
+
+ return -1;
+ }
+
+ if (fseek(file->iofile, (file->tags) ? file->tags[0].length : 0, SEEK_SET) == -1)
+ {
+ fclose(out);
+ unlink(newpath);
+ free(newpath);
+ return -1;
+ }
+
+ buffer = malloc(COPY_BUFFER_SIZE);
+ if (! buffer) {
+ fclose(out);
+ unlink(newpath);
+ free(newpath);
+ return -1;
+ }
+ for(;;)
+ {
+ numread = fread(buffer, sizeof(char), COPY_BUFFER_SIZE, file->iofile);
+ if (numread <= 0)
+ break;
+
+ numwritten = fwrite(buffer, sizeof(char), numread, out);
+ if (numwritten != numread)
+ {
+ fclose(out);
+ unlink(newpath);
+ free(newpath);
+ free(buffer);
+ return -1;
+ }
+ }
+ free(buffer);
+
+ fclose(out);
+ fclose(file->iofile);
+
+ /* Now rename the file. let's be more paranoid here than id3lib */
+ /* Move the old file to the same name with .old appended */
+ oldpath = malloc(strlen(file->path) + sizeof(OLD_SUFFIX) + 1);
+ if (! oldpath) {
+ unlink(newpath);
+ free(newpath);
+ return -1;
+ }
+ strcpy(oldpath, file->path);
+ strcat(oldpath, OLD_SUFFIX);
+
+ if (rename(file->path, oldpath))
+ {
+ unlink(newpath);
+ unlink(oldpath);
+ free(newpath);
+ free(oldpath);
+ return -1;
+ }
+
+ /* Now rename the new file to proper file */
+ if (rename(newpath, file->path))
+ {
+ /* Something failed, so let's try to put things back */
+ rename(oldpath, file->path);
+ unlink(newpath);
+ unlink(oldpath);
+ free(newpath);
+ free(oldpath);
+ return -1;
+ }
+
+ /* now that the rename succeeded, remove the old file */
+ unlink(oldpath);
+
+ free(oldpath);
+ free(newpath);
+
+ /* Now do the housekeeping to make sure we leave things as we found them */
+ newfile = id3_file_open(file->path, file->mode);
+ if (newfile)
+ {
+ int i;
+
+ /* Clean up the old data */
+ if (file->path)
+ free(file->path);
+
+ if (file->primary) {
+ id3_tag_delref(file->primary);
+ id3_tag_delete(file->primary);
+ }
+
+ for (i = 0; i < file->ntags; ++i) {
+ struct id3_tag *tag;
+
+ tag = file->tags[i].tag;
+ if (tag) {
+ id3_tag_delref(tag);
+ id3_tag_delete(tag);
+ }
+ }
+
+ if (file->tags)
+ free(file->tags);
+
+ memcpy(file, newfile, sizeof(struct id3_file));
+ }
+ else
+ {
+ /* Hmmm. Something is wrong. Let's zero out the current info */
+ memset(file, 0, sizeof(struct id3_file));
+ }
done:
return 0;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151
size 338143

3
libid3tag-0.16.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:185a6cec84644cf1aade8397dcf76753bcb3bd85ec2111a9e1079214ed85bef0
size 98074

View File

@ -1,11 +0,0 @@
--- Makefile.am-dist 2004-02-26 12:46:41.000000000 +0100
+++ Makefile.am 2004-02-26 12:47:43.000000000 +0100
@@ -21,6 +21,8 @@
## Process this file with automake to produce Makefile.in
+AUTOMAKE_OPTIONS = foreign
+
SUBDIRS =
DIST_SUBDIRS = msvc++

View File

@ -1,32 +0,0 @@
--- compat.gperf
+++ compat.gperf
@@ -46,7 +46,11 @@
static id3_compat_func_t translate_TCON;
%}
-struct id3_compat;
+struct id3_compat {
+ char const *id;
+ char const *equiv;
+ id3_compat_func_t *translate;
+};
%%
#
# ID3v2.2 and ID3v2.3 frames
--- frametype.gperf
+++ frametype.gperf
@@ -269,7 +269,13 @@
FRAMETYPE(unknown, unknown, PRESERVE, "Unknown frame");
FRAMETYPE(obsolete, unknown, OBSOLETE, "Obsolete frame");
%}
-struct id3_frametype;
+struct id3_frametype {
+ char const *id;
+ unsigned int nfields;
+ enum id3_field_type const *fields;
+ int defaultflags;
+ char const *description;
+};
%%
#
# ID3v2.4 frames

View File

@ -1,10 +0,0 @@
--- Makefile.am-dist 2003-06-04 09:37:06.000000000 +0200
+++ Makefile.am 2003-07-03 16:52:39.000000000 +0200
@@ -90,6 +90,7 @@
frametype.gperf compat.gperf genre.dat.in \
debug.c debug.h
+libid3tag_la_LIBADD = -lz
libid3tag_la_LDFLAGS = -version-info $(version_info)
BUILT_SOURCES = frametype.c compat.c genre.dat

View File

@ -1,20 +0,0 @@
--- configure.ac
+++ configure.ac
@@ -17,7 +17,7 @@
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-AC_REVISION([$Id: configure.ac,v 1.12 2004/01/23 23:22:46 rob Exp $])dnl
+AC_REVISION([$Id: configure.ac,v 1.1 2006/10/31 09:26:19 meissner Exp meissner $])dnl
dnl Process this file with autoconf to produce a configure script.
@@ -107,7 +107,7 @@
shift
;;
-O*|-f*)
- optimize="$1"
+ optimize="$optimize $1"
shift
;;
*)

View File

@ -1,42 +0,0 @@
References: https://sources.debian.org/src/libid3tag/0.15.1b-13/debian/patches/11_unknown_encoding.dpatch/
From: Karol Babioch <kbabioch@suse.com>
Date: Wed Feb 21 13:23:47 CET 2018
Upstream: dead
Subject: Fix unknown encoding when parsing ID3 tags
Fixes the handling of unknown encodings when parsing ID3 tags. (CVE-2017-11550 bsc#1081962 CVE-2008-2109 bsc#387731)
---
compat.gperf | 3 +++
parse.c | 4 ++++
2 files changed, 7 insertions(+)
Index: libid3tag-0.15.1b/compat.gperf
===================================================================
--- libid3tag-0.15.1b.orig/compat.gperf
+++ libid3tag-0.15.1b/compat.gperf
@@ -241,6 +241,9 @@ int id3_compat_fixup(struct id3_tag *tag
encoding = id3_parse_uint(&data, 1);
string = id3_parse_string(&data, end - data, encoding, 0);
+ if (!string)
+ continue;
+
if (id3_ucs4_length(string) < 4) {
free(string);
continue;
Index: libid3tag-0.15.1b/parse.c
===================================================================
--- libid3tag-0.15.1b.orig/parse.c
+++ libid3tag-0.15.1b/parse.c
@@ -165,6 +165,10 @@ id3_ucs4_t *id3_parse_string(id3_byte_t
case ID3_FIELD_TEXTENCODING_UTF_8:
ucs4 = id3_utf8_deserialize(ptr, length);
break;
+
+ default:
+ /* FIXME: Unknown encoding! Print warning? */
+ return NULL;
}
if (ucs4 && !full) {

View File

@ -1,38 +0,0 @@
From: Karol Babioch <kbabioch@suse.com>
Date: Tue Feb 20 17:52:15 CET 2018
Upstream: dead
References: https://sources.debian.org/patches/libid3tag/0.15.1b-13/10_utf16.dpatch/
Subject: Fixes utf16 handling in case of an odd number of bytes
Fixes id3_utf16_deserialize() in utf16.c, which previously misparsed ID3v2 tags
encoded in UTF-16 with an odd number of bytes, triggering an endless loop
allocating memory until OOM leading to DoS. (CVE-2004-2779 bsc#1081959
CVE-2017-11551 bsc#1081961)
---
utf16.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: libid3tag-0.15.1b/utf16.c
===================================================================
--- libid3tag-0.15.1b.orig/utf16.c
+++ libid3tag-0.15.1b/utf16.c
@@ -282,5 +282,18 @@ id3_ucs4_t *id3_utf16_deserialize(id3_by
free(utf16);
+ if (end == *ptr && length % 2 != 0)
+ {
+ /* We were called with a bogus length. It should always
+ * be an even number. We can deal with this in a few ways:
+ * - Always give an error.
+ * - Try and parse as much as we can and
+ * - return an error if we're called again when we
+ * already tried to parse everything we can.
+ * - tell that we parsed it, which is what we do here.
+ */
+ (*ptr)++;
+ }
+
return ucs4;
}

View File

@ -1,272 +0,0 @@
--- configure.ac.orig
+++ configure.ac
@@ -36,7 +36,9 @@ AC_CANONICAL_HOST
dnl Checks for programs.
-AC_PROG_CC
+AC_PROG_CC_STDC
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
if test "$GCC" = yes
then
@@ -61,7 +63,7 @@ dnl Support for libtool.
dnl AC_DISABLE_SHARED
dnl AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
+LT_INIT([disable-static pic-only])
AC_SUBST(LIBTOOL_DEPS)
--- compat.h.orig
+++ compat.h
@@ -24,6 +24,8 @@
# include "id3tag.h"
+#pragma GCC visibility push(hidden)
+
typedef int id3_compat_func_t(struct id3_frame *, char const *,
id3_byte_t const *, id3_length_t);
@@ -38,4 +40,5 @@ struct id3_compat const *id3_compat_look
int id3_compat_fixup(struct id3_tag *);
+#pragma GCC visibility pop
# endif
--- crc.h.orig
+++ crc.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_CRC_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
unsigned long id3_crc_compute(id3_byte_t const *, id3_length_t);
-
+#pragma GCC visibility pop
# endif
--- debug.h.orig
+++ debug.h
@@ -23,12 +23,12 @@
# define LIBID3TAG_DEBUG_H
# include <stdlib.h>
-
+#pragma GCC visibility push(hidden)
void *id3_debug_malloc(size_t, char const *, unsigned int);
void *id3_debug_calloc(size_t, size_t, char const *, unsigned int);
void *id3_debug_realloc(void *, size_t, char const *, unsigned int);
void id3_debug_free(void *, char const *, unsigned int);
void *id3_debug_release(void *, char const *, unsigned int);
-
+#pragma GCC visibility pop
# endif
--- field.h.orig
+++ field.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_FIELD_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
void id3_field_init(union id3_field *, enum id3_field_type);
void id3_field_finish(union id3_field *);
@@ -32,5 +32,5 @@ int id3_field_parse(union id3_field *, i
id3_length_t id3_field_render(union id3_field const *, id3_byte_t **,
enum id3_field_textencoding *, int);
-
+#pragma GCC visibility pop
# endif
--- frame.h.orig
+++ frame.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_FRAME_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
int id3_frame_validid(char const *);
void id3_frame_addref(struct id3_frame *);
@@ -32,5 +32,5 @@ void id3_frame_delref(struct id3_frame *
struct id3_frame *id3_frame_parse(id3_byte_t const **, id3_length_t,
unsigned int);
id3_length_t id3_frame_render(struct id3_frame const *, id3_byte_t **, int);
-
+#pragma GCC visibility pop
# endif
--- frametype.h.orig
+++ frametype.h
@@ -21,7 +21,7 @@
# ifndef LIBID3TAG_FRAMETYPE_H
# define LIBID3TAG_FRAMETYPE_H
-
+#pragma GCC visibility push(hidden)
struct id3_frametype {
char const *id;
unsigned int nfields;
@@ -38,5 +38,5 @@ extern struct id3_frametype const id3_fr
struct id3_frametype const *id3_frametype_lookup(register char const *,
register unsigned int);
-
+#pragma GCC visibility pop
# endif
--- latin1.h.orig
+++ latin1.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_LATIN1_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
id3_length_t id3_latin1_length(id3_latin1_t const *);
id3_length_t id3_latin1_size(id3_latin1_t const *);
@@ -41,5 +41,5 @@ id3_latin1_t id3_latin1_get(id3_byte_t c
id3_length_t id3_latin1_serialize(id3_byte_t **, id3_ucs4_t const *, int);
id3_ucs4_t *id3_latin1_deserialize(id3_byte_t const **, id3_length_t);
-
+#pragma GCC visibility pop
# endif
--- parse.h.orig
+++ parse.h
@@ -21,7 +21,7 @@
# ifndef LIBID3TAG_PARSE_H
# define LIBID3TAG_PARSE_H
-
+#pragma GCC visibility push(hidden)
signed long id3_parse_int(id3_byte_t const **, unsigned int);
unsigned long id3_parse_uint(id3_byte_t const **, unsigned int);
unsigned long id3_parse_syncsafe(id3_byte_t const **, unsigned int);
@@ -30,5 +30,5 @@ id3_latin1_t *id3_parse_latin1(id3_byte_
id3_ucs4_t *id3_parse_string(id3_byte_t const **, id3_length_t,
enum id3_field_textencoding, int);
id3_byte_t *id3_parse_binary(id3_byte_t const **, id3_length_t);
-
+#pragma GCC visibility pop
# endif
--- render.h.orig
+++ render.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_RENDER_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
id3_length_t id3_render_immediate(id3_byte_t **, char const *, unsigned int);
id3_length_t id3_render_syncsafe(id3_byte_t **, unsigned long, unsigned int);
id3_length_t id3_render_int(id3_byte_t **, signed long, unsigned int);
@@ -36,5 +36,5 @@ id3_length_t id3_render_padding(id3_byte
id3_length_t id3_render_paddedstring(id3_byte_t **, id3_ucs4_t const *,
id3_length_t);
-
+#pragma GCC visibility pop
# endif
--- tag.h.orig
+++ tag.h
@@ -23,8 +23,8 @@
# define LIBID3TAG_TAG_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
void id3_tag_addref(struct id3_tag *);
void id3_tag_delref(struct id3_tag *);
-
+#pragma GCC visibility pop
# endif
--- ucs4.h.orig
+++ ucs4.h
@@ -25,7 +25,7 @@
# include "id3tag.h"
# define ID3_UCS4_REPLACEMENTCHAR 0x000000b7L /* middle dot */
-
+#pragma GCC visibility push(hidden)
extern id3_ucs4_t const id3_ucs4_empty[];
id3_length_t id3_ucs4_length(id3_ucs4_t const *);
@@ -37,5 +37,5 @@ id3_length_t id3_ucs4_utf8size(id3_ucs4_
void id3_ucs4_copy(id3_ucs4_t *, id3_ucs4_t const *);
id3_ucs4_t *id3_ucs4_duplicate(id3_ucs4_t const *);
-
+#pragma GCC visibility pop
# endif
--- utf16.h.orig
+++ utf16.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_UTF16_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
enum id3_utf16_byteorder {
ID3_UTF16_BYTEORDER_ANY,
ID3_UTF16_BYTEORDER_BE,
@@ -47,5 +47,5 @@ id3_length_t id3_utf16_serialize(id3_byt
enum id3_utf16_byteorder, int);
id3_ucs4_t *id3_utf16_deserialize(id3_byte_t const **, id3_length_t,
enum id3_utf16_byteorder);
-
+#pragma GCC visibility pop
# endif
--- utf8.h.orig
+++ utf8.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_UTF8_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
id3_length_t id3_utf8_length(id3_utf8_t const *);
id3_length_t id3_utf8_size(id3_utf8_t const *);
@@ -38,5 +38,5 @@ id3_utf8_t id3_utf8_get(id3_byte_t const
id3_length_t id3_utf8_serialize(id3_byte_t **, id3_ucs4_t const *, int);
id3_ucs4_t *id3_utf8_deserialize(id3_byte_t const **, id3_length_t);
-
+#pragma GCC visibility pop
# endif
--- util.h.orig
+++ util.h
@@ -23,7 +23,7 @@
# define LIBID3TAG_UTIL_H
# include "id3tag.h"
-
+#pragma GCC visibility push(hidden)
id3_length_t id3_util_unsynchronise(id3_byte_t *, id3_length_t);
id3_length_t id3_util_deunsynchronise(id3_byte_t *, id3_length_t);
@@ -31,5 +31,5 @@ id3_byte_t *id3_util_compress(id3_byte_t
id3_length_t *);
id3_byte_t *id3_util_decompress(id3_byte_t const *, id3_length_t,
id3_length_t);
-
+#pragma GCC visibility pop
# endif
--- Makefile.am.orig
+++ Makefile.am
@@ -93,7 +93,7 @@ EXTRA_libid3tag_la_SOURCES = \
debug.c debug.h
libid3tag_la_LIBADD = -lz
-libid3tag_la_LDFLAGS = -version-info $(version_info)
+libid3tag_la_LDFLAGS = -no-undefined -version-info $(version_info)
BUILT_SOURCES = frametype.c compat.c genre.dat

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Thu Dec 9 19:22:27 UTC 2021 - Ferdinand Thiessen <rpm@fthiessen.de>
- Update to 0.16.1 from maintained fork by the Tenacity Audio Editor
* Merge various outstanding patches
* Upstream pkg-config file
* Use cmake for build and install cmake files
- Drop merged fixes
* fix-build-with-gperf-3.1.diff
* libid3tag-0.15.1b-mb.diff
* libid3tag-automake-fix.dif
* libid3tag-gperf.dif
* libid3tag-noweak.dif
* libid3tag-optflags.patch
* libid3tag-unknown-encoding.patch
* libid3tag-utf16.patch
* libid3tag-visibility.patch
-------------------------------------------------------------------
Wed Feb 21 10:59:28 UTC 2018 - kbabioch@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package libid3tag
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -12,56 +12,42 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define lname libid3tag0
%define lver 0_16_1
Name: libid3tag
Version: 0.15.1b
Version: 0.16.1
Release: 0
Summary: ID3 Tag Manipulation Library
License: GPL-2.0+
License: GPL-2.0-or-later
Group: Development/Libraries/C and C++
Url: http://www.underbit.com/products/mad/
Source0: ftp://ftp.mars.org/pub/mpeg/%{name}-%{version}.tar.gz
URL: https://github.com/tenacityteam/libid3tag
Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: baselibs.conf
Patch0: libid3tag-noweak.dif
Patch1: libid3tag-gperf.dif
Patch2: libid3tag-0.15.1b-mb.diff
Patch3: libid3tag-automake-fix.dif
Patch4: libid3tag-optflags.patch
Patch5: libid3tag-visibility.patch
# PATCH-FIX-UPSTREAM fix-build-with-gperf-3.1.diff alarrosa@suse.com -- Fix build with gperf 3.1
Patch6: fix-build-with-gperf-3.1.diff
Patch7: libid3tag-utf16.patch
Patch8: libid3tag-unknown-encoding.patch
BuildRequires: c++_compiler
BuildRequires: cmake
BuildRequires: gperf
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: pkgconfig(zlib)
%description
libid3tag is a library for reading and writing ID3 tags, both ID3v1 and
the various versions of ID3v2.
%package -n %{lname}
%package -n %{name}%{lver}
Summary: ID3 Tag Manipulation Library
# O/P added for 12.3
Group: System/Libraries
Obsoletes: libid3tag < %{version}-%{release}
Provides: libid3tag = %{version}-%{release}
%description -n %{lname}
%description -n %{name}%{lver}
libid3tag is a library for reading and writing ID3 tags, both ID3v1 and
the various versions of ID3v2.
%package devel
Summary: Development package for libid3tag library
Group: Development/Libraries/C and C++
Requires: %{lname} = %{version}
Requires: glibc-devel
Requires: %{name}%{lver} = %{version}
%description devel
This package contains the header files and static libraries needed to
@ -69,43 +55,26 @@ develop applications with libid3tag.
%prep
%setup -q
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%if 0%{?suse_version} > 1320
%patch6 -p1
%endif
%patch7 -p1
%patch8 -p1
%build
autoreconf -fiv
%configure \
--disable-static
make %{?_smp_mflags}
echo -e "prefix=%{_prefix}\nexec_prefix=%{_prefix}\nlibdir=%{_libdir}\nincludedir=%{_includedir}\nName: id3tag\nDescription: ID3 tag library\nRequires:\nVersion: %{version}\nLibs: -L%{_libdir} -lid3tag\nCflags: -I%{_includedir}\n" > id3tag.pc
%cmake
%cmake_build
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
install -m 644 -D id3tag.pc %{buildroot}%{_libdir}/pkgconfig/id3tag.pc
rm -f %{buildroot}%{_libdir}/libid3tag*.*a
%cmake_install
%post -n %{lname} -p /sbin/ldconfig
%post -n %{name}%{lver} -p /sbin/ldconfig
%postun -n %{name}%{lver} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%files -n %{lname}
%defattr(-,root,root)
%{_libdir}/libid3tag.so.0*
%files -n %{name}%{lver}
%license COPYING COPYRIGHT
%{_libdir}/libid3tag.so.*
%files devel
%defattr(-,root,root)
%doc CHANGES COPYING COPYRIGHT CREDITS README TODO VERSION
%{_includedir}/*
%doc CHANGES CREDITS README
%{_includedir}/id3tag.h
%{_libdir}/libid3tag.so
%{_libdir}/cmake/id3tag
%{_libdir}/pkgconfig/id3tag.pc
%changelog