Skip to content

Commit

Permalink
bkcrack: enhance
Browse files Browse the repository at this point in the history
make build() align with Arch Cmake Package Guidelines

Use doxygen to build doc

Run test

Use SPDX license identifier

optdepends on python for tools

Install example to doc folder

depends on glibc
  • Loading branch information
Xeonacid committed Jan 31, 2025
1 parent 1c8bfeb commit 7b782e6
Showing 1 changed file with 37 additions and 13 deletions.
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/"
}

0 comments on commit 7b782e6

Please sign in to comment.