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