c9c5bb3
Name:       bleachbit
c9c5bb3
Summary:    Remove sensitive data and free up disk space
c9c5bb3
URL:        https://www.bleachbit.org/
c9c5bb3
Version:    4.0.0
c9c5bb3
Release:    1%{?dist}
c9c5bb3
License:    GPLv3+ and MIT
c9c5bb3
BuildArch:  noarch
c9c5bb3
c9c5bb3
Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
c9c5bb3
c9c5bb3
BuildRequires: desktop-file-utils
c9c5bb3
BuildRequires: gettext
c9c5bb3
BuildRequires: libappstream-glib
c9c5bb3
BuildRequires: make
c9c5bb3
BuildRequires: python3-devel
c9c5bb3
BuildRequires: python3-setuptools
c9c5bb3
%if 0%{?rhel}  &&  0%{?rhel} < 8
c9c5bb3
BuildRequires: python3-rpm-macros
c9c5bb3
%endif
c9c5bb3
c9c5bb3
Requires: python(abi) >= 3.0
c9c5bb3
Requires: gtk3
c9c5bb3
Requires: usermode
c9c5bb3
Requires: python3-chardet
c9c5bb3
Requires: python3-gobject
c9c5bb3
c9c5bb3
%description
c9c5bb3
Delete traces of your computer activity and other junk files to free
c9c5bb3
disk space and maintain privacy.
c9c5bb3
c9c5bb3
With BleachBit, you can free cache, delete cookies, clear Internet
c9c5bb3
history, shred temporary files, delete logs, and discard junk you didn't
c9c5bb3
know was there. Designed for Linux and Windows systems, it wipes clean
c9c5bb3
thousands of applications including Firefox, Internet Explorer, Adobe
c9c5bb3
Flash, Google Chrome, Opera, Safari, and many more. Beyond simply
c9c5bb3
deleting files, BleachBit includes advanced features such as shredding
c9c5bb3
files to prevent recovery, wiping free disk space to hide traces of
c9c5bb3
files deleted by other applications, and cleaning Web browser profiles
c9c5bb3
to make them run faster.
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
%prep
c9c5bb3
%setup -q
c9c5bb3
4ed5f1e
# Upstream also creates this extra .desktop file, for running BleachBit as root, by copying the basic version instead of tracking a separate file in git.
4ed5f1e
cp -p  ./org.bleachbit.BleachBit.desktop  ./org.bleachbit.BleachBit-root.desktop
4ed5f1e
sed --regexp-extended 's/^Name=BleachBit$/Name=BleachBit as Administrator/g'  --in-place ./org.bleachbit.BleachBit-root.desktop
4ed5f1e
sed --regexp-extended 's/^(.*Exec)=bleachbit$/\1=bleachbit-root/g'            --in-place ./org.bleachbit.BleachBit-root.desktop
4ed5f1e
4ed5f1e
cat > ./bleachbit.pam <
575e3e9
#%%PAM-1.0
4ed5f1e
auth       include    config-util
4ed5f1e
account    include    config-util
4ed5f1e
session    include    config-util
4ed5f1e
EOF
4ed5f1e
4ed5f1e
cat > ./bleachbit.console <
4ed5f1e
USER=root
4ed5f1e
PROGRAM=%{_bindir}/bleachbit
4ed5f1e
SESSION=true
4ed5f1e
EOF
4ed5f1e
c9c5bb3
# Disable update notifications, since package will be updated by DNF or Packagekit.
c9c5bb3
sed 's/online_update_notification_enabled = True/online_update_notification_enabled = False/g'  --in-place ./bleachbit/__init__.py
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
%build
c9c5bb3
%py3_build
c9c5bb3
%make_build --directory ./po/
c9c5bb3
c9c5bb3
# Remove Windows-specific functionality.
c9c5bb3
make delete_windows_files
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
%install
c9c5bb3
%make_install  PYTHON=%{__python3}  DESTDIR=%{buildroot}  prefix=%{_prefix}  INSTALL="%{_bindir}/install -Dp"
cb9cacc
%make_install --directory ./po/  PYTHON=%{__python3}  DESTDIR=%{buildroot}  prefix=%{_prefix}  INSTALL="%{_bindir}/install -Dp"
c9c5bb3
cb9cacc
mkdir -p %{buildroot}/%{_sysconfdir}/security/console.apps
4ed5f1e
install -Dp  ./bleachbit.pam      %{buildroot}/%{_sysconfdir}/pam.d/bleachbit-root
4ed5f1e
install -Dp  ./bleachbit.console  %{buildroot}/%{_sysconfdir}/security/console.apps/bleachbit-root
4ed5f1e
mkdir -p %{buildroot}/%{_sbindir}
4ed5f1e
ln --symbolic  %{_bindir}/consolehelper  %{buildroot}/%{_bindir}/bleachbit-root
4ed5f1e
ln --symbolic  %{_bindir}/bleachbit      %{buildroot}/%{_sbindir}/bleachbit-root
4ed5f1e
4ed5f1e
desktop-file-install --dir=%{buildroot}/%{_datadir}/applications/  org.bleachbit.BleachBit*.desktop
c9c5bb3
install -Dp  org.bleachbit.BleachBit.metainfo.xml  %{buildroot}/%{_metainfodir}/
c9c5bb3
c9c5bb3
%find_lang %{name}
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
%check
4ed5f1e
desktop-file-validate %{buildroot}/%{_datadir}/applications/org.bleachbit.BleachBit*.desktop
c9c5bb3
appstream-util validate-relax --nonet %{buildroot}/%{_metainfodir}/org.bleachbit.BleachBit.metainfo.xml
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
%posttrans
c9c5bb3
update-desktop-database
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
%files -f %{name}.lang
c9c5bb3
%doc  README*  CONTRIBUTING.md
c9c5bb3
%license COPYING
c9c5bb3
%{_bindir}/bleachbit*
4ed5f1e
%{_sbindir}/bleachbit*
c9c5bb3
%{_datadir}/bleachbit/
4ed5f1e
%{_datadir}/applications/org.bleachbit.BleachBit*.desktop
4ed5f1e
%{_metainfodir}/org.bleachbit.BleachBit.metainfo.xml
c9c5bb3
%{_datadir}/pixmaps/bleachbit.png
4ed5f1e
%{_datadir}/polkit-1/actions/org.bleachbit.policy
4ed5f1e
%config(noreplace) %{_sysconfdir}/pam.d/bleachbit-root
4ed5f1e
%config(noreplace) %{_sysconfdir}/security/console.apps/bleachbit-root
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
c9c5bb3
%changelog
376b2b2
* Wed Apr 22 2020 Andrew Toskin <andrew@tosk.in> - 4.0.0-1
c9c5bb3
- Prepare to unretire package after upstream ported to GTK3 and Python3.