%global pypi_name isso %global isso_user isso %global isso_group %{isso_user} %global desc Commenting server similar to Disqus. Name: python-isso Version: 0.10.6 Release: 1%{?dist} Summary: Commenting server similar to Disqus License: MIT URL: http://posativ.org/isso Source0: https://files.pythonhosted.org/packages/ba/e9/42dbff728a3b8d5f48af945c23c50f3fb245e8ffc9ac85c6ea6e80406927/isso-0.10.6.tar.gz # See https://raw.githubusercontent.com/posativ/isso/master/LICENSE Source1: LICENSE Source2: isso.service BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %description %{desc} %package -n python2-%{pypi_name} Requires: sqlite Requires: python-itsdangerous Requires: python-misaka Requires: python-html5lib Requires: python-ipaddr Requires: python-configparser Requires: python-werkzeug Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} %{desc} %package -n python3-%{pypi_name} Summary: Commenting server similar to Disqus Requires: sqlite Requires: python3-itsdangerous Requires: python3-misaka Requires: python3-html5lib Requires: python3-werkzeug %{?python_provide:%python_provide python3-%{pypi_name}} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %description -n python3-%{pypi_name} Commenting server similar to Disqus. %prep %setup -q -n %{pypi_name}-%{version} cp %{SOURCE1} . rm -rf %{pypi_name}.egg-info rm -rf %{py3dir} cp -a . %{py3dir} %build %py2_build %py3_build %install %py2_install %py3_install # Remove shebang sed -i '\@^#!/usr/bin/env python@d' %{buildroot}%{python2_sitelib}/%{pypi_name}/__init__.py sed -i '\@^#!/usr/bin/env python@d' %{buildroot}%{python3_sitelib}/%{pypi_name}/__init__.py # Install config install -p -D -m 0644 share/%{pypi_name}.conf %{buildroot}%{_sysconfdir}/%{pypi_name}.conf install -p -D -m 0644 man/man1/%{pypi_name}.1 %{buildroot}%{_mandir}/man1/%{pypi_name}.1 install -p -D -m 0644 man/man5/%{pypi_name}.conf.5 %{buildroot}%{_mandir}/man5/%{pypi_name}.conf.5 install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{pypi_name}.service %pre -n python3-%{pypi_name} getent group %{isso_group} > /dev/null || groupadd -r %{isso_group} getent passwd %{isso_user} > /dev/null || \ useradd -r -M -g %{isso_group} \ -s /sbin/nologin -c "Nginx web server" %{isso_user} exit 0 %post %systemd_post %{pypi_name}.service %preun %systemd_preun %{pypi_name}.service %postun %systemd_postun %{pypi_name}.service %files -n python2-%{pypi_name} %license LICENSE %{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info %{python2_sitelib}/%{pypi_name}/ %files -n python3-%{pypi_name} %license LICENSE %config(noreplace) %{_sysconfdir}/%{pypi_name}.conf %{_bindir}/%{pypi_name} %{_mandir}/man1/%{pypi_name}.1* %{_mandir}/man5/%{pypi_name}.conf.5* %{_unitdir}/%{pypi_name}.service %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/%{pypi_name}/ %changelog * Sat Aug 12 2017 Julien Enselme - 0.10.6-1 - Update to 0.10.6 * Wed Sep 21 2016 Julien Enselme - 0.10.5-1 - Update to 0.10.5 * Sat Apr 16 2016 Julien Enselme - 0.10.4-1 - Update to 0.10.4 * Sat Feb 27 2016 Julien Enselme - 0.10.2-1 - Update to 0.10.3 * Tue Feb 09 2016 Julien Enselme - 0.10.1-1 - Update to 0.10.1 - Clean spec with new python macros * Sat Mar 07 2015 Julien Enselme - 0.9.9-5 - Create the user and group for isso. * Sat Mar 07 2015 Julien Enselme - 0.9.9-4 - Correct SMTP auth when neither a username nor a password are defined. * Sat Mar 07 2015 Julien Enselme - 0.9.9-3 - Install python3 after python2 so that isso is launched with python3. - Correct service file * Sat Mar 07 2015 Julien Enselme - 0.9.9-2 - Make python3 the default version for the command. - Man and service files are only install in the python3 package. * Fri Mar 06 2015 Julien Enselme - 0.9.9-1 - Update to 0.9.9 * Wed Mar 04 2015 Julien Enselme - 0.9.8-1 - Initial packaging.