File bleachbit.spec of Package bleachbit

#
# spec file for package bleachbit
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 8/2011 by open-slx GmbH <Sascha.Manns@open-slx.de>
# Copyright (c) 2010 - 7/2011 by Sascha Manns <saigkill@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           bleachbit
Version:        0.9.0
Release:        1
License:        GPL v3 only
Summary:        Remove unnecessary files, free space, and maintain privacy
BuildRequires:  fdupes
BuildRequires:  make
BuildRequires:  python-devel
%if 0%{?suse_version} >= 1110
BuildRequires:  update-desktop-files
%endif
%if 0%{?fedora} == 11
BuildRequires:  python
BuildRequires:  python-devel
%endif
Url:            http://bleachbit.sourceforge.net/download_source.php
Group:          Productivity/File utilities
Source0:        %{name}-%{version}.tar.bz2
Source1:        %{name}.desktop
# Bugreport #712471 - should fixed in 0.9.0
# Patch0:         %{name}-bnc712471.patch
Requires:       python-gnome
Requires:       python-gtk >= 2.6
Requires:       xdg-utils
Obsoletes:      %{name} < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%if 0%{?suse_version} >= 1110
%py_requires
%lang_package
%endif

%description
BleachBit deletes unnecessary files to free valuable disk space and
maintain privacy. Rid your system of old junk including broken
menu entries, cache, cookies, localizations, and temporary files.
Designed for Linux  systems, it wipes clean Bash, Beagle, Epiphany,
Firefox, Flash, GNOME, Java, KDE, OpenOffice.org, Opera, RealPlayer,
VIM, XChat, and more.

%prep
%setup -q
#%%patch0 -p0
%__sed -i -e 's|%{_bindir}/env python|%{_bindir}/python|g' \
        bleachbit/GUI.py

%build
%__make clean
%__make -C po local
%{__python} setup.py build

%install
%__make DESTDIR=%{buildroot} install \
        prefix=%{_prefix}

# create root desktop-file and change exec
%__cp %{name}.desktop %{name}-root.desktop
%__sed -i -e 's/Name=BleachBit$/Name=BleachBit as Administrator/g' \
        %{name}-root.desktop
%__sed -i -e 's/^Exec=bleachbit$/Exec=xdg-su -c bleachbit/g' \
        %{name}-root.desktop
# installing .desktop Files
%suse_update_desktop_file -n    %{name}      Utility Filesystem
%suse_update_desktop_file -n -i %{name}-root Utility Filesystem

%find_lang %{name}
%fdupes -s %{buildroot}

#%%__rm %{buildroot}%%{_datadir}/%%{name}/*.py[co]

# Hack to fix non-executable-script
%{__chmod} +x %{buildroot}%{_datadir}/%{name}/CLI.py
%{__chmod} +x %{buildroot}%{_datadir}/%{name}/GUI.py

%clean
%__rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}-root.desktop
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}.png
%doc COPYING README

%files lang -f %{name}.lang
%defattr(-,root,root,-)

%changelog
openSUSE Build Service is sponsored by