Use _udevrulesdir macro
[platform/upstream/mesa.git] / packaging / mesa.spec
1 Name:           mesa
2 Version:        19.3.0
3 Release:        0
4 License:        MIT and Apache-2.0 and SGI Free Software License B v2.0 and BSD-3-Clause
5 Summary:        System for rendering interactive 3-D graphics
6 Url:            http://www.mesa3d.org
7 Group:          Graphics & UI Framework/Hardware Adaptation
8 Source:         %{name}-%{version}.tar.gz
9 Source1001:     %{name}.manifest
10 Source1002:     99-GPU-Acceleration.rules
11
12 BuildRequires:  bison
13 BuildRequires:  flex
14 BuildRequires:  pkgconfig
15 BuildRequires:  pkgconfig(expat)
16 BuildRequires:  pkgconfig(libdrm) >= 2.4.75
17 BuildRequires:  pkgconfig(libudev) > 150
18 BuildRequires:  pkgconfig(wayland-client)
19 BuildRequires:  pkgconfig(wayland-server)
20 BuildRequires:  pkgconfig(wayland-protocols)
21 BuildRequires:  pkgconfig(tpl-egl)
22 BuildRequires:  pkgconfig(libtbm)
23 BuildRequires:  pkgconfig(libtdm)
24 BuildRequires:  pkgconfig(zlib)
25 BuildRequires:  pkgconfig(dlog)
26 BuildRequires:  pkgconfig(libsystemd)
27 BuildRequires:  meson
28 BuildRequires:  python3
29 BuildRequires:  python3-mako
30 BuildRequires:  pkgconfig(ttrace)
31 %ifarch x86_64 %ix86
32 BuildRequires:  pkgconfig(libdrm_intel) >= 2.4.24
33 %endif
34
35 %if "%{_with_emulator}" == "1"
36 ExclusiveArch:
37 %endif
38
39 %description
40 Mesa is a 3-D graphics library with an API which is very similar to
41 that of OpenGL.* To the extent that Mesa utilizes the OpenGL command
42 syntax or state machine, it is being used with authorization from
43 Silicon Graphics, Inc.(SGI). However, the author does not possess an
44 OpenGL license from SGI, and makes no claim that Mesa is in any way a
45 compatible replacement for OpenGL or associated with SGI. Those who
46 want a licensed implementation of OpenGL should contact a licensed
47 vendor.
48
49 Please do not refer to the library as MesaGL (for legal reasons). It's
50 just Mesa or The Mesa 3-D graphics library.
51
52 * OpenGL is a trademark of Silicon Graphics Incorporated.
53
54 %prep
55 %setup -q -n %{name}-%{version}
56 cp %{SOURCE1001} .
57 cp %{SOURCE1002} .
58
59 %build
60 %{?asan:/usr/bin/gcc-unforce-options}
61 mkdir build
62 meson --prefix %{_prefix} build/ \
63                 -Dc_link_args="-lttrace" \
64                 -Dcpp_link_args="-lttrace" \
65                 -Dlibdir=%{_libdir} \
66                 -Dgallium-va=false \
67                 -Dgallium-vdpau=false \
68                 -Dgallium-xa=false \
69                 -Dgallium-xvmc=false \
70                 -Dglx=disabled \
71                 -Ddri3=false \
72                 -Dgbm=true \
73                 -Dplatforms="tizen,wayland,drm" \
74 %ifarch %ix86 x86_64
75                 -Dgallium-drivers="i915,swrast" \
76                 -Ddri-drivers="" \
77                 -Dvulkan-drivers=""
78 %else
79                 -Dgallium-drivers="vc4,v3d,kmsro,swrast"
80 %endif
81 ninja -C build/
82
83 %install
84 DESTDIR=%{buildroot} ninja -C build/ install
85 mkdir -p %{buildroot}%{_libdir}/driver
86 cp -a  %{buildroot}%{_libdir}/libEGL* %{buildroot}%{_libdir}/driver
87 cp -a  %{buildroot}%{_libdir}/libGLES* %{buildroot}%{_libdir}/driver
88
89 mkdir -p %{buildroot}%{_udevrulesdir}
90 cp 99-GPU-Acceleration.rules %{buildroot}%{_udevrulesdir}
91
92 %post -p /sbin/ldconfig
93 %postun -p /sbin/ldconfig
94
95 %files
96 %define _unpackaged_files_terminate_build 0
97 %manifest %{name}.manifest
98 %defattr(-,root,root)
99 %license COPYING
100 %{_libdir}/libglapi*
101 %{_libdir}/driver/*
102 %{_libdir}/dri/*
103 %{_libdir}/libgbm*
104 %{_udevrulesdir}/99-GPU-Acceleration.rules