new build architecture
This commit is contained in:
parent
c8003f0ca7
commit
2d798dd588
7
PKGBUILD
7
PKGBUILD
|
@ -8,7 +8,7 @@ url="https://git.kske.dev/DieGurke/pwgen"
|
|||
license=('GPL')
|
||||
groups=()
|
||||
depends=('binutils' 'python')
|
||||
makedepends=('git')
|
||||
makedepends=('git' 'python-build' 'python-installer')
|
||||
checkupdates=()
|
||||
optdepends=('bash')
|
||||
provides=(pwgen)
|
||||
|
@ -26,9 +26,14 @@ pkgver() {
|
|||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
build() {
|
||||
python -m build --wheel --no-isolation
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${pkgname}
|
||||
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
|
||||
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||
install -Dm755 pwgen.sh "${pkgdir}/usr/bin/pwgen"
|
||||
python -m installer --destdir="$pkgdir" dist/*.whl
|
||||
}
|
||||
|
|
2
pwgen.sh
2
pwgen.sh
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
imp="import pwgenerator as g;"
|
||||
imp="from src import pwgenerator as g;"
|
||||
|
||||
function _help() {
|
||||
echo "Usage: pwgen [length] [mode]"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[build-system]
|
||||
requres = ["setuptools>=42"]
|
||||
build-backend = "setuptools.build_meta"
|
|
@ -0,0 +1,28 @@
|
|||
import random
|
||||
|
||||
lower = "abcdefghijklmnopqrstuvwxyz"
|
||||
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
numbers = "0123456789"
|
||||
symbols = "!$%&/?+*-#"
|
||||
|
||||
def genNum(length):
|
||||
gen(numbers, length)
|
||||
|
||||
def genLetLow(length):
|
||||
gen(lower, length)
|
||||
|
||||
def genLetUp(length):
|
||||
gen(upper, length)
|
||||
|
||||
def genLet(length):
|
||||
gen(lower + upper, length)
|
||||
|
||||
def genLetNum(length):
|
||||
gen(lower + upper + numbers, length)
|
||||
|
||||
def genFull(length):
|
||||
gen(lower + upper + numbers + symbols, length)
|
||||
|
||||
def gen(chars, length):
|
||||
print(''.join(random.choice(chars) for _ in range(length)))
|
||||
|
Loading…
Reference in New Issue