@ -1,15 +1,41 @@
%global with_mingw 0
%if 0%{?fedora}
%global with_mingw 1
%endif
%undefine _auto_set_build_flags
Name: dtc
Version: 1.6.0
Release: 7%{?dist}
Version: 1.7 .0
Release: 12 %{?dist}
Summary: Device Tree Compiler
License: GPLv2+
License: GPL-2.0-or-later
URL: https://devicetree.org/
Source0: https://www.kernel.org/pub/software/utils/%{name}/%{name}-%{version}.tar.xz
Patch1: 0001-pylibfdt-Makefile.pylibfdt-Use-CFLAGS-when-building-.patch
# For RHEL-64318 - [RHEL10][CS10] dtc fails to build with Swig 4.3.0
Patch2: dtc-pylibfdt-libfdt.i-Use-SWIG_AppendOutput.patch
BuildRequires: gcc make
BuildRequires: flex bison swig
BuildRequires: python3-devel python3-setuptools
BuildRequires: python3-devel
BuildRequires: python3-pip
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
BuildRequires: python3-wheel
%if %{with_mingw}
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc-c++
BuildRequires: meson
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc-c++
%endif
%description
Devicetree is a data structure for describing hardware. Rather than hard coding
@ -48,20 +74,73 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python3-libfdt
This package provides python2 bindings for libfdt
%if %{with_mingw}
%package -n mingw32-libfdt
Summary: MinGW Device tree library
BuildArch: noarch
%description -n mingw32-libfdt
libfdt is a library to process Open Firmware style device trees on various
architectures.
%package -n mingw32-libfdt-static
Summary: Static version of MinGW Device tree library
Requires: mingw32-libfdt = %{version}-%{release}
BuildArch: noarch
%description -n mingw32-libfdt-static
This package provides the static library of mingw32-libfdt
%package -n mingw64-libfdt
Summary: MinGW Device tree library
BuildArch: noarch
%description -n mingw64-libfdt
libfdt is a library to process Open Firmware style device trees on various
architectures.
%package -n mingw64-libfdt-static
Summary: Static version of MinGW Device tree library
Requires: mingw64-libfdt = %{version}-%{release}
BuildArch: noarch
%description -n mingw64-libfdt-static
This package provides the static library of mingw64-libfdt
%{?mingw_debug_package}
%endif
%prep
%autosetup -p1
sed -i 's/python2/python3/' pylibfdt/setup.py
# to prevent setuptools from installing an .egg, we need to pass --root to setup.py install
# since $(PREFIX) already contains %%{buildroot}, we set root to /
# .eggs are going to be deprecated, see https://github.com/pypa/pip/issues/11501
sed -i 's@--prefix=$(PREFIX)@--prefix=$(PREFIX) --root=/@' pylibfdt/Makefile.pylibfdt
%build
%{make_build} EXTRA_CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%{make_build} EXTRA_CFLAGS="%{build_cflags} -Wno-redundant-decls -Wno-cast-qual -Wno-missing-prototypes" LDFLAGS="%{build_ldflags}"
%if %{with_mingw}
%mingw_meson -Dtools=false
%mingw_ninja
%endif
%install
%{make_install} DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \
LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir}
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%{make_install} DESTDIR=%{buildroot} PREFIX=%{buildroot}/%{_prefix} \
LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir} \
EXTRA_CFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}"
# we don't want ftdump and it conflicts with freetype-demos, so drop it (rhbz 797805)
rm -f $RPM_BUILD_ROOT/%{_bindir}/ftdump
%if %{with_mingw}
%mingw_ninja_install
%mingw_debug_install_post
%endif
%ldconfig_scriptlets -n libfdt
%files
@ -71,7 +150,7 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/ftdump
%files -n libfdt
%license GPL
%{_libdir}/libfdt-1.6.0 .so
%{_libdir}/libfdt-%{version} .so
%{_libdir}/libfdt.so.*
%files -n libfdt-static
@ -82,20 +161,108 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/ftdump
%{_includedir}/*
%files -n python3-libfdt
%{python3_sitearch}/*
%{python3_sitearch}/libfdt-%{version}-py%{python3_version}.egg-info/
%{python3_sitearch}/_libfdt%{python3_ext_suffix}
%pycached %{python3_sitearch}/libfdt.py
%if %{with_mingw}
%files -n mingw32-libfdt
%license GPL
%{mingw32_bindir}/libfdt-1.dll
%{mingw32_includedir}/*fdt*.h
%{mingw32_libdir}/libfdt.dll.a
%{mingw32_libdir}/pkgconfig/libfdt.pc
%files -n mingw32-libfdt-static
%{mingw32_libdir}/libfdt.a
%files -n mingw64-libfdt
%license GPL
%{mingw64_bindir}/libfdt-1.dll
%{mingw64_includedir}/*fdt*.h
%{mingw64_libdir}/libfdt.dll.a
%{mingw64_libdir}/pkgconfig/libfdt.pc
%files -n mingw64-libfdt-static
%{mingw64_libdir}/libfdt.a
%endif
%changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.6.0-7
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Nov 26 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 1.7.0-12
- Rebuilt for MSVSphere 10
* Tue Nov 12 2024 Miroslav Rezanina <mrezanin@redhat.com> - 1.7.0-12
- dtc-pylibfdt-libfdt.i-Use-SWIG_AppendOutput.patch [RHEL-64318 RHEL-65448]
- dtc-Disable-problematic-waring-flags.patch [RHEL-64318 RHEL-65448]
- Resolves: RHEL-64318
([RHEL10][CS10] dtc fails to build with Swig 4.3.0)
- Resolves: RHEL-65448
([RHEL10][CS10][FTBFS] dtc fails to build on CS10 and RHEL10)
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.7.0-11
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Jun 28 2024 Miroslav Rezanina <mrezanin@redhat.com> - 1.7.0-10
- Fix missing dynamic tags for aarch64 python3 pylibfdt
- Resolves: RHEL-33493
(Annocheck FAIL: bind-now (dtc))
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.7.0-9
- Bump release for June 2024 mass rebuild
* Mon May 27 2024 Miroslav Rezanina <mrezanin@redhat.com> - 1.7.0-8
- dtc-Properly-harden-built-packages.patch [RHEL-33493]
- Resolves: RHEL-33493
(Annocheck FAIL: bind-now (dtc))
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Sep 27 2023 Miro Hrončok <mhroncok@redhat.com> - 1.7.0-5
- Don't install a Python .egg
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jul 05 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 1.7.0-3
- Rebuilt for Python 3.12
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 1.7.0-2
- Rebuilt for Python 3.12
* Mon Mar 20 2023 Peter Robinson <pbrobinson@fedoraproject.org> - 1.7.0-1
- Update to 1.7.0
* Mon Feb 13 2023 Josh Boyer <jwboyer@fedoraproject.org> - 1.6.1-8
- migrated to SPDX license
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Sep 14 2022 Marc-André Lureau <marcandre.lureau@redhat.com> - 1.6.1-6
- Add mingw sub-packages. Fixes rhbz#1997511
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.6.1-4
- Rebuilt for Python 3.11
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jun 23 2021 Miroslav Rezanina <mrezanin@redhat.com> - 1.6.0-6
- Gating rebuild [bz#1974188]
- Resolves: bz#1974188
(Define tests, including gating tests, for dtc)
* Tue Jun 08 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 1.6.1-1
- Update to 1.6.1
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.6.0-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.6.0-5
- Rebuilt for Python 3.10
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild