Skip to content

Commit 5a9e81c

Browse files
committed
General README and deb package building.
1 parent c6cb5fb commit 5a9e81c

6 files changed

Lines changed: 81 additions & 3 deletions

File tree

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
11
# go-devparam
2-
Go library and application for accessing device parameters.
2+
3+
Go library and applications for accessing device parameters using the
4+
deviceparameters protocol: <https://github.com/thinnect/tos-devparam>.
5+
6+
`deviceparameter`
7+
A basic utility for dealing with individual nodes and parameters.
8+
See the [deviceparameter README](cmd/deviceparameter/README.md) for details.
9+
10+
`deviceparameters`
11+
A utility for dealing with several parameters on multiple nodes.
12+
See the [deviceparameters README](cmd/deviceparameters/README.md) for details.
13+
14+
# Dependencies
15+
Go dependencies have been vendored as submodules under the vendor directory.
16+
17+
Building the _deb_ package requires `checkinstall` and `ronn`.
18+
19+
`ronn` can be obtained from <https://github.com/rtomayko/ronn>.
20+
21+
# Building
22+
23+
Check out all submodules, install `ronn` and `checkinstall`.
24+
25+
Enter `cmd/deviceparameter` or `cmd/deviceparameters` and execute `make` or
26+
enter `cmd` and execute the `build-deb.sh` script.
27+
28+
Both applications can be cross-compiled for Windows and for use on ARM based
29+
Linux platforms, though packaging only works on the native architecture. Take a
30+
look at the Makefiles for details.

cmd/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Makefile for building and installing deviceparameter and deviceparameters
2+
MAKEFILE_LOCATION := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
3+
4+
all: deviceparameter deviceparameters
5+
6+
deviceparameter:
7+
cd deviceparameter && make clean && make
8+
9+
deviceparameters:
10+
cd deviceparameters && make clean && make
11+
12+
install: deviceparameter deviceparameters
13+
install -m0755 $(MAKEFILE_LOCATION)/deviceparameter/deviceparameter /usr/bin
14+
install -m0664 $(MAKEFILE_LOCATION)/deviceparameter/deviceparameter.1.gz /usr/local/man/man1
15+
install -m0755 $(MAKEFILE_LOCATION)/deviceparameters/deviceparameters /usr/bin
16+
install -m0664 $(MAKEFILE_LOCATION)/deviceparameters/deviceparameters.1.gz /usr/local/man/man1
17+
18+
.PHONY: deviceparameter
19+
.PHONY: deviceparameters

cmd/build-deb.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
RELEASE_DATE=$(date -u +'%Y%m%d')
4+
5+
OPTIONS+=" --type=debian"
6+
OPTIONS+=" --default" # answer yes to any questions
7+
OPTIONS+=" --fstrans" # simulate filesystem so root permissions not needed
8+
OPTIONS+=" --install=no" # just make, don't install the package
9+
OPTIONS+=" --nodoc" # as long as actual docs don't exist
10+
11+
OPTIONS+=" --pkgname=mist-device-parameters"
12+
OPTIONS+=" --pkgversion=0.1.0"
13+
OPTIONS+=" --pkgrelease=$RELEASE_DATE"
14+
OPTIONS+=" --provides=mist-device-parameters"
15+
OPTIONS+=" --pkglicense=MIT"
16+
OPTIONS+=" --maintainer=somebody@thinnect.com"
17+
18+
checkinstall $OPTIONS

cmd/description-pak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Mist deviceparameter and deviceparameters.

cmd/deviceparameter/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
BUILD_DATE = $(shell date -u '+%Y-%m-%d_%H:%M:%S')
44
BUILD_DISTRO = $(shell lsb_release -sd)
55

6-
all: deviceparameter
6+
all: deviceparameter manual
77

88
win32: export GOOS=windows
99
win32: export GOARCH=386
@@ -39,3 +39,9 @@ manual: deviceparameter.1.gz
3939
install: deviceparameter manual
4040
install -m 0755 deviceparameter /usr/local/bin
4141
install -m 0644 deviceparameter /usr/local/man/man1
42+
43+
clean:
44+
rm -f deviceparameter
45+
rm -f deviceparameter.1.gz
46+
47+
.PHONY: clean

cmd/deviceparameters/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
BUILD_DATE = $(shell date -u '+%Y-%m-%d_%H:%M:%S')
44
BUILD_DISTRO = $(shell lsb_release -sd)
55

6-
all: deviceparameters
6+
all: deviceparameters manual
77

88
win32: export GOOS=windows
99
win32: export GOARCH=386
@@ -39,3 +39,9 @@ manual: deviceparameters.1.gz
3939
install: deviceparameters manual
4040
install -m 0755 deviceparameters /usr/local/bin
4141
install -m 0644 deviceparameters /usr/local/man/man1
42+
43+
clean:
44+
rm -f deviceparameters
45+
rm -f deviceparameters.1.gz
46+
47+
.PHONY: clean

0 commit comments

Comments
 (0)