Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libsvm for openSUSE:Factory checked in at 2021-03-24 16:11:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libsvm (Old) and /work/SRC/openSUSE:Factory/.libsvm.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libsvm" Wed Mar 24 16:11:40 2021 rev:2 rq:880642 version:3.24 Changes: -------- --- /work/SRC/openSUSE:Factory/libsvm/libsvm.changes 2019-09-13 15:00:11.949282018 +0200 +++ /work/SRC/openSUSE:Factory/.libsvm.new.2401/libsvm.changes 2021-03-24 16:11:41.363859501 +0100 @@ -1,0 +2,8 @@ +Tue Mar 16 23:03:23 UTC 2021 - Aaron Puchert <aaronpuch...@alice-dsl.net> + +- Fix build by adding missing python-rpm-macros dependency. +- Build Python bindings for current Python version. +- Make sure we're actually using the compiler flags. +- Fix shebangs. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsvm.spec ++++++ --- /var/tmp/diff_new_pack.Nd7inn/_old 2021-03-24 16:11:41.815859975 +0100 +++ /var/tmp/diff_new_pack.Nd7inn/_new 2021-03-24 16:11:41.819859979 +0100 @@ -1,7 +1,7 @@ # # spec file for package libsvm # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,12 +25,13 @@ URL: https://www.csie.ntu.edu.tw/~cjlin/libsvm/ Source0: https://www.csie.ntu.edu.tw/~cjlin/libsvm/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: %{python_module devel} BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: java-devel BuildRequires: javapackages-tools BuildRequires: ncurses-devel -BuildRequires: python-devel +BuildRequires: python-rpm-macros %description LIBSVM is an integrated software for support vector classification, @@ -55,7 +56,6 @@ (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class SVM). It supports multi-class classification. - %package devel Summary: C headers for developing programs with libsvm Group: Development/Libraries/C and C++ @@ -67,14 +67,16 @@ This package contains the libraries and header files needed for developing applications with libsvm. -%package -n python-svm +%package -n %{python_prefix}-svm Summary: Python bindings for libsvm Group: Development/Languages/Python Requires: gnuplot Requires: svm-tools = %{version} +Provides: python-svm = %{version}-%{release} +Obsoletes: python-svm < %{version}-%{release} BuildArch: noarch -%description -n python-svm +%description -n %{python_prefix}-svm This package contains the Python bindings for libsvm. %package java @@ -84,7 +86,7 @@ Requires: javapackages-tools Requires: libsvm2 = %{version} Requires(post): javapackages-tools -Requires(postun): javapackages-tools +Requires(postun):javapackages-tools BuildArch: noarch %description java @@ -94,10 +96,12 @@ %setup -q %build -export CFLAGS="%{optflags} -Wconversion -fPIC" -make -make all -make lib +# We can't override CFLAGS, we have to patch the Makefile. +sed -i ' + s/^CFLAGS = .*$/CFLAGS = %{optflags} -Wall -Wconversion -fPIC/g + s/$(CXX) $${SHARED_LIB_FLAG}/$(CXX) %{optflags} $${SHARED_LIB_FLAG}/g +' Makefile +make %{_smp_mflags} all lib rm -f java/libsvm.jar make -C java @@ -121,10 +125,18 @@ mv ./python/README README-python mv ./tools/README README-python-tools -install -m 755 ./python/svm.py %{buildroot}%{python_sitelib}/svm -install -m 755 ./python/svmutil.py %{buildroot}%{python_sitelib}/svm +# Don't use env in shebangs, and prefer the default Python. +# (https://www.python.org/dev/peps/pep-0394/#for-python-runtime-distributors) +sed -i '1s|/usr/bin/env *|%{_bindir}/|;1s|/usr/bin/python$|%{_bindir}/python%python_bin_suffix|' \ + %{buildroot}%{_bindir}/svm-* + +install -m 644 ./python/svm.py %{buildroot}%{python_sitelib}/svm +install -m 644 ./python/svmutil.py %{buildroot}%{python_sitelib}/svm touch %{buildroot}%{python_sitelib}/svm/__init__.py +# Remove unnecessary shebangs. +sed -i '/^#!\/usr\/bin\/env .*$/d' %{buildroot}%{python_sitelib}/svm/* + install -m 755 ./java/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar %fdupes -s %{buildroot} @@ -140,14 +152,14 @@ %{_bindir}/svm-predict %files -n libsvm2 -%doc COPYRIGHT +%license COPYRIGHT %{_libdir}/libsvm.so.2 %files devel %{_includedir}/libsvm %{_libdir}/libsvm.so -%files -n python-svm +%files -n %{python_prefix}-svm %doc README-python README-python-tools %{_bindir}/svm-checkdata %{_bindir}/svm-grid