File ConsoleKit-doc.spec of Package ConsoleKit

#
# spec file for package ConsoleKit-doc (Version 0.2.10)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           ConsoleKit-doc
%define         build_doc 1
%define pkg_name ConsoleKit
# WARNING: If you are editing ConsoleKit-doc.spec, STOP. Always edit
# ConsoleKit.spec and then run pre-checkin.sh which will create
# ConsoleKit-doc.spec based upon ConsoleKit.spec.
Url:            http://consolekit.freedesktop.org
BuildRequires:  PolicyKit-devel dbus-1-glib-devel gcc intltool pam-devel pkgconfig xorg-x11-libX11-devel zlib-devel
%if %build_doc
BuildRequires:  gtk2-devel xmlto
Provides:       ConsoleKit:/usr/share/doc/packages/ConsoleKit/spec/ConcoleKit.html
%endif
Summary:        System daemon for tracking users, sessions and seats
Version:        0.2.10
Release:        60.<RELEASE27>
License:        GPL v2 or later
Group:          System/Daemons
AutoReqProv:    on
Source:         %{pkg_name}-%{version}.tar.bz2
Patch:          %{pkg_name}-libexecdir.patch
Patch1:         %{pkg_name}-fix-dbus-permissions.patch
Patch2:         %{pkg_name}-exit-with-the-bus.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %build_doc == 0
PreReq:         pwdutils login
PreReq:         pam-config >= 0.22
%endif

%description
ConsoleKit is a system daemon for tracking what users are logged into
the system and how they interact with the computer (e.g. which keyboard
and mouse they use).



Authors:
--------
    William Jon McCann <mccann@jhu.edu>

%if !%{build_doc}

%package -n ConsoleKit-devel
License:        GPL v2 or later
Summary:        Developer package for ConsoleKit
Requires:       %{pkg_name} = %{version}-%{release}, dbus-1-devel
AutoReqProv:    on
Group:          Development/Libraries/Other

%description -n ConsoleKit-devel
Developer package for ConsoleKit



Authors:
--------
    William Jon McCann <mccann@jhu.edu>

%package -n ConsoleKit-x11
License:        GPL v2 or later
Summary:        System daemon for tracking users, sessions and seats
Requires:       %{pkg_name} = %{version}-%{release}
AutoReqProv:    on
Group:          System/Daemons

%description -n ConsoleKit-x11
ConsoleKit is a system daemon for tracking what users are logged into
the system and how they interact with the computer (e.g. which keyboard
and mouse they use).



Authors:
--------
    William Jon McCann <mccann@jhu.edu>

%endif

%prep
%setup -q -n ConsoleKit-%{version}
%patch
%patch1 -p1
%patch2 -p1

%build
intltoolize
autoreconf -fi
./configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
            --prefix=/usr \
	    --libdir=%_libdir \
            --mandir=%_mandir \
	    --sysconfdir=%_sysconfdir \
	    --libexecdir=%{_prefix}/lib/ConsoleKit \
	    --enable-pam-module \
	    --with-pam-module-dir=/%_lib/security \
            --localstatedir=%{_localstatedir} \
%if %{build_doc}
            --enable-docbook-docs \
%endif
	    --docdir=%{_datadir}/doc/packages/ConsoleKit
make

%install
make DESTDIR=%{buildroot} install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/ConsoleKit/seats.d
# fix broken "scriptdir" - already fixed upstream
if [ ! -d $RPM_BUILD_ROOT%{_prefix}/lib/ConsoleKit/scripts ]; then
	mv $RPM_BUILD_ROOT/%_libdir/ConsoleKit/scripts  $RPM_BUILD_ROOT%{_prefix}/lib/ConsoleKit/scripts
fi
if [ ! -d $RPM_BUILD_ROOT/%{_prefix}/lib/ConsoleKit/run-session.d ]; then
	mv $RPM_BUILD_ROOT/%_libdir/ConsoleKit/run-session.d  $RPM_BUILD_ROOT%{_prefix}/lib/ConsoleKit/run-session.d
fi
#no .la files in /
rm -f $RPM_BUILD_ROOT/%_lib/security/pam_ck_connector.la
# no .la files at all:
rm -f $RPM_BUILD_ROOT/%_libdir/*.la
%if %{build_doc}
rm -rf $RPM_BUILD_ROOT/%_libdir/*.so*
rm -rf $RPM_BUILD_ROOT/%{_datadir}/dbus-1/system-services/org.freedesktop.ConsoleKit.service
rm -rf $RPM_BUILD_ROOT/%_sysconfdir/dbus-1/system.d/ConsoleKit.conf
rm -rf $RPM_BUILD_ROOT/%_sysconfdir/ConsoleKit/seats.d/00-primary.seat
rm -rf $RPM_BUILD_ROOT/%_sysconfdir/init.d/consolekit
rm -rf $RPM_BUILD_ROOT/%_bindir/
rm -rf $RPM_BUILD_ROOT/%_includedir/ConsoleKit
rm -rf $RPM_BUILD_ROOT/%_libdir/
rm -rf $RPM_BUILD_ROOT/%_sbindir/
rm -rf $RPM_BUILD_ROOT/%_mandir/
rm -rf $RPM_BUILD_ROOT/%{_prefix}/lib
rm -rf $RPM_BUILD_ROOT/%_lib/security
rm -rf $RPM_BUILD_ROOT/%_datadir/PolicyKit/policy/ConsoleKit.policy
rm -rf $RPM_BUILD_ROOT/usr/share/locale/*/LC_MESSAGES/*
%endif
%if !%{build_doc}

%post
/sbin/ldconfig
if [ -n "$YAST_IS_RUNNING" ]; then
	/usr/sbin/pam-config --service login -a -f --ck_connector
else
	/usr/sbin/pam-config --service login -a --ck_connector || echo "please call \"/usr/sbin/pam-config --service login -a --ck_connector\" manually"
fi

%postun
# make sure this is not called on update
if [ "$1" = 0 ]; then
    /usr/sbin/pam-config --service login -d --ck_connector ||:
fi
/sbin/ldconfig
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%if %{build_doc}
%{_datadir}/doc/packages/ConsoleKit
%else
%dir %{_sysconfdir}/ConsoleKit
%dir %{_sysconfdir}/ConsoleKit/seats.d
%dir %{_sysconfdir}/ConsoleKit/run-session.d
%dir %{_prefix}/lib/ConsoleKit
%dir %{_prefix}/lib/ConsoleKit/run-session.d
%dir %{_prefix}/lib/ConsoleKit/scripts
%{_prefix}/lib/ConsoleKit/scripts/ck-system-restart
%{_prefix}/lib/ConsoleKit/scripts/ck-system-stop
%{_datadir}/dbus-1/system-services/org.freedesktop.ConsoleKit.service
%_sysconfdir/dbus-1/system.d/ConsoleKit.conf
%_sysconfdir/ConsoleKit/seats.d/00-primary.seat
%_bindir/*
%_libdir/*.so.*
%_sbindir/*
%_mandir/man8/pam_ck_connector.8.gz
/%_lib/security
%_localstatedir/run/ConsoleKit
%dir %{_datadir}/PolicyKit/policy
%{_datadir}/PolicyKit/policy/ConsoleKit.policy
/usr/share/locale/*/LC_MESSAGES/*

%files -n ConsoleKit-devel
%defattr(-,root,root)
%_includedir/ConsoleKit
%_libdir/*.so
%_libexecdir/pkgconfig/ck-connector.pc

%files -n ConsoleKit-x11
%defattr(-,root,root)
%{_prefix}/lib/ConsoleKit/ck-get-x11-server-pid
%{_prefix}/lib/ConsoleKit/ck-get-x11-display-device
%{_prefix}/lib/ConsoleKit/ck-collect-session-info
%endif

%changelog
* Thu May 07 2009 hmacht@suse.de
- Add ConsoleKit-exit-with-the-bus.patch (upstream commit
  8ec523138671a8fe93748a0b75adaaca96e2392e) to kill the ConsoleKit
  daemon as soon as D-Bus exits. ConsoleKit is started by D-Bus
  activation anyway (bnc#491063)
* Mon Feb 09 2009 hmacht@suse.de
- add translation infrastructure and add translations (bnc#459155)
* Fri Jan 23 2009 hmacht@suse.de
- fix D-Bus permissions (bnc#468371)
* Mon Dec 08 2008 hmacht@suse.de
- don't remove pam config on update (bnc#450962)
* Thu Oct 16 2008 ro@suse.de
- enhance baselibs.conf
- handle error case in postinstall more gracefully (#412794)
* Thu Oct 09 2008 hmacht@suse.de
- Remove %%ifarch calls, -32bit packages are selected through
  patterns. Force pam-config when YaST2 is running
  (bnc#433653,bnc#412794)
* Fri Sep 26 2008 hmacht@suse.de
- remove rc-script. ConsoleKit is activated on demand with D-Bus
  system activation (bnc#428228)
* Mon Aug 25 2008 ro@suse.de
- initscript: add $null to Required-Stop to fix build
* Mon Aug 11 2008 ro@suse.de
- fix build for ConsoleKit-doc
* Fri Jul 18 2008 hmacht@suse.de
- build with PolicyKit support (bnc#399476)
- update ConsoleKit-libexecdir.patch
* Tue May 13 2008 hmacht@suse.de
- also change libdir to prefix/lib in ck-session.c (bnc#386369)
* Fri Apr 18 2008 hmacht@suse.de
- update to version 0.2.10:
  always create the directories we need
  fix display of active vt when vt is disabled
  guard against writing null string to keyfile
  Also make criticals fatal when starting with --debug.
  reverse the sense of the dbus policy
  add a ck-launch-session tool
  don't set the session-type to the command name
  add tools to log restart and stop events
  fix typo in dbus policy file
  touch the history file to create it for people not using packages
  mkdir /var/log/ConsoleKit at install time
  set a global flag so that D-Bus does not change
  the SIGPIPE handler in the PAM module
  when a parsing error occurs don't return an empty event
  add a helper to write a system start record to the CK history
  add support for logging start/stop/restart
  allow session type filtering for all report formats
  add session-type filtering to ck-history
  try to activate x11-display-device not only display-device
  be a little smarter about how we compute the number of users
  fix policy action name
  history should log to /var/log not /var/run
- change %%_libexecdir to %%_prefix/lib
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
  for multilib support
* Sat Apr 05 2008 coolo@suse.de
- leave out ConsoleKit-x11 in -doc.spec
* Tue Apr 01 2008 hmacht@suse.de
- create ConsoleKit-x11 containing the following files:
  /usr/lib/ck-get-x11-server-pid
  /usr/lib/ck-get-x11-display-device
  /usr/lib/ck-collect-session-info
* Sat Feb 16 2008 coolo@suse.de
- pwdutils split out login and we need it
* Tue Nov 27 2007 hmacht@suse.de
- add /etc/ConsoleKit/run-session.d and
  /usr/lib/ConsoleKit/run-session.d to files section (b.n.c 343246)
* Fri Nov 09 2007 hmacht@suse.de
- fix --localstatedir and add /var/run/ConsoleKit to files section
  (novell bug 340486)
* Wed Oct 17 2007 dkukawka@suse.de
- updated to git master (20071017):
  - add a way to synchronously run programs on session
  add/remove/activity_change
  - maintain a file with the dump of the local database
  - add event logging capability
  - Use unix-user instead of user so that PAM module works
  - FreeBSD support
  - Solaris support
  - More abstraction of system dependent stuff
  - Experimental support for seat & device configuration
  - Add new helper for getting tty from DISPLAY
  - a few fixes for getfd suggested by Lennart
* Mon Oct 01 2007 hmacht@suse.de
- remove 'PreReq: %%name-64bit' for ppc (novell bug 302148)
* Mon Sep 03 2007 hmacht@suse.de
- require pam-config >= 0.22 in PreReq (novell bug 306443)
* Sun Sep 02 2007 ro@suse.de
- no PreReq for doc package
* Wed Aug 29 2007 hmacht@suse.de
- PreReq either the 32bit or the 64bit pam plugin for pam-config to
  not fail (novell bug 302148)
* Fri Aug 17 2007 hmacht@suse.de
- run '/usr/sbin/pam-config --service login -a --ck_connector' in
  %%post section (novell bug 297559)
* Mon Aug 06 2007 hmacht@suse.de
- start ConsoleKit in runlevels 2 3 and 5 (insserv consolekit)
* Sat Aug 04 2007 aj@suse.de
- Reduce build requires.
* Sat Aug 04 2007 aj@suse.de
- Split of devel and doc packages.
* Fri Aug 03 2007 hmacht@suse.de
- remove dbus-1-devel from "Requires:"
* Wed Apr 25 2007 hmacht@suse.de
- update to version 0.2.1:
    - disable static libs
    - use inotify to detect activity on tty when possible
    - add support for CKCON_X11_DISPLAY_DEVICE environment variable
    - also add ability to toggle debugging when SIGUSR1 is received
    - several autoconf fixes and cleanups
    - typo fixes in documentation
    - misc fixes
* Mon Apr 02 2007 hmacht@suse.de
- initial checkin
openSUSE Build Service is sponsored by