You are not logged in.
Hello guys,
I'm trying to create my first package but I'm having some issues.
Here's my PKGBUILD:
# Maintainer: truc <metrucgmail.com>
pkgname=cloudfail-git
pkgver=0.9.3.r102.ge8ad02c
pkgrel=2
pkgdesc="Tactical reconnaissance tool which aims to gather enough information about a target protected by Cloudflare"
arch=('any')
url="https://github.com/m0rtem/CloudFail"
license=('GPL')
depends=('python')
makedepends=('python-pip')
provides=('cloudfail')
source=("cloudfail"::'git+https://github.com/m0rtem/CloudFail.git')
sha512sums=('SKIP')
options=('!strip')
package() {
# Install files in /opt
mkdir -p "$pkgdir/opt/cloudfail"
cp -a $srcdir/cloudfail/. $pkgdir/opt/cloudfail
pip install -r $pkgdir/opt/cloudfail/requirements.txt --target $pkgdir/opt/cloudfail/lib
pip install PySocks
# Create an indirect launcher in /usr/bin
mkdir -p "$pkgdir/usr/bin"
install -Dm 755 "$srcdir/cloudfail/cloudfail.py" "$pkgdir/usr/bin/cloudfail"
}
Everything goes well except when I try to exectute the binary I get a python dependency error. It comes from a module from the package itself (I mean it's not on pip, it comes with the package).
If I go in /opt/ and execute it from there everything will go well because it can resolve the dependency, but the binary in /bin cannot. How can I solve this?
▶ cloudfail
Traceback (most recent call last):
File "/usr/bin/cloudfail", line 16, in <module>
from DNSDumpsterAPI import DNSDumpsterAPI
ModuleNotFoundError: No module named 'DNSDumpsterAPI'
Last edited by Truc (2018-07-15 08:46:43)
Offline
/opt/cloudfail/lib is not in the standard python search path so DNSDumpsterAPI is not found.
Offline
But DNSDumpster is not installed by pip so at the end it won't be found anyway I think right?
I can fix the problem by copying it like this:
package() {
cd "$srcdir/$pkgname"
pwd
pip install -r requirements.txt
pip install PySocks
# Create an indirect launcher in /usr/bin
install -Dm 755 "${srcdir}/$pkgname/cloudfail.py" "${pkgdir}/usr/bin/cloudfail"
#dependency fix
mkdir -p $pkgdir/usr/lib/python3.6/site-packages
cp $srcdir/$pkgname/DNSDumpsterAPI.py $pkgdir/usr/lib/python3.6/site-packages/DNSDumpsterAPI.py
}
Offline
Yes it appears the application is expected to be unpacked into a local directory and executed from that directory rather than system wide install.
Offline
Why do you need a virtualenv at all? Why not just depend on the python packages for the dependencies, which are available in the repos?
Then install DNSDumpsterAPI.py and /usr/bin/cloudfail by hand because upstream did not provide a setup.py for you.
But, pip/requirements.txt should definitely not be necessary.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline