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
|
# build core
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
|
# centos requires --prefix=/usr
|
||||||
./configure
|
./configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
@ -112,9 +113,11 @@ cd ..
|
||||||
pipx install invoke
|
pipx install invoke
|
||||||
|
|
||||||
# install core scripts leveraging poetry virtual environment
|
# install core scripts leveraging poetry virtual environment
|
||||||
|
# centos requires --prefix=/usr
|
||||||
inv install-scripts
|
inv install-scripts
|
||||||
|
|
||||||
# optionally install systemd service file
|
# optionally install systemd service file
|
||||||
|
# centos requires --prefix=/usr
|
||||||
inv install-service
|
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:
|
def build(c: Context, os_info: OsInfo, hide: bool) -> None:
|
||||||
print("building core...")
|
print("building core...")
|
||||||
c.run("./bootstrap.sh", hide=hide)
|
c.run("./bootstrap.sh", hide=hide)
|
||||||
# prefix = "--prefix=/usr" if os_info.like == OsLike.REDHAT else ""
|
prefix = "--prefix=/usr" if os_info.like == OsLike.REDHAT else ""
|
||||||
prefix = ""
|
|
||||||
c.run(f"./configure {prefix}", hide=hide)
|
c.run(f"./configure {prefix}", hide=hide)
|
||||||
c.run("make -j$(nproc)", 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
|
@task
|
||||||
def install_service(c, hide, prefix=DEFAULT_PREFIX):
|
def install_service(c, verbose=False, prefix=DEFAULT_PREFIX):
|
||||||
"""
|
"""
|
||||||
install systemd core service
|
install systemd core service
|
||||||
"""
|
"""
|
||||||
# install service
|
hide = not verbose
|
||||||
bin_dir = Path(prefix).joinpath("bin")
|
bin_dir = Path(prefix).joinpath("bin")
|
||||||
systemd_dir = Path("/lib/systemd/system/")
|
systemd_dir = Path("/lib/systemd/system/")
|
||||||
service_file = systemd_dir.joinpath("core-daemon.service")
|
service_file = systemd_dir.joinpath("core-daemon.service")
|
||||||
|
@ -203,11 +202,11 @@ def install_service(c, hide, prefix=DEFAULT_PREFIX):
|
||||||
|
|
||||||
|
|
||||||
@task
|
@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 core script files, modified to leverage virtual environment
|
||||||
"""
|
"""
|
||||||
# install all scripts
|
hide = not verbose
|
||||||
python = get_python(c)
|
python = get_python(c)
|
||||||
bin_dir = Path(prefix).joinpath("bin")
|
bin_dir = Path(prefix).joinpath("bin")
|
||||||
for script in Path("daemon/scripts").iterdir():
|
for script in Path("daemon/scripts").iterdir():
|
||||||
|
|
Loading…
Reference in a new issue