aboutsummaryrefslogtreecommitdiff
blob: 4cd8706e463b3bc982761fb4e4439a8bd30f2964 (plain)
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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

MYP="${P^}"

inherit desktop qmake-utils toolchain-funcs xdg

DESCRIPTION="Tomb :: File Encryption on GNU/Linux"
HOMEPAGE="
	https://www.dyne.org/software/tomb
	https://github.com/dyne/Tomb
"
SRC_URI="https://files.dyne.org/tomb/releases/Tomb-${PV}.tar.gz"
S="${WORKDIR}/${MYP}"
LICENSE="
	GPL-3
	gui? ( GPL-3+ )
"
SLOT="0"
KEYWORDS="~amd64"
IUSE="gui test tray"

#test require sudo, can't be done non interactively
RESTRICT="test"
PATCHES=(
	"${FILESDIR}/${P}-gtomb.patch"
	"${FILESDIR}/${P}-respect-ldflags.patch"
)
DOCS=(
	AUTHORS.txt
	ChangeLog.txt
	KNOWN_BUGS.txt
	README.txt
	doc/bertini_thesis.pdf
	doc/HACKING.txt
	doc/KEY_SPECIFICATIONS.txt
	doc/LinuxHDEncSettings.txt
	doc/Luks_on_disk_format.pdf
	doc/New_methods_in_HD_encryption.pdf
	doc/TKS1-draft.pdf
	doc/tomb_manpage.pdf
)

CDEPEND="
	dev-libs/libgcrypt
	tray? (
		dev-qt/qtcore:5
		dev-qt/qtgui:5
		dev-qt/qtwidgets:5
	)
"
RDEPEND="
	${CDEPEND}
	app-admin/sudo
	app-crypt/gnupg
	app-crypt/pinentry
	app-shells/zsh
	sys-fs/cryptsetup
	gui? ( gnome-extra/zenity )
"
DEPEND="${CDEPEND}"
BDEPEND="
	dev-python/markdown
	dev-python/pygments
	sys-devel/gettext
"

src_compile() {
	export CC=$(tc-getCC)
	export PREFIX="${EPREFIX}/usr"
	emake

	pushd extras/kdf-keys || die
	emake all
	popd || die

	if use tray ; then
		pushd extras/qt-tray || die
		eqmake5
		emake all
		popd || die
	fi

	#translations
	pushd extras/translations || die
	emake all
	popd || die

	#documentation
	cd doc/literate || die
	emake
}

src_install() {
	default

	#translations
	export PREFIX="${ED}/usr"
	pushd extras/translations || die
	emake install
	popd || die

	#zenity gui
	if use gui ; then
		pushd extras/gtomb || die
		dobin gtomb
		newdoc README.md README-gtomb
		popd || die
	fi

	#qt tray
	if use tray ; then
		pushd extras/qt-tray || die
		dobin tomb-qt-tray
		doicon pixmaps/tomb_icon.png
		insinto /usr/share
		doins -r i18n
		popd || die
	fi

	#kdf programs
	pushd extras/kdf-keys || die
	emake install
	popd || die

	#is there an eclass for this?
	#pixmap
	pushd extras/gtk-tray
	doicon monmort.xpm
	newicon --context mimetypes --size 32 monmort.xpm monmort
	newicon --size 32 monmort.xpm dyne-monmort
	popd
	pushd extras/desktop
	#copied from install.zsh
	#mime types
	insinto /usr/share/mime/packages
	doins dyne-tomb.xml
	#desktop
	domenu tomb.desktop
	#menu
	insinto /etc/menu
	doins tomb
	#mime info
	insinto /usr/share/mime-info
	doins tomb.mime
	doins tomb.keys
	insinto /usr/lib/mime/packages
	newins tomb.mimepkg tomb
	#application entry
	insinto /usr/share/application-registry
	doins tomb.applications
	popd

	#documentation
	einstalldocs
	cd doc/literate || die
	insinto "/usr/share/doc/${PF}/html"
	doins -r *.html *.css public
}

src_test() {
	emake test

	pushd extras/kdf-keys || die
	emake test
}