summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeng Zhuo <mengzhuo1203@gmail.com>2017-01-12 16:57:19 +0800
committerMeng Zhuo <mengzhuo1203@gmail.com>2017-01-12 16:57:19 +0800
commit7afceda9cb6352809a0a3123c6aae1234329088b (patch)
tree0e1edbb6f3b6c45d1f188456e1838f70dd1b8b5c
parentec62152429f64a625d58c0ee5e914d62061d062a (diff)
downloadgoircd-7afceda9cb6352809a0a3123c6aae1234329088b.tar.xz
add service && debian package
-rw-r--r--GNUmakefile17
-rw-r--r--startup/goircd.service11
2 files changed, 28 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 04d452d..2447b91 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,3 +1,20 @@
VERSION = $(shell git describe --tags)
+BUILD_TMP?=.rpm_tmp
include common.mk
+
+.PHONY: deb
+deb:
+ rm -rf ${BUILD_TMP}
+ mkdir -p ${BUILD_TMP}/usr/local/bin/
+ mkdir -p ${BUILD_TMP}/var/lib/goircd/history
+ mkdir -p ${BUILD_TMP}/etc/systemd/system/
+ cp goircd ${BUILD_TMP}/usr/local/bin/
+ cp startup/goircd.service ${BUILD_TMP}/etc/systemd/system/
+ fpm -s dir -t deb -n goircd -v ${VERSION}\
+ -m mengzhuo1203@gmail.com \
+ --deb-compression=bzip2 \
+ --verbose \
+ -d logrotate\
+ -C ${BUILD_TMP}
+
diff --git a/startup/goircd.service b/startup/goircd.service
new file mode 100644
index 0000000..dce0d78
--- /dev/null
+++ b/startup/goircd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=goIRC daemon
+
+[Service]
+ExecStart=/usr/local/bin/goircd -logdir /var/lib/goircd/history
+Restart=once
+RestartSec=3s
+
+[Install]
+WantedBy=multi-user.target
+Alias=goircd.service