diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-05 08:49:12 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-05 08:49:12 +0000 |
commit | 3fc53c375f905f716da429235d8cf2d898abb34f (patch) | |
tree | 478d609727068f8f4498527331c96549cb5a8742 | |
parent | 122aaeccc1776afd93f712e5f3e866af72274d8e (diff) |
automatic import of libkolabxml
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | libkolabxml.spec | 242 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 244 insertions, 0 deletions
@@ -0,0 +1 @@ +/libkolabxml-1.2.0.tar.gz diff --git a/libkolabxml.spec b/libkolabxml.spec new file mode 100644 index 0000000..6d9d12e --- /dev/null +++ b/libkolabxml.spec @@ -0,0 +1,242 @@ +%undefine __cmake_in_source_build + +%{?!mono_arches: %global mono_arches x86_64 aarch64} + +%ifarch %{mono_arches} +# Do not enable at this time +%global with_csharp 0 +%endif +%global with_java 1 +%global with_php 1 +%global with_python 1 + +%if 0%{?with_php} > 0 +%{!?php_extdir: %global php_extdir %{_libdir}/php/modules} +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d/} +%{!?php_apiver: %global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)} +%global ini_name 40-kolabformat.ini +%endif + +# Filter out private python and php libs +%if 0%{?with_php} > 0 +%if 0%{?with_python} > 0 +%{?filter_setup: +%filter_provides_in %{python3_sitearch}/.*\.so$ +%filter_provides_in %{php_extdir}/.*\.so$ +%filter_setup +} +%else +%{?filter_setup: +%filter_provides_in %{php_extdir}/.*\.so$ +%filter_setup +} +%endif +%else +%if 0%{?with_python} > 0 +%{?filter_setup: +%filter_provides_in %{python3_sitearch}/.*\.so$ +%filter_setup +} +%endif +%endif + +Name: libkolabxml +Version: 1.2.0 +Release: 1 +Summary: Kolab XML format collection parser library + +License: LGPLv3+ +URL: http://www.kolab.org + +Source0: https://cgit.kolab.org/libkolabxml/snapshot/libkolabxml-%{version}.tar.gz + +BuildRequires: boost-devel +BuildRequires: cmake >= 2.6 +BuildRequires: e2fsprogs-devel +BuildRequires: gcc-c++ +BuildRequires: libcurl-devel +BuildRequires: swig +BuildRequires: uuid-devel +BuildRequires: xerces-c-devel +BuildRequires: xsd + +%global libkolab_obsoletes 1.0.2-20 +%if 0%{?libkolab_obsoletes:1} +Obsoletes: libkolab < %{libkolab_obsoletes} +Obsoletes: libkolab-devel < %{libkolab_obsoletes} +Obsoletes: python2-libkolab < %{libkolab_obsoletes} +%endif + +%if 0%{?with_csharp} < 1 +Obsoletes: csharp-kolabformat < %{version}-%{release} +#Provides: csharp-kolabformat = %{version}-%{release} +%endif + +%if 0%{?with_java} < 1 +Obsoletes: java-kolabformat < %{version}-%{release} +#Provides: java-kolabformat = %{version}-%{release} +%endif + +%if 0%{?with_php} < 1 +Obsoletes: php-kolabformat < %{version}-%{release} +#Provides: php-kolabformat = %{version}-%{release} +%endif + +%if 0%{?with_python} < 1 +Obsoletes: python-kolabformat < %{version}-%{release} +Obsoletes: python2-kolabformat < %{version}-%{release} +%endif + +%description +The libkolabxml parsing library interprets Kolab XML formats (xCal, xCard) +with bindings for Python, PHP and other languages. The language bindings +are available through sub-packages. + +%package devel +Summary: Kolab XML library development headers +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: boost-devel +Requires: libcurl-devel +Requires: xerces-c-devel +Requires: cmake + +%description devel +Development headers for the Kolab XML libraries. + +%if 0%{?with_csharp} > 0 +%package -n csharp-kolabformat +Summary: C# Bindings for libkolabxml +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: mono-core + +%description -n csharp-kolabformat +C# bindings for libkolabxml +%endif + +%if 0%{?with_java} > 0 +%package -n java-kolabformat +Summary: Java Bindings for libkolabxml +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n java-kolabformat +Java bindings for libkolabxml +%endif + +%if 0%{?with_php} > 0 +%package -n php-kolabformat +Summary: PHP bindings for libkolabxml +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} +BuildRequires: php >= 5.3 +BuildRequires: php-devel >= 5.3 + +%description -n php-kolabformat +The PHP kolabformat package offers a comprehensible PHP library using the +bindings provided through libkolabxml. +%endif + +%if 0%{?with_python} > 0 +%package -n python3-kolabformat +Summary: Python bindings for libkolabxml +Obsoletes: python-kolabformat < 1.1.4 +Provides: python-kolabformat = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: python3-devel + +%description -n python3-kolabformat +The PyKolab format package offers a comprehensive Python library using the +bindings provided through libkolabxml. +%endif + +%prep +%autosetup -p1 + +sed -i "s/-php/-php7/g" src/php/CMakeLists.txt + +%build +%cmake \ + -DBUILD_TESTS:BOOL=OFF \ +%if 0%{?with_csharp} > 0 + -DCSHARP_BINDINGS=ON \ + -DCSHARP_INSTALL_DIR=%{_datadir}/%{name}/csharp/ \ +%endif +%if 0%{?with_java} > 0 + -DJAVA_BINDINGS=ON \ + -DJAVA_INSTALL_DIR=%{_datadir}/%{name}/java/ \ +%endif +%if 0%{?with_php} > 0 + -DPHP_BINDINGS=ON \ + -DPHP_INSTALL_DIR=%{php_extdir} \ +%endif +%if 0%{?with_python} > 0 + -DPYTHON_BINDINGS=ON \ + -DPYTHON_INSTALL_DIR=%{python3_sitearch} +%endif + +%cmake_build + +%install +%cmake_install + +%if 0%{?with_php} > 0 +mkdir -p \ + %{buildroot}/%{_datadir}/php \ + %{buildroot}/%{php_inidir}/ +cat > %{buildroot}/%{php_inidir}/%{ini_name} << EOF +extension=kolabformat.so +EOF +%endif + +%check +pushd %{_vpath_builddir} +export LD_LIBRARY_PATH=$( pwd )/src/ +%if 0%{?with_php} > 0 +php -d enable_dl=On -dextension=src/php/kolabformat.so src/php/test.php ||: +%endif +%if 0%{?with_python} > 0 +python3 src/python/test.py ||: +%endif +popd + +%ldconfig_scriptlets + +%files +%doc DEVELOPMENT NEWS README +%license COPYING* +%{_libdir}/libkolabxml.so.1* + +%files devel +%{_includedir}/kolabxml/ +%{_libdir}/libkolabxml.so +%{_libdir}/cmake/Libkolabxml/ + +%if 0%{?with_csharp} > 0 +%files -n csharp-kolabformat +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/csharp +%endif + +%if 0%{?with_java} > 0 +%files -n java-kolabformat +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/java +%endif + +%if 0%{?with_php} > 0 +%files -n php-kolabformat +%{php_extdir}/kolabformat.so +%config(noreplace) %{php_inidir}/%{ini_name} +%endif + +%if 0%{?with_python} > 0 +%files -n python3-kolabformat +%{python3_sitearch}/kolabformat.py +%{python3_sitearch}/_kolabformat.so +%{python3_sitearch}/__pycache__/* +%endif + + +%changelog +* Mon Jun 05 2023 misaka00251 <liuxin@iscas.ac.cn> - 1.2.0-1 +- Init package @@ -0,0 +1 @@ +e790115d6c85f1d56fc3065d3835fdf6 libkolabxml-1.2.0.tar.gz |