File dtb-aarch64.spec of Package dtb-source

#
# spec file for package dtb-aarch64
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           dtb-aarch64
BuildRequires:  kernel-source
Version:        %(rpm -q --qf "%{VERSION}" kernel-source | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
Release:        0
Summary:        Device Tree files for $MACHINES
License:        GPL-2.0
Group:          System/Boot
Url:            http://www.kernel.org/
%if "dtb-aarch64" == "dtb-source"
Source99:       pre_checkin.pl
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  cpp
BuildRequires:  dtc >= 1.4.0
BuildRequires:  xz
ExclusiveArch:  aarch64

%description
Device Tree files for $MACHINES.

%package -n dtb-apm-mustang
Summary:        APM X-Gene Mustang board
Group:          System/Boot

%description -n dtb-apm-mustang
Device Tree Files for APM X-Gene Mustang board.

%package -n dtb-foundation-v8
Summary:        Foundation-V8A (compatible with Vexpress64)
Group:          System/Boot

%description -n dtb-foundation-v8
Device Tree Files for Foundation-V8A (compatible with Vexpress64).

%package -n dtb-rtsm_ve-aemv8a
Summary:        RTSM VE AEMv8A board (compatible with Vexpress64)
Group:          System/Boot

%description -n dtb-rtsm_ve-aemv8a
Device Tree Files for RTSM VE AEMv8A board (compatible with Vexpress64).



%prep

%build
cp /usr/src/linux/COPYING .
cp -r /usr/src/linux/ .
chmod -R ug+rw linux

%install
%if "dtb-aarch64" != "dtb-source"
export DTC_FLAGS="-R 4 -p 0x1000"
mkdir -p %{buildroot}/boot/dtb

cd linux/arch/arm64/boot/dts
for dts in apm-mustang.dts foundation-v8.dts rtsm_ve-aemv8a.dts ; do
	target=${dts%*.dts}
	cpp -x assembler-with-cpp -undef -D__DTS__ -nostdinc -I. -I./include/ -P $target.dts -o $target.dts.tmp
	dtc $DTC_FLAGS -I dts -O dtb -o %{buildroot}/boot/dtb/$target.dtb $target.dts.tmp
done
cd -

%files -n dtb-apm-mustang
%defattr(-,root,root)
%doc COPYING
%dir /boot/dtb/
/boot/dtb/apm-mustang.dtb

%files -n dtb-foundation-v8
%defattr(-,root,root)
%doc COPYING
%dir /boot/dtb/
/boot/dtb/foundation-v8.dtb

%files -n dtb-rtsm_ve-aemv8a
%defattr(-,root,root)
%doc COPYING
%dir /boot/dtb/
/boot/dtb/rtsm_ve-aemv8a.dtb

%endif

%changelog
openSUSE Build Service is sponsored by