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