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:    Clean your system and free disk space
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
With BleachBit, you can free cache, delete cookies, clear Internet
history, shred temporary files, delete logs, and discard junk you didn't
know was there. Designed for Linux and Windows systems, it wipes clean
thousands of applications including Firefox, Internet Explorer, Adobe
Flash, Google Chrome, Opera, Safari, and more. Beyond simply deleting
files, BleachBit includes advanced features such as shredding files to
prevent recovery, wiping free disk space to hide traces of files deleted
by other applications, and cleaning Web browser profiles to make them
run faster.

%prep
%setup -q

# Do not install in `/usr/local/`.
sed 's|/local||'  --in-place ./Makefile

# Fix appdata location.
sed 's|$(datadir)/appdata|$(datadir)/metainfo|g'  --in-place ./Makefile

# Disable update notifications, since package will be updated by DNF or Packagekit.
sed 's/online_update_notification_enabled = True/online_update_notification_enabled = False/g'  --in-place ./bleachbit/__init__.py

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

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

# Fix Makefile to explicitly use python2.
sed 's/python/python2/g'  --in-place ./Makefile

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

%install
%make_install



%find_lang %{name}

%check
#make --directory ./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