150 lines
5.0 KiB
RPMSpec
150 lines
5.0 KiB
RPMSpec
#
|
|
# spec file for package zeroinstall-injector
|
|
#
|
|
# 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 https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
|
|
|
|
%define cache_dir /var/cache/0install.net
|
|
|
|
%define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
|
|
|
Name: zeroinstall-injector
|
|
Version: 2.3.10
|
|
Release: 0
|
|
%define source_version 2.3.10
|
|
Summary: Decentralised cross-distribution software installation
|
|
License: LGPL-2.1-or-later
|
|
Group: System/Management
|
|
|
|
URL: http://0install.net
|
|
Source0: 0install-%{source_version}.tar.bz2
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildArch: noarch
|
|
BuildRequires: fdupes
|
|
BuildRequires: gnupg
|
|
BuildRequires: python3
|
|
BuildRequires: python3-devel
|
|
BuildRequires: python3-gobject
|
|
|
|
Requires: binutils
|
|
Requires: gnupg
|
|
Requires: sudo
|
|
Requires: xdg-utils
|
|
AutoReqProv: no
|
|
|
|
%if 0%{?suse_version}
|
|
BuildRequires: python3-xml
|
|
Requires: python3-xml
|
|
%else
|
|
BuildRequires: PyXML
|
|
Requires: PyXML
|
|
%endif
|
|
|
|
%if 0%{?mandriva_version}
|
|
Requires: pygtk2.0 >= 2.12
|
|
BuildRequires: pygtk2.0
|
|
%else
|
|
%if 0%{?suse_version}
|
|
Requires: ca-certificates
|
|
BuildRequires: update-desktop-files
|
|
Requires: python3-gobject-Gdk
|
|
BuildRequires: python3-gobject-Gdk
|
|
%else
|
|
Requires: pygtk2 >= 2.12
|
|
BuildRequires: pygtk2
|
|
%endif
|
|
%endif
|
|
|
|
%description
|
|
The Zero Install Injector makes it easy for users to install software without
|
|
needing root privileges. It takes the URL of a program and runs it (downloading
|
|
it first if necessary). Any dependencies of the program are fetched in the same
|
|
way. The user controls which version of the program and its dependencies to
|
|
use.
|
|
|
|
Zero Install is a decentralised installation system (there is no central
|
|
repository; all packages are identified by URLs), loosly-coupled (if different
|
|
programs require different versions of a library then both versions are
|
|
installed in parallel, without conflicts), and has an emphasis on security (all
|
|
package descriptions are GPG-signed, and contain cryptographic hashes of the
|
|
contents of each version). Each version of each program is stored in its own
|
|
sub-directory within the Zero Install cache (nothing is installed to
|
|
directories outside of the cache, such as /usr/bin) and no code from the
|
|
package is run during install or uninstall. The system can automatically check
|
|
for updates when software is run.
|
|
|
|
%prep
|
|
tar xjvf %{SOURCE0}
|
|
%setup -q -T -D -n 0install-%{source_version}
|
|
|
|
%build
|
|
# (avoids error about missing build/scripts-3.2 directory)
|
|
python3 setup.py build
|
|
|
|
%check
|
|
#(cd tests && python ./testall.py)
|
|
|
|
%install
|
|
# Make Python3 libraries available, but (for now) use Python 2 as the default
|
|
# for the commands.
|
|
python3 setup.py install --skip-build --prefix=/usr --root $RPM_BUILD_ROOT
|
|
%fdupes -s %{buildroot}
|
|
rm -f $RPM_BUILD_ROOT/%{python3_sitelib}/*.egg-info
|
|
mv "$RPM_BUILD_ROOT/usr/man" "$RPM_BUILD_ROOT%{_datadir}/man"
|
|
mkdir -p "$RPM_BUILD_ROOT%{cache_dir}/implementations"
|
|
%if 0%{?suse_version}
|
|
%suse_update_desktop_file -r 0install Settings DesktopSettings
|
|
%endif
|
|
%find_lang zero-install
|
|
mkdir -p "$RPM_BUILD_ROOT/etc/bash_completion.d/"
|
|
ln -s "%{_datadir}/bash-completion/completions/0install" "$RPM_BUILD_ROOT/etc/bash_completion.d/"
|
|
|
|
%files -f zero-install.lang
|
|
%defattr(-,root,root,-)
|
|
%doc COPYING README.md
|
|
%dir %{_datadir}/fish
|
|
%dir %{_datadir}/fish/completions
|
|
%{_bindir}/0*
|
|
%{python3_sitelib}/zeroinstall
|
|
%{_mandir}/man1/0*
|
|
%{_datadir}/applications/0install.desktop
|
|
%{_datadir}/icons/hicolor/scalable/apps/zeroinstall.svg
|
|
%{_datadir}/icons/hicolor/128x128/apps/zeroinstall.png
|
|
%{_datadir}/icons/hicolor/48x48/apps/zeroinstall.png
|
|
%{_datadir}/icons/hicolor/24x24/apps/zeroinstall.png
|
|
%{_datadir}/bash-completion/completions/0install
|
|
%{_datadir}/fish/completions/0install.fish
|
|
%{_datadir}/zsh/site-functions/_0install
|
|
/etc/bash_completion.d/0install
|
|
%dir %{_datadir}/bash-completion/
|
|
%dir %{_datadir}/bash-completion/completions
|
|
%dir %{_datadir}/zsh
|
|
%dir %{_datadir}/zsh/site-functions
|
|
%dir %{cache_dir}
|
|
%attr(755,zeroinst,zeroinst) %{cache_dir}/implementations
|
|
|
|
%pre
|
|
# Add the "zeroinst" user.
|
|
# This is not used by default, but is required if you want to
|
|
# set up sharing of downloads later.
|
|
/usr/sbin/useradd -c 'Zero Install shared cache' \
|
|
-s /sbin/nologin -r -d '%{cache_dir}' zeroinst 2> /dev/null || :
|
|
/usr/sbin/groupadd -r zeroinst 2> /dev/null || :
|
|
|
|
%changelog
|