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: tar >= 1:1.22
29 BuildRequires: yaml-devel
32 BuildRequires: python-devel >= 2
33 BuildRequires: python-setuptools
34 BuildRequires: python-setuptools_scm
37 BuildRequires: python3-devel >= 1:3.2
38 BuildRequires: python3-setuptools
39 BuildRequires: python3-setuptools_scm
41 BuildRequires: swig-python >= 2.0.10
43 Requires: libfdt = %{version}-%{release}
44 Obsoletes: dtc-doc < 1.3.0-2
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define abi_ver %{version}
49 %{?debug:%define with_verbose 1}
52 The Device Tree Compiler, dtc, takes as input a device-tree in a given
53 format and outputs a device-tree in another format. Typically, the
54 input format is "dts", a human readable source format, and creates a
55 "dtb", or binary format as output.
57 %description -l pl.UTF-8
58 Kompilator drzewiastej struktury urządzeń, dtc, przyjmuje na wejściu
59 dane w jednym formacie by na wyjściu wyprodukować strukturę danych w
60 innym. Najczęściej format wejściowy to "dts", intuicyjny i łatwy w
61 odczycie (tzw. human readable), natomiast wyjściowy to "dtb" lub
62 inaczej format binarny.
65 Summary: Device tree library
66 Summary(pl.UTF-8): Biblioteka drzewiastej struktury urządzeń
67 License: GPL v2+ or BSD
69 Obsoletes: dtc-doc < 1.3.0-2
70 # does not require base. see README.license
72 %description -n libfdt
75 %description -n libfdt -l pl.UTF-8
76 Biblioteka drzewiastej struktury urządzeń.
78 %package -n libfdt-devel
79 Summary: Header files for fdt library
80 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki fdt
81 License: GPL v2+ or BSD
82 Group: Development/Libraries
83 Requires: libfdt = %{version}-%{release}
85 Obsoletes: dtc-doc < 1.3.0-2
87 %description -n libfdt-devel
88 Header files for fdt library.
90 %description -n libfdt-devel -l pl.UTF-8
91 Pliki nagłówkowe biblioteki fdt.
93 %package -n libfdt-static
94 Summary: Static fdt library
95 Summary(pl.UTF-8): Statyczna biblioteka fdt
96 License: GPL v2+ or BSD
97 Group: Development/Libraries
98 Requires: libfdt-devel = %{version}-%{release}
101 %description -n libfdt-static
104 %description -n libfdt-static -l pl.UTF-8
105 Statyczna biblioteka fdt.
107 %package -n python-libfdt
108 Summary: Python 2 binding for fdt library
109 Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki fdt
110 License: GPL v2+ or BSD
111 Group: Libraries/Python
113 %description -n python-libfdt
114 Python 2 binding for fdt library.
116 %description -n python-libfdt -l pl.UTF-8
117 Wiązanie Pythona 2 do biblioteki fdt.
119 %package -n python3-libfdt
120 Summary: Python 3 binding for fdt library
121 Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki fdt
122 License: GPL v2+ or BSD
123 Group: Libraries/Python
125 %description -n python3-libfdt
126 Python 3 binding for fdt library.
128 %description -n python3-libfdt -l pl.UTF-8
129 Wiązanie Pythona 3 do biblioteki fdt.
138 %{?with_verbose:V=1} \
140 CFLAGS="%{rpmcflags} -fPIC" \
144 export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
154 rm -rf $RPM_BUILD_ROOT
156 %{__make} -j1 install \
157 DESTDIR=$RPM_BUILD_ROOT \
158 %{?with_verbose:V=1} \
162 SETUP_PREFIX=%{_prefix}
165 export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
177 rm -rf $RPM_BUILD_ROOT
179 %post -n libfdt -p /sbin/ldconfig
180 %postun -n libfdt -p /sbin/ldconfig
183 %defattr(644,root,root,755)
184 %doc README.license README.md
185 %attr(755,root,root) %{_bindir}/convert-dtsv0
186 %attr(755,root,root) %{_bindir}/dtc
187 %attr(755,root,root) %{_bindir}/dtdiff
188 %attr(755,root,root) %{_bindir}/fdtdump
189 %attr(755,root,root) %{_bindir}/fdtget
190 %attr(755,root,root) %{_bindir}/fdtoverlay
191 %attr(755,root,root) %{_bindir}/fdtput
194 %defattr(644,root,root,755)
195 %attr(755,root,root) %{_libdir}/libfdt-%{abi_ver}.so
196 %attr(755,root,root) %ghost %{_libdir}/libfdt.so.1
198 %files -n libfdt-devel
199 %defattr(644,root,root,755)
200 %doc TODO Documentation/manual.txt
201 %attr(755,root,root) %{_libdir}/libfdt.so
203 %{_includedir}/libfdt.h
204 %{_includedir}/libfdt_env.h
206 %files -n libfdt-static
207 %defattr(644,root,root,755)
211 %files -n python-libfdt
212 %defattr(644,root,root,755)
213 %attr(755,root,root) %{py_sitedir}/_libfdt.so
214 %{py_sitedir}/libfdt.py[co]
215 %{py_sitedir}/libfdt-%{abi_ver}*.egg-info
219 %files -n python3-libfdt
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{py3_sitedir}/_libfdt.cpython-*.so
222 %{py3_sitedir}/libfdt.py
223 %{py3_sitedir}/__pycache__/libfdt.cpython-*.py[co]
224 %{py3_sitedir}/libfdt-%{abi_ver}*.egg-info