File spirv-tools.spec of Package spirv-tools

#
# spec file for package spirv-tools
#
# 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 version_unconverted 1.1.g41
%define lname libSPIRV-Tools-1_1

Name:           spirv-tools
Version:        1.1.g41
Release:        0
Summary:        API and commands for processing SPIR-V modules
License:        MIT
Group:          Development/Libraries/C and C++
Url:            https://github.com/KhronosGroup/SPIRV-Tools

Source:         %name-%version.tar.xz
Patch1:         ver.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  bison
BuildRequires:  cmake >= 2.8.12
BuildRequires:  gcc-c++
BuildRequires:  python3
BuildRequires:  spirv-headers

%description
The package includes an assembler, binary module parser,
disassembler, and validator for SPIR-V.

%package -n %lname
Summary:        SPIR-V tool component library
Group:          System/Libraries

%description -n %lname
The SPIR-V Tool library contains all of the implementation details
driving the SPIR-V assembler, binary module parser, disassembler and
validator, and is used in the standalone tools whilst also enabling
integration into other code bases directly.

%package devel
Summary:        Development headers for the SPIR-V tool library
Group:          Development/Libraries/C and C++
Requires:       %lname = %version

%description devel
The SPIR-V Tool library contains all of the implementation details
driving the SPIR-V assembler, binary module parser, disassembler and
validator, and is used in the standalone tools whilst also enabling
integration into other code bases directly.

%prep
%setup -q
%patch -P 1 -p1

%build
%cmake -D"SPIRV-Headers_SOURCE_DIR=%_prefix"
make %{?_smp_mflags}

%install
b="%buildroot"
%cmake_install
# duh..
if [ "%_lib" != lib ]; then
	pushd "$b/%_prefix"
	mv "lib" "%_lib"
fi

%post   -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig

%files
%_bindir/spirv-*
%doc LICENSE

%files -n %lname
%_libdir/libSPIRV-Tools-1.1.so

%files devel
%_includedir/spirv-tools/

%changelog
openSUSE Build Service is sponsored by