Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%define cache_dir /var/cache/0install.net

Name:    zeroinstall-injector
Version: 0.32
Release: 1%{?dist}
Summary: The Zero Install Injector (0launch)

Group:   Applications/System
License: LGPLv2
URL:     http://0install.net
Source0: http://osdn.dl.sf.net/sourceforge/zero-install/%{name}-%{version}.tar.bz2
Patch0:  zeroinstall-x86_64-arch.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch: noarch
BuildRequires: python-devel desktop-file-utils
Requires:      PyXML pygtk2 gnupg pygtk2-libglade sudo
Requires(pre): shadow-utils

%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
%setup -q
%patch0 -p1 -b .arch

%build
%{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
mv "$RPM_BUILD_ROOT/usr/man" "$RPM_BUILD_ROOT/%{_datadir}/man"
mkdir -p "$RPM_BUILD_ROOT%{cache_dir}/implementations"

desktop-file-install --vendor="fedora" \
    --remove-category="Application" \
    --delete-original \
    --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
    $RPM_BUILD_ROOT%{_datadir}/applications/zeroinstall-zero2desktop.desktop

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# Add the "zeroinst" user.
# This is not used by default, but is required if you want to
# set up sharing of downloads later.
getent group  zeroinst >/dev/null || groupadd -r zeroinst
getent passwd zeroinst >/dev/null || \
useradd -r -g zeroinst -d %{cache_dir} -s /sbin/nologin \
    -c "Zero Install shared cache" zeroinst
exit 0

%files
%defattr(-,root,root,-)
%doc COPYING README
%{_bindir}/0*
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/zeroinstall-zero2desktop.png
%dir %{python_sitelib}/zeroinstall/
%dir %{python_sitelib}/zeroinstall/0launch-gui/
%dir %{python_sitelib}/zeroinstall/injector/
%dir %{python_sitelib}/zeroinstall/zerostore/
%{python_sitelib}/zeroinstall/*.py*
%{python_sitelib}/zeroinstall/0launch-gui/0launch-gui
%{python_sitelib}/zeroinstall/0launch-gui/README
%{python_sitelib}/zeroinstall/0launch-gui/ZeroInstall-GUI.xml
%{python_sitelib}/zeroinstall/0launch-gui/zero-install.glade
%{python_sitelib}/zeroinstall/*/*.py*
%if 0%{?fedora} >= 9
%{python_sitelib}/*.egg-info
%endif
%{_mandir}/man1/0*
%dir %{cache_dir}
%attr(755,zeroinst,zeroinst) %{cache_dir}/implementations

%changelog
* Sat Apr  5 2008 Michel Salim <salimma@fedoraproject.org> - 0.32-1
- Update to 0.32
- Package .egg-info file on Fedora >= 9

* Fri Jan 18 2008 Michel Salim <michel.sylvan@gmail.com> - 0.31-1
- Update to 0.31

* Sat Sep  8 2007 Michel Salim <michel.sylvan@gmail.com> 0.30-2
- Update scriptlet that creates zeroinst user

* Wed Sep  5 2007 Michel Salim <michel.sylvan@gmail.com> 0.30-1
- Update to 0.30
- License is now versioned
- Incorporate changes from Thomas Leonard:
  * create zeroinst user
  * create shared cache

* Mon Dec 18 2006 Michel Salim <michel.salim@gmail.com> 0.24-3
- Rebuild for development branch

* Sat Nov 11 2006 Michel Salim <michel.salim@gmail.com> 0.24-2
- Allow installation of ix86 binaries on x86_64

* Sat Nov  4 2006 Michel Salim <michel.salim@gmail.com> 0.24-1
- Update to 0.24
- Not ghosting .pyos any longer

* Sun Oct  8 2006 Michel Salim <michel.salim@gmail.com> 0.23-1
- Update to 0.23

* Sun Mar  5 2006 Michel Salim <michel.salim@gmail.com> 0.18-4
- Removed left-behind pushd and popd

* Sat Feb 25 2006 Michel Salim <michel.salim@gmail.com> 0.18-3
- Add Python-related requirements, BuildReq on gnupg to decrypt upstream source
 
* Sat Feb 18 2006 Michel Salim <michel.salim@gmail.com> 0.18-2
- Use _mandir, discard CFLAGS and unused python_sitearch definition

* Thu Feb 16 2006 Michel Salim <michel.salim@gmail.com> 0.18-1
- Initial Fedora Extras release, based on upstream spec contributed by Juan Carlos Jimenez Garcia