mirror of
https://abf.rosa.ru/djam/dtc.git
synced 2025-02-22 08:53:04 +00:00
154 lines
3.8 KiB
RPMSpec
154 lines
3.8 KiB
RPMSpec
%define major 1
|
|
%define libname %mklibname fdt %{major}
|
|
%define devname %mklibname fdt -d
|
|
%define sdevname %mklibname fdt -d -s
|
|
|
|
Summary: Device Tree Compiler
|
|
Name: dtc
|
|
Version: 1.7.2
|
|
Release: 1
|
|
License: GPLv2+
|
|
Group: Development/Other
|
|
URL: https://www.devicetree.org
|
|
Source0: https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.gz
|
|
BuildRequires: bison
|
|
BuildRequires: flex
|
|
BuildRequires: swig
|
|
BuildRequires: pkgconfig(python3)
|
|
BuildRequires: python3-pip
|
|
BuildRequires: python3-setuptools
|
|
BuildRequires: python3-setuptools_scm
|
|
BuildRequires: python3-wheel
|
|
BuildRequires: python38-devel
|
|
BuildRequires: python38-setuptools
|
|
|
|
%description
|
|
The Device Tree Compiler generates flattened Open Firmware style device trees
|
|
for use with PowerPC machines that lack an Open Firmware implementation and
|
|
ARM/AArch64 devices that don't implement UEFI.
|
|
|
|
%files
|
|
%{_bindir}/*
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%package -n %{libname}
|
|
Summary: Device tree library
|
|
Group: System/Libraries
|
|
Conflicts: %{_lib}fdt1_1 < 1.7.0
|
|
Obsoletes: %{_lib}fdt1_1 < 1.7.0
|
|
|
|
%description -n %{libname}
|
|
libfdt is a library to process Open Firmware style device trees on various
|
|
architectures.
|
|
|
|
%files -n %{libname}
|
|
%{_libdir}/libfdt.so.%{major}*
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%package -n %{devname}
|
|
Summary: Development headers for device tree library
|
|
Group: Development/C
|
|
Requires: %{libname} = %{EVRD}
|
|
Provides: %{name}-devel = %{EVRD}
|
|
Provides: fdt-devel = %{EVRD}
|
|
Conflicts: %{_lib}fdt1-devel < 1.7.0
|
|
Obsoletes: %{_lib}fdt1-devel < 1.7.0
|
|
|
|
%description -n %{devname}
|
|
This package provides development files for libfdt
|
|
|
|
%files -n %{devname}
|
|
%doc GPL
|
|
%{_libdir}/libfdt.so
|
|
%{_includedir}/*.h
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%package -n %{sdevname}
|
|
Summary: %{name} static library
|
|
Group: Development/C
|
|
Requires: %{devname} = %{EVRD}
|
|
Provides: fdt-static-devel = %{EVRD}
|
|
Conflicts: %{_lib}fdt_static1-devel < 1.7.0
|
|
Obsoletes: %{_lib}fdt_static1-devel < 1.7.0
|
|
|
|
%description -n %{sdevname}
|
|
This package provides %{name} static library.
|
|
|
|
%files -n %{sdevname}
|
|
%{_libdir}/libfdt.a
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%package -n python3-%{name}
|
|
Summary: Python 3 bindings for %{name}
|
|
Group: Development/Python
|
|
Provides: python3-libfdt = %{EVRD}
|
|
Requires: %{name} = %{EVRD}
|
|
|
|
%description -n python3-%{name}
|
|
This package provides python3 bindings for %{name}.
|
|
|
|
%files -n python3-%{name}
|
|
%{python3_sitearch}/*
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%prep
|
|
%setup -q
|
|
#autopatch -p1
|
|
|
|
sed -i 's@--prefix=$(PREFIX)@--prefix=$(PREFIX) --root=/@' pylibfdt/Makefile.pylibfdt
|
|
|
|
%ifarch %{e2k}
|
|
# -MG is an unrecognized option for lcc
|
|
sed -i 's,-MG,,' Makefile
|
|
echo '#define DTC_VERSION "DTC %{version}"' > version_gen.h
|
|
%endif
|
|
|
|
%build
|
|
/usr/libexec/python3.8 -m venv .
|
|
. ./bin/activate
|
|
|
|
%set_build_flags
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
|
|
|
|
|
|
sed -i \
|
|
-e '/^CFLAGS =/s:=:+= %{optflags}:' \
|
|
-e '/^CPPFLAGS =/s:=:+=:' \
|
|
-e '/^WARNINGS =/s:=:+=:' \
|
|
-e "/^PREFIX =/s:=.*:= %{_prefix}:" \
|
|
-e "/^LIBDIR =/s:=.*:= \%{_libdir}:" \
|
|
Makefile
|
|
|
|
# no-macro-redefined is a workaround for flex bug
|
|
# https://github.com/westes/flex/issues/155
|
|
|
|
export PYTHONPATH=%{python38_sitelib}
|
|
export PYTHON3=/usr/libexec/python3.8
|
|
export PYTHON=/usr/libexec/python3.8
|
|
|
|
|
|
%make_build \
|
|
CC=%{__cc} \
|
|
LDFLAGS="%{optflags}" \
|
|
WARNINGS+=-Wno-macro-redefined \
|
|
PYTHON=/usr/libexec/python3.8
|
|
# NO_PYTHON=1 \
|
|
|
|
%install
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
|
|
%make_install \
|
|
DESTDIR=%{buildroot} \
|
|
PREFIX=%{buildroot}%{_prefix} \
|
|
LIBDIR=%{_libdir} \
|
|
BINDIR=%{_bindir} \
|
|
INCLUDEDIR=%{_includedir}
|
|
|
|
|
|
# we don't want ftdump and it conflicts with freetype-demos, so drop it (rhbz 797805)
|
|
rm -f %{buildroot}%{_bindir}/ftdump
|
|
|