File genwqe-tools.spec of Package genwqe-tools

# spec file for package genwqe-tools
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright 2015, International Business Machines
# 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

Summary:        GenWQE userspace tools
License:        Apache-2.0
Group:          Development/Tools
Name:           genwqe-tools
Version:        4.0.20
Release:        1%{?dist}
Requires:       zlib >= 1.2.7
BuildRequires:  help2man
BuildRequires:  zlib-devel >= 1.2.7
%ifarch ppc64le ppc64
BuildRequires:  kernel-devel >= 4.4.21-69
BuildRequires:  libcxl-devel
BuildRequires:  fdupes
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  s390x ppc64le ppc64
#for building from local git (fetched from _service)
Source0:        genwqe-user-%{version}.tar.xz
Source1:        %{name}-rpmlintrc
Patch0:         genwqe-user-4.0.18-install-gzFile_test.patch
Patch1:         genwqe-user-4.0.18-config.patch

Provide a suite of utilities to manage and configure the IBM GenWQE card.

%package -n genwqe-zlib
Summary:        GenWQE hardware accelerated libz
Group:          System/Libraries

%description -n genwqe-zlib
GenWQE hardware accelerated libz and test-utilities.

%package -n genwqe-vpd
Summary:        GenWQE adapter VPD tools
Group:          System/Libraries

%description -n genwqe-vpd
The genwqe-vpd package contains GenWQE adapter VPD tools.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%autosetup -p1 -n genwqe-user-%{version}

make %{?_smp_mflags} tools lib VERSION=%{version} \

make %{?_smp_mflags} install DESTDIR=%{buildroot}/%{_prefix} \
        VERSION=%{version} SYSTEMD_UNIT_DIR=%{buildroot}/%{_unitdir} \
	LIB_INSTALL_PATH=%{buildroot}/%{_libdir}/genwqe \

# FIXME Instead of trying to fixup things in the spec fike, let us consider
#       changing the associated install rule, such that the spec file
#       can get smaller and simpler.

# Move genwqe_vpd.csv to expected location.
mkdir -p %{buildroot}/%{_sysconfdir}/
install -m 0644 tools/genwqe_vpd.csv %{buildroot}/etc/

%fdupes %{buildroot}%{_bindir}

ln -sf %{_bindir}/genwqe_gunzip %{buildroot}/%{_libdir}/genwqe/gunzip
ln -sf %{_bindir}/genwqe_gzip   %{buildroot}/%{_libdir}/genwqe/gzip

%ifarch ppc64le ppc64
%service_add_pre genwqe_maint.service

%service_add_post genwqe_maint.service

%service_del_preun genwqe_maint.service

%service_del_postun genwqe_maint.service

%files -n genwqe-tools




%ifarch ppc64le ppc64

%files -n genwqe-zlib
%dir %{_libdir}/genwqe

%files -n genwqe-vpd

%files devel
%dir %{_includedir}/genwqe