Debian Codegraph @

scripts/packaging/opencl/sles_15/SPECS/opencl.spec

raw
1 # spec file for package intel-opencl
2
3 #it's changed by external script
4 %global rel i1
5 %global ver xxx
6 %global NEO_OCL_VERSION_MAJOR xxx
7 %global NEO_OCL_VERSION_MINOR xxx
8 %global NEO_OCL_VERSION_BUILD xxx
9 %global NEO_RELEASE_WITH_REGKEYS FALSE
10 %global NEO_ENABLE_I915_PRELIM_DETECTION FALSE
11 %global NEO_ENABLE_XE_PRELIM_DETECTION FALSE
12 %global NEO_ENABLE_XE_EU_DEBUG_SUPPORT FALSE
13 %global NEO_USE_XE_EU_DEBUG_EXP_UPSTREAM FALSE
14 %global NEO_I915_PRELIM_HEADERS_DIR %{nil}
15 %global NEO_OCLOC_VERSION_MODE 1
16
17 %define gmmlib_sover 12
18 %define igc_sover 2
19
20 %if !0%{?build_type:1}
21 %define build_type Release
22 %endif
23
24 %define _source_payload w5T16.xzdio
25 %define _binary_payload w5T16.xzdio
26
27 Name: intel-opencl
28 Epoch: 1
29 Version: %{ver}
30 Release: %{rel}%{?dist}
31 Summary: Intel(R) Graphics Compute Runtime for OpenCL(TM)
32 License: MIT
33 Group: System Environment/Libraries
34 Url: https://github.com/intel/compute-runtime
35 Source0: %{url}/archive/%{version}/compute-runtime.tar.xz
36 Source1: copyright
37 %if "%{NEO_I915_PRELIM_HEADERS_DIR}" != ""
38 Source2: uapi.tar.xz
39 %endif
40
41 ExclusiveArch: x86_64
42 BuildRequires: cmake gcc-c++ ninja make
43 # BuildRequires: libva-devel
44 BuildRequires: libigdgmm%{?name_suffix}-devel
45 BuildRequires: libigdfcl%{?name_suffix}-devel
46 Requires: libigc%{igc_sover}%{?name_suffix}
47 Requires: libigdfcl%{igc_sover}%{?name_suffix}
48 Requires: libigdgmm%{gmmlib_sover}%{?name_suffix}
49
50 %description
51 Intel(R) Graphics Compute Runtime for OpenCL(TM) is a open source project to
52 converge Intel's development efforts on OpenCL(TM) compute stacks supporting
53 the GEN graphics hardware architecture.
54
55 %package -n intel-ocloc%{?name_suffix}
56 Summary: ocloc package for opencl
57 %description -n intel-ocloc%{?name_suffix}
58
59 %debug_package %{nil}
60
61 %prep
62 %if "%{NEO_I915_PRELIM_HEADERS_DIR}" == ""
63 %autosetup -p1 -n compute-runtime
64 %else
65 %autosetup -p1 -n compute-runtime -b 2
66 %endif
67
68 %build
69 %cmake .. \
70 -GNinja ${NEO_BUILD_EXTRA_OPTS} \
71 -DNEO_OCL_VERSION_MAJOR=%{NEO_OCL_VERSION_MAJOR} \
72 -DNEO_OCL_VERSION_MINOR=%{NEO_OCL_VERSION_MINOR} \
73 -DNEO_VERSION_BUILD=%{NEO_OCL_VERSION_BUILD} \
74 -DCMAKE_BUILD_TYPE=%{build_type} \
75 -DBUILD_WITH_L0=FALSE \
76 -DNEO_SKIP_UNIT_TESTS=TRUE \
77 -DNEO_ENABLE_I915_PRELIM_DETECTION=%{NEO_ENABLE_I915_PRELIM_DETECTION} \
78 -DNEO_ENABLE_XE_PRELIM_DETECTION=%{NEO_ENABLE_XE_PRELIM_DETECTION} \
79 -DNEO_ENABLE_XE_EU_DEBUG_SUPPORT=%{NEO_ENABLE_XE_EU_DEBUG_SUPPORT} \
80 -DNEO_USE_XE_EU_DEBUG_EXP_UPSTREAM=%{NEO_USE_XE_EU_DEBUG_EXP_UPSTREAM} \
81 -DRELEASE_WITH_REGKEYS=%{NEO_RELEASE_WITH_REGKEYS} \
82 -DCMAKE_VERBOSE_MAKEFILE=FALSE \
83 -DNEO_I915_PRELIM_HEADERS_DIR=$(realpath %{NEO_I915_PRELIM_HEADERS_DIR})
84
85 %if 0%{?neo_rpm__post_cmake:0}
86 %{neo_rpm__post_cmake_command}
87 %endif
88
89 %ninja_build
90
91 %install
92 cd build
93 %ninja_install
94
95 rm -vf %{buildroot}/%{_libdir}/intel-opencl/libigdrcl*.so.debug
96 rm -vf %{buildroot}/%{_libdir}/libocloc*.so.debug
97 rm -rvf %{buildroot}/usr/lib/debug/
98
99 #insert license into package
100 mkdir -p %{buildroot}/usr/share/doc/intel-opencl%{?name_suffix}/
101 cp -pvR %{_sourcedir}/copyright %{buildroot}/usr/share/doc/intel-opencl%{?name_suffix}/.
102 mkdir -p %{buildroot}/usr/share/doc/intel-ocloc%{?name_suffix}/
103 cp -pvR %{_sourcedir}/copyright %{buildroot}/usr/share/doc/intel-ocloc%{?name_suffix}/.
104
105 if [ -d "${NEO_NINJA_DUMP}" ]; then
106 cp -v .ninja* ${NEO_NINJA_DUMP}/
107 fi
108
109 %files -n intel-opencl%{?name_suffix}
110 %defattr(-,root,root)
111 %{_sysconfdir}/OpenCL
112 %{_libdir}/intel-opencl/libigdrcl*.so
113 /usr/share/doc/intel-opencl%{?name_suffix}/copyright
114
115 %files -n intel-ocloc%{?name_suffix}
116 %defattr(-,root,root)
117 %{_bindir}/ocloc*
118 %{_libdir}/libocloc*.so
119 %{_includedir}/ocloc_api.h
120 /usr/share/doc/intel-ocloc%{?name_suffix}/copyright
121
122 %post -n intel-ocloc%{?name_suffix}
123 update-alternatives --quiet --install /usr/bin/ocloc ocloc /usr/bin/ocloc-%{NEO_OCL_VERSION_MAJOR}.%{NEO_OCL_VERSION_MINOR}.%{NEO_OCLOC_VERSION_MODE} %{NEO_OCL_VERSION_MAJOR}%{NEO_OCL_VERSION_MINOR}%{NEO_OCLOC_VERSION_MODE}
124
125 %preun -n intel-ocloc%{?name_suffix}
126 if [ $1 == "0" ]; then
127 # uninstall
128 update-alternatives --quiet --remove ocloc /usr/bin/ocloc-%{NEO_OCL_VERSION_MAJOR}.%{NEO_OCL_VERSION_MINOR}.%{NEO_OCLOC_VERSION_MODE}
129 fi
130
131 %changelog
132 * Mon Sep 13 2021 Compute-Runtime-Automation <[email protected]>
133 - Initial spec file for SLES 15.3