LogoopenSUSE Build Service > Projects
Sign Up | Log In

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

#
# spec file for package dtb-aarch64
#
# 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-aarch64
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
ExclusiveArch:  aarch64
%if "dtb-aarch64" == "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.

%package -n dtb-amd
Summary:        AMD based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-amd
Device Tree Files for AMD based arm64 systems.

%package -n dtb-apm
Summary:        AppliedMicro based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-apm
Device Tree Files for AppliedMicro based arm64 systems.

%package -n dtb-arm
Summary:        ARM Ltd. based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-arm
Device Tree Files for ARM Ltd. based arm64 systems.

%package -n dtb-broadcom
Summary:        Broadcom based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-broadcom
Device Tree Files for Broadcom based arm64 systems.

%package -n dtb-cavium
Summary:        Cavium based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-cavium
Device Tree Files for Cavium based arm64 systems.

%package -n dtb-exynos
Summary:        Samsung Exynos based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-exynos
Device Tree Files for Samsung Exynos based arm64 systems.

%package -n dtb-freescale
Summary:        NXP (Freescale) based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-freescale
Device Tree Files for NXP (Freescale) based arm64 systems.

%package -n dtb-hisilicon
Summary:        HiSilicon based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-hisilicon
Device Tree Files for HiSilicon based arm64 systems.

%package -n dtb-marvell
Summary:        Marvell based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-marvell
Device Tree Files for Marvell based arm64 systems.

%package -n dtb-mediatek
Summary:        MediaTek based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-mediatek
Device Tree Files for MediaTek based arm64 systems.

%package -n dtb-qcom
Summary:        Qualcomm based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-qcom
Device Tree Files for Qualcomm based arm64 systems.

%package -n dtb-rockchip
Summary:        Rockchip based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-rockchip
Device Tree Files for Rockchip based arm64 systems.

%package -n dtb-sprd
Summary:        Spreadtrum based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-sprd
Device Tree Files for Spreadtrum based arm64 systems.

%package -n dtb-xilinx
Summary:        Xilinx based arm64 systems
Group:          System/Boot
Provides:       multiversion(dtb)
Requires(post): coreutils

%description -n dtb-xilinx
Device Tree Files for Xilinx based arm64 systems.



%prep

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

cd %{_prefix}/src/linux/arch/arm64/boot/dts
for dts in amd/*.dts apm/*.dts arm/*.dts broadcom/*.dts cavium/*.dts exynos/*.dts freescale/*.dts hisilicon/*.dts marvell/*.dts mediatek/*.dts qcom/*.dts rockchip/*.dts sprd/*.dts xilinx/*.dts ; 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-aarch64" != "dtb-source"

cd pp
for dts in amd/*.dts apm/*.dts arm/*.dts broadcom/*.dts cavium/*.dts exynos/*.dts freescale/*.dts hisilicon/*.dts marvell/*.dts mediatek/*.dts qcom/*.dts rockchip/*.dts sprd/*.dts xilinx/*.dts ; do
	target=${dts%*.dts}
	install -m 700 -d %{buildroot}%{dtbdir}/$(dirname $target)
	install -m 644 $target.dtb %{buildroot}%{dtbdir}/$(dirname $target)
done
cd -

%post -n dtb-amd
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-apm
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-arm
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-broadcom
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-cavium
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-exynos
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-freescale
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-hisilicon
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-marvell
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-mediatek
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-qcom
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-rockchip
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-sprd
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%post -n dtb-xilinx
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%{kernel_version}-%{kernel_release} dtb

%files -n dtb-amd
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/amd
%{dtbdir}/amd/*.dtb

%files -n dtb-apm
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/apm
%{dtbdir}/apm/*.dtb

%files -n dtb-arm
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/arm
%{dtbdir}/arm/*.dtb

%files -n dtb-broadcom
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/broadcom
%{dtbdir}/broadcom/*.dtb

%files -n dtb-cavium
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/cavium
%{dtbdir}/cavium/*.dtb

%files -n dtb-exynos
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/exynos
%{dtbdir}/exynos/*.dtb

%files -n dtb-freescale
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/freescale
%{dtbdir}/freescale/*.dtb

%files -n dtb-hisilicon
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/hisilicon
%{dtbdir}/hisilicon/*.dtb

%files -n dtb-marvell
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/marvell
%{dtbdir}/marvell/*.dtb

%files -n dtb-mediatek
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/mediatek
%{dtbdir}/mediatek/*.dtb

%files -n dtb-qcom
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/qcom
%{dtbdir}/qcom/*.dtb

%files -n dtb-rockchip
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/rockchip
%{dtbdir}/rockchip/*.dtb

%files -n dtb-sprd
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/sprd
%{dtbdir}/sprd/*.dtb

%files -n dtb-xilinx
%defattr(-,root,root)
%doc COPYING
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/xilinx
%{dtbdir}/xilinx/*.dtb

%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