Summary:        Backup utility that use duplicity as the backend
Summary(ja):    バックエンドとして duplicity を使うバックアップユーティリティ
Name:           deja-dup
Version:        24.0
Release:	1%{?_dist_release}
Group:          Applications/Archiving
License:        GPLv3
URL:		https://launchpad.net/deja-dup
Source0:	%{name}-%{version}.tar.xz
#Patch0: escape_globs.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-root

#BuildRequires:	GConf2-devel
BuildRequires:	cairo-devel
BuildRequires:	desktop-file-utils
BuildRequires:	dbus-glib-devel
BuildRequires:	gettext >= 0.17
#BuildRequires:	gtk2-devel >= 2.18
BuildRequires:	gtk3-devel
BuildRequires:	glib2-devel >= 2.20
BuildRequires:	gnome-doc-utils >= 0.3.2
#BuildRequires:	gnome-keyring-devel
BuildRequires:	intltool >= 0.40
BuildRequires:	itstool
BuildRequires:	libgnome-keyring-devel
BuildRequires:	libnotify-devel
BuildRequires:	libpeas-devel
BuildRequires:	nautilus-devel
BuildRequires:	pango-devel
BuildRequires:	perl-XML-Parser
BuildRequires:	pkgconfig >= 0.90
BuildRequires:	vala-devel >= 0.9.2
BuildRequires:	unique-devel

Requires: duplicity yelp
#Requires(pre): GConf2
#Requires(post): GConf2
#Requires(preun): GConf2

%description
Déjà Dup is a simple backup program.
It hides the complexity of doing backups the 'right way'
(encrypted, off-site, and regular) and uses duplicity as the backend.

%description -l ja
Déjà Dup はシンプルなバックアッププログラムです。
バックアップ作業の複雑性を覆い隠して適切な方法（暗号化、オフサイト、通常）で
行い、バックエンドとして duplicity を使用します。

%prep
%setup -q
#%patch0 -p1

%build
%configure --disable-static --with-nautilus --with-gnu-ld

%{__make} %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
#export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
make DESTDIR=$RPM_BUILD_ROOT install
#unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

rm -f %{buildroot}/%{_libdir}/nautilus/extensions-3.0/*.la
rm -f %{buildroot}/%{_libdir}/%{name}/*.la
rm -f %{buildroot}/%{_libexecdir}/tools/*.la

desktop-file-install --vendor ""			\
	--dir %{buildroot}%{_datadir}/applications	\
	%{buildroot}%{_datadir}/applications/%{name}.desktop

desktop-file-install --vendor ""			\
	--dir %{buildroot}%{_datadir}/applications	\
	%{buildroot}%{_datadir}/applications/%{name}-preferences.desktop

desktop-file-validate %{buildroot}/%{_sysconfdir}/xdg/autostart/deja-dup-monitor.desktop

%find_lang %{name}

%clean
rm -rf ${RPM_BUILD_ROOT}

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :


%files -f %{name}.lang
%doc COPYING NEWS
%{_bindir}/deja-dup
%{_bindir}/deja-dup-preferences
%{_datadir}/applications/deja-dup-preferences.desktop
%{_mandir}/man1/deja-dup-preferences.1.gz
%{_mandir}/man1/deja-dup.1.gz
%{_mandir}/*/man1/deja-dup-preferences.1.gz
%{_mandir}/*/man1/deja-dup.1.gz
%{_datadir}/GConf/gsettings/deja-dup.convert
%{_datadir}/glib-2.0/schemas/org.gnome.DejaDup.gschema.xml
%{_sysconfdir}/xdg/autostart/deja-dup-monitor.desktop
%{_libdir}/%{name}/lib*.so
%{_libdir}/nautilus/extensions-3.0/libdeja-dup.so
%{_libexecdir}/deja-dup/deja-dup*
%{_libexecdir}/deja-dup/tools/
%{_datadir}/applications/deja-dup.desktop
%{_datadir}/deja-dup/ui/restore-missing.ui
%{_datadir}/icons/hicolor/*/apps/deja-dup.png
%{_datadir}/icons/hicolor/scalable/apps/deja-dup-symbolic.svg
%{_datadir}/icons/hicolor/scalable/devices/deja-dup-cloud.svg
%{_datadir}/help/*/deja-dup/

%changelog
* Fri Nov 30 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 24.0-1
- new upstream release
- added BuildRequires: libpeas-devel

* Tue May 01 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 22.1-1
- new upstream release
- changed source archive type to xz
- dropt BuildRequires: gnome-keyring-devel

* Sun Mar 18 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 20.2-1
- new upstream release
- added BuildRequires: itstool, libgnome-keyring-devel
- changed BuildRequires: gtk2-devel >= 2.18 to gtk3-devel
- dropt Gconf2 dependency
  - BuildRequires: GConf2-devel
  - Requires: GConf2
- fixed configure option
  - added --with-nautilus --with-gnu-ld
  - deleted --disable-schemas-install

* Sun Dec 5 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 16.1.1-1
- new upstream release

* Thu Oct 14 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 16.0-1
- new upstream release
- changed BuildRequires: vala-devel >= 0.9.2
- added deja-dup-preferences.desktop

* Tue Jun 9 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 14.2-1
- new upstream release

* Fri May 21 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 14.1-1
- initial build for VineSeed
