update doc and install to properly set and provide options for OSs like centos who need a different prefix
This commit is contained in:
parent
6c7e760f4e
commit
35b6f5297a
2 changed files with 8 additions and 6 deletions
|
@ -92,6 +92,7 @@ python3 -m pip install --user grpcio==1.27.2 grpcio-tools==1.27.2
|
|||
|
||||
# build core
|
||||
./bootstrap.sh
|
||||
# centos requires --prefix=/usr
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
@ -112,9 +113,11 @@ cd ..
|
|||
pipx install invoke
|
||||
|
||||
# install core scripts leveraging poetry virtual environment
|
||||
# centos requires --prefix=/usr
|
||||
inv install-scripts
|
||||
|
||||
# optionally install systemd service file
|
||||
# centos requires --prefix=/usr
|
||||
inv install-service
|
||||
```
|
||||
|
||||
|
|
11
tasks.py
11
tasks.py
|
@ -115,8 +115,7 @@ def install_grpcio(c: Context, hide: bool) -> None:
|
|||
def build(c: Context, os_info: OsInfo, hide: bool) -> None:
|
||||
print("building core...")
|
||||
c.run("./bootstrap.sh", hide=hide)
|
||||
# prefix = "--prefix=/usr" if os_info.like == OsLike.REDHAT else ""
|
||||
prefix = ""
|
||||
prefix = "--prefix=/usr" if os_info.like == OsLike.REDHAT else ""
|
||||
c.run(f"./configure {prefix}", hide=hide)
|
||||
c.run("make -j$(nproc)", hide=hide)
|
||||
|
||||
|
@ -171,11 +170,11 @@ def install_ospf_mdr(c: Context, os_info: OsInfo, hide: bool) -> None:
|
|||
|
||||
|
||||
@task
|
||||
def install_service(c, hide, prefix=DEFAULT_PREFIX):
|
||||
def install_service(c, verbose=False, prefix=DEFAULT_PREFIX):
|
||||
"""
|
||||
install systemd core service
|
||||
"""
|
||||
# install service
|
||||
hide = not verbose
|
||||
bin_dir = Path(prefix).joinpath("bin")
|
||||
systemd_dir = Path("/lib/systemd/system/")
|
||||
service_file = systemd_dir.joinpath("core-daemon.service")
|
||||
|
@ -203,11 +202,11 @@ def install_service(c, hide, prefix=DEFAULT_PREFIX):
|
|||
|
||||
|
||||
@task
|
||||
def install_scripts(c, hide, prefix=DEFAULT_PREFIX):
|
||||
def install_scripts(c, verbose=False, prefix=DEFAULT_PREFIX):
|
||||
"""
|
||||
install core script files, modified to leverage virtual environment
|
||||
"""
|
||||
# install all scripts
|
||||
hide = not verbose
|
||||
python = get_python(c)
|
||||
bin_dir = Path(prefix).joinpath("bin")
|
||||
for script in Path("daemon/scripts").iterdir():
|
||||
|
|
Loading…
Reference in a new issue