# Generated by rust2rpm 10 %bcond_without check %global __cargo_skip_build 0 %global commit 6a8bcc66c99211df3ea5aa7ba2e6dcd7de61ad7c %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitnum 1 Name: mirrorlist-server Version: 0~git.%{commitnum}.%{shortcommit} Release: 1%{?dist} Summary: Mirrorlist Server License: MIT URL: https://crates.io/crates/mirrorlist-server Source: https://github.com/adrianreber/mirrorlist-server/archive/%{commit}/%{name}-%{shortcommit}.tar.gz ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging %global _description %{expand: The mirrorlist-server uses the data created by `MirrorManager2 `_ to answer client request for the "best" mirror. This implementation of the mirrorlist-server is written in Rust. The original version of the mirrorlist-server was part of the MirrorManager2 repository and it is implemented using Python. While moving from Python2 to Python3 one of the problems was that the data exchange format (Python Pickle) did not support running the MirrorManager2 backend with Python2 and the mirrorlist frontend with Python3. To have a Pickle independent data exchange format protobuf was introduced. The first try to use protobuf in the python mirrorlist implementation required a lot more memory than the Pickle based implementation (3.5GB instead of 1.1GB). That is one of the reasons a new mirrorlist-server implementation was needed. Another reason to rewrite the mirrorlist-server is its architecture. The Python based version requires the Apache HTTP server or something that can run the included wsgi. The wsgi talks over a socket to the actual mirrorlist-server. In Fedora's MirrorManager2 instance this runs in a container which runs behind HAProxy. This implementation in Rust directly uses a HTTP library to reduce the number of involved components. In addition to being simpler this implementation also requires less memory than the Python version.} %description %{_description} %files %license LICENSE %doc README.rst %{_bindir}/mirrorlist-server %prep %autosetup -n %{name}-%{commit} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check %cargo_test %endif %changelog * Mon Nov 11 14:24:45 CET 2019 Igor Gnatenko - 1.0.0-1 - Initial package