Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bkcrack: enhance #4457

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lists/to-release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bkcrack
50 changes: 37 additions & 13 deletions packages/bkcrack/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ pkgdesc='Crack legacy zip encryption with Biham and Kocher known plaintext attac
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-cracker')
url='https://github.com/kimci86/bkcrack'
license=('ZLIB')
depends=('gcc-libs')
makedepends=('git' 'cmake')
license=('Zlib')
depends=('gcc-libs' 'glibc')
makedepends=('git' 'cmake' 'doxygen')
optdepends=('python: deflate/inflate tools')
source=("git+https://github.com/kimci86/$pkgname.git")
sha512sums=('SKIP')

Expand All @@ -21,23 +22,46 @@ pkgver() {
}

build() {
cd $pkgname

cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .
local cmake_options=(
-B build
-S $pkgname
-W no-dev
-D CMAKE_BUILD_TYPE=None
-D CMAKE_INSTALL_PREFIX=/usr
-D BKCRACK_BUILD_DOC=ON
-D BKCRACK_BUILD_TESTING=ON
)
cmake "${cmake_options[@]}"
cmake --build build
}

make
check() {
local excluded_tests=""
local ctest_flags=(
--test-dir build
# show the stdout and stderr when the test fails
--output-on-failure
# execute tests in parallel
--parallel $(nproc)
# exclude problematic tests
--exclude-regex "$excluded_tests"
)
ctest "${ctest_flags[@]}"
}

package() {
cd $pkgname
cd build
install -Dm 755 "src/$pkgname" "$pkgdir/usr/bin/$pkgname"

install -dm 755 "$pkgdir/usr/share/$pkgname/"
install -dm 755 "$pkgdir/usr/share/doc/$pkgname"
cp -a doc/html "$pkgdir/usr/share/doc/$pkgname/"

install -Dm 755 "src/$pkgname" "$pkgdir/usr/bin/$pkgname"
cd ../$pkgname
install -Dm 644 license.txt -t "$pkgdir/usr/share/licenses/$pkgname"

install -Dm 644 license.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md doc/*.md
cp -a example "$pkgdir/usr/share/doc/$pkgname"

cp -a tools example "$pkgdir/usr/share/$pkgname/"
install -dm 755 "$pkgdir/usr/share/$pkgname"
cp -a tools "$pkgdir/usr/share/$pkgname/"
}