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