Fix X11 build
[platform/upstream/libva.git] / packaging / libva.spec
1 %bcond_with wayland
2 %bcond_with mesa
3 %bcond_with x
4
5 Name:           libva
6 Version:        1.3.1
7 Release:        0
8 License:        MIT
9 Summary:        Video Acceleration (VA) API for Linux
10 Url:            http://freedesktop.org/wiki/Software/vaapi
11 Group:          Multimedia/Video
12 Source:         %{name}-%{version}.tar.bz2
13 BuildRequires:  gcc-c++
14 BuildRequires:  libtool
15 BuildRequires:  pkg-config
16 BuildRequires:  xz
17 %if %{with mesa}
18 BuildRequires:  mesa-devel
19 %else
20 BuildRequires: pkgconfig(glesv2)
21 BuildRequires:  pkgconfig(egl)
22 %endif
23 BuildRequires:  pkgconfig(libdrm)
24 BuildRequires:  pkgconfig(libudev)
25 %if %{with x}
26 BuildRequires:  pkgconfig(x11)
27 BuildRequires:  pkgconfig(xext)
28 BuildRequires:  pkgconfig(xfixes)
29 BuildRequires:  pkgconfig(xrandr)
30 BuildRequires:  pkgconfig(xv)
31 %endif
32 %if %{with wayland}
33 BuildRequires:  pkgconfig(wayland-egl)
34 BuildRequires:  pkgconfig(wayland-client)
35 %endif
36 ExclusiveArch:  %ix86 x86_64
37
38 %description
39 The libva library implements the Video Acceleration (VA) API for Linux.
40 The library loads a hardware dependendent driver.
41
42 %package devel
43 Summary:        Video Acceleration (VA) API for Linux -- development files
44 Group:          Development/Libraries
45 Requires:       libva = %{version}
46 Requires:       pkgconfig(libdrm)
47 %if %{with x}
48 Requires:       pkgconfig(gl)
49 Requires:       pkgconfig(x11)
50 Requires:       pkgconfig(xfixes)
51 %endif
52 %if %{with wayland}
53 Requires:  pkgconfig(wayland-egl)
54 Requires:  pkgconfig(wayland-client)
55 %endif
56
57 %description devel
58 The libva library implements the Video Acceleration (VA) API for Linux.
59 The library loads a hardware dependendent driver.
60
61 This package provides the development environment for libva.
62
63 %package -n vaapi-tools
64 Summary:        Video Acceleration (VA) API for Linux
65 Group:          Multimedia/Video
66
67 %description -n vaapi-tools
68 The libva library implements the Video Acceleration (VA) API for Linux.
69 The library loads a hardware dependendent driver.
70
71 This is a set of tools around vaapi livrary.
72
73 %package -n vaapi-dummy-driver
74 Summary:        Video Acceleration (VA) API for Linux
75 Group:          Multimedia/Video
76
77 %description -n vaapi-dummy-driver
78 The libva library implements the Video Acceleration (VA) API for Linux.
79 The library loads a hardware dependendent driver.
80
81 This contains the dummy driver.
82
83 %prep
84 %setup -q
85
86 %build
87 # --enable-x11 set to no explicitly, otherwise it will mislead libva build when other package brings in X11 lib
88 %autogen
89 %configure --enable-dummy-driver \
90            --enable-dummy-backend \
91 %if %{with x}
92 %if %{with mesa}
93            --enable-glx \
94 %endif
95 %else
96         --enable-x11=no \
97 %endif
98            --enable-egl \
99 %if %{with wayland}
100            --enable-wayland \
101 %endif
102            --with-drivers-path=%{_libdir}/dri
103 make %{?_smp_mflags}
104
105 %install
106 %make_install
107 grep -r include %{buildroot}%{_includedir}
108
109 %post -p /sbin/ldconfig
110
111 %postun -p /sbin/ldconfig
112
113 %files -n vaapi-tools
114 %defattr(-,root,root,-)
115 %{_bindir}/vainfo
116 %{_bindir}/avcenc
117 %{_bindir}/h264encode
118 %{_bindir}/mpeg2vldemo
119 %{_bindir}/mpeg2vaenc
120 %if %{with x}
121 %{_bindir}/putsurface
122 %{_bindir}/mpeg2transcode
123 %endif
124 %{_bindir}/loadjpeg
125 %if %{with wayland}
126 %{_bindir}/putsurface_wayland
127 %endif
128
129 %files -n vaapi-dummy-driver
130 %defattr(-,root,root,-)
131 %dir %{_libdir}/dri
132 %{_libdir}/dri/dummy_drv_video.so
133
134 %files
135 %defattr(-, root, root)
136 %license COPYING
137 %{_libdir}/libva.so.*
138 %{_libdir}/libva-tpi.so.*
139 %if %{with x}
140 %{_libdir}/libva-x11.so.*
141 %endif
142 %if %{with mesa} && %{with x}
143     %{_libdir}/libva-glx.so.*
144 %endif
145 %{_libdir}/libva-egl.so.*
146 %if %{with wayland}
147 %{_libdir}/libva-wayland.so.*
148 %endif
149 %{_libdir}/libva-drm.so.*
150
151 %files devel
152 %defattr(-,root,root,-)
153 %{_libdir}/libva.so
154 %{_libdir}/libva-tpi.so
155 %if %{with x}
156 %{_libdir}/libva-x11.so
157 %endif
158 %if %{with mesa} && %{with x}
159     %{_libdir}/libva-glx.so
160 %endif
161 %{_libdir}/libva-egl.so
162 %if %{with wayland}
163 %{_libdir}/libva-wayland.so
164 %endif
165 %{_libdir}/libva-drm.so
166 %{_includedir}/va
167 %{_libdir}/pkgconfig/libva*.pc
168
169 %changelog