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