File python-webassets.spec of Package python-webassets

#
# spec file for package python-webassets
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           python-webassets
Version:        0.12.1
Release:        0
# rjsmin=Apache-2.0
# jspacker=LGPL-2.1
# cssrewrite=BSD-3-Clause
# six.py=MIT
Summary:        Media asset management for Python, with glue code for various web frameworks
License:        BSD-2-Clause and Apache-2.0 and LGPL-2.1 and BSD-3-Clause and MIT
Group:          Development/Languages/Python
Url:            http://github.com/miracle2k/webassets/
Source:         https://pypi.python.org/packages/source/w/webassets/webassets-%{version}.tar.gz
Source1:        webassets.1
BuildRequires:  help2man
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} <= 1110
BuildRequires:  python-argparse
Requires:       python-argparse
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
Merges, minifies and compresses Javascript and CSS files, supporting a variety of different filters, including YUI, jsmin, jspacker or CSS tidy. Also supports URL rewriting in CSS files.

%prep
%setup -q -n webassets-%{version}

%build
python setup.py build
python setup.py install --root=$(pwd)/h2m --prefix=/usr
%if 0%{?suse_version} >= 1230
(PYTHONPATH=$(pwd)/h2m/%{python_sitelib}/ help2man -o webassets.1 --name=webassets --version-string=0.10.1 -N h2m/usr/bin/webassets)
rm -rf h2m
sed -i 's/PYTHON/WEBASSETS/g;s/python -m//g;s/python/webassets/g;s/__main__.py/webassets/g' webassets.1
%else
# don't bother too old help2man....
sed -e 's/VERSION_STRING/%version/g' %{S:1}  > webassets.1
%endif

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -Dm0644 webassets.1 %{buildroot}%{_mandir}/man1/webassets.1

%files
%defattr(-,root,root,-)
%_bindir/webassets
%{python_sitelib}/*
%{_mandir}/man1/webassets.1*

%changelog
openSUSE Build Service is sponsored by