-
-
Notifications
You must be signed in to change notification settings - Fork 582
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
dnswatch: add package #4381
Merged
Merged
dnswatch: add package #4381
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dnswatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). | ||
# See COPYING for license details. | ||
|
||
pkgname=dnswatch | ||
pkgver=dnswatch.1.r16.gea62872 | ||
pkgrel=1 | ||
pkgdesc='DNS Traffic Sniffer and Analyzer.' | ||
arch=('any') | ||
groups=('blackarch' 'blackarch-sniffer') | ||
url='https://github.com/HalilDeniz/DNSWatch' | ||
license=('MIT') | ||
depends=('python') | ||
makedepends=('git' 'python-setuptools' 'python-pip') | ||
source=("$pkgname::git+https://github.com/HalilDeniz/$pkgname.git") | ||
sha512sums=('SKIP') | ||
install="$pkgname.install" | ||
|
||
pkgver() { | ||
cd $pkgname | ||
|
||
( set -o pipefail | ||
git describe --long --tags --abbrev=7 2>/dev/null | | ||
sed 's/\([^-]*-g\)/r\1/;s/-/./g' || | ||
printf "%s.%s" "$(git rev-list --count HEAD)" \ | ||
"$(git rev-parse --short=7 HEAD)" | ||
) | ||
} | ||
|
||
package() { | ||
cd $pkgname | ||
|
||
install -dm 755 "$pkgdir/usr/bin" | ||
install -Dm 644 requirements.txt "$pkgdir/usr/share/$pkgname/requirements.txt" | ||
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md | ||
|
||
install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" | ||
|
||
rm -rf LICENSE .gitignore .github | ||
D3vil0p3r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
cp -a * "$pkgdir/usr/share/$pkgname/" | ||
|
||
cat > "$pkgdir/usr/bin/$pkgname" << EOF | ||
#!/bin/sh | ||
source /usr/share/$pkgname/venv/bin/activate | ||
exec python /usr/share/$pkgname/dnswatch.py "\$@" | ||
EOF | ||
|
||
chmod a+x "$pkgdir/usr/bin/$pkgname" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
post_install() { | ||
set -e | ||
cd /usr/share/dnswatch | ||
python -m venv venv | ||
source venv/bin/activate && | ||
pip install --isolated --root="/usr/share/dnswatch" --prefix='venv' \ | ||
-r requirements.txt | ||
pip install -e . | ||
} | ||
|
||
post_upgrade() { | ||
post_install "$@" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the dependencies are very easy https://github.com/HalilDeniz/DNSWatch/blob/main/requirements.txt, why did you choose a standalone package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I gave priority to PKGBUILD Python Standalone template due to the usage of venv. If you think the other PKGBUILD Python template is better, I will change it. Let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rule is like that:
It's simple: no venv unless necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed sir