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.4.2
Release:	1%{?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 python-setuptools python3-devel python3-setuptools
Requires:	python-flask
Requires:   python-wtforms

%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.


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

%description -n python3-%{pkgname}
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.




%prep
%setup -q -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 Flask_Admin.egg-info
rm -rf examples
rm -rf flask_admin/tests/.coverage
rm -rf flask_admin/tests/test_form.pyc
rm flask_admin/translations/README.md

%build
%py2_build
%py3_build

#Tests passed on my machine but are not included as they require mongod running

%install
%{__python2} setup.py install --skip-build --root %{buildroot}
%{__python3} setup.py install --skip-build --root %{buildroot}
(cd %{buildroot} && find . -name 'admin.mo')| %{__grep} -v python3.4 | %{__sed} -e 's|^.||' | %{__sed} -e 's:\(.*/translations/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' >> admin.lang
(cd %{buildroot} && find . -name 'admin.mo') | %{__grep} -v python2.7 |  %{__sed} -e 's|^.||' | %{__sed} -e 's:\(.*/translations/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' >> admin3.lang

%files -f admin.lang
%defattr(644, -, -, 755)
%license LICENSE
%doc README.rst
%dir %{python_sitelib}/flask_admin
%{python_sitelib}/flask_admin/translations
%{python_sitelib}/flask_admin/static
%{python_sitelib}/flask_admin/*.py*
%{python_sitelib}/flask_admin/tests/
%{python_sitelib}/flask_admin/contrib/
%{python_sitelib}/flask_admin/model/
%{python_sitelib}/flask_admin/templates/
%{python_sitelib}/flask_admin/form/
%{python_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__/*.py*
%{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
* 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