]> Cypherpunks.ru repositories - goircd.git/commitdiff
add service && debian package
authorMeng Zhuo <mengzhuo1203@gmail.com>
Thu, 12 Jan 2017 08:57:19 +0000 (16:57 +0800)
committerMeng Zhuo <mengzhuo1203@gmail.com>
Thu, 12 Jan 2017 08:57:19 +0000 (16:57 +0800)
GNUmakefile
startup/goircd.service [new file with mode: 0644]

index 04d452db379cb8f86abee4604c34ba761c6b629d..2447b914bed3b14f3a224ada0810d8796984057b 100644 (file)
@@ -1,3 +1,20 @@
 VERSION = $(shell git describe --tags)
 VERSION = $(shell git describe --tags)
+BUILD_TMP?=.rpm_tmp
 
 include common.mk
 
 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 (file)
index 0000000..dce0d78
--- /dev/null
@@ -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