]> Cypherpunks.ru repositories - goircd.git/commitdiff
Replace Makefile with redo, keep version in source code v1.8.2
authorSergey Matveev <stargrave@stargrave.org>
Sat, 5 Sep 2020 08:30:25 +0000 (11:30 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 5 Sep 2020 08:30:25 +0000 (11:30 +0300)
.gitignore
BSDmakefile [deleted file]
GNUmakefile [deleted file]
INSTALL
VERSION.do [new file with mode: 0644]
all.do [new file with mode: 0644]
common.mk [deleted file]
daemon.go
goircd.do [new file with mode: 0644]
goircd.go

index 3cbdb9e5693275b1f41d3688e30e74e1d527bccb..599680dfc338d5d13927e86bf6504a6c5dcdfc6b 100644 (file)
@@ -1,2 +1,4 @@
 *.deb
 *_tmp
+goircd
+VERSION
diff --git a/BSDmakefile b/BSDmakefile
deleted file mode 100644 (file)
index e3e6326..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-VERSION != git describe --tags
-
-include common.mk
diff --git a/GNUmakefile b/GNUmakefile
deleted file mode 100644 (file)
index d8024b8..0000000
+++ /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 6e9a1bcd82fa408f4211daa76826fa3a8000e38c..3c5c63420328e3b6fc35715651366212b449ba99 100644 (file)
--- 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 (file)
index 0000000..8cb734c
--- /dev/null
@@ -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 (file)
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 (file)
index 888e048..0000000
--- a/common.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-LDFLAGS = -X main.version=$(VERSION)
-
-goircd: *.go
-       go build -ldflags "$(LDFLAGS)"
index a346be2e925647fdf51503053fab27bed9831cb1..4b07e59fcdcfd4357515cd62cc42cfde889dc8de 100644 (file)
--- 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 (file)
index 0000000..0b53edd
--- /dev/null
+++ b/goircd.do
@@ -0,0 +1,2 @@
+redo-ifchange *.go
+${GO:-go} build -o $3
index 93cb67553109e76371dadf61747379829ede6239..deb6e3542feca9d32a1f494f3ffefdb5f0415403 100644 (file)
--- 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() {