Skip to content

Commit 8537011

Browse files
chore: create a snap package for i386
Signed-off-by: Claudio André <[email protected]>
1 parent dee09ff commit 8537011

File tree

3 files changed

+34
-21
lines changed

3 files changed

+34
-21
lines changed

.github/actions/spelling/expect.txt

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ google
115115
GOST
116116
gpg
117117
GPUs
118+
gui
118119
hashicorp
119120
hccap
120121
hicolor
@@ -238,6 +239,7 @@ sonarsource
238239
sonoma
239240
squashfs
240241
ssd
242+
sse
241243
SSSE
242244
stdlib
243245
strderr

deploy/snap/build.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,18 @@ fi
7070
echo ""
7171
echo "---------------------------- BUILDING -----------------------------"
7272

73-
if [[ "$arch" == "x86_64" ]]; then
73+
if [[ "$arch" == "i686" ]]; then
74+
# CPU (OMP and extensions fallback)
75+
do_configure "$X86_NO_OPENMP" --enable-simd=sse2 CPPFLAGS="-D_SNAP -D_BOXED" && do_build ../run/john-sse2
76+
do_configure "$X86_REGULAR" --enable-simd=sse2 CPPFLAGS="-D_SNAP -D_BOXED -DOMP_FALLBACK -DOMP_FALLBACK_BINARY=\"\\\"john-sse2\\\"\"" && do_build ../run/john-sse2-omp
77+
do_configure "$X86_NO_OPENMP" --enable-simd=avx CPPFLAGS="-D_SNAP -D_BOXED" && do_build ../run/john-avx
78+
do_configure "$X86_REGULAR" --enable-simd=avx CPPFLAGS="-D_SNAP -D_BOXED -DOMP_FALLBACK -DOMP_FALLBACK_BINARY=\"\\\"john-avx\\\"\" -DCPU_FALLBACK -DCPU_FALLBACK_BINARY=\"\\\"john-sse2-omp\\\"\"" && do_build ../run/john-avx-omp
79+
do_configure "$X86_NO_OPENMP" --enable-simd=avx2 CPPFLAGS="-D_SNAP -D_BOXED" && do_build ../run/john-avx2
80+
do_configure "$X86_REGULAR" --enable-simd=avx2 CPPFLAGS="-D_SNAP -D_BOXED -DOMP_FALLBACK -DOMP_FALLBACK_BINARY=\"\\\"john-avx2\\\"\" -DCPU_FALLBACK -DCPU_FALLBACK_BINARY=\"\\\"john-avx-omp\\\"\"" && do_build ../run/john-avx2-omp
81+
BINARY="john-avx2-omp"
82+
OPENCL_SUPPORT="Yes"
83+
84+
elif [[ "$arch" == "x86_64" ]]; then
7485
# x86_64 CPU (OMP and SIMD fallback)
7586
do_configure "$X86_NO_OPENMP" --enable-simd=avx CPPFLAGS="-D_SNAP -D_BOXED" && do_build ../run/john-avx
7687
do_configure "$X86_REGULAR" --enable-simd=avx CPPFLAGS="-D_SNAP -D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx\\\"\"" && do_build ../run/john-avx-omp

deploy/snap/snapcraft.yaml

+20-20
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
# More info at https://github.com/openwall/john-packages
2222
---
2323
name: john-the-ripper
24-
version: bleeding
24+
version: v2.0.0
2525

26-
base: core24
26+
base: core18
2727
confinement: strict
2828
grade: stable #TODO: [stable or devel] edit before release (BLEEDING_RELEASE)
2929

30-
assumes: [snapd2.65]
31-
adopt-info: john-the-ripper
30+
assumes: [snapd2.41]
3231

3332
license: GPL-2.0
3433
title: John the Ripper CE Auditing Tool
@@ -100,13 +99,19 @@ parts:
10099

101100
override-build: |
102101
cp "$SNAPCRAFT_STAGE"/build.sh .
102+
cp "$SNAPCRAFT_STAGE"/com.openwall.John.png ./icon.png
103+
cp "$SNAPCRAFT_STAGE"/com.openwall.John.png ./com.openwall.John.png
103104
./build.sh
104105
105-
craftctl set version="$(cat version.txt)"
106+
# craftctl set version="$(cat version.txt)"
106107
107108
mkdir -p ../install/etc/bash_completion
108109
cp run/john.*_completion ../install/etc/bash_completion/
109110
111+
mkdir -p ../install/share/icons
112+
cp icon.png ../install/share/icons/icon.png
113+
cp icon.png ../install/share/icons/com.openwall.John.png
114+
110115
build-packages:
111116
- build-essential
112117
- libssl-dev
@@ -119,30 +124,24 @@ parts:
119124
- curl
120125
- patch
121126
# OpenCL stuff
122-
- on amd64:
123-
- libpocl-dev
124-
- ocl-icd-opencl-dev
125-
- pocl-opencl-icd
127+
- libpocl-dev
128+
- ocl-icd-opencl-dev
129+
- pocl-opencl-icd
126130
- on arm64:
127131
- libpocl-dev
128132
- ocl-icd-opencl-dev
129133
- pocl-opencl-icd
130134

135+
stage-packages:
136+
- libgomp1
137+
- libpcap0.8
138+
- ocl-icd-libopencl1
139+
131140
organize:
132141
../build/run/: bin/
133142
../build/doc/: doc/
134143
../build/README.md: README.md
135-
136-
libs:
137-
plugin: nil
138-
139-
stage-packages:
140-
- libgomp1
141-
- libpcap0.8t64
142-
- on amd64:
143-
- ocl-icd-libopencl1
144-
- on arm64:
145-
- ocl-icd-libopencl1
144+
../build/com.openwall.John.png: com.openwall.John.png
146145

147146
john-packages:
148147
plugin: nil
@@ -152,6 +151,7 @@ parts:
152151
cp deploy/metadata/com.openwall.John.desktop .
153152
cp deploy/metadata/run-john.sh .
154153
cp deploy/snap/build.sh $SNAPCRAFT_STAGE
154+
cp deploy/metadata/com.openwall.John.png $SNAPCRAFT_STAGE
155155
156156
organize:
157157
../build/com.openwall.John.desktop: com.openwall.John.desktop

0 commit comments

Comments
 (0)