File pacman.spec of Package pacman

#
# spec file for package pacman
#
# Copyright (c) 2021 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 https://bugs.opensuse.org/
#


%define sover 14
Name:           pacman
Version:        6.1.0
Release:        0
Summary:        Package manager for the Arch distribution
License:        GPL-2.0-or-later
Group:          System/Packages
URL:            https://www.archlinux.org/pacman/
Source0:        https://gitlab.archlinux.org/%{name}/%{name}/-/releases/v%{version}/downloads/%{name}-%{version}.tar.xz
Source1:        https://gitlab.archlinux.org/%{name}/%{name}/-/releases/v%{version}/downloads/%{name}-%{version}.tar.xz.sig
Source2:        https://www.archlinux.org/mirrorlist/all#/mirrorlist
Source3:        https://github.com/archlinux/svntogit-packages/raw/packages/pacman/trunk/pacman.conf#/pacman.conf
BuildRequires:  asciidoc
BuildRequires:  bsdtar
BuildRequires:  doxygen
BuildRequires:  fakechroot
BuildRequires:  meson >= 0.56
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(gpgme) >= 1.12.0
BuildRequires:  pkgconfig(libarchive) >= 3.0.0
BuildRequires:  pkgconfig(libcurl) >= 7.55.0
BuildRequires:  pkgconfig(openssl)
Requires:       bsdtar
Requires:       gpgme >= 1.12.0
Recommends:     %{name}-bash-completion = %{version}
Recommends:     %{name}-lang = %{version}
Recommends:     arch-install-scripts
Recommends:     awk
Recommends:     dirmngr

%description
Pacman is the package manager used by the Arch distribution. It is a
frontend for the ALPM (Arch Linux Package Management) library.

%package -n libalpm%{sover}
Summary:        Arch Linux Package Management library
Group:          System/Libraries
Recommends:     libalpm%{sover}-lang = %{version}

%description -n libalpm%{sover}
This library is the backend behind Pacman - the package manager used
by the Arch distribution. It uses simple compressed files as a package
format, and maintains a text-based package database.

%package -n libalpm%{sover}-devel
Summary:        Development headers for libalpm
Group:          Development/Libraries/C and C++
Requires:       libalpm%{sover} = %{version}

%description -n libalpm%{sover}-devel
This package contains the public headers necessary to use libalpm.

%package bash-completion
Summary:        Bash completion support for pacman
Group:          System/Base
Requires:       bash-completion
BuildArch:      noarch

%description bash-completion
Pacman offer bash completion, but it is an optional dependency.

%lang_package
%lang_package -n libalpm%{sover}

%prep
%autosetup -p1

# Enable worldwide mirrors by default
sed -i '7,9 s/^#Server/Server/' %{SOURCE2}

%build
%meson \
%if 0%{?suse_version} > 1500
       -Ddoc=enabled \
%else
       -Ddoc=disabled \
%endif
       -Ddoxygen=enabled \

%meson_build

%install
%meson_install

install -D -m 0644 -t %{buildroot}%{_sysconfdir}/%{name}.d/ %{SOURCE2}
install -D -m 0644 -t %{buildroot}%{_sysconfdir}/ %{SOURCE3}

%find_lang %{name}
%find_lang %{name}-scripts
%find_lang libalpm

%check

%post -n libalpm%{sover} -p /sbin/ldconfig
%postun -n libalpm%{sover} -p /sbin/ldconfig

%files
%license COPYING
%doc AUTHORS NEWS README
%{_bindir}/*
%dir %{_sysconfdir}/%{name}.d
%config(noreplace) %{_sysconfdir}/makepkg.conf
%config(noreplace) %{_sysconfdir}/makepkg.conf.d/
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}.d/mirrorlist
%{_localstatedir}/lib/%{name}/
%dir %{_datadir}/libalpm/
%dir %{_datadir}/libalpm/hooks/
%dir %{_localstatedir}/cache/%{name}
%dir %{_localstatedir}/cache/%{name}/pkg
%{_datadir}/%{name}/
%{_datarootdir}/makepkg/
%if 0%{?suse_version} > 1500
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%endif
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/*
%{_datadir}/pkgconfig/libmakepkg.pc

%files lang -f %{name}.lang -f %{name}-scripts.lang

%files -n libalpm%{sover}
%{_libdir}/libalpm.so.*

%files -n libalpm%{sover}-lang -f libalpm.lang

%files -n libalpm%{sover}-devel
%license COPYING
%doc HACKING
%{_includedir}/*
%{_libdir}/pkgconfig/libalpm.pc
%{_libdir}/libalpm.so
%if 0%{?suse_version} > 1500
%{_mandir}/man3/*
%endif

%files bash-completion
%exclude %{_datadir}/bash-completion/completions/makepkg
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/*

%changelog
openSUSE Build Service is sponsored by