]> git.pld-linux.org Git - packages/dtc.git/blame - dtc.spec
macros for %py_build
[packages/dtc.git] / dtc.spec
CommitLineData
f18f0eaf 1#
6861f1fc 2# Conditional build:
cd1c3a73
JB
3%bcond_without python # Python module (any)
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6861f1fc 6%bcond_without verbose # verbose build (V=1)
cff8604d 7
cd1c3a73
JB
8%if %{without python}
9%undefine with_python2
10%undefine with_python3
11%endif
6861f1fc 12Summary: The Device Tree Compiler
cff8604d 13Summary(pl.UTF-8): Kompilator drzewiastej struktury urządzeń
6861f1fc 14Name: dtc
20819d95
JP
15Version: 1.7.0
16Release: 1
fffeac36 17License: GPL v2+ (dtc), GPL v2+ or BSD (fdt library)
6861f1fc 18Group: Libraries
cc076a48 19Source0: https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz
20819d95 20# Source0-md5: 228576aceed3aa89f54283aa0f1eb820
2b797ed5 21Patch0: %{name}-python.patch
20819d95 22Patch1: python2.patch
3c2ba202 23URL: https://www.devicetree.org/
4ecc89ea 24BuildRequires: bison
25BuildRequires: flex
f8302009 26BuildRequires: pkgconfig
c3515ca9 27BuildRequires: rpmbuild(macros) >= 1.714
cc076a48
JB
28BuildRequires: tar >= 1:1.22
29BuildRequires: xz
f8302009 30BuildRequires: yaml-devel
2b797ed5 31%if %{with python}
cd1c3a73 32%if %{with python2}
2b797ed5 33BuildRequires: python-devel >= 2
20819d95
JP
34BuildRequires: python-setuptools
35BuildRequires: python-setuptools_scm
cd1c3a73
JB
36%endif
37%if %{with python3}
38BuildRequires: python3-devel >= 1:3.2
20819d95
JP
39BuildRequires: python3-setuptools
40BuildRequires: python3-setuptools_scm
cd1c3a73
JB
41%endif
42BuildRequires: swig-python >= 2.0.10
2b797ed5 43%endif
fad8e447 44Requires: libfdt = %{version}-%{release}
cff8604d 45Obsoletes: dtc-doc < 1.3.0-2
6861f1fc
ER
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
3c2ba202
JB
48%define abi_ver %{version}
49
6861f1fc
ER
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
b14054e0 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
fad8e447
JR
65%package -n libfdt
66Summary: Device tree library
67Summary(pl.UTF-8): Biblioteka drzewiastej struktury urządzeń
fffeac36 68License: GPL v2+ or BSD
fad8e447 69Group: Libraries
cff8604d 70Obsoletes: dtc-doc < 1.3.0-2
fad8e447
JR
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
6861f1fc
ER
80Summary: Header files for fdt library
81Summary(pl.UTF-8): Pliki nagłówkowe biblioteki fdt
fffeac36 82License: GPL v2+ or BSD
6861f1fc 83Group: Development/Libraries
fad8e447
JR
84Requires: libfdt = %{version}-%{release}
85Obsoletes: dtc-devel
cff8604d 86Obsoletes: dtc-doc < 1.3.0-2
6861f1fc 87
fad8e447 88%description -n libfdt-devel
6861f1fc
ER
89Header files for fdt library.
90
fad8e447 91%description -n libfdt-devel -l pl.UTF-8
6861f1fc
ER
92Pliki nagłówkowe biblioteki fdt.
93
fad8e447 94%package -n libfdt-static
6861f1fc
ER
95Summary: Static fdt library
96Summary(pl.UTF-8): Statyczna biblioteka fdt
fffeac36 97License: GPL v2+ or BSD
6861f1fc 98Group: Development/Libraries
fad8e447
JR
99Requires: libfdt-devel = %{version}-%{release}
100Obsoletes: dtc-static
6861f1fc 101
fad8e447 102%description -n libfdt-static
6861f1fc
ER
103Static fdt library.
104
fad8e447 105%description -n libfdt-static -l pl.UTF-8
6861f1fc
ER
106Statyczna biblioteka fdt.
107
2b797ed5 108%package -n python-libfdt
cd1c3a73
JB
109Summary: Python 2 binding for fdt library
110Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki fdt
2b797ed5
JB
111License: GPL v2+ or BSD
112Group: Libraries/Python
113
114%description -n python-libfdt
cd1c3a73 115Python 2 binding for fdt library.
2b797ed5
JB
116
117%description -n python-libfdt -l pl.UTF-8
cd1c3a73
JB
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.
2b797ed5 131
6861f1fc 132%prep
cc076a48 133%setup -q
2b797ed5 134%patch0 -p1
20819d95 135%patch1 -p1
6861f1fc
ER
136
137%build
6a971399 138%{__make} -j1 \
6861f1fc
ER
139 %{?with_verbose:V=1} \
140 CC="%{__cc}" \
2b797ed5 141 CFLAGS="%{rpmcflags} -fPIC" \
cd1c3a73
JB
142 NO_PYTHON=1
143
144%if %{with python}
20819d95 145export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
cd1c3a73
JB
146%if %{with python2}
147%py_build
148%endif
149%if %{with python3}
150%py3_build
151%endif
152%endif
6861f1fc
ER
153
154%install
155rm -rf $RPM_BUILD_ROOT
6a971399 156
b16cce73 157%{__make} -j1 install \
cff8604d 158 DESTDIR=$RPM_BUILD_ROOT \
6861f1fc
ER
159 %{?with_verbose:V=1} \
160 PREFIX=%{_prefix} \
2b797ed5 161 LIBDIR=%{_libdir} \
cd1c3a73 162 NO_PYTHON=1 \
2b797ed5
JB
163 SETUP_PREFIX=%{_prefix}
164
165%if %{with python}
20819d95 166export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
cd1c3a73
JB
167%if %{with python2}
168%py_install
169
2b797ed5
JB
170%py_postclean
171%endif
cd1c3a73
JB
172%if %{with python3}
173%py3_install
174%endif
175%endif
6861f1fc
ER
176
177%clean
178rm -rf $RPM_BUILD_ROOT
179
f18f0eaf 180%post -n libfdt -p /sbin/ldconfig
cff8604d 181%postun -n libfdt -p /sbin/ldconfig
fad8e447 182
6861f1fc
ER
183%files
184%defattr(644,root,root,755)
20819d95 185%doc README.license README.md
fad8e447 186%attr(755,root,root) %{_bindir}/convert-dtsv0
6861f1fc 187%attr(755,root,root) %{_bindir}/dtc
fad8e447 188%attr(755,root,root) %{_bindir}/dtdiff
cc076a48
JB
189%attr(755,root,root) %{_bindir}/fdtdump
190%attr(755,root,root) %{_bindir}/fdtget
2b797ed5 191%attr(755,root,root) %{_bindir}/fdtoverlay
cc076a48 192%attr(755,root,root) %{_bindir}/fdtput
fad8e447
JR
193
194%files -n libfdt
195%defattr(644,root,root,755)
3c2ba202 196%attr(755,root,root) %{_libdir}/libfdt-%{abi_ver}.so
fad8e447 197%attr(755,root,root) %ghost %{_libdir}/libfdt.so.1
6861f1fc 198
fad8e447 199%files -n libfdt-devel
6861f1fc 200%defattr(644,root,root,755)
cff8604d 201%doc TODO Documentation/manual.txt
fad8e447 202%attr(755,root,root) %{_libdir}/libfdt.so
6861f1fc
ER
203%{_includedir}/fdt.h
204%{_includedir}/libfdt.h
cc076a48 205%{_includedir}/libfdt_env.h
6861f1fc 206
fad8e447 207%files -n libfdt-static
6861f1fc
ER
208%defattr(644,root,root,755)
209%{_libdir}/libfdt.a
2b797ed5 210
cd1c3a73 211%if %{with python2}
2b797ed5
JB
212%files -n python-libfdt
213%defattr(644,root,root,755)
214%attr(755,root,root) %{py_sitedir}/_libfdt.so
668ea320 215%{py_sitedir}/libfdt.py[co]
8e4d820d 216%{py_sitedir}/libfdt-%{abi_ver}*.egg-info
cd1c3a73
JB
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]
8e4d820d 225%{py3_sitedir}/libfdt-%{abi_ver}*.egg-info
2b797ed5 226%endif
This page took 0.14845 seconds and 4 git commands to generate.