File pacman.spec of Package pacman
#
# spec file for package pacman
#
# Copyright (c) 2018 SUSE LINUX 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/
#
Name: pacman
Version: 5.2.2
Release: 0
Summary: A library-based package manager with dependency support
License: GPL-2.0-or-later
Group: System/Packages
Url: https://projects.archlinux.org/pacman
Source: https://sources.archlinux.org/other/pacman/%{name}-%{version}.tar.gz
Source90: https://sources.archlinux.org/other/pacman/%{name}-%{version}.tar.gz.sig
# https://www.archlinux.org/mirrorlist/all
Source1: mirrorlist
Source3: pacman.conf
Source4: makepkg.conf
#Patch: 0001-makepkg-Clear-ERR-trap-before-trying-to-restore-it.patch
#Patch1: 0002-makepkg-Don-t-use-parameterless-return.patch
BuildRequires: libtool
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: pkg-config
BuildRequires: libarchive-devel
BuildRequires: python-devel
BuildRequires: libopenssl-devel
BuildRequires: asciidoc
BuildRequires: libcurl-devel
BuildRequires: libgpgme-devel
BuildRequires: zsh
BuildRequires: fakechroot
Requires: libalpm12 = %{version}
Requires: archlinux-keyring
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
pacman is a utility which manages software packages in Linux. It uses simple compressed files as a package format, and maintains a text-based package database (more of a hierarchy), just in case some hand tweaking is necessary.
pacman does not strive to "do everything." It will add, remove and upgrade packages in the system, and it will allow you to query the package database for installed packages, files and owners. It also attempts to handle dependencies automatically and can download packages from a remote server.
%package -n libalpm12
Summary: Shared libraries for pacman
Group: System/Libraries
%description -n libalpm12
Shared libraries for pacman.
%package -n libalpm-devel
Summary: Development files for libalpm
Group: Development/Libraries/C and C++
Requires: libalpm12 = %{version}
%description -n libalpm-devel
Development files for libalpm.
%prep
%setup -q
#patch1 -p1
#NOCONFIGURE=1 ./autogen.sh
sed -i "s/#\!\/hint\/bash/#\!\/bin\/bash/" etc/makepkg.conf.in
sed -i "s/#\!\/usr\/bin\/bash/#\!\/bin\/bash/" scripts/libmakepkg/lint_config.sh.in
%build
%configure
make %{?_smp_mflags}
%install
%make_install
find %{buildroot}%{_libdir} -name "libalpm.a" -delete -print
find %{buildroot}%{_libdir} -name "libalpm.la" -delete -print
#mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
mkdir -p %{buildroot}%{_sysconfdir}/pacman.d
install -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/pacman.d/
rm -rf %{buildroot}%{_sysconfdir}/pacman.conf
rm -rf %{buildroot}%{_sysconfdir}/makepkg.conf
install -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/pacman.conf
install -m 0644 %{S:4} %{buildroot}%{_sysconfdir}/makepkg.conf
mkdir -p %{buildroot}%{_localstatedir}/lib/pacman/sync
mkdir -p %{buildroot}%{_localstatedir}/lib/pacman/local
touch %{buildroot}%{_localstatedir}/lib/pacman/local/AlPM_DB_VERSION
mkdir -p %{buildroot}%{_localstatedir}/cache/pacman/pkg
mkdir -p %{buildroot}%{_sysconfdir}/pacman.d/gnupg
mkdir -p %{buildroot}%{_sysconfdir}/pacman.d/hooks
%find_lang libalpm
%find_lang pacman-scripts
%find_lang pacman
#%check
#make check
%post -n libalpm12 -p /sbin/ldconfig
%postun -n libalpm12 -p /sbin/ldconfig
%files -n libalpm12 -f libalpm.lang
%defattr(-,root,root)
%{_libdir}/libalpm.so.12
%{_libdir}/libalpm.so.12.0.2
%files -n libalpm-devel
%defattr(-,root,root)
%{_includedir}/alpm.h
%{_includedir}/alpm_list.h
%{_libdir}/libalpm.so
%{_libdir}/pkgconfig/libalpm.pc
%files -f pacman-scripts.lang -f pacman.lang
%defattr(-,root,root)
%doc README COPYING NEWS
%dir %{_sysconfdir}/pacman.d
%dir %{_sysconfdir}/pacman.d/gnupg
%dir %{_sysconfdir}/pacman.d/hooks
# needed by namcap build
%dir %attr(0777,root,root) %{_localstatedir}/lib/pacman
%dir %attr(0777,root,root) %{_localstatedir}/lib/pacman/sync
%dir %attr(0777,root,root) %{_localstatedir}/lib/pacman/local
%dir %{_localstatedir}/cache/pacman
%dir %{_localstatedir}/cache/pacman/pkg
%config(noreplace) %{_sysconfdir}/makepkg.conf
%config(noreplace) %{_sysconfdir}/pacman.conf
%config(noreplace) %{_sysconfdir}/pacman.d/mirrorlist
%{_bindir}/makepkg
%{_bindir}/makepkg-template
%{_bindir}/pacman
%{_bindir}/pacman-conf
%{_bindir}/pacman-db-upgrade
%{_bindir}/pacman-key
%{_bindir}/repo-add
%{_bindir}/repo-elephant
%{_bindir}/repo-remove
%{_bindir}/testpkg
%{_bindir}/vercmp
%{_datadir}/makepkg
%{_datadir}/pacman
%{_mandir}/man*/*
%{_datadir}/pkgconfig/libmakepkg.pc
%{_datadir}/bash-completion/completions/pacman
%{_datadir}/bash-completion/completions/pacman-key
%{_datadir}/bash-completion/completions/makepkg
%{_datadir}/zsh/site-functions/_pacman
%ghost %{_localstatedir}/lib/pacman/local/AlPM_DB_VERSION
%changelog