- added opt patch (drop -m32/-m64, rely on compiler default), disable asm on x32...
[packages/xavs2.git] / xavs2.spec
1 #
2 # Conditional build:
3 %bcond_without  static_libs     # don't build static libraries
4 %bcond_without  lsmash          # l-smash support in CLI
5 %bcond_without  opencl          # OpenCL features
6 #
7 Summary:        Open-source encoder of AVS2-P2/IEEE1857.4 video coding standard
8 Summary(pl.UTF-8):      Koder standardu kodowania obrazu AVS2-P2/IEEE1857.4 o otwartych źródłach
9 Name:           xavs2
10 Version:        1.3
11 Release:        2
12 License:        GPL v2+
13 Group:          Libraries
14 #Source0Download: https://github.com/pkuvcl/xavs2/releases
15 Source0:        https://github.com/pkuvcl/xavs2/archive/%{version}/%{name}-%{version}.tar.gz
16 # Source0-md5:  14995147d36e633f1155c8fea7269bea
17 Patch0:         %{name}-asm-arch.patch
18 Patch1:         %{name}-opt.patch
19 URL:            https://github.com/pkuvcl/xavs2
20 %{?with_opencl:BuildRequires:   OpenCL-devel}
21 %{?with_lsmash:BuildRequires:   l-smash-devel >= 1.5}
22 BuildRequires:  libstdc++-devel >= 6:4.7
23 BuildRequires:  pkgconfig
24 %ifarch %{ix86} %{x8664}
25 BuildRequires:  yasm >= 1.2.0
26 %endif
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 Open-source encoder of AVS2-P2/IEEE1857.4 video coding standard.
31
32 %description -l pl.UTF-8
33 Koder standardu kodowania obrazu AVS2-P2/IEEE1857.4 o otwartych
34 źródłach.
35
36 %package devel
37 Summary:        Header files for xavs2 library
38 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki xavs2
39 Group:          Development/Libraries
40 Requires:       %{name} = %{version}-%{release}
41
42 %description devel
43 Header files for xavs2 library.
44
45 %description devel -l pl.UTF-8
46 Pliki nagłówkowe biblioteki xavs2.
47
48 %package static
49 Summary:        Static xavs2 library
50 Summary(pl.UTF-8):      Statyczna biblioteka xavs2
51 Group:          Development/Libraries
52 Requires:       %{name}-devel = %{version}-%{release}
53
54 %description static
55 Static xavs2 library.
56
57 %description static -l pl.UTF-8
58 Statyczna biblioteka xavs2.
59
60 %prep
61 %setup -q
62 %patch0 -p1
63 %patch1 -p1
64
65 %build
66 cd build/linux
67 # not autoconf configure
68 CC="%{__cc}" \
69 CXX="%{__cxx}" \
70 CFLAGS="%{rpmcflags}" \
71 CXXFLAGS="%{rpmcxxflags}" \
72 CPPFLAGS="%{rpmcppflags}" \
73 LDFLAGS="%{rpmldflags} -Wl,-z,noexecstack" \
74 ./configure \
75         --prefix=%{_prefix} \
76         --bindir=%{_bindir} \
77         --includedir=%{_includedir} \
78         --libdir=%{_libdir} \
79 %ifarch x32
80         --disable-asm \
81 %endif
82         --disable-gpac \
83         %{!?with_lsmash:--disable-lsmash} \
84         %{!?with_opencl:--disable-opencl} \
85         --enable-pic \
86         --enable-shared \
87         %{!?with_static_libs:--disable-static}
88 %{__make}
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92
93 %{__make} -C build/linux install \
94         DESTDIR=$RPM_BUILD_ROOT
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %post   -p /sbin/ldconfig
100 %postun -p /sbin/ldconfig
101
102 %files
103 %defattr(644,root,root,755)
104 %doc README.md
105 %lang(zh) %doc README.zh.md
106 %attr(755,root,root) %{_bindir}/xavs2
107 %attr(755,root,root) %{_libdir}/libxavs2.so.13
108
109 %files devel
110 %defattr(644,root,root,755)
111 %attr(755,root,root) %{_libdir}/libxavs2.so
112 %{_includedir}/xavs2.h
113 %{_includedir}/xavs2_config.h
114 %{_pkgconfigdir}/xavs2.pc
115
116 %if %{with static_libs}
117 %files static
118 %defattr(644,root,root,755)
119 %{_libdir}/libxavs2.a
120 %endif
This page took 0.123284 seconds and 4 git commands to generate.