%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%global	python_module_name gcdemu

Summary: A GNOME panel applet to control CDEmu daemon
Summary(ja): CDEmu daemon を制御するための GNOME パネルアプレット
Name: gcdemu
Version: 3.1.0
Release: 1%{?_dist_release}
License: GPLv2+
Group: Applications/Accessories
URL: http://cdemu.sourceforge.net
Source: http://downloads.sourceforge.net/cdemu/%{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch

BuildRequires: cmake >= 2.8.5
BuildRequires: dbus-python-devel
BuildRequires: gettext >= 0.15
BuildRequires: glib2-devel
BuildRequires: intltool >= 0.21
BuildRequires: desktop-file-utils

Requires: cdemu-daemon
Requires: desktop-file-utils

%description
This is gCDEmu, a GNOME applet for controlling CDEmu daemon. It is part of the 
userspace-cdemu suite, a free, GPL CD/DVD-ROM device emulator for linux.

It provides a graphic interface that allows performing the key tasks related to
controlling the CDEmu daemon, such as loading and unloading devices, displaying 
devices' status and retrieving/setting devices' debug masks.

In addition, applet listens to the signals emitted by CDEmu daemon and provides
the notification via libnotify's notifications (provided that python bindings
are installed).

%prep
%setup -q

%build
%{cmake} \
  -DPOST_INSTALL_HOOKS=OFF \
  .
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__make} install DESTDIR=$RPM_BUILD_ROOT
%find_lang gcdemu --with-gnome

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%pre
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :

%post
if [ -x %{_bindir}/update-desktop-database ] ; then
%{_bindir}/update-desktop-database %{_datadir}/applications
fi
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :

%preun
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :

%postun
if [ -x %{_bindir}/update-desktop-database ] ; then
%{_bindir}/update-desktop-database %{_datadir}/applications
fi

%files -f gcdemu.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/%{name}
%{_datadir}/applications/*
%{_datadir}/glib-2.0/schemas/net.sf.cdemu.gcdemu.gschema.xml
%{_datadir}/pixmaps/*

%changelog
* Tue Jan 23 2018 IWAI, Masaharu <iwaim.sub@gmail.com> - 3.1.0-1
- update to 3.1.0

* Sat Feb 25 2017 IWAI, Masaharu <iwaim.sub@gmail.com> - 3.0.2-1
- update to 3.0.2

* Sun May 06 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.5.0-1
- new upstream release
- changed atchive type gzip to bzip2
- deleted unrecognized option: --disable-schemas-install

* Sat Dec 24 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.4.0-1
- new upstream release
- fixed configure option
  - deleted --disable-scrollkeeper

* Fri Nov 19 2010 IWAI, Masaharu <iwai@alib.jp> - 1.3.0-2
- add BuildRequires: gnome-doc-utils >= 0.3.2

* Fri Sep 3 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.3.0-1
- new upstream release

* Sun Feb 7 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.2.0-2
- rebuilt with python-2.6.4
- update BuildRequires
- update post and postun scripts

* Fri Sep 25 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.2.0-1
- initial build for VineSeed

* Sat Jun 28 2008 Rok Mandeljc <rok.mandeljc@email.si> - 1.1.0-1
- Updated to 1.1.0

* Thu Dec 20 2007 Rok Mandeljc <rok.mandeljc@email.si> - 1.0.0-1
- Initial RPM release.
