-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contains a quick and dirty solution to build with fpm.
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
name=pydtm | ||
getent group $name >/dev/null 2>&1 \ | ||
|| groupadd -r $name >/dev/null 2>&1 \ | ||
|| true | ||
getent passwd $name >/dev/null 2>&1 \ | ||
|| useradd -g $name -c "$name service" \ | ||
-d /var/lib/$name -M -s /sbin/nologin -r \ | ||
-G video $name >/dev/null 2>&1 \ | ||
|| true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#/bin/bash | ||
|
||
release=${RELEASE:-0} | ||
# TODO: read from git tags? | ||
if [ -z "$VERSION" ]; then | ||
echo '$VERSION not set, exiting' 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# build root filesystem | ||
root=$(mktemp -d) | ||
install -m 0755 -d $root/{lib/systemd/system,etc,usr/bin,var/lib/pydtm} | ||
install -m 0644 pydtm.service $root/lib/systemd/system/ | ||
install -m 0644 pydtm.env $root/etc/ | ||
install -m 0755 -T ../pydtm.py $root/usr/bin/pydtm | ||
|
||
# build package | ||
fpm -s dir -t deb -n pydtm -v $VERSION-$release -C $root \ | ||
--description "carbon API server" \ | ||
--before-install before-install.sh \ | ||
-d python \ | ||
etc lib usr var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Environment File for pydtm | ||
|
||
# PYDTM_ADAPTER=0 | ||
# PYDTM_CARBON=localhost:2003 | ||
# PYDTM_DEBUG is not set by default | ||
# PYDTM_FREQUENCIES=546:256,554:256,562:64,650:64 | ||
# PYDTM_PREFIX=docsis | ||
# PDTM_STEP=60 | ||
# PYDTM_TUNER=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=pydtm - Python (Euro)DOCSIS Traffic Meter | ||
After=syslog.target network.target | ||
|
||
[Service] | ||
User=pydtm | ||
EnvironmentFile=/etc/pydtm.env | ||
ExecStart=/usr/bin/pydtm | ||
Restart=on-failure | ||
|
||
[Install] | ||
WantedBy=multi-user.target |