]>
Commit | Line | Data |
---|---|---|
f18f0eaf | 1 | # |
6861f1fc | 2 | # Conditional build: |
cd1c3a73 JB |
3 | %bcond_without python # Python module (any) |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6861f1fc | 6 | %bcond_without verbose # verbose build (V=1) |
cff8604d | 7 | |
cd1c3a73 JB |
8 | %if %{without python} |
9 | %undefine with_python2 | |
10 | %undefine with_python3 | |
11 | %endif | |
6861f1fc | 12 | Summary: The Device Tree Compiler |
cff8604d | 13 | Summary(pl.UTF-8): Kompilator drzewiastej struktury urządzeń |
6861f1fc | 14 | Name: dtc |
20819d95 JP |
15 | Version: 1.7.0 |
16 | Release: 1 | |
fffeac36 | 17 | License: GPL v2+ (dtc), GPL v2+ or BSD (fdt library) |
6861f1fc | 18 | Group: Libraries |
cc076a48 | 19 | Source0: https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz |
20819d95 | 20 | # Source0-md5: 228576aceed3aa89f54283aa0f1eb820 |
2b797ed5 | 21 | Patch0: %{name}-python.patch |
20819d95 | 22 | Patch1: python2.patch |
3c2ba202 | 23 | URL: https://www.devicetree.org/ |
4ecc89ea | 24 | BuildRequires: bison |
25 | BuildRequires: flex | |
f8302009 | 26 | BuildRequires: pkgconfig |
c3515ca9 | 27 | BuildRequires: rpmbuild(macros) >= 1.714 |
cc076a48 JB |
28 | BuildRequires: tar >= 1:1.22 |
29 | BuildRequires: xz | |
f8302009 | 30 | BuildRequires: yaml-devel |
2b797ed5 | 31 | %if %{with python} |
cd1c3a73 | 32 | %if %{with python2} |
2b797ed5 | 33 | BuildRequires: python-devel >= 2 |
20819d95 JP |
34 | BuildRequires: python-setuptools |
35 | BuildRequires: python-setuptools_scm | |
cd1c3a73 JB |
36 | %endif |
37 | %if %{with python3} | |
38 | BuildRequires: python3-devel >= 1:3.2 | |
20819d95 JP |
39 | BuildRequires: python3-setuptools |
40 | BuildRequires: python3-setuptools_scm | |
cd1c3a73 JB |
41 | %endif |
42 | BuildRequires: swig-python >= 2.0.10 | |
2b797ed5 | 43 | %endif |
fad8e447 | 44 | Requires: libfdt = %{version}-%{release} |
cff8604d | 45 | Obsoletes: dtc-doc < 1.3.0-2 |
6861f1fc ER |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
47 | ||
3c2ba202 JB |
48 | %define abi_ver %{version} |
49 | ||
6861f1fc ER |
50 | %{?debug:%define with_verbose 1} |
51 | ||
52 | %description | |
53 | The Device Tree Compiler, dtc, takes as input a device-tree in a given | |
54 | format and outputs a device-tree in another format. Typically, the | |
55 | input format is "dts", a human readable source format, and creates a | |
56 | "dtb", or binary format as output. | |
57 | ||
b14054e0 | 58 | %description -l pl.UTF-8 |
59 | Kompilator drzewiastej struktury urządzeń, dtc, przyjmuje na wejściu | |
60 | dane w jednym formacie by na wyjściu wyprodukować strukturę danych w | |
61 | innym. Najczęściej format wejściowy to "dts", intuicyjny i łatwy w | |
62 | odczycie (tzw. human readable), natomiast wyjściowy to "dtb" lub | |
63 | inaczej format binarny. | |
64 | ||
fad8e447 JR |
65 | %package -n libfdt |
66 | Summary: Device tree library | |
67 | Summary(pl.UTF-8): Biblioteka drzewiastej struktury urządzeń | |
fffeac36 | 68 | License: GPL v2+ or BSD |
fad8e447 | 69 | Group: Libraries |
cff8604d | 70 | Obsoletes: dtc-doc < 1.3.0-2 |
fad8e447 JR |
71 | # does not require base. see README.license |
72 | ||
73 | %description -n libfdt | |
74 | Device tree library. | |
75 | ||
76 | %description -n libfdt -l pl.UTF-8 | |
77 | Biblioteka drzewiastej struktury urządzeń. | |
78 | ||
79 | %package -n libfdt-devel | |
6861f1fc ER |
80 | Summary: Header files for fdt library |
81 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki fdt | |
fffeac36 | 82 | License: GPL v2+ or BSD |
6861f1fc | 83 | Group: Development/Libraries |
fad8e447 | 84 | Requires: libfdt = %{version}-%{release} |
7e7160ab | 85 | Obsoletes: dtc-devel < 1.3.0 |
cff8604d | 86 | Obsoletes: dtc-doc < 1.3.0-2 |
6861f1fc | 87 | |
fad8e447 | 88 | %description -n libfdt-devel |
6861f1fc ER |
89 | Header files for fdt library. |
90 | ||
fad8e447 | 91 | %description -n libfdt-devel -l pl.UTF-8 |
6861f1fc ER |
92 | Pliki nagłówkowe biblioteki fdt. |
93 | ||
fad8e447 | 94 | %package -n libfdt-static |
6861f1fc ER |
95 | Summary: Static fdt library |
96 | Summary(pl.UTF-8): Statyczna biblioteka fdt | |
fffeac36 | 97 | License: GPL v2+ or BSD |
6861f1fc | 98 | Group: Development/Libraries |
fad8e447 | 99 | Requires: libfdt-devel = %{version}-%{release} |
7e7160ab | 100 | Obsoletes: dtc-static < 1.3.0 |
6861f1fc | 101 | |
fad8e447 | 102 | %description -n libfdt-static |
6861f1fc ER |
103 | Static fdt library. |
104 | ||
fad8e447 | 105 | %description -n libfdt-static -l pl.UTF-8 |
6861f1fc ER |
106 | Statyczna biblioteka fdt. |
107 | ||
2b797ed5 | 108 | %package -n python-libfdt |
cd1c3a73 JB |
109 | Summary: Python 2 binding for fdt library |
110 | Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki fdt | |
2b797ed5 JB |
111 | License: GPL v2+ or BSD |
112 | Group: Libraries/Python | |
113 | ||
114 | %description -n python-libfdt | |
cd1c3a73 | 115 | Python 2 binding for fdt library. |
2b797ed5 JB |
116 | |
117 | %description -n python-libfdt -l pl.UTF-8 | |
cd1c3a73 JB |
118 | Wiązanie Pythona 2 do biblioteki fdt. |
119 | ||
120 | %package -n python3-libfdt | |
121 | Summary: Python 3 binding for fdt library | |
122 | Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki fdt | |
123 | License: GPL v2+ or BSD | |
124 | Group: Libraries/Python | |
125 | ||
126 | %description -n python3-libfdt | |
127 | Python 3 binding for fdt library. | |
128 | ||
129 | %description -n python3-libfdt -l pl.UTF-8 | |
130 | Wiązanie Pythona 3 do biblioteki fdt. | |
2b797ed5 | 131 | |
6861f1fc | 132 | %prep |
cc076a48 | 133 | %setup -q |
2b797ed5 | 134 | %patch0 -p1 |
20819d95 | 135 | %patch1 -p1 |
6861f1fc ER |
136 | |
137 | %build | |
6a971399 | 138 | %{__make} -j1 \ |
6861f1fc ER |
139 | %{?with_verbose:V=1} \ |
140 | CC="%{__cc}" \ | |
2b797ed5 | 141 | CFLAGS="%{rpmcflags} -fPIC" \ |
cd1c3a73 JB |
142 | NO_PYTHON=1 |
143 | ||
144 | %if %{with python} | |
20819d95 | 145 | export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} |
cd1c3a73 JB |
146 | %if %{with python2} |
147 | %py_build | |
148 | %endif | |
149 | %if %{with python3} | |
150 | %py3_build | |
151 | %endif | |
152 | %endif | |
6861f1fc ER |
153 | |
154 | %install | |
155 | rm -rf $RPM_BUILD_ROOT | |
6a971399 | 156 | |
b16cce73 | 157 | %{__make} -j1 install \ |
cff8604d | 158 | DESTDIR=$RPM_BUILD_ROOT \ |
6861f1fc ER |
159 | %{?with_verbose:V=1} \ |
160 | PREFIX=%{_prefix} \ | |
2b797ed5 | 161 | LIBDIR=%{_libdir} \ |
cd1c3a73 | 162 | NO_PYTHON=1 \ |
2b797ed5 JB |
163 | SETUP_PREFIX=%{_prefix} |
164 | ||
165 | %if %{with python} | |
20819d95 | 166 | export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} |
cd1c3a73 JB |
167 | %if %{with python2} |
168 | %py_install | |
169 | ||
2b797ed5 JB |
170 | %py_postclean |
171 | %endif | |
cd1c3a73 JB |
172 | %if %{with python3} |
173 | %py3_install | |
174 | %endif | |
175 | %endif | |
6861f1fc ER |
176 | |
177 | %clean | |
178 | rm -rf $RPM_BUILD_ROOT | |
179 | ||
f18f0eaf | 180 | %post -n libfdt -p /sbin/ldconfig |
cff8604d | 181 | %postun -n libfdt -p /sbin/ldconfig |
fad8e447 | 182 | |
6861f1fc ER |
183 | %files |
184 | %defattr(644,root,root,755) | |
20819d95 | 185 | %doc README.license README.md |
fad8e447 | 186 | %attr(755,root,root) %{_bindir}/convert-dtsv0 |
6861f1fc | 187 | %attr(755,root,root) %{_bindir}/dtc |
fad8e447 | 188 | %attr(755,root,root) %{_bindir}/dtdiff |
cc076a48 JB |
189 | %attr(755,root,root) %{_bindir}/fdtdump |
190 | %attr(755,root,root) %{_bindir}/fdtget | |
2b797ed5 | 191 | %attr(755,root,root) %{_bindir}/fdtoverlay |
cc076a48 | 192 | %attr(755,root,root) %{_bindir}/fdtput |
fad8e447 JR |
193 | |
194 | %files -n libfdt | |
195 | %defattr(644,root,root,755) | |
3c2ba202 | 196 | %attr(755,root,root) %{_libdir}/libfdt-%{abi_ver}.so |
fad8e447 | 197 | %attr(755,root,root) %ghost %{_libdir}/libfdt.so.1 |
6861f1fc | 198 | |
fad8e447 | 199 | %files -n libfdt-devel |
6861f1fc | 200 | %defattr(644,root,root,755) |
cff8604d | 201 | %doc TODO Documentation/manual.txt |
fad8e447 | 202 | %attr(755,root,root) %{_libdir}/libfdt.so |
6861f1fc ER |
203 | %{_includedir}/fdt.h |
204 | %{_includedir}/libfdt.h | |
cc076a48 | 205 | %{_includedir}/libfdt_env.h |
6861f1fc | 206 | |
fad8e447 | 207 | %files -n libfdt-static |
6861f1fc ER |
208 | %defattr(644,root,root,755) |
209 | %{_libdir}/libfdt.a | |
2b797ed5 | 210 | |
cd1c3a73 | 211 | %if %{with python2} |
2b797ed5 JB |
212 | %files -n python-libfdt |
213 | %defattr(644,root,root,755) | |
214 | %attr(755,root,root) %{py_sitedir}/_libfdt.so | |
668ea320 | 215 | %{py_sitedir}/libfdt.py[co] |
8e4d820d | 216 | %{py_sitedir}/libfdt-%{abi_ver}*.egg-info |
cd1c3a73 JB |
217 | %endif |
218 | ||
219 | %if %{with python3} | |
220 | %files -n python3-libfdt | |
221 | %defattr(644,root,root,755) | |
222 | %attr(755,root,root) %{py3_sitedir}/_libfdt.cpython-*.so | |
223 | %{py3_sitedir}/libfdt.py | |
224 | %{py3_sitedir}/__pycache__/libfdt.cpython-*.py[co] | |
8e4d820d | 225 | %{py3_sitedir}/libfdt-%{abi_ver}*.egg-info |
2b797ed5 | 226 | %endif |