mirror of https://github.com/fail2ban/fail2ban
rename commands to `build-ex` and `install-ex` and use `build-ex` instead of `build` in GHA
parent
2b27d52bdd
commit
b70adfa107
|
@ -96,7 +96,7 @@ jobs:
|
||||||
#run: python bin/fail2ban-testcases --verbosity=2 -l 5 "test_WrongChar"
|
#run: python bin/fail2ban-testcases --verbosity=2 -l 5 "test_WrongChar"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: python setup.py build
|
run: python setup.py build-ex --build-base=build --bin=/usr/local/bin --lib=/usr/local/lib/python$F2B_PYV/dist-packages --without-tests
|
||||||
|
|
||||||
#- name: Test initd scripts
|
#- name: Test initd scripts
|
||||||
# run: shellcheck -s bash -e SC1090,SC1091 files/debian-initd
|
# run: shellcheck -s bash -e SC1090,SC1091 files/debian-initd
|
||||||
|
|
20
setup.py
20
setup.py
|
@ -268,7 +268,7 @@ def _dispInstallFooter():
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
# if new packaging mechanism:
|
# if new packaging mechanism:
|
||||||
if "f2b-install" in sys.argv or "f2b-build" in sys.argv:
|
if "install-ex" in sys.argv or "build-ex" in sys.argv:
|
||||||
import getopt
|
import getopt
|
||||||
build_base = 'build'
|
build_base = 'build'
|
||||||
cfg = {'dry-run':False, 'quiet':False}
|
cfg = {'dry-run':False, 'quiet':False}
|
||||||
|
@ -276,15 +276,15 @@ if "f2b-install" in sys.argv or "f2b-build" in sys.argv:
|
||||||
def _dispUsage():
|
def _dispUsage():
|
||||||
print(("usage: %s comand [options]\n"
|
print(("usage: %s comand [options]\n"
|
||||||
"Commands:\n"
|
"Commands:\n"
|
||||||
" f2b-build build the package underneath\n"
|
" build-ex build the package underneath ./build (or --build-base)\n"
|
||||||
" f2b-install will install the package\n"
|
" install-ex will install the package\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" --quiet (-q) run quietly (turns verbosity off)\n"
|
" --quiet (-q) run quietly (turns verbosity off)\n"
|
||||||
" --dry-run (-n) don't actually do anything\n"
|
" --dry-run (-n) don't actually do anything\n"
|
||||||
" --help (-h) show detailed help message\n"
|
" --help (-h) show detailed help message\n"
|
||||||
"Options of 'f2b-install' and 'f2b-build' commands:\n"
|
"Options of 'install-ex' and 'build-ex' commands:\n"
|
||||||
" --prefix= installation prefix\n"
|
" --prefix= installation prefix\n"
|
||||||
" --build-base= (-b) base directory for build ()\n"
|
" --build-base= (-b) base directory for build (default ./build)\n"
|
||||||
" --root= install everything relative to this\n"
|
" --root= install everything relative to this\n"
|
||||||
" alternate root directory\n"
|
" alternate root directory\n"
|
||||||
" --lib= directory for library\n"
|
" --lib= directory for library\n"
|
||||||
|
@ -296,7 +296,7 @@ if "f2b-install" in sys.argv or "f2b-build" in sys.argv:
|
||||||
'b:qnh',
|
'b:qnh',
|
||||||
['prefix=', 'build-base=', 'root=', 'lib=', 'bin=', 'dry-run', 'quiet', 'help']
|
['prefix=', 'build-base=', 'root=', 'lib=', 'bin=', 'dry-run', 'quiet', 'help']
|
||||||
)
|
)
|
||||||
if len(args) != 1 or args[0] not in ('f2b-install', 'f2b-build'):
|
if len(args) != 1 or args[0] not in ('install-ex', 'build-ex'):
|
||||||
raise getopt.GetoptError("invalid arguments %r" % (args,))
|
raise getopt.GetoptError("invalid arguments %r" % (args,))
|
||||||
for opt in optList:
|
for opt in optList:
|
||||||
o = opt[0]
|
o = opt[0]
|
||||||
|
@ -321,7 +321,7 @@ if "f2b-install" in sys.argv or "f2b-build" in sys.argv:
|
||||||
if os.path.isabs(p):
|
if os.path.isabs(p):
|
||||||
p = os.path.relpath(p, '/')
|
p = os.path.relpath(p, '/')
|
||||||
return join(build_base, p)
|
return join(build_base, p)
|
||||||
print("running f2b-build")
|
print("running build-ex")
|
||||||
if not cfg.get("lib"):
|
if not cfg.get("lib"):
|
||||||
cfg["lib"] = next(filter(lambda x: x.endswith("dist-packages"), sys.path), None)
|
cfg["lib"] = next(filter(lambda x: x.endswith("dist-packages"), sys.path), None)
|
||||||
build_lib = _rootpath(cfg["lib"])
|
build_lib = _rootpath(cfg["lib"])
|
||||||
|
@ -351,10 +351,10 @@ if "f2b-install" in sys.argv or "f2b-build" in sys.argv:
|
||||||
# egg_info:
|
# egg_info:
|
||||||
sys.argv = ['setup.py', 'egg_info', '--egg-base=' + build_lib] + add_args
|
sys.argv = ['setup.py', 'egg_info', '--egg-base=' + build_lib] + add_args
|
||||||
setup(**params)
|
setup(**params)
|
||||||
print("f2b-build done.")
|
print("build-ex done.")
|
||||||
# build done - now install if wanted:
|
# build done - now install if wanted:
|
||||||
if args[0] == 'f2b-install':
|
if args[0] == 'install-ex':
|
||||||
print("running f2b-install")
|
print("running install-ex")
|
||||||
raise Exception("Not yet implemented.")
|
raise Exception("Not yet implemented.")
|
||||||
_dispInstallFooter()
|
_dispInstallFooter()
|
||||||
# done
|
# done
|
||||||
|
|
Loading…
Reference in New Issue