mh dacab6f
%global pypi_name OnionBalance
mh d91cc48
%global pkgname onionbalance
mh d91cc48
%global sum Load-balancing for Tor onion services
mh d91cc48
mh d91cc48
%global toruser toranon
mh d91cc48
mh d91cc48
Name:           python-%{pkgname}
mh 83c4db4
Version:        0.2.1
fc2b9d9
Release:        11%{?dist}
mh d91cc48
Summary:        %{sum}
mh d91cc48
mh d91cc48
License:        GPLv3
mh dacab6f
URL:            https://onionbalance.readthedocs.io
mh dacab6f
Source0:        %pypi_source
mh d91cc48
Source1:        onionbalance.service
mh d91cc48
Source2:        onionbalance.tmpfiles
mh d91cc48
Source3:        onionbalance.logrotate
mh d91cc48
Source5:        onionbalance.torrc.example
mh d91cc48
Source6:        README.fedora
mh d91cc48
mh 8541d9c
Patch0:         python-onionbalance-fix-versioneer.patch
mh 8541d9c
mh d91cc48
BuildArch: noarch
mh d91cc48
mh d91cc48
BuildRequires: systemd-units
mh d91cc48
mh d91cc48
BuildRequires:  python3-devel
mh d91cc48
BuildRequires:  python3-setuptools
mh dacab6f
BuildRequires:  python3-stem >= 1.8
mh dacab6f
BuildRequires:  python3-PyYAML >= 4.2b1
mh dacab6f
BuildRequires:  python3-cryptography >= 2.5
mh ab0054f
BuildRequires:  python3-pycryptodomex
mh dacab6f
BuildRequires:  python3-future >= 0.14.3
mh dacab6f
BuildRequires:  python3-setproctitle >= 1.1.9
mh d91cc48
mh d91cc48
BuildRequires: systemd
mh d91cc48
mh d91cc48
mh dacab6f
%global _description %{expand:
mh d91cc48
OnionBalance provides load-balancing and redundancy for Tor
mh d91cc48
onion services by distributing requests to multiple back-end
mh dacab6f
Tor instances.}
mh d91cc48
mh dacab6f
%description %_description
mh dacab6f
mh dacab6f
%package -n python3-%{pkgname}
mh d91cc48
Summary:   %{sum}
mh d91cc48
Requires:  python3-setuptools
mh dacab6f
Requires:  python3-stem >= 1.8
mh dacab6f
Requires:  python3-PyYAML >= 4.2b1
mh 6c666d3
Requires:  python3-cryptography >= 2.5
mh ab0054f
Requires:  python3-pycryptodomex
mh dacab6f
Requires:  python3-future >= 0.14.3
mh dacab6f
Requires:  python3-setproctitle >= 1.1.9
mh d91cc48
%{?python_provide:%python_provide python3-%{pkgname}}
mh d91cc48
Requires: tor
mh d91cc48
Requires: logrotate
mh d91cc48
Requires(pre): shadow-utils
mh d91cc48
Requires(post): systemd
mh d91cc48
Requires(preun): systemd
mh d91cc48
Requires(postun): systemd
mh d91cc48
mh dacab6f
%description -n python3-%{pkgname} %_description
mh d91cc48
mh d91cc48
%prep
mh dacab6f
%autosetup -n %{pypi_name}-%{version}
mh d91cc48
mh d91cc48
%build
mh d91cc48
%py3_build
mh d91cc48
mh d91cc48
%install
mh d91cc48
%py3_install
mh d91cc48
mh d91cc48
install -d        %{buildroot}/etc/logrotate.d
mh d91cc48
install -d        %{buildroot}/%{_sysconfdir}/%{pkgname}
mh d91cc48
install -d        %{buildroot}/%{_localstatedir}/log/%{pkgname}
mh d91cc48
install -d        %{buildroot}/%{_localstatedir}/lib/%{pkgname}
mh d91cc48
install -d -m 755 %{buildroot}/%{_unitdir}
mh d91cc48
install -d -m 755 %{buildroot}/%{_tmpfilesdir}
mh d91cc48
mh d91cc48
install -p -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{pkgname}.service
mh d91cc48
install -p -m 644 %{SOURCE2} %{buildroot}/%{_tmpfilesdir}/%{pkgname}.conf
mh d91cc48
install -p -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/logrotate.d/%{pkgname}.conf
mh d91cc48
%if 0%{?with_docs}
mh d91cc48
install -d -m 755 %{buildroot}/%{_mandir}/man1
mh d91cc48
cp docs/_build/man/%{pkgname}* %{buildroot}/%{_mandir}/man1/
mh d91cc48
%endif
mh d91cc48
mh d91cc48
install -p -m 644 %{SOURCE5} .
mh d91cc48
install -p -m 644 %{SOURCE6} .
mh d91cc48
mh dacab6f
%pre -n python3-%{pkgname}
mh d91cc48
getent passwd %{pkgname} >/dev/null || \
mh d91cc48
    useradd -r -g %{toruser} -d %{_localstatedir}/lib/%{pkgname} -s /sbin/nologin \
mh d91cc48
    -c "%{pkgname} daemon user" %{pkgname}
mh d91cc48
exit 0
mh d91cc48
mh dacab6f
%post -n python3-%{pkgname}
mh d91cc48
%systemd_post onionbalance.service
mh d91cc48
mh dacab6f
%preun -n python3-%{pkgname}
mh d91cc48
%systemd_preun onionbalance.service
mh d91cc48
mh dacab6f
%postun -n python3-%{pkgname}
mh d91cc48
%systemd_postun_with_restart onionbalance.service
mh d91cc48
mh dacab6f
%files -n python3-%{pkgname}
mh d91cc48
%doc README.rst
mh d91cc48
%doc README.fedora
mh d91cc48
%doc onionbalance.torrc.example
mh d91cc48
%license COPYING
mh d91cc48
%if 0%{?with_docs}
mh d91cc48
%doc docs/_build/html
mh d91cc48
%doc %attr(0644,root,root) %{_mandir}/man1/%{pkgname}*
mh d91cc48
%endif
mh d91cc48
%if 0%{?for_el7}
mh d91cc48
%{python2_sitelib}/*
mh d91cc48
%else
mh d91cc48
%{python3_sitelib}/*
mh d91cc48
%endif
mh d91cc48
%{_bindir}/%{pkgname}
mh d91cc48
%{_bindir}/%{pkgname}-config
mh d91cc48
%{_unitdir}/%{pkgname}.service
mh d91cc48
%{_tmpfilesdir}/%{pkgname}.conf
mh d91cc48
%dir %attr(0750,root,%{toruser}) %{_sysconfdir}/%{pkgname}
mh d91cc48
%dir %attr(0750,%{pkgname},%{toruser}) %{_localstatedir}/log/%{pkgname}
mh d91cc48
%dir %attr(0750,%{pkgname},%{toruser}) %{_localstatedir}/lib/%{pkgname}
mh d91cc48
%config(noreplace) %{_sysconfdir}/logrotate.d/%{pkgname}.conf
mh d91cc48
mh d91cc48
%changelog
fc2b9d9
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-11
fc2b9d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
fc2b9d9
4777608
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-10
4777608
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
4777608
2ec5d00
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-9
2ec5d00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
2ec5d00
mh 8541d9c
* Fri Jul 07 2023 Python Maint <python-maint@redhat.com> - 0.2.1-8
mh 8541d9c
- Fix configparsers
mh 8541d9c
bc8a4ba
* Thu Jul 06 2023 Python Maint <python-maint@redhat.com> - 0.2.1-7
bc8a4ba
- Rebuilt for Python 3.12
bc8a4ba
mh 6c666d3
* Thu Mar 16 2023 Marcel Haerry <mh+fedora@scrit.ch> - 0.2.1-6
mh 6c666d3
- Fix dependency for binary package bz#2061839
mh 6c666d3
8fd722a
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-5
8fd722a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
8fd722a
5b66202
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-4
5b66202
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
5b66202
2d74b8d
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 0.2.1-3
2d74b8d
- Rebuilt for Python 3.11
2d74b8d
mh ab0054f
* Fri Mar 11 2022 Marcel Haerry <mh+fedora@scrit.ch> - 0.2.1-2
mh ab0054f
- Switch to python3-pycryptodomex as per bz#2061839
mh ab0054f
mh 83c4db4
* Fri Feb 11 2022 Marcel Haerry <mh+fedora@scrit.ch> - 0.2.1-1
mh 83c4db4
- Upgraded to 0.2.1 - new upstream
mh 83c4db4
757bd34
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-8
757bd34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
757bd34
967b6e2
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-7
967b6e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
967b6e2
d6e26d7
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.2.0-6
d6e26d7
- Rebuilt for Python 3.10
d6e26d7
0550472
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.2.0-5
0550472
- Rebuilt for updated systemd-rpm-macros
0550472
  See https://pagure.io/fesco/issue/2583.
0550472
e2a8440
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-4
e2a8440
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
e2a8440
38a2c18
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
38a2c18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
38a2c18
c63945b
* Tue Jun 02 2020 Miro Hrončok <mhroncok@redhat.com> - 0.2.0-2
c63945b
- Rebuilt for Python 3.9
c63945b
mh dacab6f
* Thu May 28 2020 Marcel Haerry <mh+fedora@scrit.ch> - 0.2.0-1
mh dacab6f
- Upgraded to 0.2.0 - new upstream - new HSv3 support
mh dacab6f
- Fixing build (bz#1792059)
mh dacab6f
a4c98a3
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.1.8-12
a4c98a3
- Rebuilt for Python 3.9
a4c98a3
538deec
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-11
538deec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
538deec
mh 38a925a
* Mon Sep 16 2019 Marcel Haerry 
mh 38a925a
- Fixing building on Python 3.8 (Fixes bz#1736518)
mh 38a925a
e15e136
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.1.8-9
e15e136
- Rebuilt for Python 3.8
e15e136
aae59dc
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-8
aae59dc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
aae59dc
6f887d4
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-7
6f887d4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
6f887d4
mh 6594c14
* Sat Jul 21 2018 Marcel Haerry <mh+fedora@scrit.ch> - 0.1.8-6
mh 6594c14
- Fixed tmpfiles unit file
mh 6594c14
6182c41
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-5
6182c41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6182c41
5b3337a
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.1.8-4
5b3337a
- Rebuilt for Python 3.7
5b3337a
1aaa080
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-3
1aaa080
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1aaa080
7cc07a3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-2
7cc07a3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7cc07a3
mh 7885529
* Thu May 04 2017 Marcel Haerry <mh+fedora@scrit.ch> - 0.1.8-1
mh 3abd22d
- latest upstream release (#1447661)
mh 7885529
mh d5469e2
* Thu Feb 23 2017 Marcel Haerry <mh+fedora@scrit.ch> - 0.1.7-1
mh d5469e2
- latest upstream release
mh d5469e2
a76b9a4
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.6-2
a76b9a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a76b9a4
mh d91cc48
* Fri Jan 20 2017 Marcel Haerry <mh+fedora@scrit.ch> - 0.1.6-1
mh d91cc48
  initial release