3 %bcond_without python # Python module (any)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
6 %bcond_without verbose # verbose build (V=1)
10 %undefine with_python3
12 Summary: The Device Tree Compiler
13 Summary(pl.UTF-8): Kompilator drzewiastej struktury urządzeń
17 License: GPL v2+ (dtc), GPL v2+ or BSD (fdt library)
19 Source0: https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz
20 # Source0-md5: 228576aceed3aa89f54283aa0f1eb820
21 Patch0: %{name}-python.patch
23 URL: https://www.devicetree.org/
26 BuildRequires: pkgconfig
27 BuildRequires: rpmbuild(macros) >= 1.714
28 BuildRequires: tar >= 1:1.22
30 BuildRequires: yaml-devel
33 BuildRequires: python-devel >= 2
34 BuildRequires: python-setuptools
35 BuildRequires: python-setuptools_scm
38 BuildRequires: python3-devel >= 1:3.2
39 BuildRequires: python3-setuptools
40 BuildRequires: python3-setuptools_scm
42 BuildRequires: swig-python >= 2.0.10
44 Requires: libfdt = %{version}-%{release}
45 Obsoletes: dtc-doc < 1.3.0-2
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 %define abi_ver %{version}
50 %{?debug:%define with_verbose 1}
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.
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.
66 Summary: Device tree library
67 Summary(pl.UTF-8): Biblioteka drzewiastej struktury urządzeń
68 License: GPL v2+ or BSD
70 Obsoletes: dtc-doc < 1.3.0-2
71 # does not require base. see README.license
73 %description -n libfdt
76 %description -n libfdt -l pl.UTF-8
77 Biblioteka drzewiastej struktury urządzeń.
79 %package -n libfdt-devel
80 Summary: Header files for fdt library
81 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki fdt
82 License: GPL v2+ or BSD
83 Group: Development/Libraries
84 Requires: libfdt = %{version}-%{release}
85 Obsoletes: dtc-devel < 1.3.0
86 Obsoletes: dtc-doc < 1.3.0-2
88 %description -n libfdt-devel
89 Header files for fdt library.
91 %description -n libfdt-devel -l pl.UTF-8
92 Pliki nagłówkowe biblioteki fdt.
94 %package -n libfdt-static
95 Summary: Static fdt library
96 Summary(pl.UTF-8): Statyczna biblioteka fdt
97 License: GPL v2+ or BSD
98 Group: Development/Libraries
99 Requires: libfdt-devel = %{version}-%{release}
100 Obsoletes: dtc-static < 1.3.0
102 %description -n libfdt-static
105 %description -n libfdt-static -l pl.UTF-8
106 Statyczna biblioteka fdt.
108 %package -n python-libfdt
109 Summary: Python 2 binding for fdt library
110 Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki fdt
111 License: GPL v2+ or BSD
112 Group: Libraries/Python
114 %description -n python-libfdt
115 Python 2 binding for fdt library.
117 %description -n python-libfdt -l pl.UTF-8
118 Wiązanie Pythona 2 do biblioteki fdt.
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
126 %description -n python3-libfdt
127 Python 3 binding for fdt library.
129 %description -n python3-libfdt -l pl.UTF-8
130 Wiązanie Pythona 3 do biblioteki fdt.
139 %{?with_verbose:V=1} \
141 CFLAGS="%{rpmcflags} -fPIC" \
145 export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
155 rm -rf $RPM_BUILD_ROOT
157 %{__make} -j1 install \
158 DESTDIR=$RPM_BUILD_ROOT \
159 %{?with_verbose:V=1} \
163 SETUP_PREFIX=%{_prefix}
166 export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
178 rm -rf $RPM_BUILD_ROOT
180 %post -n libfdt -p /sbin/ldconfig
181 %postun -n libfdt -p /sbin/ldconfig
184 %defattr(644,root,root,755)
185 %doc README.license README.md
186 %attr(755,root,root) %{_bindir}/convert-dtsv0
187 %attr(755,root,root) %{_bindir}/dtc
188 %attr(755,root,root) %{_bindir}/dtdiff
189 %attr(755,root,root) %{_bindir}/fdtdump
190 %attr(755,root,root) %{_bindir}/fdtget
191 %attr(755,root,root) %{_bindir}/fdtoverlay
192 %attr(755,root,root) %{_bindir}/fdtput
195 %defattr(644,root,root,755)
196 %attr(755,root,root) %{_libdir}/libfdt-%{abi_ver}.so
197 %attr(755,root,root) %ghost %{_libdir}/libfdt.so.1
199 %files -n libfdt-devel
200 %defattr(644,root,root,755)
201 %doc TODO Documentation/manual.txt
202 %attr(755,root,root) %{_libdir}/libfdt.so
204 %{_includedir}/libfdt.h
205 %{_includedir}/libfdt_env.h
207 %files -n libfdt-static
208 %defattr(644,root,root,755)
212 %files -n python-libfdt
213 %defattr(644,root,root,755)
214 %attr(755,root,root) %{py_sitedir}/_libfdt.so
215 %{py_sitedir}/libfdt.py[co]
216 %{py_sitedir}/libfdt-%{abi_ver}*.egg-info
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]
225 %{py3_sitedir}/libfdt-%{abi_ver}*.egg-info