diff --git a/.gitignore b/.gitignore index 3cbdb9e..599680d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.deb *_tmp +goircd +VERSION diff --git a/BSDmakefile b/BSDmakefile deleted file mode 100644 index e3e6326..0000000 --- a/BSDmakefile +++ /dev/null @@ -1,3 +0,0 @@ -VERSION != git describe --tags - -include common.mk diff --git a/GNUmakefile b/GNUmakefile deleted file mode 100644 index d8024b8..0000000 --- a/GNUmakefile +++ /dev/null @@ -1,20 +0,0 @@ -VERSION = $(shell git describe --tags) -BUILD_TMP ?= .rpm_tmp -DEB_MAINTAINER ?= mengzhuo1203@gmail.com - -include common.mk - -.PHONY: deb -deb: - rm -rf ${BUILD_TMP} - mkdir -p ${BUILD_TMP}/usr/local/bin/ - mkdir -p ${BUILD_TMP}/var/log/goircd - 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 $(DEB_MAINTAINER) \ - --deb-compression=bzip2 \ - --verbose \ - -d logrotate \ - -C ${BUILD_TMP} diff --git a/INSTALL b/INSTALL index 6e9a1bc..3c5c634 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,10 @@ goircd requires only standard Go's libraries and consists of single main -package. You can install it like that: +package. You can install it like either: + +* with: go get go.cypherpunks.ru/goircd +* or manually: $ git clone git://git.cypherpunks.ru/goircd.git - $ make -C goircd - $ goircd/goircd -help + $ cd goircd + $ redo goircd # or just: go build + $ ./goircd -help diff --git a/VERSION.do b/VERSION.do new file mode 100644 index 0000000..8cb734c --- /dev/null +++ b/VERSION.do @@ -0,0 +1,2 @@ +redo-ifchange goircd.go +perl -ne 'print "$1\n" if /Version.*"(.*)"$/' < goircd.go diff --git a/all.do b/all.do new file mode 100644 index 0000000..5a5ad15 --- /dev/null +++ b/all.do @@ -0,0 +1 @@ +redo-ifchange goircd diff --git a/common.mk b/common.mk deleted file mode 100644 index 888e048..0000000 --- a/common.mk +++ /dev/null @@ -1,4 +0,0 @@ -LDFLAGS = -X main.version=$(VERSION) - -goircd: *.go - go build -ldflags "$(LDFLAGS)" diff --git a/daemon.go b/daemon.go index a346be2..4b07e59 100644 --- a/daemon.go +++ b/daemon.go @@ -230,7 +230,7 @@ func ClientRegister(client *Client, cmd string, cols []string) { } client.registered = true client.ReplyNicknamed("001", "Hi, welcome to IRC") - client.ReplyNicknamed("002", "Your host is "+*hostname+", running goircd "+version) + client.ReplyNicknamed("002", "Your host is "+*hostname+", running goircd "+Version) client.ReplyNicknamed("003", "This server was created sometime") client.ReplyNicknamed("004", *hostname+" goircd o o") SendLusers(client) @@ -562,7 +562,7 @@ func Processor(events chan ClientEvent, finished chan struct{}) { } else { debug = "" } - client.ReplyNicknamed("351", fmt.Sprintf("%s.%s %s :", version, debug, *hostname)) + client.ReplyNicknamed("351", fmt.Sprintf("%s.%s %s :", Version, debug, *hostname)) default: client.ReplyNicknamed("421", cmd, "Unknown command") } diff --git a/goircd.do b/goircd.do new file mode 100644 index 0000000..0b53edd --- /dev/null +++ b/goircd.do @@ -0,0 +1,2 @@ +redo-ifchange *.go +${GO:-go} build -o $3 diff --git a/goircd.go b/goircd.go index 93cb675..deb6e35 100644 --- a/goircd.go +++ b/goircd.go @@ -28,8 +28,9 @@ import ( "strings" ) +const Version = "1.8.2" + var ( - version string hostname = flag.String("hostname", "localhost", "Hostname") bind = flag.String("bind", ":6667", "Address to bind to") motd = flag.String("motd", "", "Path to MOTD file") @@ -71,7 +72,7 @@ func Run() { log.Println(*logdir, "logger initialized") } - log.Println("goircd " + version + " is starting") + log.Println("goircd " + Version + " is starting") if *statedir == "" { // Dummy statekeeper go func() {