]>
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 |
cc076a48 JB |
27 | BuildRequires: tar >= 1:1.22 |
28 | BuildRequires: xz | |
f8302009 | 29 | BuildRequires: yaml-devel |
2b797ed5 | 30 | %if %{with python} |
cd1c3a73 | 31 | %if %{with python2} |
2b797ed5 | 32 | BuildRequires: python-devel >= 2 |
20819d95 JP |
33 | BuildRequires: python-setuptools |
34 | BuildRequires: python-setuptools_scm | |
cd1c3a73 JB |
35 | %endif |
36 | %if %{with python3} | |
37 | BuildRequires: python3-devel >= 1:3.2 | |
20819d95 JP |
38 | BuildRequires: python3-setuptools |
39 | BuildRequires: python3-setuptools_scm | |
cd1c3a73 JB |
40 | %endif |
41 | BuildRequires: swig-python >= 2.0.10 | |
2b797ed5 | 42 | %endif |
fad8e447 | 43 | Requires: libfdt = %{version}-%{release} |
cff8604d | 44 | Obsoletes: dtc-doc < 1.3.0-2 |
6861f1fc ER |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
3c2ba202 JB |
47 | %define abi_ver %{version} |
48 | ||
6861f1fc ER |
49 | %{?debug:%define with_verbose 1} |
50 | ||
51 | %description | |
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. | |
56 | ||
b14054e0 | 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. | |
63 | ||
fad8e447 JR |
64 | %package -n libfdt |
65 | Summary: Device tree library | |
66 | Summary(pl.UTF-8): Biblioteka drzewiastej struktury urządzeń | |
fffeac36 | 67 | License: GPL v2+ or BSD |
fad8e447 | 68 | Group: Libraries |
cff8604d | 69 | Obsoletes: dtc-doc < 1.3.0-2 |
fad8e447 JR |
70 | # does not require base. see README.license |
71 | ||
72 | %description -n libfdt | |
73 | Device tree library. | |
74 | ||
75 | %description -n libfdt -l pl.UTF-8 | |
76 | Biblioteka drzewiastej struktury urządzeń. | |
77 | ||
78 | %package -n libfdt-devel | |
6861f1fc ER |
79 | Summary: Header files for fdt library |
80 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki fdt | |
fffeac36 | 81 | License: GPL v2+ or BSD |
6861f1fc | 82 | Group: Development/Libraries |
fad8e447 JR |
83 | Requires: libfdt = %{version}-%{release} |
84 | Obsoletes: dtc-devel | |
cff8604d | 85 | Obsoletes: dtc-doc < 1.3.0-2 |
6861f1fc | 86 | |
fad8e447 | 87 | %description -n libfdt-devel |
6861f1fc ER |
88 | Header files for fdt library. |
89 | ||
fad8e447 | 90 | %description -n libfdt-devel -l pl.UTF-8 |
6861f1fc ER |
91 | Pliki nagłówkowe biblioteki fdt. |
92 | ||
fad8e447 | 93 | %package -n libfdt-static |
6861f1fc ER |
94 | Summary: Static fdt library |
95 | Summary(pl.UTF-8): Statyczna biblioteka fdt | |
fffeac36 | 96 | License: GPL v2+ or BSD |
6861f1fc | 97 | Group: Development/Libraries |
fad8e447 JR |
98 | Requires: libfdt-devel = %{version}-%{release} |
99 | Obsoletes: dtc-static | |
6861f1fc | 100 | |
fad8e447 | 101 | %description -n libfdt-static |
6861f1fc ER |
102 | Static fdt library. |
103 | ||
fad8e447 | 104 | %description -n libfdt-static -l pl.UTF-8 |
6861f1fc ER |
105 | Statyczna biblioteka fdt. |
106 | ||
2b797ed5 | 107 | %package -n python-libfdt |
cd1c3a73 JB |
108 | Summary: Python 2 binding for fdt library |
109 | Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki fdt | |
2b797ed5 JB |
110 | License: GPL v2+ or BSD |
111 | Group: Libraries/Python | |
112 | ||
113 | %description -n python-libfdt | |
cd1c3a73 | 114 | Python 2 binding for fdt library. |
2b797ed5 JB |
115 | |
116 | %description -n python-libfdt -l pl.UTF-8 | |
cd1c3a73 JB |
117 | Wiązanie Pythona 2 do biblioteki fdt. |
118 | ||
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 | |
124 | ||
125 | %description -n python3-libfdt | |
126 | Python 3 binding for fdt library. | |
127 | ||
128 | %description -n python3-libfdt -l pl.UTF-8 | |
129 | Wiązanie Pythona 3 do biblioteki fdt. | |
2b797ed5 | 130 | |
6861f1fc | 131 | %prep |
cc076a48 | 132 | %setup -q |
2b797ed5 | 133 | %patch0 -p1 |
20819d95 | 134 | %patch1 -p1 |
6861f1fc ER |
135 | |
136 | %build | |
6a971399 | 137 | %{__make} -j1 \ |
6861f1fc ER |
138 | %{?with_verbose:V=1} \ |
139 | CC="%{__cc}" \ | |
2b797ed5 | 140 | CFLAGS="%{rpmcflags} -fPIC" \ |
cd1c3a73 JB |
141 | NO_PYTHON=1 |
142 | ||
143 | %if %{with python} | |
20819d95 | 144 | export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} |
cd1c3a73 JB |
145 | %if %{with python2} |
146 | %py_build | |
147 | %endif | |
148 | %if %{with python3} | |
149 | %py3_build | |
150 | %endif | |
151 | %endif | |
6861f1fc ER |
152 | |
153 | %install | |
154 | rm -rf $RPM_BUILD_ROOT | |
6a971399 | 155 | |
b16cce73 | 156 | %{__make} -j1 install \ |
cff8604d | 157 | DESTDIR=$RPM_BUILD_ROOT \ |
6861f1fc ER |
158 | %{?with_verbose:V=1} \ |
159 | PREFIX=%{_prefix} \ | |
2b797ed5 | 160 | LIBDIR=%{_libdir} \ |
cd1c3a73 | 161 | NO_PYTHON=1 \ |
2b797ed5 JB |
162 | SETUP_PREFIX=%{_prefix} |
163 | ||
164 | %if %{with python} | |
20819d95 | 165 | export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} |
cd1c3a73 JB |
166 | %if %{with python2} |
167 | %py_install | |
168 | ||
2b797ed5 JB |
169 | %py_postclean |
170 | %endif | |
cd1c3a73 JB |
171 | %if %{with python3} |
172 | %py3_install | |
173 | %endif | |
174 | %endif | |
6861f1fc ER |
175 | |
176 | %clean | |
177 | rm -rf $RPM_BUILD_ROOT | |
178 | ||
f18f0eaf | 179 | %post -n libfdt -p /sbin/ldconfig |
cff8604d | 180 | %postun -n libfdt -p /sbin/ldconfig |
fad8e447 | 181 | |
6861f1fc ER |
182 | %files |
183 | %defattr(644,root,root,755) | |
20819d95 | 184 | %doc README.license README.md |
fad8e447 | 185 | %attr(755,root,root) %{_bindir}/convert-dtsv0 |
6861f1fc | 186 | %attr(755,root,root) %{_bindir}/dtc |
fad8e447 | 187 | %attr(755,root,root) %{_bindir}/dtdiff |
cc076a48 JB |
188 | %attr(755,root,root) %{_bindir}/fdtdump |
189 | %attr(755,root,root) %{_bindir}/fdtget | |
2b797ed5 | 190 | %attr(755,root,root) %{_bindir}/fdtoverlay |
cc076a48 | 191 | %attr(755,root,root) %{_bindir}/fdtput |
fad8e447 JR |
192 | |
193 | %files -n libfdt | |
194 | %defattr(644,root,root,755) | |
3c2ba202 | 195 | %attr(755,root,root) %{_libdir}/libfdt-%{abi_ver}.so |
fad8e447 | 196 | %attr(755,root,root) %ghost %{_libdir}/libfdt.so.1 |
6861f1fc | 197 | |
fad8e447 | 198 | %files -n libfdt-devel |
6861f1fc | 199 | %defattr(644,root,root,755) |
cff8604d | 200 | %doc TODO Documentation/manual.txt |
fad8e447 | 201 | %attr(755,root,root) %{_libdir}/libfdt.so |
6861f1fc ER |
202 | %{_includedir}/fdt.h |
203 | %{_includedir}/libfdt.h | |
cc076a48 | 204 | %{_includedir}/libfdt_env.h |
6861f1fc | 205 | |
fad8e447 | 206 | %files -n libfdt-static |
6861f1fc ER |
207 | %defattr(644,root,root,755) |
208 | %{_libdir}/libfdt.a | |
2b797ed5 | 209 | |
cd1c3a73 | 210 | %if %{with python2} |
2b797ed5 JB |
211 | %files -n python-libfdt |
212 | %defattr(644,root,root,755) | |
213 | %attr(755,root,root) %{py_sitedir}/_libfdt.so | |
668ea320 | 214 | %{py_sitedir}/libfdt.py[co] |
8e4d820d | 215 | %{py_sitedir}/libfdt-%{abi_ver}*.egg-info |
cd1c3a73 JB |
216 | %endif |
217 | ||
218 | %if %{with python3} | |
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] | |
8e4d820d | 224 | %{py3_sitedir}/libfdt-%{abi_ver}*.egg-info |
2b797ed5 | 225 | %endif |