Blob Blame Raw
Name:           mu
Version:        1.0.2
Release:        1%{?dist}
Summary:        A simple Python editor not only for micro:bit
License:        GPLv3
URL:            https://github.com/mu-editor/mu
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

# Qt 5.12 tests fix
Patch0:         %{url}/commit/d38470adc623f887.patch

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3dist(appdirs)
BuildRequires:  python3dist(microfs) >= 1.3
BuildRequires:  python3dist(nudatus)
BuildRequires:  python3dist(pycodestyle)
BuildRequires:  python3dist(pyflakes)
BuildRequires:  python3dist(pyqtchart)
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(qtconsole)
BuildRequires:  python3dist(semver)
BuildRequires:  python3dist(setuptools)
BuildRequires:  python3dist(uflash)
# no dist provide for this:
BuildRequires:  python3-qt5
BuildRequires:  python3-qscintilla-qt5

BuildRequires:  systemd

BuildRequires:  qt5-qtserialport >= 5.5.0

BuildRequires:  %{_bindir}/desktop-file-install
BuildRequires:  %{_bindir}/xvfb-run

%?python_enable_dependency_generator

# unbundled
Requires:       python3dist(microfs) >= 1.3
Requires:       python3dist(nudatus)
Requires:       python3dist(uflash)
# no dist provide for this:
Requires:       python3-qt5 >= 5.11
Requires:       python3-qscintilla-qt5 >= 2.10.7

Requires:       hicolor-icon-theme

%description
mu is a simple Python editor also for BBC micro:bit devices.

%prep
%autosetup -p1

# make the versions not pinned for the entry_point to work
# also pyqt and qscintilla are not properly provided in Fedora :(
# upstream removes some reqs on arm, we don't
sed -i -e 's/pycodestyle==2.4.0/pycodestyle >= 2.4, < 2.6/' \
       -e 's/pyflakes==2.0.0/pyflakes >= 2.0, < 2.2/' \
       -e 's/pyserial==3.4/pyserial >= 3.0, < 3.5/' \
       -e 's/qtconsole==4.3.1/qtconsole >= 4.3, < 4.4/' \
       -e 's/matplotlib==2.2.2/matplotlib >= 2.2, < 3.1/' \
       -e 's/pgzero==1.2/pgzero >= 1.2, < 1.3/' \
       -e 's/PyQtChart==5.11.3/PyQtChart >= 5.11, < 5.12/' \
       -e "s/'pyqt5==5.11.3', 'qscintilla==2.10.8',//" \
       -e "s/machine.lower().startswith('arm')/False/" \
       setup.py

# unbundle things
sed -i 's/from mu.contrib import /import /' mu/modes/microbit.py tests/modes/test_microbit.py
rm -rf mu/contrib
sed -i "s@ 'mu.contrib',@@" setup.py
sed -i "s@mu.contrib.@@" tests/modes/test_microbit.py


%build
%py3_build


%install
%py3_install

mkdir -p %{buildroot}%{_datadir}/applications \
         %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/ \
         %{buildroot}%{_udevrulesdir} \
         %{buildroot}%{_metainfodir}

desktop-file-install --dir=%{buildroot}%{_datadir}/applications conf/mu.codewith.editor.desktop
cp -p conf/mu.codewith.editor.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
cp -p conf/90-usb-microbit.rules %{buildroot}%{_udevrulesdir}/
cp -p conf/mu.appdata.xml %{buildroot}%{_metainfodir}/


%check
xvfb-run %{__python3} -m pytest -vv tests


%files
%doc README.rst LICENSE
%{_bindir}/mu-editor
%{python3_sitelib}/mu*/
%{_udevrulesdir}/90-usb-microbit.rules
%{_datadir}/icons/hicolor/256x256/apps/mu.codewith.editor.png
%{_datadir}/applications/mu.codewith.editor.desktop
%{_metainfodir}/mu.appdata.xml


%changelog
* Sun Mar 24 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.2-1
- Update to 1.0.2
- Loosen some strict dependency declarations
- Fix test failure

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Nov 30 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-3
- Mu works with matplotlib 3.0

* Thu Sep 13 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-2
- Fix requires to allow startup
- Fix the desktop file

* Tue Aug 14 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-1
- Update to 1.0.0 (#1387943)
- Move udev rules to /usr/lib/udev/rules.d (#1602361)

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.13-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.13-3
- Rebuilt for Python 3.7

* Sun May 27 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.13-2
- Add missing requires (pyflakes, pep8) (#1582237)

* Tue Apr 10 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.13-1
- Updated to 0.9.13
- Unbundle things
- Run tests

* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.2-3
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Apr 13 2016 Kushal Das <kushal@fedoraprojects.org> - 0.2-1
- Updates to 0.2 release

* Fri Feb 26 2016 Kushal Das <kushal@fedoraprojects.org> - 0.1-2
- Updates the desktop file creation

* Tue Feb 02 2016 Kushal Das <kushal@fedoraprojects.org> - 0.1-1
- Initial package creation