File zypper.spec of Package zypper

# spec file for package zypper
# Copyright (c) 2020 SUSE LLC
# 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

Name:           zypper
BuildRequires:  augeas-devel >= 1.10.0
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_headers-devel
BuildRequires:  boost-devel >= 1.33.1
BuildRequires:  cmake >= 3.1
BuildRequires:  gcc-c++ >= 7
BuildRequires:  gettext-devel >= 0.15
BuildRequires:  libxml2-devel
BuildRequires:  libzypp-devel >= 17.23.2
BuildRequires:  readline-devel >= 5.1
Requires:       procps
%if 0%{?suse_version}
Requires:       libaugeas0 >= 1.10.0
%requires_ge    libzypp
Recommends:     logrotate zypper-log
Requires:       augeas >= 1.10.0

# required for documentation
BuildRequires:  rubygem(asciidoctor)

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Command line software manager using libzypp
License:        GPL-2.0-or-later
Group:          System/Packages
Version:        1.14.37
Release:        0
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}-rpmlintrc
Provides:       y2pmsh
Obsoletes:      y2pmsh

Provides:       zypper(auto-agree-with-product-licenses)
Provides:       zypper(oldpackage)
Provides:       zypper(purge-kernels)
Provides:       zypper(updatestack-only)

Zypper is a command line tool for managing software. It can be used to add
package repositories, search for packages, install, remove, or update packages,
install patches, hardware drivers, verify dependencies, and more.

Zypper can be used interactively or non-interactively by user, from scripts,
or front-ends.

    Jan Kupec <>
    Michael Andres <>
    Duncan Mac-Vicar <>
    Martin Vidner <>
    Josef Reidinger <>

%package log
Requires:       /bin/bash
Requires:       /usr/bin/awk
Requires:       /usr/bin/grep
BuildArch:      noarch
Summary:        CLI for accessing the zypper logfile
Group:          System/Packages

%description -n zypper-log
CLI for accessing the zypper logfile

%package aptitude
Summary:        aptitude compatibility with zypper
Group:          System/Packages
Requires:       perl
Requires:       zypper
BuildArch:      noarch

%description aptitude
provides compatibility to Debian's aptitude command using zypper

    Bernhard M. Wiedemann <bernhard+aptitude4zypp lsmod de>

%package needs-restarting
Summary:        needs-restarting compatibility with zypper
Group:          System/Packages
Requires:       zypper
%if 0%{?suse_version}
Supplements:    zypper
BuildArch:      noarch

%description needs-restarting
provides compatibility to YUM needs-restarting command using zypper

    Michael Andres <>

%setup -q

mkdir -p build
cd build


%if 0%{?suse_version} == 1500 && 0%{?sle_version} && 0%{?sle_version} <= 150100
  # Fixed in 1.14.34: Do not allow the abbreviation of cli arguments (bsc#1164543)
  # On SLE15/Leap 15.0 and 15.1 we will stay bug-compatible and accept the
  # abbreviations in order not to break tools. In 15.2 they must be fixed.

cmake $CMAKE_FLAGS \
      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DSYSCONFDIR=%{_sysconfdir} \
      -DMANDIR=%{_mandir} \
      -DCMAKE_BUILD_TYPE=Release \

#gettextize -f
make %{?_smp_mflags}

pushd build/tests
ctest --output-on-failure .

cd build

mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypper
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypper/commands

# yzpper symlink
ln -s zypper $RPM_BUILD_ROOT%{_bindir}/yzpper

# Create filelist with translations
cd ..
%{find_lang} zypper
%{__install} -d -m755 $RPM_BUILD_ROOT%{_var}/log
touch $RPM_BUILD_ROOT%{_var}/log/zypper.log

rm -rf "$RPM_BUILD_ROOT"

%files -f zypper.lang
%if 0%{?suse_version} >= 1500
%license COPYING
%config(noreplace) %{_sysconfdir}/zypp/zypper.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/
%config(noreplace) %{_sysconfdir}/logrotate.d/
%dir %{_datadir}/zypper
%dir %{_datadir}/zypper/xml
%doc %{_mandir}/man8/zypper.8*
%doc %{_mandir}/man8/zypp-refresh.8*
%doc %dir %{_datadir}/doc/packages/zypper
%doc %{_datadir}/doc/packages/zypper/HACKING
# declare ownership of the log file but prevent
# it from being erased by rpm -e
%ghost %config(noreplace) %attr (640,root,root) %{_var}/log/zypper.log

%files log
%doc %{_mandir}/man8/zypper-log.8*

%files aptitude
%dir %{_sysconfdir}/zypp/apt-packagemap.d/
%config(noreplace) %{_sysconfdir}/zypp/apt-packagemap.d/*

%files needs-restarting
%doc %{_mandir}/man1/needs-restarting.1*

openSUSE Build Service is sponsored by