debian/0000755000000000000000000000000012265370163007173 5ustar debian/control0000644000000000000000000000502112263647434010602 0ustar Source: libcoverart Section: libs Priority: optional Maintainer: Debian Multimedia Maintainers Uploaders: Sebastian Ramacher Build-Depends: debhelper (>= 9), cmake, libneon27-gnutls-dev| libneon-dev, libjansson-dev Build-Depends-Indep: doxygen Standards-Version: 3.9.5 Homepage: http://musicbrainz.org/doc/libcoverart Vcs-Git: git://anonscm.debian.org/pkg-multimedia/libcoverart.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/libcoverat.git Package: libcoverart-dev Section: libdevel Architecture: any Depends: ${misc:Depends}, libcoverart0 (= ${binary:Version}), libneon27-gnutls-dev | libneon-dev, libjansson-dev Suggests: libcoverart-doc Multi-Arch: same Description: library to access the Cover Art Archive (development files) The Cover Art Archive (CAA) is a joint project between MusicBrainz and Internet Archive that provides a covert art image database for music releases. Libcoverart is a client library to access the data stored in the CAA. . This package contains the development files. Package: libcoverart0 Architecture: any Pre-Depends: ${misc:Pre-Depends}, Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: libcoverart-dbg Multi-Arch: same Description: library to access the Cover Art Archive The Cover Art Archive (CAA) is a joint project between MusicBrainz and Internet Archive that provides a covert art image database for music releases. Libcoverart is a client library to access the data stored in the CAA. . This package contains the shared library. Package: libcoverart-dbg Section: debug Priority: extra Architecture: any Depends: ${misc:Depends}, libcoverart0 (= ${binary:Version}) Multi-Arch: same Description: library to access the Cover Art Archive (debugging symbols) The Cover Art Archive (CAA) is a joint project between MusicBrainz and Internet Archive that provides a covert art image database for music releases. Libcoverart is a client library to access the data stored in the CAA. . This package contains the debugging symbols for the shared library. Package: libcoverart-doc Section: doc Architecture: all Depends: ${misc:Depends}, libjs-jquery Description: library to access the Cover Art Archive (developer documentation) The Cover Art Archive (CAA) is a joint project between MusicBrainz and Internet Archive that provides a covert art image database for music releases. Libcoverart is a client library to access the data stored in the CAA. . This package contains the developer documentation. debian/history/0000755000000000000000000000000012263646071010676 5ustar debian/libcoverart-doc.docs0000644000000000000000000000000612263646071013122 0ustar docs/ debian/libcoverart0.install0000644000000000000000000000002412263646071013155 0ustar usr/lib/*/lib*.so.* debian/changelog0000644000000000000000000000075712265370120011047 0ustar libcoverart (1.0.0+git20140109-2) unstable; urgency=medium * debian/patches/PATH_MAX.patch: Replace the use of PATH_MAX with dynamic memory allocation to fix the build failure on hurd-i386. * debian/watch: Mangle Debian version. -- Sebastian Ramacher Wed, 15 Jan 2014 03:19:15 +0100 libcoverart (1.0.0+git20140109-1) unstable; urgency=low * Initial release (Closes: #714853). -- Sebastian Ramacher Fri, 10 Jan 2014 02:45:09 +0100 debian/libcoverart-dev.install0000644000000000000000000000006612263646071013657 0ustar usr/include/* usr/lib/*/lib*.so usr/lib/*/pkgconfig/* debian/libcoverart-doc.links0000644000000000000000000000012712263646071013316 0ustar usr/share/javascript/jquery/jquery.min.js usr/share/doc/libcoverart-doc/docs/jquery.js debian/compat0000644000000000000000000000000212263646071010373 0ustar 9 debian/rules0000755000000000000000000000333712263646071010263 0ustar #!/usr/bin/make -f export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed %: dh $@ --parallel --builddirectory=$(CURDIR) override_dh_auto_clean: dh_auto_clean rm -rf docs # This needs to be fixed in upstream's build system. rm -f CMakeCache.txt \ Doxyfile \ Makefile \ config.h \ install_manifest.txt \ libcoverart.pc \ ImportExecutables.cmake find -name CMakeFiles -print | xargs /bin/rm -rf find -name Makefile -delete find -name cmake_install.cmake -delete override_dh_auto_configure: dh_auto_configure -- \ -DLIB_SUFFIX=/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_auto_build-indep: $(MAKE) docs rm docs/jquery.js ln -s /usr/share/javascript/jquery/jquery.js docs/jquery.js override_dh_auto_test-indep override_dh_auto_install-indep: # no tests and install for indep override_dh_strip: dh_strip --dbg-package=libcoverart-dbg override_dh_makeshlibs: dh_makeshlibs -V 'libcoverart0 (>= 1.0)' override_dh_installchangelogs: dh_installchangelogs NEWS.txt DEB_DEBDIR=$(dir $(firstword $(MAKEFILE_LIST))) DEB_UPSTREAM_VER=$(shell dpkg-parsechangelog -l$(DEB_DEBDIR)/changelog \ | sed -ne 's/^Version: \(.*\)-[^-]*/\1/p' | sed -ne 's/^\([^+]*\)+git.*/\1/p') COMMIT=39dd2c520b6c225b3c3186553bfe89f37f403a41 get-orig-source: TMPD=`mktemp -d` && \ git clone https://github.com/metabrainz/libcoverart \ "$$TMPD/libcoverart" && \ git --git-dir="$$TMPD/libcoverart/.git" archive \ --prefix=libcoverart/ $(COMMIT) | \ xz > $$TMPD/libcoverart.tar.xz && \ CDATE=`git --git-dir="$$TMPD/libcoverart/.git" show \ --format=format:%ci -s $(COMMIT) | \ awk '{ gsub(/-/,""); print $$1 }'` && \ mv $$TMPD/libcoverart.tar.xz \ libcoverart_$(DEB_UPSTREAM_VER)+git$$CDATE.orig.tar.xz && \ rm -rf $$TMPD debian/copyright0000644000000000000000000000235512263646071011135 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: libcoverart Upstream-Contact: Andy Hawkins Source: http://musicbrainz.org/doc/libcoverart Files: * Copyright: 2012 Andy Hawkins License: LGPL-2.1+ Files: src/xmlParser.* Copyright: 2012 Christophe Fergeau License: LGPL-2.1+ Files: debian/* Copyright: 2014 Sebastian Ramacher License: LGPL-2.1+ License: LGPL-2.1+ 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. . libcoverart 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 General Public License along with this library. If not, see . . On Debian GNU/Linux systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2.1'. debian/dirs/0000755000000000000000000000000012263646071010136 5ustar debian/source/0000755000000000000000000000000012263646071010475 5ustar debian/source/format0000644000000000000000000000001412263646071011703 0ustar 3.0 (quilt) debian/gbp.conf0000644000000000000000000000014112263646332010610 0ustar [DEFAULT] pristine-tar = True debian-branch = master upstream-branch = upstream compression = xz debian/patches/0000755000000000000000000000000012265367532010630 5ustar debian/patches/series0000644000000000000000000000005012265367542012041 0ustar remove-unused-code.patch PATH_MAX.patch debian/patches/PATH_MAX.patch0000644000000000000000000001220312265367532013110 0ustar Description: Replace PATH_MAX with dynamic memory allocation Author: Sebastian Ramacher Last-Update: 2014-01-15 Forwarded: https://github.com/metabrainz/libcoverart diff --git a/examples/example_c.c b/examples/example_c.c index a4ddd12..6a05831 100644 --- a/examples/example_c.c +++ b/examples/example_c.c @@ -23,6 +23,7 @@ ----------------------------------------------------------------------------*/ +#include #include #include #include @@ -44,9 +45,12 @@ int main(int argc, const char *argv[]) { if (0!=caa_imagedata_size(ImageData)) { - char FileName[PATH_MAX]; + int size; + char *FileName; FILE *fptr; + size=snprintf(NULL,0,"%s-front.jpg",ReleaseID); + FileName=malloc((size+1) * sizeof(char)); sprintf(FileName,"%s-front.jpg",ReleaseID); printf("Saving front to '%s'\n",FileName); @@ -57,6 +61,8 @@ int main(int argc, const char *argv[]) fclose(fptr); printf("Saved front to '%s'\n",FileName); } + + free(FileName); } else { @@ -71,9 +77,12 @@ int main(int argc, const char *argv[]) { if (0!=caa_imagedata_size(ImageData)) { - char FileName[PATH_MAX]; + int size; + char *FileName; FILE *fptr; + size=snprintf(NULL,0,"%s-back.jpg",ReleaseID); + FileName=malloc((size+1) * sizeof(char)); sprintf(FileName,"%s-back.jpg",ReleaseID); printf("Saving back to '%s'\n",FileName); @@ -84,6 +93,8 @@ int main(int argc, const char *argv[]) fclose(fptr); printf("Saved back to '%s'\n",FileName); } + + free(FileName); } else { @@ -109,14 +120,25 @@ int main(int argc, const char *argv[]) CaaImage Image=caa_image_list_item(ImageList,ImageNum); if (Image) { - char ID[PATH_MAX]; - char Comment[PATH_MAX]; - char URL[PATH_MAX]; + char *ID; + char *Comment; + char *URL; + int ID_size; + int Comment_size; + int URL_size; CaaThumbnails Thumbnails=caa_image_get_thumbnails(Image); - caa_image_get_id(Image,ID,sizeof(ID)); - caa_image_get_comment(Image,Comment,sizeof(Comment)); - caa_image_get_image(Image,URL,sizeof(URL)); + ID_size=caa_image_get_id(Image, NULL, 0) + 1; + Comment_size=caa_image_get_comment(Image, NULL, 0) + 1; + URL_size=caa_image_get_image(Image, NULL, 0) + 1; + + ID=malloc(ID_size * sizeof(char)); + Comment=malloc(Comment_size * sizeof(char)); + URL=malloc(URL_size * sizeof(char)); + + caa_image_get_id(Image,ID,ID_size); + caa_image_get_comment(Image,Comment,Comment_size); + caa_image_get_image(Image,URL,URL_size); printf("\nApproved: %d\n",caa_image_get_approved(Image)); printf("Back: %d\n",caa_image_get_back(Image)); @@ -131,9 +153,12 @@ int main(int argc, const char *argv[]) { if (0!=caa_imagedata_size(ImageData)) { - char FileName[PATH_MAX]; + int size; + char *FileName; FILE *fptr; + size=snprintf(NULL,0,"%s-%s-full.jpg",ReleaseID,ID); + FileName=malloc((size+1) * sizeof(char)); sprintf(FileName,"%s-%s-full.jpg",ReleaseID,ID); printf("Saving full for '%s' to '%s'\n",ID,FileName); @@ -144,6 +169,8 @@ int main(int argc, const char *argv[]) fclose(fptr); printf("Saved full to '%s'\n",FileName); } + + free(FileName); } caa_imagedata_delete(ImageData); @@ -158,9 +185,12 @@ int main(int argc, const char *argv[]) { if (0!=caa_imagedata_size(ImageData)) { - char FileName[PATH_MAX]; + int size; + char *FileName; FILE *fptr; + size=snprintf(NULL,0,"%s-%s-500.jpg",ReleaseID,ID); + FileName=malloc((size+1) * sizeof(char)); sprintf(FileName,"%s-%s-500.jpg",ReleaseID,ID); printf("Saving 500 for '%s' to '%s'\n",ID,FileName); @@ -171,6 +201,8 @@ int main(int argc, const char *argv[]) fclose(fptr); printf("Saved 500 to '%s'\n",FileName); } + + free(FileName); } caa_imagedata_delete(ImageData); @@ -183,9 +215,12 @@ int main(int argc, const char *argv[]) { if (0!=caa_imagedata_size(ImageData)) { - char FileName[PATH_MAX]; + int size; + char *FileName; FILE *fptr; + size=snprintf(NULL,0,"%s-%s-250.jpg",ReleaseID,ID); + FileName=malloc((size+1) * sizeof(char)); sprintf(FileName,"%s-%s-250.jpg",ReleaseID,ID); printf("Saving 250 for '%s' to '%s'\n",ID,FileName); @@ -196,6 +231,8 @@ int main(int argc, const char *argv[]) fclose(fptr); printf("Saved 250 to '%s'\n",FileName); } + + free(FileName); } caa_imagedata_delete(ImageData); @@ -203,6 +240,10 @@ int main(int argc, const char *argv[]) } } } + + free(ID); + free(Comment); + free(URL); } } } debian/patches/remove-unused-code.patch0000644000000000000000000000503112263646071015352 0ustar Description: remove unused code CAA_C_EXT_GETTER, GetMapName and GetMapValue are not used anywhere. Also, GetMapName and GetMapValue should be static if they were used. Author: Sebastian Ramacher Forwarded: not-needed Last-Update: 2013-11-05 --- libcoverart-1.0.0.orig/src/c-int-source-funcs.inc +++ libcoverart-1.0.0/src/c-int-source-funcs.inc @@ -27,7 +27,6 @@ #include "coverart/caa_c.h" #include -#include #include #include "coverart/CoverArt.h" @@ -39,50 +38,6 @@ #include "coverart/Type.h" #include "coverart/TypeList.h" -std::string GetMapName(std::map Map, int Item) -{ - std::string Ret; - - if (Item<(int)Map.size()) - { - std::map::const_iterator ThisItem=Map.begin(); - - int count=0; - - while (count Map, int Item) -{ - std::string Ret; - - if (Item<(int)Map.size()) - { - std::map::const_iterator ThisItem=Map.begin(); - - int count=0; - - while (countExt##PROP1##s().size(); \ - } \ - return 0; \ - } \ - int \ - caa_entity_ext_##PROP2##_name(CaaEntity o, int Item, char *str, int len) \ - { \ - int ret=0; \ - if (str) \ - *str=0; \ - if (o) \ - { \ - std::map Items=((CoverArtArchive::CEntity *)o)->Ext##PROP1##s(); \ - std::string Name=GetMapName(Items,Item); \ - ret=Name.length(); \ - if (str && len) \ - { \ - strncpy(str, Name.c_str(), len); \ - str[len-1]='\0'; \ - } \ - } \ - return ret; \ - } \ - int \ - caa_entity_ext_##PROP2##_value(CaaEntity o, int Item, char *str, int len) \ - { \ - int ret=0; \ - if (str) \ - *str=0; \ - if (o) \ - { \ - std::map Items=((CoverArtArchive::CEntity *)o)->Ext##PROP1##s(); \ - std::string Name=GetMapValue(Items,Item); \ - ret=Name.length(); \ - if (str && len) \ - { \ - strncpy(str, Name.c_str(), len); \ - str[len-1]='\0'; \ - } \ - } \ - return ret; \ - } \ - debian/libcoverart-doc.doc-base0000644000000000000000000000040312263650675013655 0ustar Document: libcoverart Title: libcoverart API documentation Abstract: This documentation describes libcoverart's API. Section: Programming/C Format: HTML Index: /usr/share/doc/libcoverart-doc/docs/index.html Files: /usr/share/doc/libcoverart-doc/docs/*.html debian/libcoverart-doc.examples0000644000000000000000000000003412263646071014011 0ustar examples/*.c examples/*.cpp debian/watch0000644000000000000000000000016412265367365010237 0ustar version=3 opts=dversionmangle=s/\+git\d+$// \ http://musicbrainz.org/doc/libcoverart .*/libcoverart-(.*)\.tar\.gz