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