add packaging
[platform/upstream/flac.git] / packaging / flac.spec
1 Name:           flac
2 BuildRequires:  gcc-c++
3 BuildRequires:  gettext-tools
4 BuildRequires:  libogg-devel
5 BuildRequires:  libtool
6 BuildRequires:  pkg-config
7 %ifarch %{ix86}
8 BuildRequires:  nasm
9 %endif
10 Version:        1.2.1
11 Release:        0
12 License:        BSD-3-Clause
13 Summary:        Free Lossless Audio Codec
14 Url:            http://flac.sourceforge.net/
15 Group:          Productivity/Multimedia/Sound/Utilities
16 Source:         %{name}-%{version}.tar.bz2
17 Patch0:         flac-no-xmms.diff
18 Patch1:         flac-printf-format-fix.diff
19 Patch2:         flac-gcc43-fixes.diff
20 Patch3:         flac-1.2.1-asm.patch
21 Patch4:         flac-1.2.1-bitreader.patch
22 Patch5:         flac-ocloexec.patch
23 Patch6:         flac-visibility.patch
24 Patch7:         flac-leaks.patch
25 Patch8:         flac-disable-hidden-visibility-for-ppc.patch
26 Patch9:         flac-gcc47.patch
27 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
28
29 %description
30 FLAC is an open source lossless audio codec developed by Josh Coalson.
31
32 %package -n libflac
33 Summary:        Free Lossless Audio Codec Library
34 Group:          System/Libraries
35
36 %description -n libflac
37 This package contains the library for FLAC (Free Lossless Audio Codec)
38 developed by Josh Coalson.
39
40 %package -n libflac++
41 Summary:        Free Lossless Audio Codec Library
42 Group:          System/Libraries
43
44 %description -n libflac++
45 This package contains the C++ library for FLAC (Free Lossless Audio
46 Codec) developed by Josh Coalson.
47
48 %package devel
49 Summary:        FLAC Library Development Package
50 Group:          Development/Libraries/C and C++
51 Requires:       glibc-devel
52 Requires:       libflac = %{version}
53 Requires:       libflac = %{version}
54 Requires:       libstdc++-devel
55
56 %description devel
57 This package contains the files needed to compile programs that use the
58 FLAC library.
59
60 %prep
61 %setup -q
62 %patch0
63 %patch1
64 %patch2
65 %patch3 -p1
66 %patch4
67 %patch5
68 %patch6
69 %patch7
70 %patch9 -p1
71
72 %build
73 autoreconf --force --install
74 %define warn_flags -O3 -W -Wall -Wstrict-prototypes -Wformat-security
75 export CFLAGS="%{optflags} %{warn_flags}"
76 export CXXFLAGS="$CFLAGS"
77 %configure  --disable-thorough-tests --disable-exhaustive-tests\
78     --disable-xmms-plugin \
79         --disable-static \
80         --disable-rpath \
81         --with-pic \
82     --enable-sse
83
84 make %{?_smp_mflags}
85
86 %install
87 %make_install
88 # documents
89 mkdir -p %{buildroot}%{_docdir}
90 mv %{buildroot}%{_datadir}/doc/%{name}-%{version} %{buildroot}%{_docdir}/%{name}
91 cp -a AUTHORS README COPYING.* %{buildroot}%{_docdir}/%{name}
92
93 %post -n libflac -p /sbin/ldconfig
94
95 %postun -n libflac -p /sbin/ldconfig
96
97 %post -n libflac++ -p /sbin/ldconfig
98
99 %postun -n libflac++ -p /sbin/ldconfig
100
101 %files
102 %defattr(-, root, root)
103 %doc %{_docdir}/%{name}
104 %{_bindir}/*
105 %{_mandir}/man*/*
106
107 %files -n libflac
108 %defattr(-, root, root)
109 %{_libdir}/libFLAC.so.8*
110
111 %files -n libflac++
112 %defattr(-, root, root)
113 %{_libdir}/libFLAC++.so.6*
114
115 %files devel
116 %defattr(-, root, root)
117 %{_libdir}/lib*.so
118 %{_includedir}/*
119 %{_libdir}/pkgconfig/*.pc
120 %{_datadir}/aclocal/*.m4