Package init

This commit is contained in:
overweight 2019-09-30 11:13:44 -04:00
commit 7f331156e5
4 changed files with 172 additions and 0 deletions

BIN
pinentry-1.1.0.tar.bz2 Normal file

Binary file not shown.

BIN
pinentry-1.1.0.tar.bz2.sig Normal file

Binary file not shown.

78
pinentry-wrapper Executable file
View File

@ -0,0 +1,78 @@
#!/bin/sh
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2009 Fedora Project
# Copyright (c) 2014-2015 Red Hat
# 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://bugzilla.redhat.com/
#
# Anna Bernathova <anicka@novell.com> 2006
# Pavel Nemec <pnemec@novell.com> 2006
# Rex Dieter <rdieter@fedoraproject.org> 2009
# Pavol Rusnak <prusnak@novell.com> 2009
# Boris Ranto <branto@redhat.com> 2014
#
# use proper binary (pinentry-qt, pinentry-gnome, pinentry-gtk-2 or pinentry-curses)
kde_running=
arg=
display=
# look for a --display option
for opt in "$@"; do
if [ "$opt" = "--display" ]; then
arg=1
elif [ -n "$arg" ]; then
display="$opt"
else
arg=
fi
done
# export DISPLAY if pinentry is meant to be run on a different display
# check the KDE_FULL_SESSION variable otherwise
if [ -n "$display" -a "$DISPLAY" != "$display" ]; then
export DISPLAY="$display"
elif [ -n "$KDE_FULL_SESSION" ]; then
kde_running=1
kde_ver="$KDE_SESSION_VERSION"
fi
# Check for presence of xprop binary
type xprop >/dev/null 2>/dev/null
XPROP=$?
if [ -n "$DISPLAY" -a $XPROP -eq 0 ]; then
xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null
if test $? -eq 0; then
kde_running=1
kde_ver="`xprop -root | sed -n 's/KDE_SESSION_VERSION(CARDINAL) = //p'`" 2>/dev/null
fi
fi
# if a user supplied a pinentry binary, use it
if [ -n "$PINENTRY_BINARY" ];
then
export PINENTRY_BINARY="$PINENTRY_BINARY"
# if KDE is detected and pinentry-qt exists, use pinentry-qt
elif [ -n "$kde_running" -a -x /usr/bin/pinentry-qt ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-qt"
# otherwise test if pinentry-gnome3 is installed
elif [ -n "$DISPLAY" -a -x /usr/bin/pinentry-gnome3 ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-gnome3"
# otherwise test if pinentry-gtk-2 is installed
elif [ -n "$DISPLAY" -a -x /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 [ -n "$DISPLAY" -a -x /usr/bin/pinentry-qt ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-qt"
# pinentry-curses is installed by default
else
export PINENTRY_BINARY="/usr/bin/pinentry-curses"
fi
exec $PINENTRY_BINARY "$@"

94
pinentry.spec Normal file
View File

@ -0,0 +1,94 @@
Name: pinentry
Version: 1.1.0
Release: 5
Summary: A new module that contains various interfaces to enter a PIN/passphrase.
License: GPLv2+
URL: https://github.com/gpg/pinentry/archive/pinentry-1.1.0.tar.gz
Source0: https://www.gnupg.org/ftp/gcrypt/pinentry/%{name}-%{version}.tar.bz2
# source1 is from opensuse
Source1: pinentry-wrapper
Source2: https://www.gnupg.org/ftp/gcrypt/pinentry/%{name}-%{version}.tar.bz2.sig
BuildRequires: pkgconfig(Qt5Widgets) libcap-devel ncurses-devel libassuan-devel
BuildRequires: libgpg-error-devel libsecret-devel pkgconfig(Qt5Core) gcc
BuildRequires: pkgconfig(Qt5Gui) gcr-devel gtk2-devel
Requires(pre): %{_sbindir}/update-alternatives
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Provides: %{name}-gui = %{version}-%{release}
Provides: pinentry-gtk2 = %{version}-%{release}
Provides: %{name}-curses = %{version}-%{release}
Provides: %{name}-emacs %{name}-gnome3 %{name}-gtk
Obsoletes: %{name}-emacs %{name}-gnome3 %{name}-gtk
%description
This is a collection of PIN or passphrase entry dialogs which
utilize the Assuan protocol as specified in the Libassuan manual.
There are programs for different toolkits available. For all GUIs it
is automatically detected which modules can be built, but it can also
be requested explicitly.
%package qt
Summary: Collection of Simple PIN or Passphrase Entry Dialogs
Requires: %{name} = %{version}-%{release}
Provides: %{name}-gui = %{version}-%{release}
Obsoletes: %{name}-qt4 < 0.8.0-2
Provides: %{name}-qt5 = %{version}-%{release}
%description qt
Pinentry is a collection of PIN or passphrase entry dialogs which
utilize the Assuan protocol as specified in the Libassuan manual.
This package contains the Qt4 and Qt5 GUI based version of the PIN entry dialog.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1
%build
%configure --enable-pinentry-gnome3 --enable-pinentry-gtk2 --enable-pinentry-emacs \
--enable-pinentry-qt5 --enable-libsecret --disable-pinentry-fltk --disable-rpath\
--without-libcap --disable-dependency-tracking
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
install -p -D -m 755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}
ln -s pinentry-gtk-2 %{buildroot}%{_bindir}/pinentry-gtk
ln -s pinentry-qt %{buildroot}%{_bindir}/pinentry-qt4
%post
if [ -f %{_infodir}/pinentry.info* ]; then
/sbin/install-info %{_infodir}/pinentry.info %{_infodir}/dir ||:
fi
%preun
if [ $1 -eq 0 -a -f %{_infodir}/pinentry.info* ] ; then
/sbin/install-info --delete %{_infodir}/pinentry.info %{_infodir}/dir ||:
fi
%files
%doc AUTHORS README THANKS
%license COPYING
%{_bindir}/pinentry
%{_bindir}/pinentry-curses
%{_bindir}/pinentry-emacs
%{_bindir}/pinentry-gnome3
%{_bindir}/pinentry-gtk*
%{_datadir}/info/pinentry.info.gz
%exclude %{_datadir}/info/dir
%files qt
%{_bindir}/pinentry-qt*
%files help
%doc ChangeLog NEWS TODO
%changelog
* Tue Sep 17 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.1.0-5
- Package Init