aboutsummaryrefslogtreecommitdiff
path: root/security/pinentry/Makefile
blob: 87217f55c00cdfdfa13cf0d902a35e3b02ead356 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
PORTNAME=	pinentry
PORTVERSION=	1.3.0
PORTREVISION?=	0
CATEGORIES=	security
MASTER_SITES=	GNUPG/pinentry

PATCH_SITES=	https://github.com/gpg/pinentry/commit/
PATCHFILES+=	844360c9c99d2f11dc4236c0ab6bdb9b56758898.patch:-p1

MAINTAINER=	jhale@FreeBSD.org
COMMENT?=	Collection of simple PIN or passphrase entry dialogs
WWW=		https://www.gnupg.org/aegypten2

LICENSE=	GPLv2+
LICENSE_FILE=	${WRKSRC}/COPYING

USES=		tar:bzip2

.if !defined(PINENTRY_GUI)
INFO=		pinentry
NO_ARCH=	yes
NO_BUILD=	yes
PLIST_FILES=	bin/pinentry

OPTIONS_SINGLE=	FRONTEND
OPTIONS_SINGLE_FRONTEND=	EFL FLTK GNOME GTK2 NCURSES QT5 QT6 TTY
OPTIONS_DEFAULT=	NCURSES

FRONTEND_DESC=	Default frontend

TTY_DESC=	Console version
PINENTRY_TTY=	pinentry-tty
TTY_RUN_DEPENDS=	${PINENTRY_TTY}:security/pinentry-tty

NCURSES_DESC=	Curses frontend
PINENTRY_NCURSES=	pinentry-curses
NCURSES_RUN_DEPENDS=	${PINENTRY_NCURSES}:security/pinentry-curses

EFL_DESC=	EFL frontend
PINENTRY_EFL=	pinentry-efl
# Due to a dependency loop that exists between security/pinentry-efl,
# devel/elf, graphics/poppler, security/gpgme-cpp, security/gpgme,
# security/gnupg and security/pinentry, the user must install
# pinentry-efl manually. See pkg-message.dep-loop for more details.
#EFL_RUN_DEPENDS=	${PINENTRY_EFL}:security/pinentry-efl
EFL_SUB_FILES=	pkg-message.dep-loop
EFL_SUB_LIST=	PKGNAME="pinentry-efl"
EFL_VARS=	PKGMESSAGE+=${WRKDIR}/pkg-message.dep-loop

FLTK_DESC=	FLTK frontend
PINENTRY_FLTK=	pinentry-fltk
FLTK_RUN_DEPENDS=	${PINENTRY_FLTK}:security/pinentry-fltk

GTK2_DESC=	Gtk+ 2 frontend
PINENTRY_GTK2=	pinentry-gtk-2
GTK2_RUN_DEPENDS=	${PINENTRY_GTK2}:security/pinentry-gtk2

QT5_DESC=	Qt 5 frontend
PINENTRY_QT5=	pinentry-qt5
QT5_RUN_DEPENDS=	${PINENTRY_QT5}:security/pinentry-qt5

QT6_DESC=	Qt 6 frontend
PINENTRY_QT6=	pinentry-qt
QT6_RUN_DEPENDS=	${PINENTRY_QT6}:security/pinentry-qt6

GNOME_DESC=	GNOME frontend
PINENTRY_GNOME=	pinentry-gnome3
# Due to a dependency loop that exists between security/pinentry-gnome,
# security/gcr, security/gnupg and security/pinentry, the user must install
# pinentry-gnome manually. See pkg-message.dep-loop for more details.
#GNOME_RUN_DEPENDS=	${PINENTRY_GNOME}:security/pinentry-gnome
GNOME_SUB_FILES=pkg-message.dep-loop
GNOME_SUB_LIST=	PKGNAME="pinentry-gnome"
GNOME_VARS=	PKGMESSAGE+=${WRKDIR}/pkg-message.dep-loop

.include <bsd.port.options.mk>

.for gui in ${OPTIONS_SINGLE_FRONTEND}
. if ${PORT_OPTIONS:M${gui}}
PINENTRY_BIN=	${PINENTRY_${gui}}
. endif
.endfor

do-install:
	${LN} -sf ${PINENTRY_BIN} ${STAGEDIR}${PREFIX}/bin/pinentry
	${INSTALL_DATA} ${WRKSRC}/doc/pinentry.info ${STAGEDIR}${PREFIX}/${INFO_PATH}

.else # !defined(PINENTRY_GUI)
PKGNAMESUFFIX=	-${PINENTRY_GUI}
LIB_DEPENDS=	libassuan.so:security/libassuan \
		libgpg-error.so:security/libgpg-error

USES+=		gmake iconv localbase ncurses pkgconfig
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--disable-pinentry-emacs
LDFLAGS+=	-Wl,--as-needed

OPTIONS_DEFINE=	LIBSECRET

LIBSECRET_DESC=	Saving the passphrase with libsecret
LIBSECRET_CONFIGURE_ENABLE=	libsecret
LIBSECRET_LIB_DEPENDS=	libsecret-1.so:security/libsecret
LIBSECRET_USES=		gnome
LIBSECRET_USE=		GNOME=glib20

.if ${PINENTRY_GUI} == "gnome"
OPTIONS_SLAVE=	LIBSECRET
LIB_DEPENDS+=	libgcr-base-3.so:security/gcr
PLIST_FILES=	bin/pinentry-gnome3
.else
CONFIGURE_ARGS+=--disable-pinentry-gnome3
.endif

.if ${PINENTRY_GUI} == "qt5"
USES+=		compiler:c++11-lang kde:5 qt:5 xorg
USE_KDE=	wayland
USE_QT=		core gui widgets x11extras buildtools:build
USE_XORG=	x11
PLIST_FILES=	bin/pinentry-qt5 \
		share/applications/org.gnupg.pinentry-qt5.desktop
CONFIGURE_ARGS+=--enable-pinentry-qt5
.else
CONFIGURE_ARGS+=--disable-pinentry-qt5
.endif

.if ${PINENTRY_GUI} == "qt6"
USES+=		compiler:c++17-lang kde:6 qt:6
USE_KDE=	guiaddons windowsystem
USE_QT=		base
PLIST_FILES=	bin/pinentry-qt \
		share/applications/org.gnupg.pinentry-qt.desktop
CONFIGURE_ARGS+=--enable-pinentry-qt
.else
CONFIGURE_ARGS+=--disable-pinentry-qt
.endif

.if ${PINENTRY_GUI} == "gtk2"
USES+=		gnome
USE_GNOME+=	gtk20
PLIST_FILES=	bin/pinentry-gtk-2
.else
CONFIGURE_ARGS+=--disable-pinentry-gtk2
.endif

.if ${PINENTRY_GUI} == "efl"
LIB_DEPENDS+=	libefl.so:devel/efl
PLIST_FILES=	bin/pinentry-efl
.else
CONFIGURE_ARGS+=--disable-pinentry-efl
.endif

.if ${PINENTRY_GUI} == "fltk"
USES+=		compiler:c++11-lib
LIB_DEPENDS+=	libfltk.so:x11-toolkits/fltk
PLIST_FILES=	bin/pinentry-fltk
.else
CONFIGURE_ARGS+=--disable-pinentry-fltk
.endif

.if ${PINENTRY_GUI} == "curses"
PLIST_FILES=	bin/pinentry-curses
.else
CONFIGURE_ARGS+=--disable-pinentry-curses
.endif

.if ${PINENTRY_GUI} == "tty"
PLIST_FILES=	bin/pinentry-tty
CONFIGURE_ARGS+=--enable-pinentry-tty
.else
CONFIGURE_ARGS+=--disable-pinentry-tty
.endif

post-install:
	${RM} ${STAGEDIR}${PREFIX}/bin/pinentry \
		${STAGEDIR}${PREFIX}/share/info/pinentry.info

.endif # !defined(PINENTRY_GUI)

.include <bsd.port.mk>