File ConsoleKit.spec of Package ConsoleKit
#
# spec file for package ConsoleKit
#
# Copyright (c) 2011 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/
#
Name: ConsoleKit
%define build_doc 0
%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: dbus-1-glib-devel
BuildRequires: libtool
BuildRequires: pam-devel
BuildRequires: xorg-x11-libX11-devel
BuildRequires: polkit-devel
BuildRequires: zlib-devel
BuildRequires: pkgconfig
%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.4.5
Release: 1
License: GPLv2+
Group: System/Daemons
Source: %{pkg_name}-%{version}.tar.bz2
Source2: baselibs.conf
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).
%if !%{build_doc}
%package -n ConsoleKit-devel
License: GPLv2+
Summary: Developer package for ConsoleKit
Requires: %{pkg_name} = %{version}-%{release}, dbus-1-devel
Group: Development/Libraries/Other
%description -n ConsoleKit-devel
Developer package for ConsoleKit and libck-connector
%package -n ConsoleKit-x11
License: GPLv2+
Summary: System daemon for tracking users, sessions and seats
Requires: %{pkg_name} = %{version}-%{release}
Group: System/Daemons
Supplements: packageand(xorg-x11:ConsoleKit)
%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).
%endif
%prep
%setup -q -n ConsoleKit-%{version}
%build
export V=1
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} \
--with-systemdsystemunitdir=/lib/systemd/system \
%if %{build_doc}
--enable-docbook-docs \
%endif
--docdir=%{_datadir}/doc/packages/ConsoleKit
make %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/ConsoleKit/seats.d
rm -f $RPM_BUILD_ROOT/%_lib/security/pam_ck_connector.la
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/polkit-1/actions/org.freedesktop.consolekit.policy
rm -rf $RPM_BUILD_ROOT/%_datadir/dbus-1/interfaces/org.freedesktop.ConsoleKit.Manager.xml
rm -rf $RPM_BUILD_ROOT/%_datadir/dbus-1/interfaces/org.freedesktop.ConsoleKit.Seat.xml
rm -rf $RPM_BUILD_ROOT/%_datadir/dbus-1/interfaces/org.freedesktop.ConsoleKit.Session.xml
rm -rf $RPM_BUILD_ROOT/lib/systemd/
%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
%files
%defattr(-,root,root)
%if %{build_doc}
%{_datadir}/doc/packages/ConsoleKit
%else
%dir %{_sysconfdir}/ConsoleKit
%dir %{_sysconfdir}/ConsoleKit/seats.d
%dir %{_sysconfdir}/ConsoleKit/run-seat.d
%dir %{_sysconfdir}/ConsoleKit/run-session.d
%dir %{_prefix}/lib/ConsoleKit
%dir %{_prefix}/lib/ConsoleKit/run-seat.d
%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
%{_prefix}/lib/ConsoleKit/ck-collect-session-info
%{_datadir}/dbus-1/system-services/org.freedesktop.ConsoleKit.service
%config %_sysconfdir/dbus-1/system.d/ConsoleKit.conf
%config %_sysconfdir/ConsoleKit/seats.d/00-primary.seat
%_bindir/*
%_libdir/*.so.*
%_sbindir/*
%_mandir/man8/pam_ck_connector.8.gz
/%_lib/security
%ghost %_localstatedir/run/ConsoleKit
%{_datadir}/polkit-1/actions/org.freedesktop.consolekit.policy
%{_datadir}/dbus-1/interfaces/org.freedesktop.ConsoleKit.Manager.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.ConsoleKit.Seat.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.ConsoleKit.Session.xml
/lib/systemd/system/console-kit-*.service
/lib/systemd/system/*.target.wants
%files -n ConsoleKit-devel
%defattr(-,root,root)
%_includedir/ConsoleKit
%_libdir/*.so
%_libdir/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
%endif
%changelog