Imported Upstream version 17.23.0
[platform/upstream/libzypp.git] / libzypp.spec.cmake
index e4d3b75..6eb36fd 100644 (file)
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+%if 0%{?is_opensuse} && (0%{?sle_version} >= 150100 || 0%{?suse_version} > 1500)
+%bcond_without zchunk
+%else
+%bcond_with zchunk
+%endif
+
+%bcond_without mediabackend_tests
 
-Name:           @PACKAGE@
+Name:           libzypp
 Version:        @VERSION@
 Release:        0
 License:        GPL-2.0+
@@ -45,11 +52,7 @@ Recommends:     lsof
 %endif
 BuildRequires:  cmake
 BuildRequires:  openssl-devel
-%if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
 BuildRequires:  pkgconfig(libudev)
-%else
-BuildRequires:  hal-devel
-%endif
 %if 0%{?suse_version} >= 1330
 BuildRequires:  libboost_headers-devel
 BuildRequires:  libboost_program_options-devel
@@ -75,7 +78,7 @@ BuildRequires:  pkgconfig
 BuildRequires:  pkg-config
 %endif
 
-BuildRequires:  libsolv-devel >= 0.7.2
+BuildRequires:  libsolv-devel >= 0.7.11
 %if 0%{?suse_version} >= 1100
 BuildRequires:  libsolv-tools
 %requires_eq    libsolv-tools
@@ -83,8 +86,13 @@ BuildRequires:  libsolv-tools
 Requires:       libsolv-tools
 %endif
 
-# required for testsuite, webrick
-BuildRequires:  ruby
+BuildRequires:  glib2-devel
+BuildRequires:  libsigc++2-devel
+
+# required for testsuite
+%if %{with mediabackend_tests}
+BuildRequires:  nginx
+%endif
 
 Requires:       rpm
 
@@ -93,20 +101,26 @@ BuildRequires:  rpm-devel > 4.4
 %endif
 
 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
-BuildRequires:  glib2-devel
 BuildRequires:  popt-devel
 BuildRequires:  rpm-devel > 4.4
 %endif
 
 %if 0%{?mandriva_version}
-BuildRequires:  glib2-devel
 BuildRequires:  librpm-devel > 4.4
 %endif
 
 %if 0%{?suse_version}
 BuildRequires:  libgpgme-devel
+#testsuite
+%if %{with mediabackend_tests}
+BuildRequires:  FastCGI-devel
+%endif
 %else
 BuildRequires:  gpgme-devel
+#testsuite
+%if %{with mediabackend_tests}
+BuildRequires: fcgi-devel
+%endif
 %endif
 
 %define min_curl_version 7.19.4
@@ -133,6 +147,10 @@ BuildRequires:  asciidoc
 BuildRequires:  libxslt-tools
 %endif
 
+%if %{with zchunk}
+BuildRequires:  libzck-devel
+%endif
+
 %description
 libzypp is the package management library that powers applications
 like YaST, zypper and the openSUSE/SLE implementation of PackageKit.
@@ -172,11 +190,7 @@ Requires:       openssl-devel
 Requires:       popt-devel
 Requires:       rpm-devel > 4.4
 Requires:       zlib-devel
-%if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
 Requires:       libudev-devel
-%else
-Requires:       hal-devel
-%endif
 %if 0%{?suse_version}
 %if 0%{?suse_version} >= 1100
 # Code11+
@@ -221,21 +235,22 @@ export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
 %endif
 
 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+      -DENABLE_BUILD_DOCS=TRUE \
+      -DENABLE_BUILD_TRANS=TRUE \
+      -DENABLE_BUILD_TESTS=TRUE \
       -DDOC_INSTALL_DIR=%{_docdir} \
       -DLIB=%{_lib} \
       -DCMAKE_BUILD_TYPE=Release \
       -DCMAKE_SKIP_RPATH=1 \
+      %{?with_zchunk:-DENABLE_ZCHUNK_COMPRESSION=1} \
+      %{!?with_mediabackend_tests:-DDISABLE_MEDIABACKEND_TESTS=1} \
       ${EXTRA_CMAKE_OPTIONS} \
       ..
 make %{?_smp_mflags} VERBOSE=1
-make -C doc/autodoc %{?_smp_mflags}
-make -C po %{?_smp_mflags} translations
-make -C tests %{?_smp_mflags}
 
 %install
 cd build
 %make_install
-%make_install -C doc/autodoc
 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
 ln -s %{_sysconfdir}/yum.repos.d %{buildroot}/%{_sysconfdir}/zypp/repos.d
 %else
@@ -264,14 +279,14 @@ mkdir -p %{buildroot}/%{_var}/cache/zypp
 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
 %endif
 
-%make_install -C po
-# Create filelist with translations
 cd ..
+
+# Create filelist with translations
 %{find_lang} zypp
 
 %check
 pushd build/tests
-LD_LIBRARY_PATH="%{buildroot}/%{_libdir}:$LD_LIBRARY_PATH" ctest .
+LD_LIBRARY_PATH="$(pwd)/../zypp:$LD_LIBRARY_PATH" ctest --output-on-failure .
 popd
 
 %post