Blob Blame History Raw
Name:           dexter
Version:        0.18
Release:        5%{?dist}
Summary:        Address Book that goes hand in hand with Postler
Group:          Applications/Internet
License:        GPLv3 and GPLv2
URL:            http://launchpad.net/dexter-rolodex
Source0:        http://launchpad.net/dexter-rolodex/0.x/%{version}/+download/%{name}_%{version}.tar.gz
# taken from the elementary icon theme (named office-address-book there), GPLv2
Source1:        dexter.svg
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  python-devel
BuildRequires:  python-distutils-extra
BuildRequires:  pygtk2 python-storm python-vobject pyxdg
BuildRequires:  dbus-python pygobject2 python-enchant
BuildRequires:  intltool
BuildRequires:  Xvfb xauth
BuildRequires:  desktop-file-utils
Requires:       pygtk2 python-storm python-vobject pyxdg
Requires:       dbus-python pygobject2 python-enchant


%description
Dexter is a very simple, easy to use address book, designed with the
home user in mind. This personal contact manager integrates with
Postler, and can import and export contacts in vCard format.


%prep
%setup -q -n dexter-rolodex

# apport is ubuntu-specific
rm -rf apport etc/apport

# remove shebangs and fix permissions
find . -type f -a \( -name '*.py' -o -name 'py.*' \) \
   -exec sed -e '1{/^#!/d}' -i {} \; \
   -exec chmod u=rw,go=r {} \;

# icon with generic name might not be available
find . -type f -a \( -name '*.ui' -o -name 'setup.py' \) \
   -exec sed -e 's,office-address-book,dexter,' -i {} \;

# remove ubuntu-specific properties
find . -type f -name '*.ui' \
   -exec sed -e 's,<property name="ubuntu_local">.*</property>,,' -i {} \;


%build
# work around https://bugs.launchpad.net/dexter-rolodex/+bug/801751
mkdir -p $(python -c 'import glib; print glib.get_user_data_dir()')
xvfb-run -a -w 1 %{__python} setup.py build


%install
rm -rf %{buildroot}
# --skip-build prevents message catalogs from being installed
xvfb-run -a -w 1 %{__python} setup.py install -O1  --root %{buildroot}

install -p -D %{SOURCE1} \
  %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/dexter.svg
desktop-file-validate %{buildroot}%{_datadir}/applications/dexter.desktop

%find_lang %{name}


%clean
rm -rf %{buildroot}


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


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


%posttrans
gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor &>/dev/null || :


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING
%{_bindir}/dexter
%{_bindir}/dexter-server
%{_datadir}/dexter
%{python_sitelib}/dexter*
%{_datadir}/dbus-1/services/org.elementary.dexterserver.service
%{_datadir}/applications/dexter.desktop
%{_datadir}/icons/hicolor/scalable/apps/dexter.svg


%changelog
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Fri Jun 24 2011 Thomas Moschny <thomas.moschny@gmx.de> - 0.18-4
- Fix FTBFS issues (bz 715964).
  - Add missing BR on pyxdg.
  - Ensure xdg user data dir is present at build time.

* Sat Apr  9 2011 Thomas Moschny <thomas.moschny@gmx.de> - 0.18-3
- Include the office-address-book icon from the elementary icon theme
  as dexter.svg.
- Remove Ubuntu-specific properties from .ui files.

* Mon Mar 28 2011 Thomas Moschny <thomas.moschny@gmx.de> - 0.18-2
- Update Summary tag.

* Fri Mar 18 2011 Thomas Moschny <thomas.moschny@gmx.de> - 0.18-1
- New package.