File ntfs-config.spec of Package ntfs-config

#
# spec file for package ntfs-config
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#

# norootforbuild


Name:           ntfs-config
Version:        1.0.1
Release:        153
Url:            http://flomertens.free.fr/ntfs-config/
License:        GPLv2+
Group:          System/Filesystems
Summary:        Enable and disable write support for NTFS partitions
Source:         %{name}-%{version}.tar.bz2
Source1:        ntfs-config-rpmlintrc
Patch0:         %{name}-%{version}-destdir.patch
Patch1:         %{name}-%{version}-desktop.patch
Patch2:         %{name}-%{version}-environ.patch
Patch3:         ntfs-config-1.0.1-pythonver.patch
BuildRequires:  fdupes hal-devel intltool perl-XML-Parser python-gtk update-desktop-files
Requires:       ntfs-3g
Requires:       python-gtk
Requires:       python-xml
Requires:       /usr/bin/readlink
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%py_requires

%description
Add write support for all your NTFS partitions and external USB and
Firewire drives which have NTFS partitions with this tool.

It will configure them to use the open source driver ntfs-3g that allow
full read/write capability, but it can also unmount them again and
remount them with the read-only kernel driver when checkbox for
selecting read-write support is unchecked.

%lang_package
%prep
%setup -q
%patch0
%patch1 -p1
%patch2
%patch3

%build
autoreconf -fiv
%configure
make pyexecdir=%{py_sitedir}

%install
make DESTDIR=$RPM_BUILD_ROOT pyexecdir=%{py_sitedir} install
# make the icon-checker happy, this one is a standard icon, no need to include it:
mkdir -p     $RPM_BUILD_ROOT/%_datadir/pixmaps/drive-harddisk.png
%suse_update_desktop_file -i %{name} System Settings Filesystem
# Should change pt_PT -> pt, I guess:
%find_lang %{name} %{?no_lang_C}
%fdupes $RPM_BUILD_ROOT

%if 0%{?suse_version} > 1130

%post
%desktop_database_post
%endif

%preun
symlink_created_by_ntfs_config="%_sysconfdir/hal/fdi/policy/20-ntfs-config-write-policy.fdi"
if [ -L "$symlink_created_by_ntfs_config" ]; then
	ntfs_3g_fdi=$(readlink "$symlink_created_by_ntfs_config")
	# If it point to our ntfs-config write-policy.fdi, clean it up:
	if [ "$ntfs_3g_fdi" = "%_datadir/ntfs-config/write-policy.fdi" ]; then
		rm "$symlink_created_by_ntfs_config"
	fi
fi

%if 0%{?suse_version} > 1130

%postun
%desktop_database_postun
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%doc %{_mandir}/man8/*
%{_bindir}/ntfs-config
%{_sbindir}/ntfs-config-root
%{_datadir}/applications/ntfs-config.desktop
%dir %{_datadir}/ntfs-config
%{_datadir}/ntfs-config/*
%dir %{py_sitedir}/NtfsConfig
%{py_sitedir}/NtfsConfig/*
%exclude %_datadir/pixmaps/drive-harddisk.png

%files lang -f %name.lang

%changelog
openSUSE Build Service is sponsored by