Skip to content

Commit e1bd583

Browse files
committed
cve-search: update install.
1 parent 7b63a14 commit e1bd583

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

packages/cve-search/PKGBUILD

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33

44
pkgname=cve-search
55
pkgver=v5.2.0.r2.g0396abf
6-
pkgrel=1
6+
pkgrel=2
77
pkgdesc='A tool to perform local searches for known vulnerabilities.'
88
groups=('blackarch' 'blackarch-exploitation')
99
arch=('any')
1010
url='http://cve-search.github.io/cve-search'
1111
license=('AGPL')
12-
depends=('mongodb' 'python' 'python-click' 'python-dateutil' 'python-flask'
13-
'python-flask-login' 'python-itsdangerous' 'python-jinja' 'redis'
14-
'python-lxml' 'python-passlib' 'python-pymongo' 'python-pytz'
15-
'python-redis' 'python-requests' 'python-six' 'python-tornado'
16-
'python-werkzeug' 'python-whoosh' 'python-xlrd' 'python-feedformater'
17-
'python-flask-pymongo' 'python-requirements-parser')
12+
depends=('python' 'python-virtualenv')
1813
makedepends=('git')
1914
source=("git+https://github.com/$pkgname/$pkgname.git")
2015
sha512sums=('SKIP')
16+
install="$pkgname.install"
2117

2218
pkgver() {
2319
cd $pkgname
@@ -39,15 +35,27 @@ package() {
3935
cd bin/
4036
for script in *; do
4137
final_script_name="${pkgname}-${script%.*}"
42-
ln -sf "/usr/share/$pkgname/bin/$script" \
43-
"$pkgdir/usr/bin/$final_script_name"
38+
cat > "$pkgdir/usr/bin/$final_script_name" << EOF
39+
#!/bin/sh
40+
cd /usr/share/$pkgname/
41+
source venv/bin/activate
42+
exec python bin/$script "\$@"
43+
EOF
44+
chmod +x "$pkgdir/usr/bin/$final_script_name"
4445
done
4546

4647
cd ../sbin/
4748
for script in *; do
4849
final_script_name="${pkgname}-${script%.*}"
49-
ln -sf "/usr/share/$pkgname/sbin/$script" \
50-
"$pkgdir/usr/bin/$final_script_name"
50+
cat > "$pkgdir/usr/bin/$final_script_name" << EOF
51+
#!/bin/sh
52+
cd /usr/share/$pkgname/
53+
source venv/bin/activate
54+
exec python sbin/$script "\$@"
55+
EOF
56+
chmod +x "$pkgdir/usr/bin/$final_script_name"
5157
done
58+
59+
rm "$pkgdir/usr/bin/"*__init*
5260
}
5361

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
post_install() {
2+
set -e
3+
cd /usr/share/cve-search
4+
python -m virtualenv venv
5+
source venv/bin/activate &&
6+
pip install --isolated --root='/usr/share/cve-search' --prefix='venv' \
7+
-r requirements.txt
8+
}
9+
10+
post_upgrade() {
11+
post_install "$@"
12+
}
13+

0 commit comments

Comments
 (0)