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

Name:       bleachbit
Summary:    Python utility to free disk space and improve privacy
URL:        https://www.bleachbit.org/
Version:    2.2
Release:    2%{?dist}
License:    GPLv3+
BuildArch:  noarch

Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz

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

Requires: gnome-python2
Requires: pygtk2

%description
BleachBit deletes unnecessary files to free valuable disk space,
maintain privacy, and remove junk. Rid your system of old clutter
including cache, cookies, Internet history, localizations, logs,
temporary files, and broken shortcuts. It wipes clean the cache and
history list of many common programs.

%prep
%setup -q

#do not install in /usr/local
sed -i 's/\/local//' Makefile

# fix appdata location
sed -i 's/$(datadir)\/appdata/$(datadir)\/metainfo/g' Makefile

# Disable update notifications
sed -i -e '\@online_update_notification_enabled@s/^.*$/online_update_notification_enabled = False/g' \
bleachbit/Common.py && egrep online_update_notification_enabled[[:space:]]=[[:space:]]False bleachbit/Common.py

# Drop deprecated line in desktop file.
sed -i '/Encoding/d' bleachbit.desktop

# Drop env shebangs as files in %%_datadir usually don't need this.
find bleachbit/ -type f -name '*.py' -exec sed -i '1{\@^#!/usr/bin/env python@d}' {} +

# fix makefile to explicitly use python2
sed -i 's/python/python2/g' Makefile

%build
make -C po local
%{__python2} setup.py build

%install
%make_install



%find_lang %{name}

%check
#make -C cleaners tests
#{__python2} tests/TestUnix.py

desktop-file-validate %{buildroot}%{_datadir}/applications/bleachbit.desktop
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml

%files -f %{name}.lang
%doc README*
%license COPYING
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/polkit-1/actions/org.bleachbit.policy
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}.png
%exclude %{_datadir}/%{name}/Windows.py*

%changelog
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Mar 23 2019 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 2.2-1
- Update to 2.2

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Mon Jul 16 2018 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 2.0-3
- Fix python issues in makefile

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

* Sat Mar 03 2018 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 2.0-1
- Update to 2.0
- Disable tests temporarily