]> git.pld-linux.org Git - packages/dtc.git/blame_incremental - dtc.spec
- versioned Obsoletes
[packages/dtc.git] / dtc.spec
... / ...
CommitLineData
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
12Summary: The Device Tree Compiler
13Summary(pl.UTF-8): Kompilator drzewiastej struktury urządzeń
14Name: dtc
15Version: 1.7.0
16Release: 1
17License: GPL v2+ (dtc), GPL v2+ or BSD (fdt library)
18Group: Libraries
19Source0: https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz
20# Source0-md5: 228576aceed3aa89f54283aa0f1eb820
21Patch0: %{name}-python.patch
22Patch1: python2.patch
23URL: https://www.devicetree.org/
24BuildRequires: bison
25BuildRequires: flex
26BuildRequires: pkgconfig
27BuildRequires: rpmbuild(macros) >= 1.714
28BuildRequires: tar >= 1:1.22
29BuildRequires: xz
30BuildRequires: yaml-devel
31%if %{with python}
32%if %{with python2}
33BuildRequires: python-devel >= 2
34BuildRequires: python-setuptools
35BuildRequires: python-setuptools_scm
36%endif
37%if %{with python3}
38BuildRequires: python3-devel >= 1:3.2
39BuildRequires: python3-setuptools
40BuildRequires: python3-setuptools_scm
41%endif
42BuildRequires: swig-python >= 2.0.10
43%endif
44Requires: libfdt = %{version}-%{release}
45Obsoletes: dtc-doc < 1.3.0-2
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%define abi_ver %{version}
49
50%{?debug:%define with_verbose 1}
51
52%description
53The Device Tree Compiler, dtc, takes as input a device-tree in a given
54format and outputs a device-tree in another format. Typically, the
55input 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
59Kompilator drzewiastej struktury urządzeń, dtc, przyjmuje na wejściu
60dane w jednym formacie by na wyjściu wyprodukować strukturę danych w
61innym. Najczęściej format wejściowy to "dts", intuicyjny i łatwy w
62odczycie (tzw. human readable), natomiast wyjściowy to "dtb" lub
63inaczej format binarny.
64
65%package -n libfdt
66Summary: Device tree library
67Summary(pl.UTF-8): Biblioteka drzewiastej struktury urządzeń
68License: GPL v2+ or BSD
69Group: Libraries
70Obsoletes: dtc-doc < 1.3.0-2
71# does not require base. see README.license
72
73%description -n libfdt
74Device tree library.
75
76%description -n libfdt -l pl.UTF-8
77Biblioteka drzewiastej struktury urządzeń.
78
79%package -n libfdt-devel
80Summary: Header files for fdt library
81Summary(pl.UTF-8): Pliki nagłówkowe biblioteki fdt
82License: GPL v2+ or BSD
83Group: Development/Libraries
84Requires: libfdt = %{version}-%{release}
85Obsoletes: dtc-devel < 1.3.0
86Obsoletes: dtc-doc < 1.3.0-2
87
88%description -n libfdt-devel
89Header files for fdt library.
90
91%description -n libfdt-devel -l pl.UTF-8
92Pliki nagłówkowe biblioteki fdt.
93
94%package -n libfdt-static
95Summary: Static fdt library
96Summary(pl.UTF-8): Statyczna biblioteka fdt
97License: GPL v2+ or BSD
98Group: Development/Libraries
99Requires: libfdt-devel = %{version}-%{release}
100Obsoletes: dtc-static < 1.3.0
101
102%description -n libfdt-static
103Static fdt library.
104
105%description -n libfdt-static -l pl.UTF-8
106Statyczna biblioteka fdt.
107
108%package -n python-libfdt
109Summary: Python 2 binding for fdt library
110Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki fdt
111License: GPL v2+ or BSD
112Group: Libraries/Python
113
114%description -n python-libfdt
115Python 2 binding for fdt library.
116
117%description -n python-libfdt -l pl.UTF-8
118Wiązanie Pythona 2 do biblioteki fdt.
119
120%package -n python3-libfdt
121Summary: Python 3 binding for fdt library
122Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki fdt
123License: GPL v2+ or BSD
124Group: Libraries/Python
125
126%description -n python3-libfdt
127Python 3 binding for fdt library.
128
129%description -n python3-libfdt -l pl.UTF-8
130Wią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}
145export 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
155rm -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}
166export 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
178rm -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.078177 seconds and 4 git commands to generate.