%global min_libzypp_ver 16.17.16
Name: zypper
Version: 1.13.45
Release: 1%{?dist}
Summary: Command line package manager using libzypp
License: GPLv2+
URL: http://en.opensuse.org/Portal:Zypper
Source0: https://github.com/openSUSE/zypper/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires: perl-generators
BuildRequires: cmake
BuildRequires: augeas-devel
BuildRequires: boost-devel
BuildRequires: gettext-devel
BuildRequires: readline-devel
BuildRequires: libxml2-devel
BuildRequires: libzypp-devel >= %{min_libzypp_ver}
Requires: libzypp%{?_isa} >= %{min_libzypp_ver}
Requires: procps
Requires: bash-completion
Recommends: logrotate
Recommends: zypper-log
# Zypper specific virtual provides
Provides: zypper(oldpackage)
Provides: zypper(updatestack-only)
Provides: zypper(auto-agree-with-product-licenses)
%description
Zypper is a command line package manager tool using libzypp,
which can be used to manage software for RPM based systems.
%package log
Summary: Zypper log file command line tool
Requires: %{name} = %{version}-%{release}
Requires: xz
BuildArch: noarch
%description log
This package provides a command line tool for
accessing the Zypper log file.
%package aptitude
Summary: apt/aptitude CLI compatibility interface for Zypper
Provides: %{name}-apt = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Enhances: zypper
BuildArch: noarch
%description aptitude
This package provides apt-get and aptitude frontends for Zypper,
for those used to the Debian package manager's CLI structure.
These can be accessed with either of the following:
* %{_bindir}/zypp-apt-get
* %{_bindir}/zypp-aptitude
%prep
%autosetup -p1
# Use correct libexecdir
find -type f -exec sed -i -e "s|/usr/lib/zypper|%{_libexecdir}/zypper|g" {} ';'
find -type f -exec sed -i -e "s|\${CMAKE_INSTALL_PREFIX}/lib/zypper|\${CMAKE_INSTALL_PREFIX}/libexec/zypper|g" {} ';'
find -type f -exec sed -i -e "s|\${CMAKE_INSTALL_PREFIX}/lib/\${PACKAGE}|\${CMAKE_INSTALL_PREFIX}/libexec/\${PACKAGE}|g" {} ';'
# Use correct docdir
find -type f -exec sed -i -e "s|\${INSTALL_PREFIX}/share/doc/packages/\${PACKAGE}|\${INSTALL_PREFIX}/share/doc/\${PACKAGE}|g" {} ';'
%build
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOC_INSTALL_DIR=%{_docdir}
%make_build
%make_build -C po translations
%make_build -C tests
%install
%make_install
%make_install -C po
mkdir -p %{buildroot}%{_libexecdir}/zypper/commands
%find_lang %{name}
install -dm 0755 %{buildroot}%{_localstatedir}/log
touch %{buildroot}%{_localstatedir}/log/zypper.log
# Remove conflict with apt
mv %{buildroot}%{_bindir}/aptitude %{buildroot}%{_bindir}/zypp-aptitude
# Redo the symlink to point to the new binary name
rm %{buildroot}%{_bindir}/apt-get
ln -sf zypp-aptitude %{buildroot}%{_bindir}/zypp-apt-get
# Fix shebang for zypper-log
sed -e "s|/usr/bin/env python|/usr/bin/python|g" -i %{buildroot}%{_sbindir}/zypper-log
# Move the bash completion file
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
mv %{buildroot}%{_sysconfdir}/bash_completion.d/zypper.sh %{buildroot}%{_datadir}/bash-completion/completions/zypper
rm -rf %{buildroot}%{_sysconfdir}/bash_completion.d/
%check
pushd tests
ctest .
popd
%files -f %{name}.lang
%license COPYING
%doc %{_docdir}/zypper/*
%config(noreplace) %{_sysconfdir}/zypp/zypper.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/zypper.lr
%config(noreplace) %{_sysconfdir}/logrotate.d/zypp-refresh.lr
%{_datadir}/bash-completion/completions/zypper
%{_bindir}/zypper
%{_bindir}/installation_sources
%{_sbindir}/zypp-refresh
%{_datadir}/zypper/
%{_libexecdir}/zypper/
%{_mandir}/man8/zypper.8.*
%{_mandir}/man8/zypp-refresh.8.*
%ghost %config(noreplace) %attr(640,root,root) %{_localstatedir}/log/zypper.log
%files log
%{_sbindir}/zypper-log
%{_mandir}/man8/zypper-log.8.*
%files aptitude
%{_bindir}/zypp-aptitude
%{_bindir}/zypp-apt-get
%dir %{_sysconfdir}/zypp/apt-packagemap.d/
%config(noreplace) %{_sysconfdir}/zypp/apt-packagemap.d/*
%changelog
* Wed Sep 05 2018 Neal Gompa <ngompa13@gmail.com> - 1.13.45-1
- Update to 1.13.45
* Wed Mar 07 2018 Neal Gompa <ngompa13@gmail.com> - 1.13.41-1
- Update to 1.13.41
- Drop recommends for cron
* Sun Sep 03 2017 Neal Gompa <ngompa13@gmail.com> - 1.13.32-1
- Update to 1.13.32 (#1485336)
* Thu Aug 17 2017 Neal Gompa <ngompa13@gmail.com> - 1.13.31-1
- Update to 1.13.31 (#1480827)
* Sun Aug 06 2017 Neal Gompa <ngompa13@gmail.com> - 1.13.30-1
- Update to 1.13.30 (#1470434)
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.28-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.28-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Jun 20 2017 Neal Gompa <ngompa13@gmail.com> - 1.13.28-1
- Update to 1.13.28 (#1444590)
* Sun Jun 04 2017 Jitka Plesnikova <jplesnik@redhat.com> - 1.13.22-2
- Perl 5.26 rebuild
* Mon Apr 17 2017 Neal Gompa <ngompa13@gmail.com> - 1.13.22-1
- Update to 1.13.22
- Fix zypp-apt-get symlink
- Add missing (Build)Requires for zypper-aptitude
- Move bash completion file and add bash-completion Requires
* Fri Mar 31 2017 Neal Gompa <ngompa13@gmail.com> - 1.13.21-1
- Update to 1.13.21
- Drop merged patches
- Use correct libexecdir
- Use correct docdir
* Fri Feb 24 2017 Neal Gompa <ngompa13@gmail.com> - 1.13.19-1
- Update to 1.13.19
- Bump required libzypp version
- Backport patch from upstream to fix building tests
* Mon Dec 12 2016 Neal Gompa <ngompa13@gmail.com> - 1.13.14-1
- Update to 1.13.14
- Bump required libzypp version
* Sat Aug 27 2016 Neal Gompa <ngompa13@gmail.com> - 1.13.9-3
- Bump to rebuild against libzypp-16.2.2-3 to add suserepo support
* Thu Aug 25 2016 Neal Gompa <ngompa13@gmail.com> - 1.13.9-2
- Bump to rebuild against libzypp-16.2.2-2
* Wed Aug 24 2016 Neal Gompa <ngompa13@gmail.com> - 1.13.9-1
- Update to 1.13.9
- Bump required libzypp version
* Fri Jun 10 2016 Neal Gompa <ngompa13@gmail.com> - 1.13.2-1
- Update to 1.13.2
* Tue Apr 26 2016 Neal Gompa <ngompa13@gmail.com> - 1.13.0-2
- Rebuild against libzypp-15.22.0
* Wed Apr 6 2016 Neal Gompa <ngompa13@gmail.com> - 1.13.0-1
- Update to 1.13.0
* Thu Feb 4 2016 Neal Gompa <ngompa13@gmail.com> - 1.12.32-1
- Update to 1.12.32
* Mon Feb 1 2016 Neal Gompa <ngompa13@gmail.com> - 1.12.30-1
- Initial packaging