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