diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f0fadf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/pinentry-0.8.1.tar.gz diff --git a/.pinentry.metadata b/.pinentry.metadata new file mode 100644 index 0000000..8318bc8 --- /dev/null +++ b/.pinentry.metadata @@ -0,0 +1 @@ +84a6940175b552a8562b4014f4661dec3ff10165 SOURCES/pinentry-0.8.1.tar.gz diff --git a/SOURCES/0001-Add-wide-char-support-to-pinentry-curses.patch b/SOURCES/0001-Add-wide-char-support-to-pinentry-curses.patch new file mode 100644 index 0000000..3c1781e --- /dev/null +++ b/SOURCES/0001-Add-wide-char-support-to-pinentry-curses.patch @@ -0,0 +1,365 @@ +From e2b89cbdcba7475047ca3c46fc7d03825355b3ff Mon Sep 17 00:00:00 2001 +From: Daiki Ueno +Date: Wed, 10 Aug 2011 12:50:43 +0900 +Subject: [PATCH] Add wide-char support to pinentry-curses. + +--- + configure.ac | 2 +- + m4/curses.m4 | 20 +++++- + pinentry/pinentry-curses.c | 150 +++++++++++++++++++++++++++++++++++++-------- + 3 files changed, 143 insertions(+), 29 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 4b8ed79..bcbe26e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -158,7 +158,7 @@ fi + + # Checks for header files. + AC_HEADER_STDC +-AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h) ++AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h wchar.h) + + dnl Checks for library functions. + AC_CHECK_FUNCS(seteuid stpcpy mmap) +diff --git a/m4/curses.m4 b/m4/curses.m4 +index 1e1cb4f..3a01881 100644 +--- a/m4/curses.m4 ++++ b/m4/curses.m4 +@@ -28,7 +28,13 @@ AC_DEFUN([IU_LIB_NCURSES], [ + AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses], + , enable_ncurses=yes) + if test "$enable_ncurses" = yes; then +- AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses") ++ AC_CHECK_LIB(ncursesw, initscr, LIBNCURSES="-lncursesw", ++ AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")) ++ if test "$ac_cv_lib_ncursesw_initscr" = yes; then ++ have_ncursesw=yes ++ else ++ have_ncursesw=no ++ fi + if test "$LIBNCURSES"; then + # Use ncurses header files instead of the ordinary ones, if possible; + # is there a better way of doing this, that avoids looking in specific +@@ -53,9 +59,14 @@ AC_DEFUN([IU_LIB_NCURSES], [ + else + AC_CACHE_CHECK(for ncurses include dir, + inetutils_cv_includedir_ncurses, ++ if test "$have_ncursesw" = yes; then ++ ncursesdir=ncursesw ++ else ++ ncursesdir=ncurses ++ fi + for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do +- if test -d $D/ncurses; then +- inetutils_cv_includedir_ncurses="$D/ncurses" ++ if test -d $D/$ncursesdir; then ++ inetutils_cv_includedir_ncurses="$D/$ncursesdir" + break + fi + test "$inetutils_cv_includedir_ncurses" \ +@@ -68,6 +79,9 @@ AC_DEFUN([IU_LIB_NCURSES], [ + NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses" + fi + fi ++ if test $have_ncursesw = yes; then ++ AC_DEFINE(HAVE_NCURSESW, 1, [Define if you have working ncursesw]) ++ fi + fi + AC_SUBST(NCURSES_INCLUDE) + AC_SUBST(LIBNCURSES)])dnl +diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c +index 76ddbdd..585059f 100644 +--- a/pinentry/pinentry-curses.c ++++ b/pinentry/pinentry-curses.c +@@ -42,6 +42,10 @@ + + #include + ++#ifdef HAVE_WCHAR_H ++#include ++#endif /*HAVE_WCHAR_H*/ ++ + #include "pinentry.h" + + /* FIXME: We should allow configuration of these button labels and in +@@ -94,6 +98,24 @@ struct dialog + typedef struct dialog *dialog_t; + + ++#ifdef HAVE_NCURSESW ++typedef wchar_t CH; ++#define STRLEN(x) wcslen (x) ++#define ADDCH(x) addnwstr (&x, 1); ++#define CHWIDTH(x) wcwidth (x) ++#define NULLCH L'\0' ++#define NLCH L'\n' ++#define SPCH L' ' ++#else ++typedef char CH; ++#define STRLEN(x) strlen (x) ++#define ADDCH(x) addch ((unsigned char) x) ++#define CHWIDTH(x) 1 ++#define NULLCH '\0' ++#define NLCH '\n' ++#define SPCH ' ' ++#endif ++ + /* Return the next line up to MAXLEN columns wide in START and LEN. + The first invocation should have 0 as *LEN. If the line ends with + a \n, it is a normal line that will be continued. If it is a '\0' +@@ -101,40 +123,95 @@ typedef struct dialog *dialog_t; + there is a forced line break. A full line is returned and will be + continued in the next line. */ + static void +-collect_line (int maxlen, char **start_p, int *len_p) ++collect_line (int maxwidth, wchar_t **start_p, int *len_p) + { + int last_space = 0; + int len = *len_p; +- char *end; ++ int width = 0; ++ CH *end; + + /* Skip to next line. */ + *start_p += len; + /* Skip leading space. */ +- while (**start_p == ' ') ++ while (**start_p == SPCH) + (*start_p)++; + + end = *start_p; + len = 0; + +- while (len < maxlen - 1 && *end && *end != '\n') ++ while (width < maxwidth - 1 && *end != NULLCH && *end != NLCH) + { + len++; + end++; +- if (*end == ' ') ++ if (*end == SPCH) + last_space = len; ++ width += CHWIDTH (*end); + } + +- if (*end && *end != '\n' && last_space != 0) ++ if (*end != NULLCH && *end != NLCH && last_space != 0) + { + /* We reached the end of the available space, but still have + characters to go in this line. We can break the line into + two parts at a space. */ + len = last_space; +- (*start_p)[len] = '\n'; ++ (*start_p)[len] = NLCH; + } + *len_p = len + 1; + } + ++#ifdef HAVE_NCURSESW ++static CH * ++utf8_to_local (char *lc_ctype, char *string) ++{ ++ mbstate_t ps; ++ size_t len; ++ char *local; ++ const char *p; ++ wchar_t *wcs = NULL; ++ char *old_ctype = NULL; ++ ++ local = pinentry_utf8_to_local (lc_ctype, string); ++ if (!local) ++ return NULL; ++ ++ old_ctype = strdup (setlocale (LC_CTYPE, NULL)); ++ setlocale (LC_CTYPE, lc_ctype? lc_ctype : ""); ++ ++ p = local; ++ memset (&ps, 0, sizeof(mbstate_t)); ++ len = mbsrtowcs (NULL, &p, strlen (string), &ps); ++ if (len == (size_t)-1) ++ { ++ free (local); ++ goto leave; ++ } ++ wcs = calloc (len + 1, sizeof(wchar_t)); ++ if (!wcs) ++ { ++ free (local); ++ goto leave; ++ } ++ ++ p = local; ++ memset (&ps, 0, sizeof(mbstate_t)); ++ mbsrtowcs (wcs, &p, len, &ps); ++ ++ leave: ++ if (old_ctype) ++ { ++ setlocale (LC_CTYPE, old_ctype); ++ free (old_ctype); ++ } ++ ++ return wcs; ++} ++#else ++static CH * ++utf8_to_local (const char *lc_ctype, const char *string) ++{ ++ return pinentry_utf8_to_local (lc_ctype, string); ++} ++#endif + + static int + dialog_create (pinentry_t pinentry, dialog_t dialog) +@@ -148,16 +225,15 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + int xpos; + int description_x = 0; + int error_x = 0; +- char *description = NULL; +- char *error = NULL; +- char *prompt = NULL; ++ CH *description = NULL; ++ CH *error = NULL; ++ CH *prompt = NULL; + + #define COPY_OUT(what) \ + do \ + if (pinentry->what) \ + { \ +- what = pinentry_utf8_to_local (pinentry->lc_ctype, \ +- pinentry->what); \ ++ what = utf8_to_local (pinentry->lc_ctype, pinentry->what); \ + if (!what) \ + { \ + err = 1; \ +@@ -214,7 +290,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + y = 1; /* Top frame. */ + if (description) + { +- char *start = description; ++ CH *start = description; + int len = 0; + + do +@@ -232,7 +308,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + { + if (error) + { +- char *p = error; ++ CH *p = error; + int err_x = 0; + + while (*p) +@@ -287,7 +363,9 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + + new_x = MIN_PINENTRY_LENGTH; + if (prompt) +- new_x += strlen (prompt) + 1; /* One space after prompt. */ ++ { ++ new_x += STRLEN (prompt) + 1; /* One space after prompt. */ ++ } + if (new_x > size_x - 4) + new_x = size_x - 4; + if (new_x > x) +@@ -335,7 +413,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + ypos++; + if (description) + { +- char *start = description; ++ CH *start = description; + int len = 0; + + do +@@ -347,9 +425,11 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + addch (' '); + collect_line (size_x - 4, &start, &len); + for (i = 0; i < len - 1; i++) +- addch ((unsigned char) start[i]); +- if (start[len - 1] && start[len - 1] != '\n') +- addch ((unsigned char) start[len - 1]); ++ { ++ ADDCH (start[i]); ++ } ++ if (start[len - 1] != NULLCH && start[len - 1] != NLCH) ++ ADDCH (start[len - 1]); + ypos++; + } + while (start[len - 1]); +@@ -363,7 +443,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + + if (error) + { +- char *p = error; ++ CH *p = error; + i = 0; + + while (*p) +@@ -378,11 +458,11 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + } + else + standout (); +- for (;*p && *p != '\n'; p++) ++ for (;*p && *p != NLCH; p++) + if (i < x - 4) + { + i++; +- addch ((unsigned char) *p); ++ ADDCH (*p); + } + if (USE_COLORS && pinentry->color_so != PINENTRY_COLOR_NONE) + { +@@ -410,14 +490,16 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) + dialog->pin_size = x - 4; + if (prompt) + { +- char *p = prompt; +- i = strlen (prompt); ++ CH *p = prompt; ++ i = STRLEN (prompt); + if (i > x - 4 - MIN_PINENTRY_LENGTH) + i = x - 4 - MIN_PINENTRY_LENGTH; + dialog->pin_x += i + 1; + dialog->pin_size -= i + 1; + while (i-- > 0) +- addch ((unsigned char) *(p++)); ++ { ++ ADDCH (*(p++)); ++ } + addch (' '); + } + for (i = 0; i < dialog->pin_size; i++) +@@ -631,6 +713,17 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type) + SCREEN *screen = 0; + int done = 0; + char *pin_utf8; ++#ifdef HAVE_NCURSESW ++ char *old_ctype = NULL; ++ ++ if (pinentry->lc_ctype) ++ { ++ old_ctype = strdup (setlocale (LC_CTYPE, NULL)); ++ setlocale (LC_CTYPE, pinentry->lc_ctype); ++ } ++ else ++ setlocale (LC_CTYPE, ""); ++#endif + + /* Open the desired terminal if necessary. */ + if (tty_name) +@@ -804,6 +897,13 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type) + if (screen) + delscreen (screen); + ++#ifdef HAVE_NCURSESW ++ if (old_ctype) ++ { ++ setlocale (LC_CTYPE, old_ctype); ++ free (old_ctype); ++ } ++#endif + if (ttyfi) + fclose (ttyfi); + if (ttyfo) +-- +1.8.3.1 + diff --git a/SOURCES/0001-Check-if-we-are-on-tty-before-initializing-curses.patch b/SOURCES/0001-Check-if-we-are-on-tty-before-initializing-curses.patch new file mode 100644 index 0000000..509b48f --- /dev/null +++ b/SOURCES/0001-Check-if-we-are-on-tty-before-initializing-curses.patch @@ -0,0 +1,39 @@ +From a3a81549ffb787410a694b6e29de6638588eaf88 Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Fri, 14 Feb 2014 12:58:38 +0100 +Subject: [PATCH] Check if we are on tty before initializing curses. + +* pinentry/pinentry-curses.c (dialog_run): Check stant stdin and stout +are connected to ttys. + +-- + +When we did not have a ttyname we just used stdin/out without checking +if it's a proper TTY or a pipe. In some cases this can cause endless +loop or escape seqeunces on the terminal. + +This commit changes behaviour so that if stdin/out is not tty and no +ttyname is specified we error-out with errno set to ENOTTY +--- + pinentry/pinentry-curses.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c +index 585059f..5482c15 100644 +--- a/pinentry/pinentry-curses.c ++++ b/pinentry/pinentry-curses.c +@@ -746,6 +746,11 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type) + { + if (!init_screen) + { ++ if (!(isatty(fileno(stdin)) && isatty(fileno(stdout)))) ++ { ++ errno = ENOTTY; ++ return -1; ++ } + init_screen = 1; + initscr (); + } +-- +2.5.0 + diff --git a/SOURCES/0001-Fix-qt4-pinentry-window-created-in-the-background.patch b/SOURCES/0001-Fix-qt4-pinentry-window-created-in-the-background.patch new file mode 100644 index 0000000..8f9faae --- /dev/null +++ b/SOURCES/0001-Fix-qt4-pinentry-window-created-in-the-background.patch @@ -0,0 +1,28 @@ +From c2ab12b3742c929a225c3753439438edc27bfa81 Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Tue, 1 Feb 2011 14:42:27 +0100 +Subject: [PATCH] Fix qt4 pinentry window created in the background + +This is probably just a workaround. Proper fix is being investigated. +See: +https://bugzilla.redhat.com/show_bug.cgi?id=589532 +http://stackoverflow.com/questions/2788518/calling-activatewindow-on-qdialog-sends-window-to-background +--- + qt4/pinentrydialog.cpp | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/qt4/pinentrydialog.cpp b/qt4/pinentrydialog.cpp +index 541baf4..d634eb6 100644 +--- a/qt4/pinentrydialog.cpp ++++ b/qt4/pinentrydialog.cpp +@@ -69,7 +69,6 @@ void raiseWindow( QWidget* w ) + SetForegroundWindow( w->winId() ); + #endif + w->raise(); +- w->activateWindow(); + } + + QPixmap icon( QStyle::StandardPixmap which ) +-- +1.7.3.5 + diff --git a/SOURCES/pinentry-0.8.1.tar.gz.sig b/SOURCES/pinentry-0.8.1.tar.gz.sig new file mode 100644 index 0000000..9cad268 Binary files /dev/null and b/SOURCES/pinentry-0.8.1.tar.gz.sig differ diff --git a/SOURCES/pinentry-wrapper b/SOURCES/pinentry-wrapper new file mode 100644 index 0000000..281bc6b --- /dev/null +++ b/SOURCES/pinentry-wrapper @@ -0,0 +1,82 @@ +#!/bin/sh + +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 Fedora Project +# Copyright (c) 2014 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 2006 +# Pavel Nemec 2006 +# Rex Dieter 2009 +# Pavol Rusnak 2009 +# Boris Ranto 2014 +# +# use proper binary (pinentry-qt4, pinentry-qt, 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-qt4 exists, use pinentry-qt4 +elif [ -n "$kde_running" -a "$kde_ver"x = 4x -a -x /usr/bin/pinentry-qt4 ] +then + export PINENTRY_BINARY="/usr/bin/pinentry-qt4" +# 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-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-qt4 exists although KDE is not detected +elif [ -n "$DISPLAY" -a -x /usr/bin/pinentry-qt4 ] +then + export PINENTRY_BINARY="/usr/bin/pinentry-qt4" +# 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 "$@" diff --git a/SPECS/pinentry.spec b/SPECS/pinentry.spec new file mode 100644 index 0000000..4da5afb --- /dev/null +++ b/SPECS/pinentry.spec @@ -0,0 +1,373 @@ + +%if 0%{?fedora} > 8 || 0%{?rhel} > 5 +%define _enable_pinentry_qt4 --enable-pinentry-qt4 +%define _enable_pinentry_qt --enable-pinentry-qt +%define qt_major 3 +%define qt3 qt3 +%else +%define qt3 qt +%define _enable_pinentry_qt --enable-pinentry-qt +%endif + +%if 0%{?fedora} && 0%{?fedora} > 12 +%define _enable_pinentry_qt4 --enable-pinentry-qt4 +%define qt_major 4 +%undefine _enable_pinentry_qt +%endif + +Name: pinentry +Version: 0.8.1 +Release: 17%{?dist} +Summary: Collection of simple PIN or passphrase entry dialogs + +Group: Applications/System +# qt & qt4 subpackage have different license, see subpackage definitions +License: GPLv2+ +URL: http://www.gnupg.org/aegypten/ +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) + +# borrowed from opensuse +Source10: pinentry-wrapper + +## Patches not yet in SVN +Patch53: 0001-Fix-qt4-pinentry-window-created-in-the-background.patch + +## Backported patches +Patch200: 0001-Add-wide-char-support-to-pinentry-curses.patch +Patch201: 0001-Check-if-we-are-on-tty-before-initializing-curses.patch + +BuildRequires: gettext-devel +BuildRequires: autoconf, automake +BuildRequires: gtk2-devel +BuildRequires: libcap-devel +BuildRequires: ncurses-devel +%if 0%{?_enable_pinentry_qt:1} +BuildRequires: %{qt3}-devel +%endif +%if 0%{?_enable_pinentry_qt4:1} +BuildRequires: qt4-devel +%endif + +Requires(pre): %{_sbindir}/update-alternatives +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +Provides: %{name}-curses = %{version}-%{release} + +%description +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 curses (text) based version of the PIN entry dialog. + +%package gtk +Summary: Passphrase/PIN entry dialog based on GTK+ +Group: Applications/System +Requires: %{name} = %{version}-%{release} +Provides: %{name}-gui = %{version}-%{release} +%description gtk +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. + +%package qt +Summary: Passphrase/PIN entry dialog based on Qt%{?qt_major} +Group: Applications/System +# Original license for secq* files doesn't allow higher GPL versions to be used +License: GPLv2 +Requires: %{name} = %{version}-%{release} +Provides: %{name}-gui = %{version}-%{release} +%if ! 0%{?_enable_pinentry_qt:1} +Obsoletes: %{name}-qt4 < 0.8.0-2 +Provides: %{name}-qt4 = %{version}-%{release} +%endif +%description qt +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 Qt%{?qt_major} GUI based version of the PIN entry dialog. + +%package qt4 +Summary: Passphrase/PIN entry dialog based on Qt4 +Group: Applications/System +# original code for secstring.cpp doesn't allow GPL versions higher than 3 to be +# used +License: GPLv2 or GPLv3 +Requires: %{name} = %{version}-%{release} +Provides: %{name}-gui = %{version}-%{release} +%description qt4 +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 Qt4 GUI based version of the PIN entry dialog. +Support for Qt4 is new, and a bit experimental. + + +%prep +%setup -q + +%patch53 -p1 -b .rhbug_589532 +%patch200 -p1 +%patch201 -p1 + +# patch200 changes configure.ac so we need to regenerate +./autogen.sh + +# 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 \ + --without-libcap \ + %{?_enable_pinentry_qt} %{!?_enable_pinentry_qt:--disable-pinentry-qt} \ + %{?_enable_pinentry_qt4} %{!?_enable_pinentry_qt4:--disable-pinentry-qt4} + +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT + +make install DESTDIR=$RPM_BUILD_ROOT + +# Backwards compatibility +ln -s pinentry-gtk-2 $RPM_BUILD_ROOT%{_bindir}/pinentry-gtk +%if ! 0%{?_enable_pinentry_qt:1} +ln -s pinentry-qt4 $RPM_BUILD_ROOT%{_bindir}/pinentry-qt +%endif + +install -p -m755 -D %{SOURCE10} $RPM_BUILD_ROOT%{_bindir}/pinentry + +# unpackaged files +rm -f $RPM_BUILD_ROOT%{_infodir}/dir + + +%clean +rm -rf $RPM_BUILD_ROOT + + +# alternatives dropped at 0.7.6-3 (use %%trigger instead?) +%pre +%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-curses ||: +%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-gtk ||: +%{_sbindir}/update-alternatives --remove pinentry %{_bindir}/pinentry-qt ||: + +%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 +%defattr(-,root,root,-) +%doc AUTHORS ChangeLog COPYING NEWS README THANKS TODO +%{_bindir}/pinentry-curses +%{_bindir}/pinentry +%{_infodir}/pinentry.info* + +%files gtk +%defattr(-,root,root,-) +%{_bindir}/pinentry-gtk +%{_bindir}/pinentry-gtk-2 + +%files qt +%defattr(-,root,root,-) +%{_bindir}/pinentry-qt +%if ! 0%{?_enable_pinentry_qt:1} +%{_bindir}/pinentry-qt4 +%else + +%if 0%{?_enable_pinentry_qt4:1} +%files qt4 +%defattr(-,root,root,-) +%{_bindir}/pinentry-qt4 +%endif +%endif + + +%changelog +* Thu Mar 17 2016 Boris Ranto - 0.8.1-17 +- actually apply the previous patch in the spec file +- resolves: rhbz#1058972 + +* Fri Feb 19 2016 Boris Ranto - 0.8.1-16 +- curses: detect non-tty environment and exit gracefully +- resolves: rhbz#1058972 + +* Fri Feb 19 2016 Boris Ranto - 0.8.1-15 +- rewrite the pinentry-wrapper shell script to better handle corner cases +- resolves: rhbz#1231229 + +* Thu Jan 30 2014 Stanislav Ochotnicky - 0.8.1-14 +- Add wide-char support to pinentry-curses +- Resolves: rhbz#1059729 + +* Fri Jan 24 2014 Daniel Mach - 0.8.1-13 +- Mass rebuild 2014-01-24 + +* Wed Jan 15 2014 Stanislav Ochotnicky - 0.8.1-12 +- Provide final fallback to pinetry-curses +- Resolves: #rhbz1002599 + +* Fri Dec 27 2013 Daniel Mach - 0.8.1-11 +- Mass rebuild 2013-12-27 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.8.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Nov 14 2012 Stanislav Ochotnicky - 0.8.1-9 +- Fix macros expansions so that conditionals work + +* Mon Nov 12 2012 Stanislav Ochotnicky - 0.8.1-8 +- Fix up licenses for qt and qt4 subpackages (#875875) + +* Sat Jul 21 2012 Fedora Release Engineering - 0.8.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 0.8.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Nov 14 2011 Adam Jackson 0.8.1-5 +- Rebuild for new libpng + +* Tue Jul 26 2011 Stanislav Ochotnicky - 0.8.1-4 +- Improve wrapper to fallback to curses even with DISPLAY set (#622077) + +* Fri Feb 18 2011 Stanislav Ochotnicky - 0.8.1-3 +- Fix pinentry-curses running as root by disabling capabilities (#677670) + +* Wed Feb 09 2011 Fedora Release Engineering - 0.8.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Feb 1 2011 Stanislav Ochotnicky - 0.8.1-1 +- Updated to latest upstream version (0.8.1) + +* Fri May 7 2010 Stanislav Ochotnicky - 0.8.0-3 +- Fix X11 even race with gtk (#589998) +- Fix qt4 problems with creating window in the background (#589532) + +* Thu Apr 29 2010 Rex Dieter - 0.8.0-2 +- -qt: build as qt4 version, and drop qt3 support (f13+ only) + +* Tue Apr 27 2010 Stanislav Ochotnicky - 0.8.0-1 +- pinentry-0.8.0 +- pinentry-gtk keyboard grab fail results in SIGABRT (#585422) + +* Sun Apr 18 2010 Rex Dieter - 0.7.6-5 +- pinentry-gtk -g segfaults on focus change (#520236) + +* Sun Sep 13 2009 Rex Dieter - 0.7.6-4 +- Errors installing with --excludedocs (#515925) + +* Sun Sep 13 2009 Rex Dieter - 0.7.6-3 +- drop alternatives, use app-wrapper instead (borrowed from opensuse) +- -qt4 experimental subpkg, -qt includes qt3 version again (#523488) + +* Sun Jul 26 2009 Fedora Release Engineering - 0.7.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Jun 22 2009 Rex Dieter - 0.7.6-1 +- pinentry-0.7.6 +- -qt switched qt4 version, where applicable (f9+, rhel6+) +- fixup scriptlets + +* Sat Apr 25 2009 Rex Dieter - 0.7.5-1 +- pinentry-0.7.5 + +* Thu Feb 26 2009 Fedora Release Engineering - 0.7.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Mar 25 2008 Rex Dieter - 0.7.4-5 +- pinentry failed massrebuild attempt for GCC 4.3 (#434400) + +* Tue Mar 25 2008 Rex Dieter - 0.7.4-4 +- s/qt-devel/qt3-devel/ (f9+) + +* Tue Feb 19 2008 Fedora Release Engineering - 0.7.4-3 +- Autorebuild for GCC 4.3 + +* Sun Feb 17 2008 Adam Tkac - 0.7.4-2 +- rebuild against new libcap + +* Sun Dec 09 2007 Rex Dieter - 0.7.4-1 +- pinentry-0.7.4 +- BR: libcap-devel + +* Sat Aug 25 2007 Rex Dieter - 0.7.3-2 +- respin (BuildID) + +* Sat Aug 11 2007 Rex Dieter - 0.7.3-1 +- pinentry-0.7.3 +- License: GPLv2+ + +* Thu May 10 2007 Rex Dieter - 0.7.2-15 +- respin (for ppc64) + +* Mon Dec 04 2006 Rex Dieter - 0.7.2-14 +- -14 respin (to help retire ATrpms pinentry pkg) + +* Mon Aug 28 2006 Rex Dieter - 0.7.2-3 +- fc6 respin + +* Wed Aug 09 2006 Rex Dieter - 0.7.2-2 +- fc6 respin + +* Wed Mar 01 2006 Rex Dieter +- fc5: gcc/glibc respin + +* Tue Oct 18 2005 Ville Skyttä - 0.7.2-1 +- 0.7.2, docs patch applied upstream. +- Switch to GTK2 in -gtk. +- Fine tune dependencies. +- Build with dependency tracking disabled. +- Clean up obsolete pre-FC2 support. + +* Thu Apr 7 2005 Michael Schwendt - 0.7.1-4 +- rebuilt + +* Wed Jun 30 2004 Ville Skyttä - 0:0.7.1-0.fdr.3 +- BuildRequires qt-devel >= 3.2. + +* Sat May 22 2004 Ville Skyttä - 0:0.7.1-0.fdr.2 +- Spec cleanups. + +* Sat Apr 24 2004 Ville Skyttä - 0:0.7.1-0.fdr.1 +- Update to 0.7.1. + +* Fri Dec 26 2003 Ville Skyttä - 0:0.7.0-0.fdr.1 +- Update to 0.7.0. +- Split GTK+ and QT dialogs into subpackages. + +* Thu Jul 10 2003 Ville Skyttä - 0:0.6.9-0.fdr.1 +- Update to 0.6.9. +- Smoother experience with --excludedocs. +- Don't change alternative priorities on upgrade. + +* Sat Mar 22 2003 Ville Skyttä - 0:0.6.8-0.fdr.1 +- Update to current Fedora guidelines. + +* Wed Feb 12 2003 Warren Togami 0.6.8-1.fedora.3 +- info/dir temporary workaround + +* Sat Feb 8 2003 Ville Skyttä - 0.6.8-1.fedora.1 +- First Fedora release.