%define         commit f8ce834c

Name:           gksu-polkit
Version:        0.0.3
Release:        2%{?_dist_release}
Summary:        Command line utility to run programs as root
Summary(ja):    プログラムをrootで実行するためのコマンドラインツール

License:        LGPLv3+
Group:          Applications/System
URL:            http://live.gnome.org/gksu

# There is no other download source
Source0:        %{name}-%{version}-git%{commit}.tar.bz2
Source99:       %{name}-git-checkout.sh
Patch0:         %{name}-dbus.patch
Patch1:         %{name}-%{version}-policy.patch
Patch2:         %{name}-%{version}-format-security.patch

BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  doxygen
BuildRequires:  dbus-glib-devel
BuildRequires:  gtk-doc
BuildRequires:  gtk2-devel
BuildRequires:  intltool
BuildRequires:  libgee06-devel
BuildRequires:  libgee06-vala
BuildRequires:  libtool
BuildRequires:  polkit-devel
BuildRequires:  startup-notification-devel
BuildRequires:  vala

Requires:       %{name}-libs = %{version}-%{release}

%description
This is a library and application used to ask the user for passwords to run
programs as root.

%package libs
Summary:        Libraries for %{name}
Summary(ja):    %{name} 用のライブラリ
Group:          System Environment/Libraries

%description libs
Libraries for software which uses %{name}.

%package libs-devel
Summary:        Development libraries and headers for %{name}
Summary(ja):    %{name} 用の開発ライブラリおよびヘッダファイル
Group:          Development/Libraries
Requires:       %{name}-libs = %{version}-%{release}

%description libs-devel
Development libraries and headers for %{name}-libs.

%prep
%setup -q -n %{name}
%patch0 -p0
%patch1 -p1
%patch2 -p1

%build
autoreconf -v -f --install
%configure
make

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=%{buildroot}
find %{buildroot} -name '*.la' -delete
find %{buildroot} -name '*.a' -delete

# Currently no translations available, although we have a po folder

%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/%{name}
%{_datadir}/dbus-1/system-services/org.gnome.Gksu.service
%{_datadir}/%{name}-1/environment/common.variables
%{_datadir}/polkit-1/actions/org.gnome.gksu.policy
%{_sbindir}/gksu-server
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/%{name}.conf

%files libs
%doc COPYING README THANKS TODO
%{_libdir}/lib%{name}.so.*

%files libs-devel
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/lib%{name}-1.pc

%changelog
* Sun Nov 16 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.0.3-2
- added Group tag and %%clean section to spec

* Fri Jul 11 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 0.0.3-1
- initial build for Vine Linux

* Wed Jun 11 2014 Simone Caronni <negativo17@gmail.com> - 0.0.3-10.gitf8ce834c
- Add patch for format-security.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.3-9.gitf8ce834c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Jul 21 2013 Simone Caronni <negativo17@gmail.com> - 0.0.3-8.gitf8ce834c
- Update to git snapshot, add script to recreate tarball.
- Fix Patch1, was creating a patch file and not patching files.
- Add fix to service file from  Jan Pokorný (#975541).

* Tue Jun 11 2013 Simone Caronni <negativo17@gmail.com> - 0.0.3-7
- Fix systemd service file (#948613).
- SPEC file formatting.

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Sep 15 2012 Mario Blättermann <mariobl@fedoraproject.org> 0.0.3-4
- Added full systemd support via dbus

* Fri Aug 10 2012 Mario Blättermann <mariobl@fedoraproject.org> 0.0.3-3
- Removed find_lang macro, should be readded once there are real po files

* Thu Aug 09 2012 Mario Blättermann <mariobl@fedoraproject.org> 0.0.3-2
- Changed the libs requirement for the base package
- The ldconfig commands point now to the libs instead of the main package
- Disable rpath

* Sun Jul 29 2012 Mario Blättermann <mariobl@fedoraproject.org> 0.0.3-1
- Initial version
