fix build error for opensuse with python3.x 16/293616/20 sandbox/wangbiao/py3-version
authorbiao716.wang <biao716.wang@samsung.com>
Thu, 1 Jun 2023 05:30:32 +0000 (14:30 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Fri, 4 Aug 2023 02:14:29 +0000 (11:14 +0900)
For opensuse154, the lib name is libpython3.6m , there is 'm' behind version.
Change-Id: Ie51d20658d8799f3f1a0930a1a12527540999346
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
configure.ac
packaging/librpm-tizen.spec

index a47b319f5e6e0ef295294bb94ff05ab42e774a2a..acdc5204c3c86e418493a866db4049763b6106ef 100644 (file)
@@ -127,7 +127,7 @@ AC_MSG_CHECKING(old version of patch)
 
 AC_PATH_PROG(__PERL, perl, /usr/bin/perl, $MYPATH)
 AC_PATH_PROG(__PGP, pgp, /usr/bin/pgp, $MYPATH)
-AC_PATH_PROG(__PYTHON, python, /usr/bin/python, $MYPATH) 
+AC_PATH_PROG(__PYTHON, python, /usr/bin/python3, $MYPATH) 
 AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
 AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
 AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
@@ -550,9 +550,10 @@ AS_IF([test "$enable_python" = yes],[
       ])
     CPPFLAGS="$save_CPPFLAGS"
     save_LIBS="$LIBS"
-    AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
+
+    AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python3.6m],[
       WITH_PYTHON_LIB="$ac_res"
-    ],[AC_MSG_ERROR([missing python library])
+    ],[AC_MSG_ERROR([missing python library, ${PYTHON_VERSION}    vvv${PYTHON_ABI}vvv])
     ])
     LIBS="$save_LIBS"
   ])
index 74045f450aaaeeb41f2bcc0010f010d03d9009de..e58b52e64e2b2a3504c85f33b0946e79f3574e2b 100644 (file)
@@ -37,11 +37,7 @@ BuildRequires:  pkgconfig(popt)
 BuildRequires:  pkgconfig(zlib)
 BuildRequires:  pkgconfig(nss)
 BuildRequires:  pkg-config
-%if 0%{?centos_ver} || 0%{?centos_version}
-BuildRequires:  python-devel
-%else
-BuildRequires:  pkgconfig(python) >= 2.6
-%endif
+BuildRequires:  pkgconfig(python3)
 # Disable security
 %if 0
 BuildRequires:  uthash-devel
@@ -128,9 +124,9 @@ make install DESTDIR="`pwd`/tmp_install"
 
 # And only copy the files that we want
 install -d %{buildroot}%{_libdir}/%{name}
-install -d %{buildroot}%{python_sitearch}
+install -d %{buildroot}%{python3_sitearch}
 cp -ax tmp_install/%{_libdir}/%{name}  %{buildroot}%{_libdir}/
-cp -ax tmp_install/%{python_sitearch}/%{python_mod_name} %{buildroot}%{python_sitearch}/
+cp -ax tmp_install/%{python3_sitearch}/%{python_mod_name} %{buildroot}%{python3_sitearch}/
 
 # Install extra sources
 install -m644 %{SOURCE4} %{buildroot}%{_libdir}/%{name}/rpm/tizen_macros
@@ -145,16 +141,16 @@ rm -rf "%{buildroot}%{_libdir}/%{name}/rpm-plugins"
 
 # Compile python modules (Fedora does this automatically) and find duplicates
 %if 0%{?suse_version}
-%py_compile %{buildroot}/%{python_sitearch}/%{python_mod_name}/
-%py_compile -O %{buildroot}/%{python_sitearch}/%{python_mod_name}/
+%py3_compile %{buildroot}/%{python3_sitearch}/%{python_mod_name}/
+%py3_compile -O %{buildroot}/%{python3_sitearch}/%{python_mod_name}/
 
-%fdupes %{buildroot}/%{python_sitearch}/
+%fdupes %{buildroot}/%{python3_sitearch}/
 %endif
 
 %files
 %defattr(-,root,root,-)
 %dir %{_libdir}/%{name}
-%dir %{python_sitearch}/%{python_mod_name}/
+%dir %{python3_sitearch}/%{python_mod_name}/
 %{_libdir}/%{name}/*.so.*
 %{_libdir}/%{name}/rpm
-%{python_sitearch}/%{python_mod_name}/*
+%{python3_sitearch}/%{python_mod_name}/*