remove obsolete hicolor-icon-theme BuildRequires
[platform/upstream/libzypp.git] / libzypp.spec.cmake
index 603b41f..d93dd96 100644 (file)
@@ -1,22 +1,31 @@
 #
 # spec file for package libzypp
 #
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
+# Copyright (c) 2005-2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
 # norootforbuild
+%define force_gcc_46 0
+
 
 Name:           @PACKAGE@
-License:        GPLv2
+License:        GPL-2.0+
 Group:          System/Packages
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Summary:        Package, Patch, Pattern, and Product Management
 Version:        @VERSION@
-Release:        0
+Release:        1
 Source:         %{name}-%{version}.tar.bz2
 Source1:        %{name}-rpmlintrc
 Provides:       yast2-packagemanager
@@ -36,7 +45,7 @@ Recommends:     lsof
 %endif
 BuildRequires:  cmake
 BuildRequires:  openssl-devel
-%if 0%{?suse_version} >= 1130
+%if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
 BuildRequires:  libudev-devel
 %else
 BuildRequires:  hal-devel
@@ -44,17 +53,31 @@ BuildRequires:  hal-devel
 BuildRequires:  boost-devel
 BuildRequires:  dejagnu
 BuildRequires:  doxygen
-BuildRequires:  gcc-c++
+%if 0%{?force_gcc_46}
+BuildRequires:  gcc46
+BuildRequires:  gcc46-c++
+%else
+BuildRequires:  gcc-c++ >= 4.6
+%endif
 BuildRequires:  gettext-devel
 BuildRequires:  graphviz
 BuildRequires:  libxml2-devel
+%if 0%{?suse_version} != 1110
+# No libproxy on SLES
 BuildRequires:  libproxy-devel
+%endif
+
+%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
+BuildRequires:  pkgconfig
+%else
+BuildRequires:  pkg-config
+%endif
 
-BuildRequires:  libsatsolver-devel >= 0.14.17
+BuildRequires:  libsolv-devel
 %if 0%{?suse_version} >= 1100
-%requires_eq    satsolver-tools
+%requires_eq    libsolv-tools
 %else
-Requires:       satsolver-tools
+Requires:       libsolv-tools
 %endif
 
 # required for testsuite, webrick
@@ -66,14 +89,11 @@ BuildRequires:  libexpat-devel
 BuildRequires:  expat-devel
 %endif
 
-Requires:      rpm
+Requires:       rpm
 
 %if 0%{?suse_version}
 BuildRequires:  rpm-devel
 Requires:       /usr/bin/uuidgen
-%if 0%{?suse_version} > 1020
-BuildRequires:  hicolor-icon-theme
-%endif
 %endif
 
 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
@@ -95,21 +115,7 @@ Requires:       gpg2
 Requires:       gnupg2
 %endif
 
-%define min_aria_version 1.1.2
-# ---------------------------------------------------------------
-%if 0%{?suse_version} >= 1110
-# (almost) common codebase, but on SLES11-SP1 (according to Rudi
-# suse_version == 1110) we have a patched libcurl-7.19.0-11.22,
-# and no aria2. Furthermore SLE may use it's own set of .po files
-# from po/sle-zypp-po.tar.bz2.
-
-# this check should use 7.19.0 if SLE and 7.19.4 if not (backported
-# CURLOPT_REDIR_PROTOCOLS)
-%define min_curl_version 7.19.0-11.22
-%endif
-
-# ---------------------------------------------------------------
-
+%define min_curl_version 7.19.4
 %if 0%{?suse_version}
 %if 0%{?suse_version} >= 1100
 # Code11+
@@ -140,6 +146,7 @@ Authors:
     Ladislav Slezak <lslezak@suse.cz>
 
 %package devel
+License:        GPL-2.0+
 Requires:       libzypp = %{version}
 Requires:       libxml2-devel
 Requires:       openssl-devel
@@ -150,7 +157,7 @@ Requires:       bzip2
 Requires:       popt-devel
 Requires:       boost-devel
 Requires:       libstdc++-devel
-%if 0%{?suse_version} >= 1130
+%if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
 Requires:       libudev-devel
 %else
 Requires:       hal-devel
@@ -159,19 +166,19 @@ Requires:       cmake
 %if 0%{?suse_version}
 %if 0%{?suse_version} >= 1100
 # Code11+
-Requires:  libcurl-devel >= %{min_curl_version}
+Requires:       libcurl-devel >= %{min_curl_version}
 %else
 # Code10
-Requires:  curl-devel
+Requires:       curl-devel
 %endif
 %else
 # Other distros (Fedora)
-Requires:  libcurl-devel >= %{min_curl_version}
+Requires:       libcurl-devel >= %{min_curl_version}
 %endif
 %if 0%{?suse_version} >= 1100
-%requires_ge    libsatsolver-devel
+%requires_ge    libsolv-devel
 %else
-Requires:       libsatsolver-devel
+Requires:       libsolv-devel
 %endif
 Summary:        Package, Patch, Pattern, and Product Management - developers files
 Group:          System/Packages
@@ -198,13 +205,19 @@ Authors:
 %build
 mkdir build
 cd build
+%if 0%{?force_gcc_46}
+export CC=gcc-4.6
+export CXX=g++-4.6
+%endif
 export CFLAGS="$RPM_OPT_FLAGS"
 export CXXFLAGS="$RPM_OPT_FLAGS"
 unset TRANSLATION_SET
+unset EXTRA_CMAKE_OPTIONS
 # SLE11-* might want its own translation set:
 %if 0%{?suse_version} == 1110
 if [ -f ../po/sle-zypp-po.tar.bz ]; then
   export TRANSLATION_SET=sle-zypp
+  export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
 fi
 %endif
 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
@@ -213,6 +226,7 @@ cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
       -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}
@@ -238,6 +252,8 @@ ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
 %endif
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
@@ -253,7 +269,6 @@ make -C po install DESTDIR=$RPM_BUILD_ROOT
 cd ..
 %{find_lang} zypp
 
-
 %post
 /sbin/ldconfig
 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
@@ -318,7 +333,6 @@ if is_old ${LOCKSFILE}
   done
 fi
 
-
 %postun -p /sbin/ldconfig
 
 %clean
@@ -333,6 +347,8 @@ rm -rf "$RPM_BUILD_ROOT"
 %dir               %{_sysconfdir}/zypp/repos.d
 %endif
 %dir               %{_sysconfdir}/zypp/services.d
+%dir               %{_sysconfdir}/zypp/vendors.d
+%dir               %{_sysconfdir}/zypp/multiversion.d
 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr