Package PolicyKit: Specfile

%define libname libpolkit

Name: PolicyKit
Version: 0.9
Release: alt6
Summary: Toolkit for privilege control
License: AFL/GPL 
Group: System/Libraries
URL: http://www.freedesktop.org/wiki/Software/hal
Packager: Valery Inozemtsev <shrek@altlinux.ru>

Requires: %libname = %version-%release
PreReq: dbus

Source: %name-%version.tar
Patch: %name-%version-%release.patch

BuildRequires: gcc-c++ glib2-devel intltool libdbus-devel libdbus-glib-devel libexpat-devel libpam-devel xmlto

%description 
PolicyKit is a toolkit for defining and handling the policy that
allows unprivileged processes to speak to privileged processes.

%package -n %libname
Summary: PolicyKit libraries
Group: System/Libraries
Obsoletes: lib%name < %version
Provides: lib%name = %version-%release

%description -n %libname
Libraries for interacting with PolicyKit

%package -n %libname-devel
Summary: Development libraries and headers for PolicyKit
Group: Development/C++
Requires: %libname = %version-%release
Obsoletes: lib%name-devel < %version
Provides: lib%name-devel = %version-%release

%description -n %libname-devel
Headers, libraries and API docs for PolicyKit

%prep
%setup -q
%patch -p1

%build
%autoreconf
%configure \
	--disable-static \
	--with-os-type=ALTLinux \
	--with-polkit-group=_polkit \
	--with-polkit-user=_polkit \
	--libexecdir=%_prefix/libexec/%name \
	--localstatedir=%_var \
	--with-pam-module-dir=/%_lib/security \
	--enable-docbook-docs
%make

%install
%make DESTDIR=%buildroot install

%pre
%_sbindir/groupadd -r -f _polkit >/dev/null 2>&1 || :
%_sbindir/useradd -r -g _polkit -d '/' -s /sbin/nologin -c PolicyKit _polkit >/dev/null 2>&1 ||:

%files
%doc README NEWS COPYING AUTHORS
%_sysconfdir/%name
%_sysconfdir/dbus-1/system.d/org.freedesktop.PolicyKit.conf
%_sysconfdir/pam.d/polkit
#%_sysconfdir/profile.d/polkit-bash-completion.sh
%_bindir/*
%dir %_prefix/libexec/%name
%_prefix/libexec/%name/polkitd
%attr(2511,_polkit,_polkit) %_prefix/libexec/%name/polkit-explicit-grant-helper
%attr(2511,_polkit,_polkit) %_prefix/libexec/%name/polkit-re*
%attr(2511,_polkit,_polkit) %_prefix/libexec/%name/polkit-grant-helper
%attr(4511,_polkit,_polkit) %_prefix/libexec/%name/polkit-set-default-helper
%attr(4510,root,_polkit) %_prefix/libexec/%name/polkit-grant-helper-pam
%_datadir/%name
%dir %_datadir/dbus-1/interfaces
%_datadir/dbus-1/interfaces/org.freedesktop.PolicyKit.AuthenticationAgent.xml
%_datadir/dbus-1/system-services/org.freedesktop.PolicyKit.service
%_man1dir/*.1*
%_man5dir/*.5*
%_man8dir/%name.8*
%attr(0770,root,_polkit) %_var/run/%name
%dir %attr(0775,root,_polkit) %_localstatedir/%name
%dir %attr(0755,_polkit,_polkit) %_localstatedir/%name-public
%attr(0664,_polkit,_polkit) %_localstatedir/%name/reload

%files -n %libname
%_libdir/*.so.*

%files -n %libname-devel
%_includedir/*
%_libdir/*.so
%_pkgconfigdir/*.pc

%changelog
* Thu Feb 12 2009 Valery Inozemtsev <shrek@altlinux.ru> 0.9-alt6
- fixed D-Bus policy (fd.o #18948)

* Sat Nov 22 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.9-alt5
- removed obsolete %%post_ldconfig/%%postun_ldconfig calls

* Fri Nov 21 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.9-alt4
- added suid for polkit-grant-helper-pam

* Thu Nov 20 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.9-alt3
- /usr/libexec/PolicyKit/polkit-*: fixed permission

* Sat Aug 02 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.9-alt2
- API fixed in CK 0.3

* Fri Aug 01 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.9-alt1
- 0.9

* Thu Apr 17 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.8-alt1
- 0.8
- rename subpackage libPolicyKit to libpolkit

* Fri Apr 04 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.7-alt3
- fixed CVE-2008-1658
- drop polkit-bash-completion.sh (close #15232)

* Tue Apr 01 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.7-alt2
- fixed read default policy on reiserfs/xfs

* Fri Jan 25 2008 Valery Inozemtsev <shrek@altlinux.ru> 0.7-alt1
- 0.7

* Fri Oct 12 2007 Valery Inozemtsev <shrek@altlinux.ru> 0.6-alt1
- 0.6

* Sun Jul 29 2007 Valery Inozemtsev <shrek@altlinux.ru> 0.4-alt1
- 0.4

* Mon Jun 25 2007 Valery Inozemtsev <shrek@altlinux.ru> 0.3-alt1
- 0.3

* Mon Jun 11 2007 Igor Zubkov <icesik@altlinux.org> 0.2-alt7.git20060822
- move gtk-doc documentation to devel subpackage (closes #12008)
- buildreq

* Tue Feb 20 2007 Igor Zubkov <icesik@altlinux.org> 0.2-alt6.git20060822
- fix attr's for %%_var/run/polkit

* Mon Dec 25 2006 Igor Zubkov <icesik@altlinux.org> 0.2-alt5.git20060822
- rebuild with new dbus

* Tue Nov 28 2006 Igor Zubkov <icesik@altlinux.org> 0.2-alt4.git20060822
- small fix for thresh@ changes
- s/%%make_build/make/ (fix build in hasher)
- change polkit group to _polkit
- change polkit user to _polkit

* Mon Nov 27 2006 Pavlov Konstantin <thresh@altlinux.ru> 0.2-alt3.git20060822
- Some spec cleanup.
- Some buildrequires cleanup.
- Some descriptions cleanup.
- Fix docs packaging.
- Altify user creation in %%pre.

* Mon Nov 20 2006 Igor Zubkov <icesik@altlinux.org> 0.2-alt2.git20060822
- disable -Werror

* Mon Nov 20 2006 Igor Zubkov <icesik@altlinux.org> 0.2-alt1.git20060822
- rename spec from policykit.spec to PolicyKit.spec
- s/%%make/%%make_build/
- add HACKING to docs
- remove INSTALL from docs
- correct License from GPL to AFL/GPL
- add Packager tag
- add pam module subpackage
- build with -Werror by default
- add PolicyKit-devel-static subpackage

* Tue Nov 14 2006 Alexey Shabalin <shaba@altlinux.ru> 0.2_git20060822-alt0.1
- initial build