Bump to 17.31.23 sandbox/libzypp_17.31.23
authorTizenOpenSource <tizenopensrc@samsung.com>
Fri, 15 Mar 2024 09:14:33 +0000 (18:14 +0900)
committerTizenOpenSource <tizenopensrc@samsung.com>
Fri, 15 Mar 2024 09:14:33 +0000 (18:14 +0900)
Signed-off-by: TizenOpenSource <tizenopensrc@samsung.com>
.gitignore [deleted file]
packaging/Exclude_subdirectory.patch [new file with mode: 0644]
packaging/add_pie_compile_option.patch [new file with mode: 0644]
packaging/fix_swig_syntax_error.patch [new file with mode: 0644]
packaging/libzypp-rpmlintrc [new file with mode: 0644]
packaging/libzypp.manifest [new file with mode: 0644]
packaging/libzypp.spec [new file with mode: 0644]
zypp/parser/xml/Reader.cc

diff --git a/.gitignore b/.gitignore
deleted file mode 100644 (file)
index c164043..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-build
-*.orig
-*.rej
-*.swp
-*.kate-swp
-#*
-.#*
-*#
-.*project
-.externalToolBuilders
-.settings
-*flymake.h.gch
-CMakeLists.txt.user*
-zypp/APIConfig.h
-.vscode
diff --git a/packaging/Exclude_subdirectory.patch b/packaging/Exclude_subdirectory.patch
new file mode 100644 (file)
index 0000000..5bb3d51
--- /dev/null
@@ -0,0 +1,23 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1245837f9..0f45d52bc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -298,7 +298,6 @@ ADD_SUBDIRECTORY( zypp )
+ # do not build devel by default
+ ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
+ ADD_SUBDIRECTORY( tools )
+-ADD_SUBDIRECTORY( doc )
+
+ IF ( ENABLE_BUILD_TRANS )
+   ADD_SUBDIRECTORY( po )
+@@ -306,10 +305,5 @@ ELSE ( ENABLE_BUILD_TRANS )
+   ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
+ ENDIF ( ENABLE_BUILD_TRANS )
+
+-IF ( ENABLE_BUILD_TESTS )
+-  ADD_SUBDIRECTORY( tests )
+-ELSE ( ENABLE_BUILD_TESTS )
+-  ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
+-ENDIF ( ENABLE_BUILD_TESTS )
+ INCLUDE(CTest)
+ ENABLE_TESTING()
diff --git a/packaging/add_pie_compile_option.patch b/packaging/add_pie_compile_option.patch
new file mode 100644 (file)
index 0000000..e3ad76f
--- /dev/null
@@ -0,0 +1,11 @@
+diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
+index 97b28ceed..634778706 100644
+--- a/tools/CMakeLists.txt
++++ b/tools/CMakeLists.txt
+@@ -1,4 +1,6 @@
+ ## ############################################################
++SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
++SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+
+ FILE( GLOB ALLCC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc" )
+ STRING( REPLACE ".cc" ";" APLLPROG ${ALLCC} )
diff --git a/packaging/fix_swig_syntax_error.patch b/packaging/fix_swig_syntax_error.patch
new file mode 100644 (file)
index 0000000..7cf70fa
--- /dev/null
@@ -0,0 +1,69 @@
+diff --git a/zypp-core/onmedialocation.h b/zypp-core/onmedialocation.h
+index 6755c45..c764a69 100644
+--- a/zypp-core/onmedialocation.h
++++ b/zypp-core/onmedialocation.h
+@@ -128,10 +128,10 @@ namespace zypp
+   /** \relates OnMediaLocation Stream output */
+   std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
+-
++#ifndef SWIG // Swig treats it as syntax error
+   /** \relates OnMediaLocation Verbose stream output */
+   std::ostream & dumOn( std::ostream & str, const OnMediaLocation & obj );
+-
++#endif
+ } // namespace zypp
+ ///////////////////////////////////////////////////////////////////
+ #endif // ZYPP_SOURCE_ONMEDIALOCATION_H
+diff --git a/zypp/Patch.h b/zypp/Patch.h
+index 9247c73..138e3a4 100644
+--- a/zypp/Patch.h
++++ b/zypp/Patch.h
+@@ -107,7 +107,7 @@ namespace zypp
+       bool isCategory( const std::string & category_r ) const;
+       /** \overload taking OR'ed \ref Categories */
+       bool isCategory( Categories category_r ) const;
+-
++#ifndef SWIG // Swig treats it as syntax error
+       /** \overload taking container of category strings
+        * 2nd template arg just to prevent instantiation for Category
+        */
+@@ -118,7 +118,7 @@ namespace zypp
+         { if ( isCategory( el ) ) return true; }
+         return false;
+       }
+-
++#endif
+       /** Patch category as enum of wellknown categories.
+        * Unknown values are mapped to \ref CAT_OTHER.
+        */
+@@ -144,6 +144,7 @@ namespace zypp
+       /** \overload taking OR'ed \ref SeverityFlags */
+       bool isSeverity( SeverityFlags severity_r ) const;
++#ifndef SWIG // Swig treats it as syntax error
+       /** \overload taking container of severity strings
+        * 2nd template arg just to prevent instantiation for SeverityFlag
+        */
+@@ -154,6 +155,7 @@ namespace zypp
+         { if ( isSeverity( el ) ) return true; }
+         return false;
+       }
++#endif
+       /** Severity string mapped to an enum.
+        * Unknown string values are mapped to \ref SEV_OTHER
+diff --git a/zypp/ResPool.h b/zypp/ResPool.h
+index 32933c9..4fddcba 100644
+--- a/zypp/ResPool.h
++++ b/zypp/ResPool.h
+@@ -335,7 +335,9 @@ namespace zypp
+        * content changes. User code usually want's to call \ref changedPseudoInstalled
+        * directly.
+        */
++#ifndef SWIG // Swig treats it as syntax error
+       EstablishedStates establishedStates() const;
++#endif
+       /** Map holding pseudo installed items where current and established status differ. */
+       typedef EstablishedStates::ChangedPseudoInstalled ChangedPseudoInstalled;
diff --git a/packaging/libzypp-rpmlintrc b/packaging/libzypp-rpmlintrc
new file mode 100644 (file)
index 0000000..4aa496b
--- /dev/null
@@ -0,0 +1 @@
+addFilter("libzypp.* shlib-policy-name-error")
diff --git a/packaging/libzypp.manifest b/packaging/libzypp.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/libzypp.spec b/packaging/libzypp.spec
new file mode 100644 (file)
index 0000000..68d6cff
--- /dev/null
@@ -0,0 +1,278 @@
+Name:           libzypp
+License:        GPL-2.0+
+Group:          System/Package Management
+Summary:        Package, Patch, Pattern, and Product Management
+Version:        17.31.23
+Release:        1
+Source:         %{name}-%{version}.tar.bz2
+Source1:        %{name}-rpmlintrc
+Source10:       Exclude_subdirectory.patch
+Source11:       add_pie_compile_option.patch
+Source12:       fix_swig_syntax_error.patch
+Source1001:    libzypp.manifest
+
+# Features we provide (update doc/autoinclude/FeatureTest.doc):
+Provides:       libzypp(plugin) = 0.1
+Provides:       libzypp(plugin:appdata) = 0
+Provides:       libzypp(plugin:commit) = 1
+Provides:       libzypp(plugin:services) = 1
+Provides:       libzypp(plugin:system) = 1
+Provides:       libzypp(plugin:urlresolver) = 0
+Provides:       libzypp(repovarexpand) = 1.1
+
+BuildRequires:  cmake
+BuildRequires:  libgpgme-devel
+BuildRequires:  libxslt-tools
+BuildRequires:  asciidoc
+BuildRequires:  pkgconfig(openssl1.1)
+BuildRequires:  libudev-devel
+BuildRequires:  boost-devel
+BuildRequires:  doxygen
+BuildRequires:  gcc-c++ >= 4.6
+BuildRequires:  gettext-devel
+BuildRequires:  libxml2-devel
+BuildRequires:  pkgconfig(libproxy-1.0)
+BuildRequires:  pkgconfig(sigc++-2.0)
+BuildRequires:  protobuf-devel
+BuildRequires:  protobuf-static
+BuildRequires:  protobuf-lite-static
+BuildRequires:  protobuf-lite
+BuildRequires:  yaml-cpp-devel
+BuildRequires:  libsolv-devel
+Requires:       libsolv-tools
+
+# should be recommends
+Requires:       lsof
+
+BuildRequires:  expat-devel
+
+Requires:       rpm
+
+BuildRequires:  rpm-devel
+
+BuildRequires:  glib2-devel
+BuildRequires:  popt-devel
+BuildRequires:  rpm-devel
+
+%define min_curl_version 7.19.4
+BuildRequires:  libcurl-devel >= %{min_curl_version}
+Requires:       libcurl   >= %{min_curl_version}
+
+# Without gpg, any repos with public key sign will fail.
+Requires:      gpg
+
+%description
+Package, Patch, Pattern, and Product Management
+
+Authors:
+--------
+    Michael Andres <ma@suse.de>
+    Jiri Srain <jsrain@suse.cz>
+    Stefan Schubert <schubi@suse.de>
+    Duncan Mac-Vicar <dmacvicar@suse.de>
+    Klaus Kaempf <kkaempf@suse.de>
+    Marius Tomaschewski <mt@suse.de>
+    Stanislav Visnovsky <visnov@suse.cz>
+    Ladislav Slezak <lslezak@suse.cz>
+
+%package devel
+Summary:        Package, Patch, Pattern, and Product Management - developers files
+License:        GPL-2.0+
+Requires:       libzypp = %{version}
+Requires:       libxml2-devel
+Requires:       pkgconfig(openssl1.1)
+Requires:       rpm-devel
+Requires:       glibc-devel
+Requires:       zlib-devel
+Requires:       bzip2
+Requires:       popt-devel
+Requires:       boost-devel
+Requires:       libstdc++-devel
+Requires:       libudev-devel
+Requires:       cmake
+Requires:       libcurl-devel >= %{min_curl_version}
+Requires:       libsolv-devel
+Group:          Development/Libraries
+
+%description -n libzypp-devel
+Package, Patch, Pattern, and Product Management - developers files
+
+Authors:
+--------
+    Michael Andres <ma@suse.de>
+    Jiri Srain <jsrain@suse.cz>
+    Stefan Schubert <schubi@suse.de>
+    Duncan Mac-Vicar <dmacvicar@suse.de>
+    Klaus Kaempf <kkaempf@suse.de>
+    Marius Tomaschewski <mt@suse.de>
+    Stanislav Visnovsky <visnov@suse.cz>
+    Ladislav Slezak <lslezak@suse.cz>
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+%{__patch} -p1 < %{SOURCE10}
+%{__patch} -p1 < %{SOURCE11}
+%{__patch} -p1 < %{SOURCE12}
+
+%build
+mkdir build
+cd build
+export CFLAGS="$RPM_OPT_FLAGS"
+export CXXFLAGS="$RPM_OPT_FLAGS"
+unset TRANSLATION_SET
+unset EXTRA_CMAKE_OPTIONS
+cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+      -DDOC_INSTALL_DIR=%{_docdir} \
+      -DLIB=%{_lib} \
+      -DCMAKE_BUILD_TYPE=Release \
+      -DCMAKE_SKIP_RPATH=1 \
+      -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
+      ${EXTRA_CMAKE_OPTIONS} \
+      ..
+make %{?_smp_mflags} VERBOSE=1
+# make -C doc/autodoc %{?_smp_mflags}
+make -C po %{?_smp_mflags} translations
+
+%install
+rm -rf "$RPM_BUILD_ROOT"
+cd build
+make install DESTDIR=$RPM_BUILD_ROOT
+# make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
+%if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
+ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
+%else
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
+%endif
+mkdir -p %{buildroot}/%{_sysconfdir}/zypp/services.d
+mkdir -p %{buildroot}/%{_sysconfdir}/zypp/systemCheck.d
+mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vars.d
+mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vendors.d
+mkdir -p %{buildroot}/%{_sysconfdir}/zypp/multiversion.d
+mkdir -p %{buildroot}/%{_sysconfdir}/zypp/needreboot.d
+mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
+mkdir -p %{buildroot}/%{_prefix}/lib/zypp
+mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins
+mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/appdata
+mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/commit
+mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/services
+mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/system
+mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/urlresolver
+mkdir -p %{buildroot}/%{_var}/lib/zypp
+mkdir -p %{buildroot}/%{_var}/log/zypp
+mkdir -p %{buildroot}/%{_var}/cache/zypp
+
+make -C po install DESTDIR=$RPM_BUILD_ROOT
+# Create filelist with translations
+cd ..
+%{find_lang} zypp
+
+%{remove_docs}
+
+%post
+/sbin/ldconfig
+if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
+
+# convert old lock file to new
+# TODO make this a separate file?
+# TODO run the sript only when updating form pre-11.0 libzypp versions
+LOCKSFILE=%{_sysconfdir}/zypp/locks
+OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
+
+is_old(){
+  # if no such file, exit with false (1 in bash)
+  test -f ${LOCKSFILE} || return 1
+  TEMP_FILE=`mktemp`
+  cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
+  if [ -s ${TEMP_FILE} ]
+  then
+    RES=0
+  else
+    RES=1
+  fi
+  rm -f ${TEMP_FILE}
+  return ${RES}
+}
+
+append_new_lock(){
+  case "$#" in
+    1 )
+  echo "
+solvable_name: $1
+match_type: glob
+" >> ${LOCKSFILE}
+;;
+    2 ) #TODO version
+  echo "
+solvable_name: $1
+match_type: glob
+version: $2
+" >> ${LOCKSFILE}
+;;
+    3 ) #TODO version
+  echo "
+solvable_name: $1
+match_type: glob
+version: $2 $3
+" >> ${LOCKSFILE}
+  ;;
+esac
+}
+
+die() {
+  echo $1
+  exit 1
+}
+
+if is_old ${LOCKSFILE}
+  then
+  mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
+  cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
+  do
+    append_new_lock $line
+  done
+fi
+
+%postun -p /sbin/ldconfig
+
+%lang_package -f zypp
+
+%files
+%manifest %{name}.manifest
+%license           COPYING
+%dir               %{_sysconfdir}/zypp
+%dir               %{_sysconfdir}/zypp/repos.d
+%dir               %{_sysconfdir}/zypp/services.d
+%dir               %{_sysconfdir}/zypp/systemCheck.d
+%dir               %{_sysconfdir}/zypp/vars.d
+%dir               %{_sysconfdir}/zypp/vendors.d
+%dir               %{_sysconfdir}/zypp/multiversion.d
+%config(noreplace) %{_sysconfdir}/zypp/needreboot
+%dir               %{_sysconfdir}/zypp/needreboot.d
+%dir               %{_sysconfdir}/zypp/credentials.d
+%config(noreplace) %{_sysconfdir}/zypp/zypp.conf
+%config(noreplace) %{_sysconfdir}/zypp/systemCheck
+%config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
+%dir               %{_var}/lib/zypp
+%dir %attr(750,root,root) %{_var}/log/zypp
+%dir               %{_var}/cache/zypp
+%{_prefix}/lib/zypp
+%{_datadir}/zypp
+%{_bindir}/*
+%{_libdir}/libzypp*so.*
+%{_libexecdir}/zypp/zypp-rpm
+
+%files devel
+%manifest %{name}.manifest
+%license           COPYING
+%{_libdir}/libzypp.so
+%{_includedir}/zypp
+%{_includedir}/zypp-core
+%{_includedir}/zypp-curl
+%{_includedir}/zypp-media
+%{_includedir}/zypp-tui
+%{_datadir}/cmake/Modules/*
+%{_libdir}/pkgconfig/libzypp.pc
+%{_libdir}/libzypp-tui.a
+
+%changelog
index 674ad0a..3ffbc2b 100644 (file)
@@ -50,7 +50,11 @@ namespace zypp
 
 
       std::list<std::string> structuredErrors;
-      void structuredErrorFunc( void * userData, xmlErrorPtr error )
+#if LIBXML_VERSION >= 21200
+      void structuredErrorFunc( void * userData, const xmlError * error )
+#else
+      void structuredErrorFunc( void * userData, xmlError * error )
+#endif
       {
         if ( error )
         {