LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dtb-source.spec of Package dtb-source (Project home:ocurero:branches:Base:System)

#
# spec file for package dtb-source
#
# Copyright (c) 2016 SUSE LINUX 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/
#


%define kernel_version %(rpm -q --qf "%{VERSION}" kernel-source | grep -v "is not")
%define kernel_release %(rpm -q --qf "%{RELEASE}" kernel-source | grep -v "is not" | cut -d. -f 1)
Name:           dtb-source
Version:        %{kernel_version}
Release:        0
Summary:        Device Tree files for $MACHINES
License:        GPL-2.0
Group:          System/Boot
Url:            http://www.kernel.org/
BuildRequires:  kernel-source

%if "dtb-source" == "dtb-source"
Source99:       pre_checkin.pl
%else
BuildRequires:  cpp
BuildRequires:  dtc >= 1.4.0
BuildRequires:  xz
Requires:       kernel = %{kernel_version}
%endif

%description
Device Tree files for $MACHINES.



%prep

%build
cp %{_prefix}/src/linux/COPYING .
%if "dtb-source" != "dtb-source"
mkdir pp
PPDIR=`pwd`/pp
export DTC_FLAGS="-R 4 -p 0x1000"

cd %{_prefix}/src/linux/arch/arm/boot/dts
for dts in ; do
	target=${dts%*.dts}
	mkdir -p $PPDIR/$(dirname $target)
	cpp -x assembler-with-cpp -undef -D__DTS__ -nostdinc -I. -I./include/ -P $target.dts -o $PPDIR/$target.dts
	dtc $DTC_FLAGS -I dts -O dtb -i ./$(dirname $target) -o $PPDIR/$target.dtb $PPDIR/$target.dts
done
%endif

%define dtbdir /boot/dtb-%{kernel_version}-%{kernel_release}

%install
%if "dtb-source" != "dtb-source"

cd pp
for dts in ; do
	target=${dts%*.dts}
	install -m 700 -d %{buildroot}%{dtbdir}/$(dirname $target)
	install -m 644 $target.dtb %{buildroot}%{dtbdir}/$(dirname $target)
done
cd -

%else
cat - > README <<EOF
This package only consists for convenience reason to pass openSUSE Factory
review bots. Please take a look at the dtb-%{_arch}.src.rpm instead.
EOF

%files
%doc README COPYING

%endif

%changelog