-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
264 lines (207 loc) · 10.2 KB
/
Portfile
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
name john
categories sysutils security
maintainers {@catap korins.ky:kirill} openmaintainer
homepage https://www.openwall.com/john/
patchfiles patch-src-params.h.diff
post-patch {
reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/params.h
}
if {${subport} eq "john"} {
version 1.9.0
revision 2
# john is quite old and doesn't support arm64, but jumbo is different story
supported_archs i386 ppc ppc64 x86_64
license {GPL-2+ OpenSSLException}
description Featureful Unix password cracker
long_description John the Ripper is a UNIX password cracker, currently available for \
UNIX (tested with Linux x86, FreeBSD x86, Solaris 2.x SPARC, OSF/1 \
Alpha), DOS, WinNT/Win95.
master_sites https://www.openwall.com/john/k/
use_xz yes
checksums rmd160 16114db2fe5004ce4044a2d56b46ef209b941dc4 \
sha256 0b266adcfef8c11eed690187e71494baea539efbd632fe221181063ba09508df \
size 8944932
conflicts john-jumbo john-jumbo-devel
use_configure no
use_parallel_build no
build.dir ${worksrcpath}/src
build.args CC=${configure.cc}
build.target clean
switch ${configure.build_arch} {
i386 {
build.target-append macosx-x86-sse2
}
x86_64 {
# x86_64 is only supported on Leopard and up
if {${os.major} >= 9} {
build.target-append macosx-x86-64
} else {
configure.build_arch i386
build.target-append macosx-x86-sse2
}
}
ppc {
# Use altivec if available
if {![catch {sysctl hw.vectorunit} result] && $result == 1} {
build.target-append macosx-ppc32-altivec
} else {
build.target-append macosx-ppc32
}
}
ppc64 {
build.target-append macosx-ppc64
}
default {
build.target-append unknown-arch
}
}
}
subport john-jumbo {
version 1.9.0
revision 3
set jumbo_patchlvl 1
master_sites https://www.openwall.com/john/k/
distname ${name}-${version}-jumbo-${jumbo_patchlvl}
use_xz yes
checksums rmd160 ea75c464d211691f00db7aec66e0503c1177866b \
sha256 f5d123f82983c53d8cc598e174394b074be7a77756f5fb5ed8515918c81e7f3b \
size 33638768
conflicts john john-jumbo-devel
patchfiles-append patch-apple-m1.diff
}
subport john-jumbo-devel {
PortGroup github 1.0
github.setup openwall john c798c3f39215f6e08c67677eb9b79f65cfe08e40
version 20230717
revision 0
checksums rmd160 8bbee5e154eece0e05185342cca4fc852275a198 \
sha256 f45971f2d5d34b6c37bf76ea83b697226ffb00c0c9d5c8e7dde54e12a9a46e75 \
size 56766799
conflicts john john-jumbo
}
if {${subport} in [list "john-jumbo" "john-jumbo-devel"]} {
PortGroup openssl 1.0
description This is the community-enhanced, "jumbo" version of John the Ripper.
long_description {*}${description}
license GPL-2 GPL-3+ Apache-2 Restrictive
depends_lib-append port:bzip2 \
port:gmp \
port:libpcap \
port:zlib
set perl_version 5.34
set ruby_branch 3.1
set ruby_version [string map {. {}} ${ruby_branch}]
# NOTE: not all scripts were migrated to python3
# See:
# - https://github.com/openwall/john/issues/4883
# - https://github.com/openwall/john/pull/5309
set python2_branch 2.7
set python3_branch 3.11
set python2_version [string map {. {}} ${python2_branch}]
set python3_version [string map {. {}} ${python3_branch}]
depends_run-append port:p${perl_version}-compress-raw-lzma \
port:p${perl_version}-digest-md4 \
port:p${perl_version}-net-radius \
port:p${perl_version}-netpacket \
port:p${perl_version}-data-plist \
port:perl${perl_version} \
port:py${python2_version}-asn1 \
port:py${python2_version}-plyvel \
port:py${python2_version}-pysap \
port:py${python3_version}-asn1crypto \
port:py${python3_version}-bsddb3 \
port:py${python3_version}-ldap3 \
port:py${python3_version}-parsimonious \
port:py${python3_version}-protobuf3 \
port:python${python2_version} \
port:python${python3_version} \
port:ruby${ruby_version}
if {${subport} eq "john-jumbo"} {
depends_run-append port:py${python2_version}-lxml \
port:py${python2_version}-pycryptodome \
port:py${python2_version}-scapy
}
if {${subport} eq "john-jumbo-devel"} {
depends_run-append port:py${python3_version}-asn1 \
port:py${python3_version}-cbor2 \
port:py${python3_version}-lxml \
port:py${python3_version}-pycryptodome \
port:py${python3_version}-scapy
}
configure.dir ${worksrcpath}/src
# error We need minimum OpenCL 1.2 to build with OpenCL support.
if {${os.platform} eq "darwin" && ${os.major} <= 11} {
configure.args-append --disable-opencl
}
build.dir ${worksrcpath}/src
variant native description {Enable CPU-specific optimizations} {
configure.args-append --enable-native-march
}
variant experimental description {Enable new, experimental or even incomplete features} {
configure.args-append --enable-experimental-code
}
variant threads description {Enable multithreaded support via OpenMP} {
compiler.openmp_version 3.0
depends_lib-append port:libomp
}
# libomp aren't available on PowerPC
if {${build_arch} ni [list ppc ppc64]} {
default_variants-append +threads
}
if {![variant_isset native]} {
notes "\
This version is built based on a base architecture for convenience,\
which may not be optimized for your system. To build a version\
customized for your machine, use the +native variant"
}
post-destroot {
# pse2john.py depends on pysap which is python2 only
reinplace -W ${destroot}${prefix}/share/john \
-locale C -E -q "1s|^#! ?/usr/bin/(env )?python|#!${prefix}/bin/python${python2_branch}|" \
pse2john.py
if {${subport} eq "john-jumbo"} {
reinplace -W ${destroot}${prefix}/share/john \
-locale C -E -q "1s|^#! ?/usr/bin/(env )?python|#!${prefix}/bin/python${python2_branch}|" \
DPAPImk2john.py \
aix2john.py \
ibmiscanner2john.py \
keyring2john.py \
kirbi2john.py \
pcap2john.py \
ps_token2john.py
system -W ${destroot}${prefix}/share/john "chmod +x diskcryptor2john.py"
}
if {${subport} eq "john-jumbo-devel"} {
system -W ${destroot}${prefix}/share/john "chmod +x bestcryptve2john.py coinomi2john.py"
}
reinplace -locale C -E -q "1s|^#! ?/usr/bin/(env )?python2|#!${prefix}/bin/python${python2_branch}|" \
{*}[glob ${destroot}${prefix}/share/john/*.py]
reinplace -locale C -E -q "1s|^#! ?/usr/bin/(env )?python3?|#!${prefix}/bin/python${python3_branch}|" \
{*}[glob ${destroot}${prefix}/share/john/*.py]
reinplace -locale C -E -q "1s|^#! ?/usr/bin/(env )?perl|#!${prefix}/bin/perl${perl_version}|" \
{*}[glob -directory ${destroot}${prefix}/share/john *.pl benchmark-unify relbench]
reinplace -locale C -E -q "1s|^#! ?/usr/bin/(env )?ruby|#!${prefix}/bin/ruby${ruby_branch}|" \
{*}[glob ${destroot}${prefix}/share/john/*.rb]
xinstall -d ${destroot}${prefix}/etc/bash_completion.d
move ${destroot}${prefix}/share/john/john.bash_completion \
${destroot}${prefix}/etc/bash_completion.d
xinstall -d ${destroot}${prefix}/share/zsh/site-functions
move ${destroot}${prefix}/share/john/john.zsh_completion \
${destroot}${prefix}/share/zsh/site-functions
}
}
destroot {
file copy ${worksrcpath}/run ${destroot}${prefix}/share/john
system "chmod -R a+rX ${destroot}${prefix}/share/john"
system "ln -s ${prefix}/share/john/john ${destroot}${prefix}/bin/john"
xinstall -d ${destroot}${prefix}/share/doc
file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/john
system "chmod -R a+rX ${destroot}${prefix}/share/doc/john"
}
notes-append "You'll find the john files under ${prefix}/share/john/"
if {${subport} in [list "john" "john-jumbo"]} {
livecheck.type regex
livecheck.regex /${name}-(\[0-9.\]+)${extract.suffix}
}