]>
Commit | Line | Data |
---|---|---|
fefa06f9 | 1 | %define realname libvorbis |
2 | Summary: The Vorbis General Audio Compression Codec - Mingw32 cross version | |
46df40d7 | 3 | Summary(pl.UTF-8): Kodek kompresji audio - Vorbis - wersja skrośna dla Mingw32 |
fefa06f9 | 4 | Name: crossmingw32-%{realname} |
5 | Version: 1.1.2 | |
6 | Release: 1 | |
7 | License: BSD | |
8 | Group: Libraries | |
9 | Source0: http://downloads.xiph.org/releases/vorbis/%{realname}-%{version}.tar.gz | |
10 | # Source0-md5: 37847626b8e1b53ae79a34714c7b3211 | |
11 | Patch0: %{realname}-ac_fixes.patch | |
12 | Patch1: %{realname}-make.patch | |
13 | URL: http://www.vorbis.com/ | |
14 | BuildRequires: crossmingw32-gcc | |
15 | BuildRequires: crossmingw32-libogg | |
16 | BuildRequires: crossmingw32-w32api | |
17 | BuildRequires: pkgconfig | |
18 | Requires: crossmingw32-libogg | |
19 | Requires: crossmingw32-runtime | |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
21 | ||
22 | %define no_install_post_strip 1 | |
23 | ||
24 | %define target i386-mingw32 | |
25 | %define target_platform i386-pc-mingw32 | |
26 | %define arch %{_prefix}/%{target} | |
27 | %define gccarch %{_prefix}/lib/gcc-lib/%{target} | |
28 | %define gcclib %{_prefix}/lib/gcc-lib/%{target}/%{version} | |
29 | ||
30 | %define __cc %{target}-gcc | |
31 | %define __cxx %{target}-g++ | |
32 | ||
33 | %ifarch alpha sparc sparc64 sparcv9 | |
34 | %define optflags -O2 | |
35 | %endif | |
36 | ||
37 | %description | |
38 | Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, | |
39 | general-purpose compressed audio format for audio and music at fixed | |
40 | and variable bitrates from 16 to 128 kbps/channel. | |
41 | ||
17e12ff9 JR |
42 | %description -l pl.UTF-8 |
43 | Ogg Vorbis jest całkowicie otwartym, nie będącym niczyją własnością, | |
44 | wolnym od patentów, ogólnego przeznaczenia kodekiem audio i muzyki o | |
45 | stałej i zmiennej bitrate od 16 do 128 kbps/kanał. | |
fefa06f9 | 46 | |
47 | %package dll | |
48 | Summary: %{realname} - DLL library for Windows | |
46df40d7 | 49 | Summary(pl.UTF-8): %{realname} - biblioteka DLL dla Windows |
fefa06f9 | 50 | Group: Applications/Emulators |
51 | ||
52 | %description dll | |
53 | %{realname} - DLL library for Windows. | |
54 | ||
17e12ff9 | 55 | %description dll -l pl.UTF-8 |
fefa06f9 | 56 | %{realname} - biblioteka DLL dla Windows. |
57 | ||
58 | %prep | |
59 | %setup -q -n %{realname}-%{version} | |
60 | %patch0 -p1 | |
61 | %patch1 -p1 | |
62 | ||
63 | %build | |
64 | CC=%{target}-gcc ; export CC | |
65 | CXX=%{target}-g++ ; export CXX | |
66 | LD=%{target}-ld ; export LD | |
67 | AR=%{target}-ar ; export AR | |
68 | AS=%{target}-as ; export AS | |
69 | CROSS_COMPILE=1 ; export CROSS_COMPILE | |
70 | CPPFLAGS="-I%{arch}/include" ; export CPPFLAGS | |
71 | RANLIB=%{target}-ranlib ; export RANLIB | |
72 | LDSHARED="%{target}-gcc -shared" ; export LDSHARED | |
73 | TARGET="%{target}" ; export TARGET | |
74 | ||
75 | %configure \ | |
76 | --host=%{_host} \ | |
77 | --target=%{target} | |
78 | ||
79 | for i in mdct.c smallft.c block.c envelope.c window.c lsp.c lpc.c analysis.c synthesis.c psy.c info.c floor1.c floor0.c \ | |
80 | res0.c mapping0.c registry.c codebook.c sharedbook.c lookup.c bitrate.c | |
81 | do | |
82 | %{__cc} %{rpmcflags} -c lib/$i -Iinclude | |
83 | done | |
84 | ||
85 | rm -f libvorbis.a | |
86 | $AR cru libvorbis.a *.o | |
87 | $RANLIB libvorbis.a | |
88 | ||
89 | %{__cc} --shared *.o -Wl,--enable-auto-image-base -o vorbis.dll -Wl,--out-implib,libvorbis.dll.a `pkg-config --libs i386-mingw32-ogg` | |
90 | ||
91 | ||
92 | %{__cc} %{rpmcflags} -c lib/vorbisenc.c -Iinclude -Ilib | |
93 | %{__cc} %{rpmcflags} -c lib/vorbisfile.c -Iinclude | |
94 | ||
95 | rm -f libvorbisenc.a | |
96 | $AR cru libvorbisenc.a vorbisenc.o | |
97 | $RANLIB libvorbisenc.a | |
98 | ||
99 | %{__cc} --shared vorbisenc.o -Wl,--enable-auto-image-base -o vorbisenc.dll -Wl,--out-implib,libvorbisenc.dll.a -lvorbis -L. | |
100 | ||
101 | rm -f libvorbisfile.a | |
102 | $AR cru libvorbisfile.a vorbisfile.o | |
103 | $RANLIB libvorbisfile.a | |
104 | ||
105 | %{__cc} --shared vorbisfile.o -Wl,--enable-auto-image-base -o vorbisfile.dll -Wl,--out-implib,libvorbisfile.dll.a `pkg-config --libs i386-mingw32-ogg` -lvorbis -L. | |
106 | ||
107 | %if 0%{!?debug:1} | |
108 | %{target}-strip *.dll | |
109 | %{target}-strip -g -R.comment -R.note *.a | |
110 | %endif | |
111 | ||
112 | sed -i -e 's@libdir=/usr/lib@libdir=%{arch}/lib@' \ | |
113 | -e 's@includedir=/usr/include@includedir=%{arch}/include@' \ | |
114 | vorbis.pc vorbisenc.pc vorbisfile.pc | |
115 | ||
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | install -d $RPM_BUILD_ROOT%{arch}/{include/vorbis,lib} | |
119 | install -d $RPM_BUILD_ROOT%{_datadir}/wine/windows/system | |
120 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
121 | ||
122 | install include/vorbis/*.h $RPM_BUILD_ROOT%{arch}/include/vorbis | |
123 | install libvorbis*.a $RPM_BUILD_ROOT%{arch}/lib | |
124 | install vorbis*.dll $RPM_BUILD_ROOT%{_datadir}/wine/windows/system | |
125 | ||
126 | install vorbis.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/i386-mingw32-vorbis.pc | |
127 | install vorbisenc.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/i386-mingw32-vorbisenc.pc | |
128 | install vorbisfile.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/i386-mingw32-vorbisfile.pc | |
129 | ||
130 | %clean | |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
133 | %files | |
134 | %defattr(644,root,root,755) | |
135 | %{arch}/include/vorbis | |
136 | %{arch}/lib/* | |
137 | %{_pkgconfigdir}/* | |
138 | ||
139 | %files dll | |
140 | %defattr(644,root,root,755) | |
141 | %{_datadir}/wine/windows/system/* |