Summary:	dock-independent helper scripts
Summary(ja): 	ドック用ヘルパースクリプト
Name:		dockmanager
Version:	0.1.0
Release: 	2%{?_dist_release}
Source0:	%{name}-%{version}.tar.gz
License:	GPLv3
Group:		System Environment/Libraries
URL:		https://launchpad.net/dockmanager

BuildRequires:	glib2 >= 2.18.0
BuildRequires:	libdesktop-agnostic-devel >= 0.3.9
BuildRequires:	libdesktop-agnostic-bin >= 0.3.9
BuildRequires:	dbus-glib-devel
Requires(pre):	GConf2
Requires(post):	GConf2
Requires(preun):GConf2
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

Packager:	kazutaka

%description
This package contains dock-independent helper scripts, which add functionality
to any dock implementing the DockManager DBus interface specification.

%description -l ja
このパッケージには、DockManager DBus インターフェーススペックに準拠した
ドックで利用できるヘルパースクリプトが含まれます。


%prep
%setup -q


%build
%configure --enable-shared \
           --disable-static \
           --disable-debug
%{__make} %{?_smp_mflags}


%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__make} install DESTDIR=$RPM_BUILD_ROOT

# remove unnecessary files
##find $RPM_BUILD_ROOT/%{_libdir} -name "*.la" -exec %{__rm} -f "{}" \;
##find $RPM_BUILD_ROOT/%{_libdir} -name "*.a" -exec %{__rm} -f "{}" \;
find $RPM_BUILD_ROOT/%{_prefix}/lib -name "*.la" -exec %{__rm} -f "{}" \;
find $RPM_BUILD_ROOT/%{_prefix}/lib -name "*.a" -exec %{__rm} -f "{}" \;


%clean
%{__rm} -rf $RPM_BUILD_ROOT


%pre
# uninstall old schemas before update
if [ "$1" -gt 1 ]; then
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
  gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/%{name}-daemon.schemas > /dev/null ||:
fi

%post
# install schemas after install/update
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
    %{_sysconfdir}/gconf/schemas/%{name}-daemon.schemas > /dev/null ||:

%preun
# uninstall schemas before clean remove
if [ "$1" -eq 0 ]; then
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
  gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/%{name}-daemon.schemas > /dev/null;
fi


%files
%defattr(-,root,root)
%doc AUTHORS COPYING
%{_sysconfdir}/gconf/schemas/%{name}-daemon.schemas
%{_bindir}/%{name}-settings
%{_libexecdir}/%{name}-daemon
%{python_sitelib}/%{name}
%{_datadir}/dbus-1/services/%{name}.service
%{_datadir}/%{name}


%changelog
* Wed Apr 13 2011 Shu KONNO <owa@bg.wakwak.com> 0.1.0-2
- fixed remove files path
- fixed changelog typo

* Sun Jan 23 2005 Kazutaka HARADA <kazutaka@vinelinux.org> 0.1.0-1
- initial build for Vine Linux

