--- rpms/libsearpc/contribs9/libsearpc.spec 2018/02/20 02:33:42 1.1 +++ rpms/libsearpc/contribs9/libsearpc.spec 2018/03/09 04:57:10 1.2 @@ -1,9 +1,32 @@ +# define name of the scl +%global scl python27 +%scl_package %scl + +# Defaults for the values for the python27/rh-python35 Software Collection. These +# will be used when python27-scldevel (or rh-python35-scldevel) is not in the +# build root +%{!?scl_python:%global scl_python python27} +%{!?scl_no_vendor:%global scl_no_vendor python27} +%{!?scl_prefix_python:%global scl_prefix_python %{scl_python}-} + +# Only for this build, you need to override default __os_install_post, +# because the default one would find /opt/.../lib/python2.7/ and try +# to bytecompile with the system /usr/bin/python2.7 +%global __os_install_post %{%{scl_no_vendor}_os_install_post} +# Similarly, override __python_requires for automatic dependency generator +%global __python_requires %{%{scl_no_vendor}_python_requires} + +# The directory for site packages for this Software Collection +%global seafile_sitelib %(echo %{python27python_sitelib} | sed 's|%{scl_python}|%{scl}|') + + + %global _hardened_build 1 -%define release 3 +%define release 4 Name: libsearpc Version: 3.0.7 -Release: %{release}%{?dist} +Release: %{release}%{?dist} Summary: A simple and easy-to-use C language RPC framework License: LGPLv3 @@ -16,7 +39,18 @@ BuildRequires: libtool BuildRequires: glib2-devel BuildRequires: jansson-devel BuildRequires: pygobject2 -BuildRequires: python-simplejson +#might need pygobject227 instead +BuildRequires: %{scl_prefix_python}python-simplejson +#SCL +BuildRequires: scl-utils-build +# Always make sure that there is the python27-sclbuild (or rh-python35-sclbuild) +# package in the build root +BuildRequires: %{scl_prefix_python}scldevel +# Require python27-python-devel, you will need macros from that package +BuildRequires: %{scl_prefix_python}python-devel +BuildRequires: %{scl_prefix_python}build +Requires: %{scl_prefix}python-versiontools + %description @@ -25,36 +59,72 @@ handles the serialization/deserializatio left to users. -%package devel +%package -n %{scl_python}-%{name}-devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: glib2-devel Requires: jansson-devel >= 2.2.1 -%description devel +%description -n %{scl_python}-%{name}-devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. +#---------------------------------------------------- +%package -n %{scl_python}-%{name} +Summary: A simple and easy-to-use C language RPC framework +Requires: %{scl_prefix}python-versiontools + +%description -n %{scl_python}-%{name} +Searpc is a simple C language RPC framework based on GObject system. Searpc +handles the serialization/deserialization part of RPC, the transport part is +left to users. + +#---------------------------------------------------- +%package -n %{scl_python}-%{name}-debug +Summary: debug package for %{scl_python}-%{name} + +%description -n %{scl_python}-%{name}-debug +Searpc is a simple C language RPC framework based on GObject system. Searpc +handles the serialization/deserialization part of RPC, the transport part is +left to users. + + %prep %setup -qn %{name}-%{version} sed -i -e /\(DESTDIR\)/d %{name}.pc.in %build +%{?scl:scl enable %{scl_python} - << \EOF} +export PYTHON='/opt/rh/python27/root/usr/bin/python' + ./autogen.sh %configure --disable-static --disable-compile-demo %{__make} %{?_smp_mflags} CFLAGS="%{optflags}" - +%{?scl:EOF} %install +%scl_install +%{?scl:scl enable %{scl_python} - << \EOF} +export PYTHON='/opt/rh/python27/root/usr/bin/python' %{__make} install DESTDIR=%{buildroot} +%{?scl:EOF} + + find %{buildroot} -name '*.la' -exec rm -f {} ';' +rm -rf %{buildroot}/etc/rpm/macros.python27-config +rm -rf %{buildroot}/etc/scl/prefixes/python27 +rm -rf %{buildroot}/opt/rh/python27/root/usr/tmp +rm -rf %{buildroot}/opt/rh/python27/root/var/mail %check +%{?scl:scl enable %{scl_python} - << \EOF} +export PYTHON='/opt/rh/python27/root/usr/bin/python' %{__make} check +%{?scl:EOF} %post -p /sbin/ldconfig @@ -62,21 +132,29 @@ find %{buildroot} -name '*.la' -exec rm %postun -p /sbin/ldconfig -%files +%files -n %{scl_python}-%{name} %doc AUTHORS README.markdown %doc COPYING %{_libdir}/%{name}.so.* %{_bindir}/searpc-codegen.py %{python_sitearch}/pysearpc/ -%files devel +%files -n %{scl_python}-%{name}-devel %doc COPYING %{_includedir}/searpc* %{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc +%files -n %{scl_python}-%{name}-debug +/usr/src/debug/* +/usr/lib/debug/.build-id/* +/usr/lib/debug/opt/rh/python27/root/usr/lib64/* + %changelog +* Wed Mar 07 2018 Jean-Philipe Pialasse - 3.0.7-4.sme +- fix [SME: ] + * Mon Feb 19 2018 Jean-Philippe Pialasse - 3.0.7-3 - first import for SME Server