Blob Blame History Raw
# This package depends on automagic byte compilation
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2
%global _python_bytecompile_extra 1

# bytecompile with Python 2
%global __python %{__python2}

Name:		blueberry
Version:	1.2.3
Release:	1%{?dist}
Summary:	Bluetooth configuration tool

License:	GPLv3+
URL:		https://github.com/linuxmint/%{name}
Source0:	%{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildArch:	noarch

BuildRequires:	desktop-file-utils
BuildRequires:	gettext
BuildRequires:	python2-devel

Requires:	bluez-obexd
Requires:	bluez-tools
Requires:	filesystem
Requires:	gnome-bluetooth
Requires:	hicolor-icon-theme
Requires:	rfkill
Requires:	wmctrl

%if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7)
Requires:	dbus-python
Requires:	pygobject3
Requires:	python-setproctitle
%else
Requires:	python2-dbus
Requires:	python2-gobject
Requires:	python2-setproctitle
%endif

%description
%{summary} depending on gnome-bluetooth.


%package -n cinnamon-applet-%{name}
Summary:	Cinnamon applet for %{name}

Requires:	%{name}			== %{version}-%{release}
Requires:	cinnamon

%description -n cinnamon-applet-%{name}
Cinnamon applet for %{name}.


%prep
%autosetup -p 1

# Fix shebangs to system Python2.x
for file in .%{_bindir}/* $(%{_bindir}/find .%{_prefix} -name '*.py' -type f)
do
	%{__sed} -i.orig						\
	-e 's~#![ \t]*%{_bindir}/python$~#!%{__python2}~'\
	-e 's~#![ \t]*%{_bindir}/env[ \t]*python[2]*$~#!%{__python2}~'	\
	 ${file}
	/bin/touch -r ${file}.orig ${file}
	%{__rm} -f ${file}.orig
done

for f in $(%{__grep} -Rl '#!.*python3') ; do
  %{__sed} -e 's~#!.*python3~#!/usr/bin/python2~g' < ${f} > ${f}.new
  /bin/touch -r ${f}.new ${f}
  mode="$(%{_bindir}/stat -c '%a' ${f})"
  %{__mv} -f ${f}.new ${f}
  %{__chmod} -c ${mode} ${f}
done


%build
%make_build


%install
%{__mkdir} -p %{buildroot}
%{__cp} -a .%{_prefix} .%{_sysconfdir} %{buildroot}
%{__grep} -RZl '#!%{__python2}' %{buildroot}%{_prefix}/lib/%{name}/* |	\
	%{_bindir}/xargs -0 %{__chmod} -c 0755
for file in $(%{_bindir}/find %{buildroot} -name '*.desktop' -type f)
do
	%{_bindir}/desktop-file-validate ${file}
done
%find_lang %{name}


%if (0%{?rhel} && 0%{?rhel} >= 7)
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :


%postun
if [ $1 -eq 0 ] ; then
	/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
	%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor	\
		&>/dev/null || :
	%{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas	\
		&> /dev/null || :
fi


%posttrans
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor		\
	&>/dev/null || :
%{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas		\
	&> /dev/null || :
%endif # (0%%{?rhel} && 0%%{?rhel} >= 7)


%files -f %{name}.lang
%license debian/copyright COPYING
%doc debian/changelog
# Desktop-file for xdg/autostart.
%config %{_sysconfdir}/xdg/autostart/*%{name}*.desktop
%{_bindir}/%{name}*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/glib-2.0/schemas/org.%{name}.gschema.xml
%{_datadir}/icons/hicolor/*/status/%{name}*.png
%{_datadir}/icons/hicolor/*/status/%{name}*.svg
%{_prefix}/lib/%{name}


%files -n cinnamon-applet-%{name}
%{_datadir}/cinnamon/applets/%{name}*


%changelog
* Wed Aug 15 2018 Leigh Scott <leigh123linux@googlemail.com> - 1.2.3-1
- New upstream release

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Leigh Scott <leigh123linux@googlemail.com> - 1.2.2-1
- New upstream release

* Tue May 22 2018 Leigh Scott <leigh123linux@googlemail.com> - 1.2.1-1
- New upstream release

* Thu Feb 15 2018 Leigh Scott <leigh123linux@googlemail.com> - 1.1.20-6
- Do it better

* Thu Feb 15 2018 Leigh Scott <leigh123linux@googlemail.com> - 1.1.20-5
- Add some upstream fixes
- Remove the python3 dep

* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.1.20-4
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.20-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sun Jan 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.1.20-2
- Remove obsolete scriptlets

* Mon Dec 18 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.1.20-1
- New upstream release

* Sun Dec 10 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.1.19-1
- New upstream release

* Tue Nov 14 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.1.18-1
- New upstream release
  Add upstream fix for double icons (rhbz#1478751)

* Mon Nov 06 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.17-1
- New upstream release (rhbz#1509725)

* Fri Oct 27 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.1.16-1
- New upstream release

* Tue Oct 24 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.1.15-6
- Patch for util-linux rfkill change in f28

* Thu Aug 31 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.15-5
- Preserve mode of files when changing hashbang

* Thu Aug 31 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.15-4
- Fix regex for EPEL

* Thu Aug 31 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.15-3
- Use Python2 on EPEL <= 7

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

* Wed Jun 28 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.15-1
- New upstream release (rhbz#1465880)

* Mon Jun 12 2017 Leigh Scott <leigh123linux@googlemail.com> - 1.1.13-1
- New upstream release

* Wed May 24 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.12-1
- New upstream release (rhbz#1454974)

* Sat May 06 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.11-1
- New upstream release

* Sun Feb 19 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.10-3
- Add requires for bluez-tools

* Sun Feb 19 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.10-2
- Fix dependencies
- Update patches from upstream

* Sun Feb 19 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.10-1
- New upstream release
- Add sub-pkg for new Cinnamon applet

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

* Fri Jan 06 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.9-2
- Fix %%files for el <= 7

* Thu Jan 05 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.9-1
- Initial rpm-release (rhbz#1409404)

* Sun Jan 01 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.9-0.3
- Added scriptlets for Fedora <= 23 and RHEL <= 7

* Sun Jan 01 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.9-0.2
- Updated Patch0

* Sun Jan 01 2017 Björn Esser <besser82@fedoraproject.org> - 1.1.9-0.1
- Initial package (rhbz#1409404)