- pinentry-0.7.6

- -qt switched qt4 version, where applicable (f9+, rhel6+)
- fixup scriptlets
This commit is contained in:
Rex Dieter 2009-06-23 15:28:41 +00:00
parent e9454cea70
commit ac2aa98189
4 changed files with 123 additions and 34 deletions

View File

@ -1,2 +1,2 @@
pinentry-0.7.5.tar.gz
pinentry-0.7.5.tar.gz.sig
pinentry-0.7.6.tar.gz
pinentry-0.7.6.tar.gz.sig

67
pinentry-wrapper Normal file
View File

@ -0,0 +1,67 @@
#!/bin/sh
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# Anna Bernathova <anicka@novell.com> 2006
# Pavel Nemec <pnemec@novell.com> 2006
#
# use proper binary (pinentry-qt, pinentry-gtk-2 or pinentry-curses)
kde_running=
if [ -n "$KDE_FULL_SESSION" ]; then
kde_running=1
elif [ -n "$DISPLAY" ]; then
xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null
if test $? -eq 0; then
kde_running=1
fi
else
arg=
display=
for opt in "$@"; do
if [ "$opt" = "--display" ]; then
arg=1
elif [ -n "$arg" ]; then
display="$opt"
else
arg=
fi
done
if [ -n "$display" ]; then
DISPLAY="$display" xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null
if test $? -eq 0; then
kde_running=1
fi
fi
fi
# if KDE is detected and pinentry-qt exists, use pinentry-qt
if [ -n "$kde_running" -a -f /usr/bin/pinentry-qt ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-qt"
# otherwise test if pinentry-gtk-2 is installed
elif [ -f /usr/bin/pinentry-gtk-2 ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-gtk-2"
# otherwise test if pinentry-qt exists although KDE is not detected
elif [ -f /usr/bin/pinentry-qt ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-qt"
# pinentry-curses is installed by default
else
#test if gui binary is required
for opt in "$@"; do
if [ "x$opt" = "x--display" ]; then
# should not happen because of package dependencies
echo "Please install pinentry-qt or pinentry-gtk2" >&2
exit 1
fi
done
export PINENTRY_BINARY="/usr/bin/pinentry-curses"
fi
exec $PINENTRY_BINARY "$@"

View File

@ -1,12 +1,12 @@
%if 0%{?fedora} > 8
%define qt3 qt3
%if 0%{?fedora} > 8 || 0%{?rhel} > 5
%define _enable_pinentry_qt4 --enable-pinentry-qt4
%else
%define qt3 qt
%define _enable_pinentry_qt --enable-pinentry-qt
%endif
Name: pinentry
Version: 0.7.5
Version: 0.7.6
Release: 1%{?dist}
Summary: Collection of simple PIN or passphrase entry dialogs
@ -17,17 +17,20 @@ Source0: ftp://ftp.gnupg.org/gcrypt/pinentry/%{name}-%{version}.tar.gz
Source1: ftp://ftp.gnupg.org/gcrypt/pinentry/%{name}-%{version}.tar.gz.sig
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: pinentry-0.7.4-glib2.patch
BuildRequires: gtk2-devel
BuildRequires: libcap-devel
BuildRequires: ncurses-devel
BuildRequires: %{qt3}-devel
%if 0%{?_enable_pinentry_qt:1}
BuildRequires: qt-devel
%endif
%if 0%{?_enable_pinentry_qt4:1}
BuildRequires: qt4-devel
%endif
Requires(post): %{_sbindir}/update-alternatives
Requires(post): /sbin/install-info
Requires(postun): %{_sbindir}/update-alternatives
Requires(postun): /sbin/install-info
Requires(preun): /sbin/install-info
Provides: %{name}-curses = %{version}-%{release}
@ -48,10 +51,10 @@ Requires(postun): %{_sbindir}/update-alternatives
Pinentry is a collection of simple PIN or passphrase entry dialogs which
utilize the Assuan protocol as described by the aegypten project; see
http://www.gnupg.org/aegypten/ for details.
This package contains the GTK+ GUI based version of the PIN entry dialog.
This package contains the GTK GUI based version of the PIN entry dialog.
%package qt
Summary: Passphrase/PIN entry dialog based on Qt3
Summary: Passphrase/PIN entry dialog based on Qt
Group: Applications/System
Requires: %{name} = %{version}-%{release}
Provides: %{name}-gui = %{version}-%{release}
@ -67,16 +70,25 @@ This package contains the Qt GUI based version of the PIN entry dialog.
%prep
%setup -q
#patch1 -p1 -b .glib2
# hack around auto* madness, lack of proper support for moc
%if %{?_enable_pinentry_qt4:1}
pushd qt4
moc-qt4 pinentrydialog.h > pinentrydialog.moc
moc-qt4 qsecurelineedit.h > qsecurelineedit.moc
popd
%endif
%build
%if 0%{?_enable_pinentry_qt:1}
unset QTDIR || : ; . /etc/profile.d/qt.sh
%endif
%configure \
--disable-rpath \
--disable-dependency-tracking \
--disable-pinentry-gtk
--disable-pinentry-gtk \
%{?_enable_pinentry_qt} %{!?_enable_pinentry_qt:--disable-pinentry-qt} \
%{?_enable_pinentry_qt4} %{!?_enable_pinentry_qt4:--disable-pinentry-qt4}
make %{?_smp_mflags}
@ -88,6 +100,9 @@ make install DESTDIR=$RPM_BUILD_ROOT
# Backwards compatibility
ln -s pinentry-gtk-2 $RPM_BUILD_ROOT%{_bindir}/pinentry-gtk
%if 0%{?_enable_pinentry_qt4:1}
ln -s pinentry-qt4 $RPM_BUILD_ROOT%{_bindir}/pinentry-qt
%endif
# Dummy symlink for %%ghost
ln -sf %{_sysconfdir}/alternatives/pinentry $RPM_BUILD_ROOT%{_bindir}/pinentry
@ -101,38 +116,36 @@ rm -rf $RPM_BUILD_ROOT
%post
/sbin/install-info %{_infodir}/pinentry.info %{_infodir}/dir || :
if [ $1 -eq 1 ] ; then
%{_sbindir}/update-alternatives --install %{_bindir}/pinentry \
pinentry %{_bindir}/pinentry-curses 10
fi
/sbin/install-info %{_infodir}/pinentry.info %{_infodir}/dir
%{_sbindir}/update-alternatives --install %{_bindir}/pinentry \
pinentry %{_bindir}/pinentry-curses %{?curses_priority}%{!?curses_priority:10} ||:
%post gtk
if [ $1 -eq 1 ] ; then
%{_sbindir}/update-alternatives --install %{_bindir}/pinentry \
pinentry %{_bindir}/pinentry-gtk 40
fi
%{_sbindir}/update-alternatives --install %{_bindir}/pinentry \
pinentry %{_bindir}/pinentry-gtk %{?gtk_priority}%{!?gtk_priority:40} ||:
%post qt
if [ $1 -eq 1 ] ; then
%{_sbindir}/update-alternatives --install %{_bindir}/pinentry \
pinentry %{_bindir}/pinentry-qt 30
%{_sbindir}/update-alternatives --install %{_bindir}/pinentry \
pinentry %{_bindir}/pinentry-qt %{?qt_priority}%{!?qt_priority:30} ||:
%preun
if [ $1 -eq 0 ] ; then
/sbin/install-info --delete %{_infodir}/pinentry.info %{_infodir}/dir ||:
fi
%postun
if [ $1 -eq 0 ] ; then
/sbin/install-info --delete %{_infodir}/pinentry.info %{_infodir}/dir || :
%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-curses
%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-curses ||:
fi
%postun gtk
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-gtk
%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-gtk ||:
fi
%postun qt
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-qt
%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-qt ||:
fi
@ -145,16 +158,25 @@ fi
%files gtk
%defattr(-,root,root,-)
%{_bindir}/pinentry-gtk*
%{_bindir}/pinentry-gtk
%{_bindir}/pinentry-gtk-2
%ghost %{_bindir}/pinentry
%files qt
%defattr(-,root,root,-)
%{_bindir}/pinentry-qt
%if 0%{?_enable_pinentry_qt4:1}
%{_bindir}/pinentry-qt4
%endif
%ghost %{_bindir}/pinentry
%changelog
* Mon Jun 22 2009 Rex Dieter <rdieter@fedoraproject.org> - 0.7.6-1
- pinentry-0.7.6
- -qt switched qt4 version, where applicable (f9+, rhel6+)
- fixup scriptlets
* Sat Apr 25 2009 Rex Dieter <rdieter@fedoraproject.org> - 0.7.5-1
- pinentry-0.7.5

View File

@ -1,2 +1,2 @@
ca492afbbb59cd19f1c875533f18b269 pinentry-0.7.5.tar.gz
afe88ce56cd02924a292f9f5f6f40cd6 pinentry-0.7.5.tar.gz.sig
5a4f676375fa882009da02013d77210f pinentry-0.7.6.tar.gz
36cd76923724de5d10830346f4b0f915 pinentry-0.7.6.tar.gz.sig