]>
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 |
8e4d820d JP |
15 | Version: 1.6.1 |
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 |
8e4d820d | 20 | # Source0-md5: 709888bac3aad657e6020d0e491fc0ba |
2b797ed5 | 21 | Patch0: %{name}-python.patch |
3c2ba202 | 22 | URL: https://www.devicetree.org/ |
4ecc89ea | 23 | BuildRequires: bison |
24 | BuildRequires: flex | |
f8302009 | 25 | BuildRequires: pkgconfig |
cc076a48 JB |
26 | BuildRequires: tar >= 1:1.22 |
27 | BuildRequires: xz | |
f8302009 | 28 | BuildRequires: yaml-devel |
2b797ed5 | 29 | %if %{with python} |
cd1c3a73 | 30 | %if %{with python2} |
2b797ed5 | 31 | BuildRequires: python-devel >= 2 |
cd1c3a73 JB |
32 | %endif |
33 | %if %{with python3} | |
34 | BuildRequires: python3-devel >= 1:3.2 | |
35 | %endif | |
36 | BuildRequires: swig-python >= 2.0.10 | |
2b797ed5 | 37 | %endif |
fad8e447 | 38 | Requires: libfdt = %{version}-%{release} |
cff8604d | 39 | Obsoletes: dtc-doc < 1.3.0-2 |
6861f1fc ER |
40 | BuildRoot: %{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 | |
47 | The Device Tree Compiler, dtc, takes as input a device-tree in a given | |
48 | format and outputs a device-tree in another format. Typically, the | |
49 | input 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 |
53 | Kompilator drzewiastej struktury urządzeń, dtc, przyjmuje na wejściu | |
54 | dane w jednym formacie by na wyjściu wyprodukować strukturę danych w | |
55 | innym. Najczęściej format wejściowy to "dts", intuicyjny i łatwy w | |
56 | odczycie (tzw. human readable), natomiast wyjściowy to "dtb" lub | |
57 | inaczej format binarny. | |
58 | ||
fad8e447 JR |
59 | %package -n libfdt |
60 | Summary: Device tree library | |
61 | Summary(pl.UTF-8): Biblioteka drzewiastej struktury urządzeń | |
fffeac36 | 62 | License: GPL v2+ or BSD |
fad8e447 | 63 | Group: Libraries |
cff8604d | 64 | Obsoletes: dtc-doc < 1.3.0-2 |
fad8e447 JR |
65 | # does not require base. see README.license |
66 | ||
67 | %description -n libfdt | |
68 | Device tree library. | |
69 | ||
70 | %description -n libfdt -l pl.UTF-8 | |
71 | Biblioteka drzewiastej struktury urządzeń. | |
72 | ||
73 | %package -n libfdt-devel | |
6861f1fc ER |
74 | Summary: Header files for fdt library |
75 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki fdt | |
fffeac36 | 76 | License: GPL v2+ or BSD |
6861f1fc | 77 | Group: Development/Libraries |
fad8e447 JR |
78 | Requires: libfdt = %{version}-%{release} |
79 | Obsoletes: dtc-devel | |
cff8604d | 80 | Obsoletes: dtc-doc < 1.3.0-2 |
6861f1fc | 81 | |
fad8e447 | 82 | %description -n libfdt-devel |
6861f1fc ER |
83 | Header files for fdt library. |
84 | ||
fad8e447 | 85 | %description -n libfdt-devel -l pl.UTF-8 |
6861f1fc ER |
86 | Pliki nagłówkowe biblioteki fdt. |
87 | ||
fad8e447 | 88 | %package -n libfdt-static |
6861f1fc ER |
89 | Summary: Static fdt library |
90 | Summary(pl.UTF-8): Statyczna biblioteka fdt | |
fffeac36 | 91 | License: GPL v2+ or BSD |
6861f1fc | 92 | Group: Development/Libraries |
fad8e447 JR |
93 | Requires: libfdt-devel = %{version}-%{release} |
94 | Obsoletes: dtc-static | |
6861f1fc | 95 | |
fad8e447 | 96 | %description -n libfdt-static |
6861f1fc ER |
97 | Static fdt library. |
98 | ||
fad8e447 | 99 | %description -n libfdt-static -l pl.UTF-8 |
6861f1fc ER |
100 | Statyczna biblioteka fdt. |
101 | ||
2b797ed5 | 102 | %package -n python-libfdt |
cd1c3a73 JB |
103 | Summary: Python 2 binding for fdt library |
104 | Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki fdt | |
2b797ed5 JB |
105 | License: GPL v2+ or BSD |
106 | Group: Libraries/Python | |
107 | ||
108 | %description -n python-libfdt | |
cd1c3a73 | 109 | Python 2 binding for fdt library. |
2b797ed5 JB |
110 | |
111 | %description -n python-libfdt -l pl.UTF-8 | |
cd1c3a73 JB |
112 | Wiązanie Pythona 2 do biblioteki fdt. |
113 | ||
114 | %package -n python3-libfdt | |
115 | Summary: Python 3 binding for fdt library | |
116 | Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki fdt | |
117 | License: GPL v2+ or BSD | |
118 | Group: Libraries/Python | |
119 | ||
120 | %description -n python3-libfdt | |
121 | Python 3 binding for fdt library. | |
122 | ||
123 | %description -n python3-libfdt -l pl.UTF-8 | |
124 | Wią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} | |
138 | cd pylibfdt | |
8e4d820d JP |
139 | ln -sf ../version_gen.h . |
140 | ln -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 | |
151 | rm -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 |
162 | cd 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 | |
175 | rm -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 |