File cputype-armv7.spec of Package cputype-armv7

#
# spec file for package qemu-cputype-armv7
#
# Copyright (c) 2012 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:           cputype-armv7
Version:        20190430
Release:        0
Source1:        ldpreload-cputype-armv7.sh
Source2:        fake-uname-to-armv7.c
Summary:        Exports a LD_PRELOAD to fake uname to armv7l
License:        GPL-2.0
Group:          Development/Libraries/Cross
Provides:       qemu-cputype-armv7 = %version
Obsoletes:      qemu-cputype-armv7 < %version
#ExclusiveArch:  armv7l armv7hl

%description
This package provides an easy way for build jobs to force the CPU reported
to be ARMv7.

This helps to make sure that uname returns armv7 and that the instructions we
execute are only within the ARMv7 instruction space.

%prep
%setup -q -D -T -n .

%build
gcc %optflags -shared -fPIC -o libfakearmv7l.so %{SOURCE2} -ldl
LD_PRELOAD=$PWD/libfakearmv7l.so /bin/uname -m

%install
install -D -m 755 libfakearmv7l.so %buildroot/%_lib/libfakearmv7l.so
mkdir -p %buildroot/etc/profile.d
install -m 644 %SOURCE1 %buildroot/etc/profile.d/ldpreload-cputype-armv7.sh

%files
/etc/profile.d
/%_lib/libfakearmv7l.so

%changelog
openSUSE Build Service is sponsored by