]> git.pld-linux.org Git - packages/libvpx.git/blob - libvpx.spec
add static_libs bcond
[packages/libvpx.git] / libvpx.spec
1 #
2 # Conditional build:
3 %bcond_without  asm             # x86 assembler
4 %bcond_without  doc             # don't build doc
5 %bcond_with     tests           # build tests (not useful, creates libgtest.a)
6 %bcond_without  ssse3           # use SSSE3 instructions (Intel since Core2, Via Nano)
7 %bcond_without  static_libs     # static library
8
9 %ifnarch %{ix86} %{x8664} x32
10 %undefine       with_asm
11 %endif
12
13 %if "%{pld_release}" == "ac"
14 # not supported by compiler
15 %undefine       with_ssse3
16 %endif
17
18 Summary:        VP8, a high-quality video codec
19 Summary(pl.UTF-8):      VP8 - kodek obrazu wysokiej jakości
20 Name:           libvpx
21 Version:        1.14.0
22 Release:        1
23 License:        BSD
24 Group:          Libraries
25 # original download URL: http://downloads.webmproject.org/releases/webm/index.html
26 # ...but use github mirror to get consistent tarballs
27 #Source0Download: https://github.com/webmproject/libvpx/tags
28 Source0:        https://github.com/webmproject/libvpx/archive/v%{version}/%{name}-%{version}.tar.gz
29 # Source0-md5:  026bc289d916624dabdfd713c1c5b69a
30 URL:            https://www.webmproject.org/
31 BuildRequires:  doxygen
32 BuildRequires:  libstdc++-devel
33 BuildRequires:  perl-base
34 BuildRequires:  pkgconfig
35 BuildRequires:  rpmbuild(macros) >= 1.673
36 BuildRequires:  sed >= 4.0
37 %{?with_asm:BuildRequires:      yasm >= 0.8}
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %define generic_target  generic-gnu
41 %define vpxtarget       %{generic_target}
42 %ifarch %{x8664}
43 %define vpxtarget       x86_64-linux-gcc
44 %endif
45 %ifarch %{ix86}
46 %define vpxtarget       x86-linux-gcc
47 %endif
48 %ifarch ppc
49 %define vpxtarget       ppc32-linux-gcc
50 %endif
51 %ifarch ppc64
52 %define vpxtarget       ppc64-linux-gcc
53 %endif
54 %ifarch aarch64
55 %define vpxtarget       arm64-linux-gcc
56 %endif
57 %ifarch armv7hnl
58 %define vpxtarget       armv7-linux-gcc
59 %endif
60
61 %description
62 VP8, a high-quality video codec.
63
64 %description -l pl.UTF-8
65 VP8 - kodek obrazu wysokiej jakości.
66
67 %package devel
68 Summary:        Header files for libvpx
69 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libvpx
70 Group:          Development/Libraries
71 Requires:       %{name} = %{version}-%{release}
72
73 %description devel
74 Header files for libvpx library.
75
76 %description devel -l pl.UTF-8
77 Pliki nagłówkowe biblioteki libvpx.
78
79 %package static
80 Summary:        Static libvpx library
81 Summary(pl.UTF-8):      Statyczna biblioteka libvpx
82 Group:          Development/Libraries
83 Requires:       %{name}-devel = %{version}-%{release}
84
85 %description static
86 Static libvpx library.
87
88 %description static -l pl.UTF-8
89 Statyczna biblioteka libvpx.
90
91 %package tools
92 Summary:        VPX decoding/encoding tools
93 Summary(pl.UTF-8):      Narzędzia do kodowania/dekodowania formatu VPX
94 Group:          Applications/Graphics
95 Requires:       %{name} = %{version}-%{release}
96
97 %description tools
98 VPX decoding/encoding tools.
99
100 %description tools -l pl.UTF-8
101 Narzędzia do kodowania/dekodowania formatu VPX.
102
103 %prep
104 %setup -q
105
106 %build
107 install -d obj
108 cd obj
109 # not autoconf configure
110 CC="%{__cc}" \
111 CXX="%{__cxx}" \
112 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
113 ../configure \
114 %if %{with asm}
115         --as=yasm \
116 %endif
117         --target=%{vpxtarget} \
118         --enable-shared \
119         %{!?with_static_libs:--disable-static} \
120         %{!?with_ssse3:--disable-ssse3} \
121         --disable-optimizations \
122         --%{!?with_tests:dis}%{?with_tests:en}able-unit-tests \
123         --%{!?with_doc:dis}%{?with_doc:en}able-docs \
124         --%{!?with_doc:dis}%{?with_doc:en}able-install-docs \
125         --enable-vp8 \
126         --enable-vp8 \
127         --enable-postproc \
128         --enable-runtime-cpu-detect
129
130 %{__make} verbose=true target=libs \
131         HAVE_GNU_STRIP=no \
132         LDFLAGS="%{rpmldflags}"
133
134 %{__make} verbose=true target=examples \
135         LDFLAGS="%{rpmldflags} -L."
136
137 %if %{with doc}
138 %{__make} verbose=true target=docs
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143 install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/vpx,%{_libdir}}
144
145 %{__make} -C obj verbose=true install \
146         LIBSUBDIR=%{_lib} \
147         DIST_DIR=$RPM_BUILD_ROOT%{_prefix}
148
149 # redundant minor version symlink (not SONAME)
150 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libvpx.so.9.0
151
152 # adjust prefix and libdir
153 %{__sed} -i -e 's,^prefix=.*,prefix=%{_prefix},;s,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/vpx.pc
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %post   -p /sbin/ldconfig
159 %postun -p /sbin/ldconfig
160
161 %files
162 %defattr(644,root,root,755)
163 %doc AUTHORS CHANGELOG LICENSE PATENTS README
164 %attr(755,root,root) %{_libdir}/libvpx.so.*.*.*
165 %attr(755,root,root) %ghost %{_libdir}/libvpx.so.9
166
167 %files devel
168 %defattr(644,root,root,755)
169 %attr(755,root,root) %{_libdir}/libvpx.so
170 %{_includedir}/vpx
171 %{_pkgconfigdir}/vpx.pc
172
173 %if %{with static_libs}
174 %files static
175 %defattr(644,root,root,755)
176 %{_libdir}/libvpx.a
177 %endif
178
179 %files tools
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{_bindir}/vpxdec
182 %attr(755,root,root) %{_bindir}/vpxenc
This page took 0.10801 seconds and 4 git commands to generate.