Blob Blame History Raw
%global srcname	Flask-Admin
%global pkgname flask-admin
%global sum Simple and extensible admin interface framework for Flask

Name:		python-%{pkgname}
Version:	1.5.0
Release:	3%{?dist}
Summary:	%{sum}
License:	BSD
URL:		https://github.com/flask-admin/flask-admin/
Source0:	https://github.com/flask-admin/flask-admin/archive/v%{version}.tar.gz

BuildArch:	noarch
BuildRequires:	python2-devel python2-setuptools python3-devel python3-setuptools

%global _description\
Flask-Admin is advanced, extensible and simple to use administrative interface\
building extension for Flask framework.\
\
It comes with batteries included: model scaffolding for SQLAlchemy,\
MongoEngine, MongoDB and Peewee ORMs, simple file management interface\
and a lot of usage samples.\
\
You're not limited by the default functionality - instead of providing simple\
scaffolding for the ORM models, Flask-Admin provides tools that can be used to\
construct administrative interfaces of any complexity, using a consistent look\
and feel.\


%description %_description

%package -n python2-%{pkgname}
Summary: %summary
Requires:	python2-flask
Requires:   python2-wtforms
%{?python_provide:%python_provide python2-%{pkgname}}

%description -n python2-%{pkgname} %_description

%package -n python3-%{pkgname}
Summary:	%{sum}
Requires:	python3-flask
Requires:   python3-wtforms
%{?python_provide:%python_provide python3-%{pkgname}}

%description -n python3-%{pkgname} %_description


%prep
%autosetup -n %{pkgname}-%{version}
for f in \
	flask_admin/contrib/pymongo/typefmt.py \
	flask_admin/tests/mock.py \
    flask_admin/tests/fileadmin/files/dummy.txt \
; do
	echo "#Empty file" > $f
done

rm -rf examples
rm flask_admin/translations/README.md


%build
%py2_build
%py3_build


%install
%py2_install
%py3_install
(cd %{buildroot} && find .%{python2_sitelib} -name 'admin.mo') | %{__sed} -e \
  's|^.||' | %{__sed} -e \
  's:\(.*/translations/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
   >> admin.lang
(cd %{buildroot} && find .%{python3_sitelib} -name 'admin.mo') | %{__sed} -e \
  's|^.||' | %{__sed} -e \
  's:\(.*/translations/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
   >> admin3.lang


%check
# Tests are not included as they require mongod running


%files -n python2-%{pkgname} -f admin.lang
%defattr(644, -, -, 755)
%license LICENSE
%doc README.rst
%dir %{python2_sitelib}/flask_admin
%{python2_sitelib}/flask_admin/translations
%{python2_sitelib}/flask_admin/static
%{python2_sitelib}/flask_admin/*.py*
%{python2_sitelib}/flask_admin/tests/
%{python2_sitelib}/flask_admin/contrib/
%{python2_sitelib}/flask_admin/model/
%{python2_sitelib}/flask_admin/templates/
%{python2_sitelib}/flask_admin/form/
%{python2_sitelib}/*.egg-info/

%files -n python3-%{pkgname} -f admin3.lang
%defattr(644, -, -, 755)
%doc README.rst
%license LICENSE
%dir %{python3_sitelib}/flask_admin
%{python3_sitelib}/flask_admin/translations
%{python3_sitelib}/flask_admin/static
%{python3_sitelib}/flask_admin/*.py*
%{python3_sitelib}/flask_admin/__pycache__/
%{python3_sitelib}/flask_admin/tests/
%{python3_sitelib}/flask_admin/contrib/
%{python3_sitelib}/flask_admin/model/
%{python3_sitelib}/flask_admin/templates/
%{python3_sitelib}/flask_admin/form/
%{python3_sitelib}/*.egg-info/

%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jan 03 2018 Lumír Balhar <lbalhar@redhat.com> - 1.5.0-2
- Fix directory ownership in python3 subpackage

* Mon Dec 18 2017 Jan Beran <jberan@redhat.com> - 1.5.0-1
- New version 1.5.0
- Fix of the single package dependence on both Python 2 and Python 3

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4.2-5
- Python 2 binary package renamed to python2-flask-admin
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Dec 22 2016 Miro Hrončok <mhroncok@redhat.com> - 1.4.2-2
- Rebuild for Python 3.6

* Sat Oct 08 2016 Patrick Uiterwijk <puiterwijk@redhat.com> - 1.4.2-1
- Unretired and upgrade to new upstream release

* Fri Feb 12 2016 Sebastian Dyroff <sdyroff@fedoraproject.org> - 1.2.0-2
- add python3 package

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Aug 09 2015 Matej Stuchlik <mstuchli@redhat.com> - 1.2.0-1
- Update to 1.2.0

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Apr 29 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.0.8-1
- Updated to 1.0.8
- Removed unnecessary requires

* Wed Jan 08 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.0.7-1
- Updated to 1.0.7

* Tue Aug 13 2013 Matej Stuchlik <mstuchli@redhat.com> - 1.0.6-1
- Updated to 1.0.6

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed May 08 2013 Matej Stuchlik <mstuchli@redhat.com> - 1.0.5-3
- Requires fixes

* Wed Apr 24 2013 Matej Stuchlik <mstuchli@redhat.com> - 1.0.5-2
- Review fixes

* Tue Mar 19 2013 mstuchli <mstuchli@redhat.com> - 1.0.5-1
- Initial spec