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