kde-plasma: Add KDE Plasma 5.18.3
[gentoo.git] / kde-plasma / ksshaskpass / ksshaskpass-5.17.5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 KFMIN=5.64.0
7 PVCUT=$(ver_cut 1-3)
8 QTMIN=5.12.3
9 inherit ecm kde.org
10
11 DESCRIPTION="KDE implementation of ssh-askpass with Kwallet integration"
12 HOMEPAGE="https://cgit.kde.org/ksshaskpass.git"
13
14 LICENSE="GPL-2" # TODO: CHECK
15 SLOT="5"
16 KEYWORDS="amd64 ~arm arm64 ~ppc64 x86"
17 IUSE=""
18
19 DEPEND="
20         >=dev-qt/qtwidgets-${QTMIN}:5
21         >=kde-frameworks/kcoreaddons-${KFMIN}:5
22         >=kde-frameworks/ki18n-${KFMIN}:5
23         >=kde-frameworks/kwallet-${KFMIN}:5
24         >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
25 "
26 RDEPEND="${DEPEND}"
27
28 pkg_setup() {
29         ecm_pkg_setup
30
31         local srcfile=/etc/plasma/startup/05-ksshaskpass.sh
32         local newfile=/etc/xdg/plasma-workspace/env/05-ksshaskpass.sh
33         if [[ -f "${EROOT}"${srcfile} ]]; then
34                 local md5=$(md5sum "${EROOT}"${srcfile})
35                 if [[ ${md5%% *} != 615ae8f5b0090ff7f51d0edee7885d55 ]]; then
36                         elog "Existing modified "${EPREFIX}"${srcfile} detected."
37                         elog "Copying to "${EPREFIX}"${newfile}..."
38                         cp -v "${EROOT}"${srcfile} "${T}"/ || die
39                 fi
40         fi
41 }
42
43 src_prepare() {
44         ecm_src_prepare
45         if [[ ! -f "${T}"/05-ksshaskpass.sh ]]; then
46                 cp "${FILESDIR}"/05-ksshaskpass.sh "${T}"/ || die
47         fi
48 }
49
50 src_install() {
51         ecm_src_install
52
53         insinto /etc/xdg/plasma-workspace/env/
54         doins "${FILESDIR}/05-ksshaskpass.sh"
55 }
56
57 pkg_postinst() {
58         ecm_pkg_postinst
59
60         elog "In order to have ssh-agent start with Plasma 5,"
61         elog "edit /etc/xdg/plasma-workspace/env/10-agent-startup.sh"
62         elog "and uncomment the lines enabling ssh-agent."
63         elog
64         elog "If you do so, do not forget to uncomment the respective"
65         elog "lines in /etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh"
66         elog "to properly kill the agent when the session ends."
67         elog
68         elog "${PN} has been installed as your default askpass application"
69         elog "for Plasma 5 sessions."
70         elog "If that's not desired, select the one you want to use in"
71         elog "/etc/xdg/plasma-workspace/env/05-ksshaskpass.sh"
72
73         # Clean up pre-5.17.4 script
74         if [[ -e "${EROOT}"/etc/plasma/startup/05-ksshaskpass.sh ]]; then
75                 rm "${EROOT}"/etc/plasma/startup/05-ksshaskpass.sh || die
76                 elog "Removed obsolete ${EPREFIX}/etc/plasma/startup/05-ksshaskpass.sh"
77         fi
78 }