]> git.pld-linux.org Git - packages/dtc.git/blob - dtc.spec
8468304ad1b99453cfa3efd0f9ec61904a9a0890
[packages/dtc.git] / dtc.spec
1 #
2 # Conditional build:
3 %bcond_without  python          # Python module (any)
4 %bcond_without  python2         # CPython 2.x module
5 %bcond_without  python3         # CPython 3.x module
6 %bcond_without  verbose         # verbose build (V=1)
7
8 %if %{without python}
9 %undefine       with_python2
10 %undefine       with_python3
11 %endif
12 Summary:        The Device Tree Compiler
13 Summary(pl.UTF-8):      Kompilator drzewiastej struktury urządzeń
14 Name:           dtc
15 Version:        1.6.1
16 Release:        2
17 License:        GPL v2+ (dtc), GPL v2+ or BSD (fdt library)
18 Group:          Libraries
19 Source0:        https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz
20 # Source0-md5:  709888bac3aad657e6020d0e491fc0ba
21 Patch0:         %{name}-python.patch
22 URL:            https://www.devicetree.org/
23 BuildRequires:  bison
24 BuildRequires:  flex
25 BuildRequires:  pkgconfig
26 BuildRequires:  tar >= 1:1.22
27 BuildRequires:  xz
28 BuildRequires:  yaml-devel
29 %if %{with python}
30 %if %{with python2}
31 BuildRequires:  python-devel >= 2
32 %endif
33 %if %{with python3}
34 BuildRequires:  python3-devel >= 1:3.2
35 %endif
36 BuildRequires:  swig-python >= 2.0.10
37 %endif
38 Requires:       libfdt = %{version}-%{release}
39 Obsoletes:      dtc-doc < 1.3.0-2
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         abi_ver %{version}
43
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
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
59 %package -n libfdt
60 Summary:        Device tree library
61 Summary(pl.UTF-8):      Biblioteka drzewiastej struktury urządzeń
62 License:        GPL v2+ or BSD
63 Group:          Libraries
64 Obsoletes:      dtc-doc < 1.3.0-2
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
74 Summary:        Header files for fdt library
75 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki fdt
76 License:        GPL v2+ or BSD
77 Group:          Development/Libraries
78 Requires:       libfdt = %{version}-%{release}
79 Obsoletes:      dtc-devel
80 Obsoletes:      dtc-doc < 1.3.0-2
81
82 %description -n libfdt-devel
83 Header files for fdt library.
84
85 %description -n libfdt-devel -l pl.UTF-8
86 Pliki nagłówkowe biblioteki fdt.
87
88 %package -n libfdt-static
89 Summary:        Static fdt library
90 Summary(pl.UTF-8):      Statyczna biblioteka fdt
91 License:        GPL v2+ or BSD
92 Group:          Development/Libraries
93 Requires:       libfdt-devel = %{version}-%{release}
94 Obsoletes:      dtc-static
95
96 %description -n libfdt-static
97 Static fdt library.
98
99 %description -n libfdt-static -l pl.UTF-8
100 Statyczna biblioteka fdt.
101
102 %package -n python-libfdt
103 Summary:        Python 2 binding for fdt library
104 Summary(pl.UTF-8):      Wiązanie Pythona 2 do biblioteki fdt
105 License:        GPL v2+ or BSD
106 Group:          Libraries/Python
107
108 %description -n python-libfdt
109 Python 2 binding for fdt library.
110
111 %description -n python-libfdt -l pl.UTF-8
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.
125
126 %prep
127 %setup -q
128 %patch0 -p1
129
130 %build
131 %{__make} -j1 \
132         %{?with_verbose:V=1} \
133         CC="%{__cc}" \
134         CFLAGS="%{rpmcflags} -fPIC" \
135         NO_PYTHON=1
136
137 %if %{with python}
138 cd pylibfdt
139 ln -sf ../version_gen.h .
140 ln -sf ../libfdt .
141
142 %if %{with python2}
143 %py_build
144 %endif
145 %if %{with python3}
146 %py3_build
147 %endif
148 %endif
149
150 %install
151 rm -rf $RPM_BUILD_ROOT
152
153 %{__make} -j1 install \
154         DESTDIR=$RPM_BUILD_ROOT \
155         %{?with_verbose:V=1} \
156         PREFIX=%{_prefix} \
157         LIBDIR=%{_libdir} \
158         NO_PYTHON=1 \
159         SETUP_PREFIX=%{_prefix}
160
161 %if %{with python}
162 cd pylibfdt
163
164 %if %{with python2}
165 %py_install
166
167 %py_postclean
168 %endif
169 %if %{with python3}
170 %py3_install
171 %endif
172 %endif
173
174 %clean
175 rm -rf $RPM_BUILD_ROOT
176
177 %post   -n libfdt -p /sbin/ldconfig
178 %postun -n libfdt -p /sbin/ldconfig
179
180 %files
181 %defattr(644,root,root,755)
182 %doc README README.license
183 %attr(755,root,root) %{_bindir}/convert-dtsv0
184 %attr(755,root,root) %{_bindir}/dtc
185 %attr(755,root,root) %{_bindir}/dtdiff
186 %attr(755,root,root) %{_bindir}/fdtdump
187 %attr(755,root,root) %{_bindir}/fdtget
188 %attr(755,root,root) %{_bindir}/fdtoverlay
189 %attr(755,root,root) %{_bindir}/fdtput
190
191 %files -n libfdt
192 %defattr(644,root,root,755)
193 %attr(755,root,root) %{_libdir}/libfdt-%{abi_ver}.so
194 %attr(755,root,root) %ghost %{_libdir}/libfdt.so.1
195
196 %files -n libfdt-devel
197 %defattr(644,root,root,755)
198 %doc TODO Documentation/manual.txt
199 %attr(755,root,root) %{_libdir}/libfdt.so
200 %{_includedir}/fdt.h
201 %{_includedir}/libfdt.h
202 %{_includedir}/libfdt_env.h
203
204 %files -n libfdt-static
205 %defattr(644,root,root,755)
206 %{_libdir}/libfdt.a
207
208 %if %{with python2}
209 %files -n python-libfdt
210 %defattr(644,root,root,755)
211 %attr(755,root,root) %{py_sitedir}/_libfdt.so
212 %{py_sitedir}/libfdt.py[co]
213 %{py_sitedir}/libfdt-%{abi_ver}*.egg-info
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]
222 %{py3_sitedir}/libfdt-%{abi_ver}*.egg-info
223 %endif
This page took 0.073696 seconds and 3 git commands to generate.