From 26b6c7a1ba5f7fd8d71b07a8de538df298956b10 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sun, 4 Nov 2012 07:26:25 -0800 Subject: [PATCH] packaging: Intial packaging for Tizen Change-Id: I57675e03bbc6c057dffd74403cc2d14ef73ce566 --- packaging/baselibs.conf | 5 + packaging/libvorbis-pkgconfig.patch | 37 +++++++ packaging/libvorbis.spec | 201 ++++++++++++++++++++++++++++++++++++ packaging/vorbis-fix-linking.patch | 24 +++++ packaging/vorbis-ocloexec.patch | 82 +++++++++++++++ 5 files changed, 349 insertions(+) create mode 100644 packaging/baselibs.conf create mode 100644 packaging/libvorbis-pkgconfig.patch create mode 100644 packaging/libvorbis.spec create mode 100644 packaging/vorbis-fix-linking.patch create mode 100644 packaging/vorbis-ocloexec.patch diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf new file mode 100644 index 0000000..6f125dd --- /dev/null +++ b/packaging/baselibs.conf @@ -0,0 +1,5 @@ +libvorbis0 + targettype 32bit provides "libvorbis- = 1.3.2" + targettype 64bit obsoletes "libvorbis- < 1.3.2" +libvorbisenc2 +libvorbisfile3 diff --git a/packaging/libvorbis-pkgconfig.patch b/packaging/libvorbis-pkgconfig.patch new file mode 100644 index 0000000..005da90 --- /dev/null +++ b/packaging/libvorbis-pkgconfig.patch @@ -0,0 +1,37 @@ +Index: vorbis.pc.in +================================================================================ +--- vorbis.pc.in ++++ vorbis.pc.in +@@ -8,7 +8,8 @@ + Name: vorbis + Description: vorbis is the primary Ogg Vorbis library + Version: @VERSION@ +-Requires: ogg ++Requires.private: ogg + Conflicts: +-Libs: -L${libdir} -lvorbis -lm ++Libs: -L${libdir} -lvorbis ++Libs.private: -lm + Cflags: -I${includedir} +--- vorbisenc.pc.in ++++ vorbisenc.pc.in +@@ -8,7 +8,7 @@ + Name: vorbisenc + Description: vorbisenc is a library that provides a convenient API for setting up an encoding environment using libvorbis + Version: @VERSION@ +-Requires: vorbis ++Requires.private: vorbis + Conflicts: + Libs: -L${libdir} -lvorbisenc + Cflags: -I${includedir} +--- vorbisfile.pc.in ++++ vorbisfile.pc.in +@@ -8,7 +8,7 @@ + Name: vorbisfile + Description: vorbisfile is a library that provides a convenient high-level API for decoding and basic manipulation of all Vorbis I audio streams + Version: @VERSION@ +-Requires: vorbis ++Requires.private: vorbis + Conflicts: + Libs: -L${libdir} -lvorbisfile + Cflags: -I${includedir} diff --git a/packaging/libvorbis.spec b/packaging/libvorbis.spec new file mode 100644 index 0000000..6d93294 --- /dev/null +++ b/packaging/libvorbis.spec @@ -0,0 +1,201 @@ +# +# spec file for package libvorbis +# +# Copyright (c) 2012 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# 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/ +# + + +Name: libvorbis +Version: 1.3.3 +Release: 0 +License: BSD-3-Clause +#to_be_filled_by_service +Summary: The Vorbis General Audio Compression Codec +Url: http://www.vorbis.com/ +Group: System/Libraries +# bug437293 (SLES10 -> SLES11 upgrade path) +%ifarch ppc64 +Obsoletes: libvorbis-64bit +%endif +# +Source: %{name}-%{version}.tar.bz2 +Source2: baselibs.conf +Patch1: libvorbis-lib64.dif +Patch2: libvorbis-m4.dif +# URL http://www.geocities.jp/aoyoume/aotuv/ +# 'Patch5: libvorbis-%%{version}-aotuv-b5.7.diff' +# PATCH-FIX-UPSTREAM libvorbis-pkgconfig.patch https://trac.xiph.org/ticket/1759 reddwarf@opensuse.org -- Use Requires/Libs.private to avoid overlinking +Patch10: libvorbis-pkgconfig.patch +Patch11: vorbis-fix-linking.patch +Patch12: vorbis-ocloexec.patch +BuildRequires: fdupes +BuildRequires: libogg-devel +BuildRequires: libtool +BuildRequires: pkgconfig +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +Vorbis is a fully open, nonproprietary, patent-and-royalty-free, and +general-purpose compressed audio format for audio and music at fixed +and variable bit rates from 16 to 128 kbps/channel. + +The native bitstream format of Vorbis is libogg (Ogg). Alternatively, +libmatroska (matroska) can also be used. + +%package -n libvorbis0 + +Summary: The Vorbis General Audio Compression Codec +Group: System/Libraries +# bug437293 (SLES10 -> SLES11 upgrade path) +%ifarch ppc64 +Obsoletes: libvorbis-64bit +%endif +# +# libvorbis was last used in openSUSE 11.3 +Provides: %{name} = 1.3.2 +Obsoletes: %{name} < 1.3.2 + +%description -n libvorbis0 +Vorbis is a fully open, nonproprietary, patent-and-royalty-free, and +general-purpose compressed audio format for audio and music at fixed +and variable bit rates from 16 to 128 kbps/channel. + +The native bitstream format of Vorbis is libogg (Ogg). Alternatively, +libmatroska (matroska) can also be used. + +%package -n libvorbisenc2 + +Summary: The Vorbis General Audio Compression Codec +Group: System/Libraries + +%description -n libvorbisenc2 +Vorbis is a fully open, nonproprietary, patent-and-royalty-free, and +general-purpose compressed audio format for audio and music at fixed +and variable bit rates from 16 to 128 kbps/channel. + +The native bitstream format of Vorbis is libogg (Ogg). Alternatively, +libmatroska (matroska) can also be used. + +%package -n libvorbisfile3 + +Summary: The Vorbis General Audio Compression Codec +Group: System/Libraries + +%description -n libvorbisfile3 +Vorbis is a fully open, nonproprietary, patent-and-royalty-free, and +general-purpose compressed audio format for audio and music at fixed +and variable bit rates from 16 to 128 kbps/channel. + +The native bitstream format of Vorbis is libogg (Ogg). Alternatively, +libmatroska (matroska) can also be used. + +%package devel +Summary: Include Files and Libraries mandatory for Ogg Vorbis Development +Group: Development/Libraries/C and C++ +Requires: glibc-devel +Requires: libogg-devel +Requires: libvorbis0 = %{version} +Requires: libvorbisenc2 = %{version} +Requires: libvorbisfile3 = %{version} +# bug437293 (SLES10 -> SLES11 upgrade path) +%ifarch ppc64 +Obsoletes: libvorbis-devel-64bit +%endif +# + +%description devel +This package contains all necessary include files and libraries needed +to compile and develop applications that use libvorbis. + +%package doc +Summary: Documentation of Ogg/Vorbis library +Group: Documentation/Other +%if 0%{?suse_version} >= 1120 +BuildArch: noarch +%endif + +%description doc +This package contains documents for Ogg/Vorbis library, including the +API reference. + +%prep +%setup -q +%patch2 +# %%patch5 -p1 +%patch10 +if [ "%{_lib}" == "lib64" ]; then +%patch1 +fi +%patch11 +%patch12 + +%build +# Fix optimization level +sed -i s,-O20,-O3,g configure.ac + +autoreconf -fiv +%configure --disable-examples --disable-static +make %{?_smp_mflags} + +%check +make check + +%install +%make_install +mkdir -p %{buildroot}%{_docdir}/%{name} +mv %{buildroot}%{_datadir}/doc/libvorbis-* %{buildroot}%{_docdir}/%{name} +install -c -m 0644 doc/Vorbis_I_spec.* %{buildroot}%{_docdir}/%{name} +# remove unneeded files +rm -f %{buildroot}%{_libdir}/*.la +find %{buildroot}%{_docdir}/ -empty -delete +%fdupes -s %{buildroot}%{_docdir} + + +%post -n libvorbis0 -p /sbin/ldconfig + +%postun -n libvorbis0 -p /sbin/ldconfig + +%post -n libvorbisenc2 -p /sbin/ldconfig + +%postun -n libvorbisenc2 -p /sbin/ldconfig + +%post -n libvorbisfile3 -p /sbin/ldconfig + +%postun -n libvorbisfile3 -p /sbin/ldconfig + +%files -n libvorbis0 +%defattr(0644,root,root,0755) +%{_libdir}/libvorbis.so.0* + +%files -n libvorbisenc2 +%defattr(0644,root,root,0755) +%{_libdir}/libvorbisenc.so.2* + +%files -n libvorbisfile3 +%defattr(0644,root,root,0755) +%{_libdir}/libvorbisfile.so.3* + +%files devel +%defattr(-,root,root) +%doc COPYING AUTHORS README *.txt +%{_datadir}/aclocal/*.m4 +%{_includedir}/vorbis +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/*.pc + +%files doc +%defattr(-,root,root) +%doc %{_docdir}/%{name} + +%changelog diff --git a/packaging/vorbis-fix-linking.patch b/packaging/vorbis-fix-linking.patch new file mode 100644 index 0000000..826fab9 --- /dev/null +++ b/packaging/vorbis-fix-linking.patch @@ -0,0 +1,24 @@ +--- Makefile.am 2010-12-21 17:46:03.000000000 +0900 ++++ Makefile.am 2012-06-16 15:43:41.143756104 +0900 +@@ -1,8 +1,8 @@ + ## Process this file with automake to produce Makefile.in + + #AUTOMAKE_OPTIONS = 1.7 foreign dist-zip dist-bzip2 +-AUTOMAKE_OPTIONS = foreign 1.11 dist-zip dist-xz +- ++AUTOMAKE_OPTIONS = foreign 1.10 dist-zip ++ACLOCAL_AMFLAGS = -I m4 + SUBDIRS = m4 include vq lib test doc + + if BUILD_EXAMPLES +--- configure.ac 2012-02-04 07:00:34.000000000 +0900 ++++ configure.ac 2012-06-16 15:43:05.647225479 +0900 +@@ -8,7 +8,7 @@ + AC_INIT([libvorbis],[1.3.3],[vorbis-dev@xiph.org]) + + AC_CONFIG_SRCDIR([lib/mdct.c]) +- ++AC_CONFIG_MACRO_DIR([m4]) + AC_CANONICAL_TARGET([]) + + AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION) diff --git a/packaging/vorbis-ocloexec.patch b/packaging/vorbis-ocloexec.patch new file mode 100644 index 0000000..71a56fc --- /dev/null +++ b/packaging/vorbis-ocloexec.patch @@ -0,0 +1,82 @@ +--- lib/analysis.c.orig ++++ lib/analysis.c +@@ -73,7 +73,7 @@ void _analysis_output_always(char *base, + char buffer[80]; + + sprintf(buffer,"%s_%d.m",base,i); +- of=fopen(buffer,"w"); ++ of=fopen(buffer,"we"); + + if(!of)perror("failed to open data dump file"); + +--- lib/floor1.c.orig ++++ lib/floor1.c +@@ -899,7 +899,7 @@ int floor1_encode(oggpack_buffer *opb,vo + char buffer[80]; + sprintf(buffer,"line_%dx%ld_class%d.vqd", + vb->pcmend/2,posts-2,class); +- of=fopen(buffer,"a"); ++ of=fopen(buffer,"ae"); + fprintf(of,"%d\n",cval); + fclose(of); + } +@@ -923,7 +923,7 @@ int floor1_encode(oggpack_buffer *opb,vo + char buffer[80]; + sprintf(buffer,"line_%dx%ld_%dsub%d.vqd", + vb->pcmend/2,posts-2,class,bookas[k]); +- of=fopen(buffer,"a"); ++ of=fopen(buffer,"ae"); + fprintf(of,"%d\n",out[j+k]); + fclose(of); + } +--- lib/psytune.c.orig ++++ lib/psytune.c +@@ -202,7 +202,7 @@ void analysis(char *base,int i,float *v, + FILE *of; + char buffer[80]; + sprintf(buffer,"%s_%d.m",base,i); +- of=fopen(buffer,"w"); ++ of=fopen(buffer,"we"); + + for(j=0;jsubmap,j,k); +- of=fopen(buffer,"a"); ++ of=fopen(buffer,"ae"); + + for(l=0;lentries;l++) + fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]); +@@ -462,7 +462,7 @@ static long **_01class(vorbis_block *vb, + + for(i=0;itrain_seq); +- of=fopen(buffer,"a"); ++ of=fopen(buffer,"ae"); + for(j=0;jtrain_seq); +- of=fopen(buffer,"a"); ++ of=fopen(buffer,"ae"); + for(i=0;i