Summary:	Screensaver for MATE
Name:		mate-screensaver
Version:	1.1.0
Release:	2%{?_dist_release}
Source0:	%{name}-%{version}.tar.xz
Source1:	%{name}.pam
License:	GPLv2
Group:		User Interface/Desktops
URL:		https://matsusoft.com.ar/projects/mate/

BuildRequires:	mate-common
BuildRequires:	mate-doc-utils
BuildRequires:	mate-conf-devel
BuildRequires:	mate-desktop-devel
BuildRequires:	mate-menus-devel
BuildRequires:	libmatekbd-devel
BuildRequires:	libmatenotify-devel
BuildRequires:	gtk2-devel
BuildRequires:	dbus-glib-devel
BuildRequires:	libSM-devel
BuildRequires:	libXScrnSaver-devel
BuildRequires:	libXxf86misc-devel
BuildRequires:	gtk-doc
BuildRequires:	autoconf
BuildRequires:	automake

Requires(post,postun):	desktop-file-utils

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

Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	Takemikaduchi


%description
mate-screensaver is a screen saver and locker that aims to have
simple, sane, secure defaults and be well integrated with the desktop.
It is designed to support:

        * the ability to lock down configuration settings
        * translation into many languages
        * user switching


%package	devel
Summary:        Development tools for mate-screensaver
Summary(ja):    mate-screensaver の開発環境
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig
Requires:       mate-corba-devel

%description	devel
Header files and libraries for building a extension library for the
mate-screensaver.


%prep
%setup -q


%build
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; fi)
%configure \
	--libexecdir=%{_libexecdir}/mate \
	--disable-static \
	--disable-scrollkeeper

%{__make} %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}

export MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%{__make} install DESTDIR=${RPM_BUILD_ROOT}
unset MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d
install -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/mate-screensaver

find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} \;
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;

# conflict with gnome-screensaver
%{__rm} -rf ${RPM_BUILD_ROOT}%{_datadir}/backgrounds/cosmos

%find_lang %{name}


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post
/sbin/ldconfig

export MATECONF_CONFIG_SOURCE=`mateconftool-2 --get-default-source`

SCHEMAS=" \
  mate-screensaver.schemas"
for S in $SCHEMAS; do
  echo %{_sysconfdir}/mateconf/schemas/$S; done \
  | xargs mateconftool-2 --makefile-install-rule >& /dev/null ||:

update-desktop-database %{_datadir}/applications >& /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  /usr/bin/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:
fi

%pre
if [ "$1" -gt 1 ]; then
  export MATECONF_CONFIG_SOURCE=`mateconftool-2 --get-default-source`

  SCHEMAS=" \
    mate-screensaver.schemas"
  for S in $SCHEMAS; do
    echo %{_sysconfdir}/mateconf/schemas/$S; done \
    | xargs mateconftool-2 --makefile-uninstall-rule >& /dev/null ||:
fi

%preun
if [ "$1" -eq 0 ]; then
  export MATECONF_CONFIG_SOURCE=`mateconftool-2 --get-default-source`

  SCHEMAS=" \
    mate-screensaver.schemas"
  for S in $SCHEMAS; do
    echo %{_sysconfdir}/mateconf/schemas/$S; done \
    | xargs mateconftool-2 --makefile-uninstall-rule >& /dev/null ||:
fi

%postun
/sbin/ldconfig
update-desktop-database %{_datadir}/applications >& /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  /usr/bin/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:
fi


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING ChangeLog NEWS README
%{_sysconfdir}/mateconf/schemas/mate-screensaver.schemas
%{_sysconfdir}/pam.d/mate-screensaver
%{_sysconfdir}/xdg/autostart/mate-screensaver.desktop
%{_sysconfdir}/xdg/menus/mate-screensavers.menu
%{_bindir}/mate-screensaver
%{_bindir}/mate-screensaver-command
%{_bindir}/mate-screensaver-preferences
%{_libexecdir}/mate/mate-screensaver
%{_libexecdir}/mate/mate-screensaver-dialog
%{_libexecdir}/mate/mate-screensaver-gl-helper
%{_datadir}/applications/mate-screensaver-preferences.desktop
%{_datadir}/applications/screensavers/*.desktop
#%{_datadir}/backgrounds/cosmos
%{_datadir}/dbus-1/services/org.mate.ScreenSaver.service
%{_datadir}/desktop-directories/mate-screensaver.directory
%{_datadir}/mate-background-properties/cosmos.xml
%{_datadir}/%{name}
%{_datadir}/pixmaps/mate-logo-white.svg
%{_mandir}/man1/*.1.gz

%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/mate-screensaver.pc


%changelog
* Fri Dec 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.0-2
- change category

* Fri Dec 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.0-1
- initial build for Vine Linux

