From 1f1d7a320e1fee8a636da8ee3bda31fbfc3017a3 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 16 Dec 2024 12:53:07 +0000 Subject: [PATCH] docs: disable CGO and update docs We don't have ethernet face anymore, so don't need this at the moment. --- Makefile | 22 +--------------------- README.md | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 5d3e72db..02af808e 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,11 @@ -PACKAGE = github.com/named-data/YaNFD VERSION = 1.3.0.0 -# COMMIT = git rev-parse --short HEAD -# DATE != date .PHONY: all install clean test coverage all: yanfd yanfd: clean - go build -ldflags "-X 'main.Version=${VERSION}'" ${PACKAGE}/cmd/yanfd + CGO_ENABLED=0 go build -o yanfd cmd/yanfd/main.go install: install -m 755 yanfd /usr/local/bin @@ -23,20 +20,3 @@ test: coverage: go tool cover -html=coverage.out - -cleanui: - rm -f yanfdui - -yanfdui: cleanui - go build -ldflags "-X 'main.Version=${VERSION}' -X 'main.HttpBaseDir=cmd/yanfdui'" ${PACKAGE}/cmd/yanfdui - -# To publish a Windows Store application -# rm -rf publish -# mkdir publish -# go generate github.com/named-data/YaNFD/cmd/yanfdui -# go build -ldflags "-X 'main.Version=${VERSION}' ${PACKAGE}/cmd/yanfdui -# mv yanfdui publish/ -# cp -R cmd/yanfdui/static publish/ -# cp -R cmd/yanfdui/templates publish/ -# cp ./ndn_app.ico publish/ -# Then, create the YaNFD-x64.msix file (including publish, yanfd.toml) diff --git a/README.md b/README.md index 557f265f..13c1f4f8 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,6 @@ It is compatible with existing NDN applications and utilizes the management tool # Prerequisites YaNFD requires [Go 1.23](https://go.dev/doc/install) or later. -Besides that, you will need `libpcap` and `g++` on Linux and MacOS. On Ubuntu, these libraries can be installed by: - -```bash -sudo apt install build-essential pkg-config libpcap-dev -``` You may refer to [this](https://github.com/zjkmxy/YaNFD-docker) if you want to build a Docker image. @@ -31,6 +26,7 @@ go install github.com/named-data/YaNFD/cmd/yanfd@latest Get it from: https://www.microsoft.com/store/apps/9NBK3ZJT4CL8 ## Install the configuration file + ### On MacOS/Linux ```bash curl -o ./yanfd.toml https://raw.githubusercontent.com/named-data/YaNFD/master/yanfd.toml.sample @@ -42,7 +38,8 @@ rm ./yanfd.toml On MacOS, one also needs to change `socket_path` to `/var/run/nfd/nfd.sock` in the copied configuration file. ### On Windows 10/11 -```text + +```powershell curl -o yanfd.toml https://raw.githubusercontent.com/named-data/YaNFD/master/yanfd.toml.sample mkdir %APPDATA%\ndn move yanfd.toml %APPDATA%\ndn\ @@ -50,7 +47,8 @@ move yanfd.toml %APPDATA%\ndn\ One needs to change `socket_path` to `${TEMP}\\nfd\\nfd.sock` in the copied configuration file. Also, to execute YaNFD on Windows 10, one needs to explicitly specify the configuration path: -```text + +```bash yanfd.exe --config=%APPDATA%\ndn\yanfd.toml ``` @@ -60,13 +58,16 @@ yanfd.exe --config=%APPDATA%\ndn\yanfd.toml To build and install YaNFD on Unix-like platforms, run: - make - sudo make install +```bash +make +sudo make install +``` ## Windows 10 To build and install YaNFD on Windows, please run the `go build` command in the `Makefile` manually: -```text + +```powershell go build github.com/named-data/YaNFD/cmd/yanfd ``` @@ -95,7 +96,7 @@ YaNFD supports the majority of this management protocol, but some features are c # Running To run YaNFD, run the `yanfd` (or `yanfd.exe`) executable. -To view a list of available options, specify the `--help` argument. +To view a list of available options, specify the `--help` argument. After starting YaNFD, you can treat it like NFD from an application and configuration perspective.