Accepting request 571426 from home:mslacken

- Put the libraries to external packages
  * added sample config files
  * rename compat file and upadet its description

OBS-URL: https://build.opensuse.org/request/show/571426
OBS-URL: https://build.opensuse.org/package/show/network:cluster/genders?expand=0&rev=5
This commit is contained in:
Egbert Eich 2018-01-31 15:49:05 +00:00 committed by Git OBS Bridge
parent 97cddabdba
commit 09192465e4
2 changed files with 84 additions and 26 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jan 31 13:42:28 UTC 2018 - cgoll@suse.com
- Put the libraries to external packages
* added sample config files
* rename compat file and upadet its description
-------------------------------------------------------------------
Tue Jan 30 13:38:14 UTC 2018 - cgoll@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package genders
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 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
@ -17,25 +17,30 @@
%define pname genders
# Check file META in sources: update so_version to (API_CURRENT - API_AGE)
%define c_api 0
%define cpp_api 2
Name: %{pname}
Version: 1.22
Release: 1%{?dist}
Release: 0
Summary: Static cluster configuration database
License: GPL-2.0
Group: System/Management
Source: https://github.com/chaos/genders/releases/download/genders-1-22-1/%{pname}-%{version}.tar.gz
Patch1: Fix-Python-package-installation-use-root.patch
Patch2: Remove-PERL_DESTDIR-use-DESTDIR-instead.patch
Patch3: Remove-all-remains-of-EXTENSION_DESTDIR.patch
Patch2: Remove-PERL_DESTDIR-use-DESTDIR-instead.patch
Patch3: Remove-all-remains-of-EXTENSION_DESTDIR.patch
Url: https://github.com/chaos/genders
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: python
BuildRequires: python-devel
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: autoconf automake libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -48,12 +53,12 @@ sense the variations of cluster nodes. By abstracting this information
into a plain text file, it becomes possible to change the
configuration of a cluster by modifying only one file.
%package -n %{pname}-compat
Summary: Compatibility Library
Group: System/Management
%package -n %{pname}-perl-compat
Summary: Perl compatibility Library
Group: Development/Languages/Perl
%description -n %{pname}-compat
genders API that is compatible with earlier releases of genders
%description -n %{pname}-perl-compat
Perl genders API for the most part used exclusively by LLNL. It is compatible with earlier releases of genders.
%package -n %{pname}-devel
Summary: Headers and development files
@ -65,7 +70,7 @@ genders headers and libraries files needed for development
%package -n python-%{pname}
Summary: Python bindings for genders
Group: Development/Languages/Perl
Group: Development/Languages/Python
Requires: %{pname} = %{version}
Requires: python
@ -73,14 +78,30 @@ Requires: python
Necessary files for using genders with python
%package -n perl-%{pname}
Summary: Python bindings for genders
Group: Development/Languages/Python
Summary: Perl bindings for genders
Group: Development/Languages/Perl
Requires: %{pname} = %{version}
Requires: perl-base = %{perl_version}
%description -n perl-%{pname}
Necessary files for using genders with perl
%package -n lib%{pname}%{c_api}
Summary: Libraries for genders for C
Group: System/Libraries
%description -n lib%{pname}%{c_api}
This package contains the library needed to run programs dynamically linked
with genders. This is the C api.
%package -n lib%{pname}plusplus%{cpp_api}
Summary: Libraries for genders for C++
Group: System/Libraries
%description -n lib%{pname}plusplus%{cpp_api}
This package contains the library needed to run programs dynamically linked
with genders. This is the C++ api.
%{!?_with_perl_extensions: %{!?_without_perl_extensions: %global _with_perl_extensions --with-perl-extensions}}
%{!?_with_python_extensions: %{!?_without_python_extensions: %global _with_python_extensions --with-python-extensions}}
%{!?_with_cplusplus_extensions: %{!?_without_cplusplus_extensions: %global _with_cplusplus_extensions --with-cplusplus-extensions}}
@ -122,6 +143,10 @@ autoconf --force
make all #%%{?_smp_mflags}
%install
# turn off rpath check... causes failure on libgenders library
# is a bug in perl-ExtUtils-MakeMaker
export NO_BRP_CHECK_RPATH=true
make install DESTDIR=%{buildroot} #%%{?_smp_mflags}
find "$RPM_BUILD_ROOT" -name .packlist -exec sed -i "s#$RPM_BUILD_ROOT##" {} +
@ -134,30 +159,45 @@ for file in %{buildroot}%{_prefix}/lib/genders/*.pl; do grep '#!/usr/bin/perl' $
rm -v %{buildroot}%{_libdir}/libgendersplusplus.la
%endif
rm -v %{buildroot}%{_libdir}/libgenders.la
# turn off rpath check... causes failure on libgenders library
# is a bug in perl-ExtUtils-MakeMaker
export NO_BRP_CHECK_RPATH=true
mkdir -p %{buildroot}%{_sysconfdir}
# create sample config, but remove comments
cat > %{buildroot}%{_sysconfdir}/genders <<EOF
# Sample genders file which should be the same on all nodes, with following format.
# Each line of the genders file may have one of the following formats
# The nodename(s) is the shortened[2] hostname of a node. This is followed by
# any number of spaces or tabs, and then the comma-separated list of attributes,
# each of which can optionally have a value. The substitution string "%n" can
# be used in an attribute value to represent the nodename. Nodenames can be
# listed on multiple lines, so a node's attributes can be specified on multiple
# lines. However, no single node may have duplicate attributes. Genders database
# accepts ranges of nodenames in the general form: prefix[n-m,l-k,...],
# where n < m and l < k, etc., as an alternative to explicit lists of nodenames.
EOF
LD_PRELOAD=%{buildroot}%{_libdir}/libgenders.so.0 %{buildroot}%{_bindir}/nodeattr -f genders.sample --compress >> %{buildroot}%{_sysconfdir}/genders
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n lib%{pname}plusplus%{cpp_api} -p /sbin/ldconfig
%postun -n lib%{pname}plusplus%{cpp_api} -p /sbin/ldconfig
%post -n lib%{pname}%{c_api} -p /sbin/ldconfig
%postun -n lib%{pname}%{c_api} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc README NEWS ChangeLog DISCLAIMER DISCLAIMER.UC COPYING TUTORIAL genders.sample
# It doesn't matter if the user chooses a 32bit or 64bit target. The
# packaging must work off whatever Perl is installed.
%{_mandir}/man1/*
%{_mandir}/man3/genders*
%{_mandir}/man3/libgenders*
%{_bindir}/*
%{_libdir}/libgenders.so.*
%if %{?_with_cplusplus_extensions:1}%{!?_with_cplusplus_extensions:0}
%{_libdir}/libgendersplusplus.so.*
%endif
%config(noreplace) %{_sysconfdir}/genders
%files -n %{pname}-compat
%files -n %{pname}-perl-compat
%defattr(-,root,root)
%{_mandir}/man3/gendlib*
%dir %{_prefix}/lib/genders
%{_prefix}/lib/genders/*
@ -168,6 +208,11 @@ export NO_BRP_CHECK_RPATH=true
%if %{?_with_cplusplus_extensions:1}%{!?_with_cplusplus_extensions:0}
%{_libdir}/libgendersplusplus.so
%endif
%{_mandir}/man3/genders*
%{_mandir}/man3/libgenders*
%{_mandir}/man3/Libgenders*
%{_mandir}/man3/Genders*
%{_mandir}/man3/gendlib*
%files -n python-%{pname}
%if %{?_with_python_extensions:1}%{!?_with_python_extensions:0}
@ -176,9 +221,15 @@ export NO_BRP_CHECK_RPATH=true
%files -n perl-%{pname}
%if %{?_with_perl_extensions:1}%{!?_with_perl_extensions:0}
%{_mandir}/man3/Libgenders*
%{_mandir}/man3/Genders*
%{_perldir}/*
%endif
%files -n lib%{pname}%{c_api}
%{_libdir}/libgenders.so.*
%files -n lib%{pname}plusplus%{cpp_api}
%if %{?_with_cplusplus_extensions:1}%{!?_with_cplusplus_extensions:0}
%{_libdir}/libgendersplusplus.so.*
%endif
%changelog