python-rjsmin/python-rjsmin.spec

71 lines
1.5 KiB
RPMSpec
Raw Normal View History

2016-03-16 08:13:19 +00:00
%global pypi_name rjsmin
2022-08-10 13:27:19 +00:00
%global desc %{expand: \
The minifier is based on the semantics of jsmin.c by Douglas Crockford.
The module is a re-implementation aiming for speed, so it can be used at
runtime (rather than during a preprocessing step). Usually it produces the
same results as the original jsmin.c.}
2016-03-16 08:13:19 +00:00
Name: python-%{pypi_name}
2022-08-10 13:27:19 +00:00
Version: 1.2.1
Release: 8%{?dist}
2016-03-16 08:13:19 +00:00
Summary: Javascript Minifier
2022-08-10 13:27:19 +00:00
License: Apache-2.0
2016-03-16 08:13:19 +00:00
URL: http://opensource.perlig.de/rjsmin/
Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
2018-02-21 07:03:47 +00:00
BuildRequires: gcc
2022-08-10 13:27:19 +00:00
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx_rtd_theme
2018-02-21 07:03:47 +00:00
2022-08-10 13:27:19 +00:00
%description %{desc}
2016-03-16 08:13:19 +00:00
2022-08-10 13:27:19 +00:00
%package -n python3-%{pypi_name}
Summary: Javascript Minifier
2016-03-16 08:13:19 +00:00
%description -n python3-%{pypi_name}
2022-08-10 13:27:19 +00:00
%{desc}
2016-03-16 08:13:19 +00:00
%package docs
2022-08-10 13:27:19 +00:00
Summary: Javascript Minifier - docs
2020-09-08 13:49:14 +00:00
2016-03-16 08:13:19 +00:00
%description docs
2022-08-10 13:27:19 +00:00
%{desc}
2016-03-16 08:13:19 +00:00
%prep
%autosetup -n %{pypi_name}-%{version}
# strip bang path from rjsmin.py
sed -i '1d' rjsmin.py
2022-08-10 13:27:19 +00:00
%generate_buildrequires
%pyproject_buildrequires
2016-03-16 08:13:19 +00:00
%build
2022-08-10 13:27:19 +00:00
%pyproject_wheel
2016-03-16 08:13:19 +00:00
2022-08-10 13:27:19 +00:00
sphinx-build -b html docs/_userdoc docs/_userdoc/html
# Remove the sphinx-build leftovers.
rm -rf docs/_userdoc/html/.{doctrees,buildinfo}
2020-09-08 13:49:14 +00:00
2016-03-16 08:13:19 +00:00
%install
2022-08-10 13:27:19 +00:00
%pyproject_install
%pyproject_save_files %{pypi_name}
%check
%pytest -v
2016-03-16 08:13:19 +00:00
2022-08-10 13:27:19 +00:00
%files -n python3-%{pypi_name} -f %{pyproject_files}
2020-09-08 13:49:14 +00:00
%doc README.md
2016-03-16 08:13:19 +00:00
%{python3_sitearch}/_%{pypi_name}.cpython*
%files docs
2022-08-10 13:27:19 +00:00
%license LICENSE
2020-09-08 13:49:14 +00:00
%doc README.md docs/_userdoc/html
2016-03-16 08:13:19 +00:00
%changelog
2022-08-10 13:27:19 +00:00
%autochangelog