Skip to content

Commit 4ebb041

Browse files
norajnoptrix
authored andcommitted
unisec: 0.0.6 + virtual environment packaging
venv because of version requirement
1 parent 483f68a commit 4ebb041

File tree

2 files changed

+45
-16
lines changed

2 files changed

+45
-16
lines changed

packages/unisec/PKGBUILD

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,40 @@
22
# See COPYING for license details.
33

44
pkgname=unisec
5-
_gemname=$pkgname
6-
pkgver=0.0.5
7-
pkgrel=3
5+
pkgver=0.0.6
6+
pkgrel=1
87
pkgdesc='Unicode Security Toolkit.'
98
arch=('any')
109
groups=('blackarch' 'blackarch-misc')
11-
url='https://acceis.github.io/unisec'
12-
#url='https://github.com/Acceis/unisec'
10+
url='https://noraj.github.io/unisec'
1311
license=('MIT')
14-
depends=('ruby' 'ctf-party' 'ruby-dry-cli' 'ruby-paint' 'ruby-twitter_cldr'
15-
'ruby-unicode-confusable')
16-
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
17-
noextract=("$_gemname-$pkgver.gem")
18-
sha512sums=('46bc2e0166124bea4524a5376adb35afa2bc49fc7281426c63976fb46770b0718dc989f76036bf8fa2902b2c661746e44437a492755a5c38e866d588a7b96cae')
12+
depends=('ruby')
13+
makedepends=('git' 'ruby-bundler')
14+
source=("https://github.com/noraj/$pkgname/archive/refs/tags/$pkgver.tar.gz")
15+
sha512sums=('5922fde428d93ad12df1ade61d188d5f4e8731d704a824e69b7f8beeb7c4d4199393ad327c1b34382b7b2fba7477a78ddd38f2c2263e094ba15da68fbf6e3093')
16+
install="$pkgname.install"
1917

2018
package() {
21-
_gemhome="$(gem env home)"
19+
cd "$pkgname-$pkgver"
2220

23-
gem install --ignore-dependencies --no-user-install --no-document \
24-
-i "$pkgdir/$_gemhome" -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"
21+
install -dm 755 "$pkgdir/usr/bin"
22+
install -dm 755 "$pkgdir/usr/share/$pkgname"
2523

26-
rm "$pkgdir/$_gemhome/cache/$_gemname-$pkgver.gem"
24+
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
25+
cp -rT --no-preserve=ownership --preserve=all --no-dereference docs/ "$pkgdir/usr/share/doc/$pkgname"
2726

28-
install -Dm 644 "$pkgdir/$_gemhome/gems/$_gemname-$pkgver/LICENSE" \
29-
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
27+
install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
28+
29+
rm -rf docs/ *.md LICENSE .github/ docs-tools/ test/ .* Rakefile
30+
31+
cp --no-preserve=ownership -a * "$pkgdir/usr/share/$pkgname/"
32+
33+
cat > "$pkgdir/usr/bin/$pkgname" << EOF
34+
#!/bin/sh
35+
cd /usr/share/$pkgname
36+
bundle exec ruby bin/$pkgname "\$@"
37+
EOF
38+
39+
chmod +x "$pkgdir"/usr/bin/*
3040
}
3141

packages/unisec/unisec.install

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
post_install() {
2+
set -e
3+
cd /usr/share/unisec
4+
#rm -f Gemfile.lock
5+
bundle config build.nokogiri --use-system-libraries
6+
bundle config set --local path 'vendor/bundle'
7+
bundle config set --local without development install test lint docs
8+
bundle install
9+
}
10+
11+
post_upgrade() {
12+
post_install "$@"
13+
}
14+
15+
post_remove() {
16+
rm -r /usr/share/unisec/{vendor,.bundle}
17+
rmdir /usr/share/unisec
18+
}
19+

0 commit comments

Comments
 (0)