summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO12
-rw-r--r--.editorconfig10
-rw-r--r--PKGBUILD47
-rw-r--r--install36
-rw-r--r--oragono.tmpfiles4
-rw-r--r--path.patch45
6 files changed, 95 insertions, 59 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b0ec61e7a43f..f37f99265c38 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,27 +1,25 @@
pkgbase = oragono
pkgdesc = A modern IRC server written in Go.
- pkgver = 1.0.0
+ pkgver = 2.6.1
pkgrel = 1
url = https://github.com/oragono/oragono
install = install
arch = x86_64
license = MIT
- makedepends = go-pie
+ makedepends = go
makedepends = git
depends = glibc
backup = etc/oragono.conf
- source = git+https://github.com/oragono/oragono#tag=v1.0.0
- source = git+https://github.com/oragono/oragono-vendor
+ source = git+https://github.com/oragono/oragono#tag=v2.6.1
source = oragono.service
source = oragono.sysusers
source = path.patch
source = oragono.tmpfiles
sha256sums = SKIP
- sha256sums = SKIP
sha256sums = d35dd5205e3b607ee105a1252677d0607d0c35636ee3e6057275b5f13e555858
sha256sums = 7e214caa8bee053adac26a00a17ed732970e86665cbe31553b1d3d609f0a49b4
- sha256sums = 9b6bae7dc9bb49cb2ca4ec4dedc23ac4f2f2275958caae34316ca4462d674e69
- sha256sums = d56a8935891bc421683e48245786c9f8d9d4c449197de5f455ce7d7804907c7a
+ sha256sums = ce58277f778809df5f6bdaa5d6997f5d55157e367c0d4a0b6cae0a61fd293e51
+ sha256sums = 8f6baaa89e9723ac3344a2af201a93f348975537bc748024c0a48b0773f42b1f
pkgname = oragono
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..0ea0cc46c761
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
diff --git a/PKGBUILD b/PKGBUILD
index 5cffcf57340e..342ab527b8cc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: Sean Enck <enckse@gmail.com>
pkgname=oragono
-pkgver=1.0.0
+pkgver=2.6.1
pkgrel=1
pkgdesc="A modern IRC server written in Go."
arch=('x86_64')
@@ -10,56 +10,48 @@ url="https://github.com/oragono/oragono"
license=('MIT')
install=install
depends=('glibc')
-makedepends=('go-pie' 'git')
+makedepends=('go' 'git')
source=("git+$url#tag=v$pkgver"
- "git+https://github.com/oragono/oragono-vendor"
"oragono.service"
"oragono.sysusers"
"path.patch"
"oragono.tmpfiles")
sha256sums=('SKIP'
- 'SKIP'
'd35dd5205e3b607ee105a1252677d0607d0c35636ee3e6057275b5f13e555858'
'7e214caa8bee053adac26a00a17ed732970e86665cbe31553b1d3d609f0a49b4'
- '9b6bae7dc9bb49cb2ca4ec4dedc23ac4f2f2275958caae34316ca4462d674e69'
- 'd56a8935891bc421683e48245786c9f8d9d4c449197de5f455ce7d7804907c7a')
+ 'ce58277f778809df5f6bdaa5d6997f5d55157e367c0d4a0b6cae0a61fd293e51'
+ '8f6baaa89e9723ac3344a2af201a93f348975537bc748024c0a48b0773f42b1f')
backup=('etc/oragono.conf')
prepare() {
- export GOPATH=$(pwd)/..
cd "${srcdir}/$pkgname"
- local _path=$(pwd)
- git submodule init
- git config submodule.vendor.url "$srcdir"/oragono-vendor
- git submodule update
- patch -p1 < ../path.patch
- cd vendor/github.com/$pkgname
- rm -rf $pkgname
- mkdir -p $pkgname
- ln -s "$_path"/irc $pkgname/irc
- ln -s "$_path"/mkcerts $pkgname/mkcerts
+ patch < ../path.patch
}
build() {
+ export GOPATH=$(pwd)/..
cd "${srcdir}/$pkgname"
+ GIT_COMMIT="$(git rev-parse HEAD 2> /dev/null)"
+
# flags from https://wiki.archlinux.org/index.php/Go_package_guidelines
# to address issues namcap warns about:
# oragono W: ELF file ('usr/bin/oragono') lacks FULL RELRO, check LDFLAGS.
# oragono W: ELF file ('usr/bin/oragono') lacks PIE.
# related: https://bugs.archlinux.org/task/60928
- # GOFLAGS="-buildmode=pie"
- GOOS=linux GOARCH=amd64 \
- go build -v \
- -gcflags "all=-trimpath=${PWD}" \
- -asmflags "all=-trimpath=${PWD}" \
- -ldflags "-extldflags ${LDFLAGS}"
-
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -ldflags "-X main.commit=${GIT_COMMIT} -linkmode external -extldflags \"${LDFLAGS}\"" \
+ -v \
+ .
+
rm languages/README.md
rm -rf languages/example
}
check() {
+ export GOPATH=$(pwd)/..
cd "${srcdir}/$pkgname"
go test ./...
@@ -69,11 +61,12 @@ package() {
install -Dm644 oragono.service "$pkgdir/usr/lib/systemd/system/oragono.service"
install -Dm644 "$srcdir/oragono.sysusers" "$pkgdir/usr/lib/sysusers.d/oragono.conf"
install -Dm644 "$srcdir/oragono.tmpfiles" "${pkgdir}"/usr/lib/tmpfiles.d/oragono.conf
-
+
cd "${srcdir}/$pkgname"
install -Dm755 -d "$pkgdir/usr/share/$pkgname/i18n"
cp languages/* "$pkgdir/usr/share/$pkgname/i18n/"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
- install -Dm 755 oragono "$pkgdir/usr/bin/oragono"
- install -Dm 644 oragono.yaml "$pkgdir/etc/oragono.conf"
+ install -Dm755 oragono "$pkgdir/usr/bin/oragono"
+ install -Dm644 default.yaml "$pkgdir/etc/oragono.conf"
+ install -Dm644 oragono.motd "$pkgdir/usr/share/$pkgname/default.motd"
}
diff --git a/install b/install
index 243a8e7b53e9..de78ad3882b8 100644
--- a/install
+++ b/install
@@ -1,12 +1,36 @@
+# Warning: This file has syntactically significant, mixed whitespace.
+# The heredoc bodies are indented with tabs up to the block level.
+# The tabs are for block indentation in the source code.
+# The spaces following the tabs are for indentation of the printed output.
+
post_install() {
if [[ ! -e /var/lib/oragono/ircd.db ]]; then
- cat <<-EOF
- ==> oragono needs to initialize the database and have
- certificates made available prior to use.
+ cat <<-EOF
+ ==> oragono needs to initialize the database and have
+ certificates made available prior to use.
+ EOF
+ mkcert_howto
+ fi
+}
- cd /var/lib/oragono
- sudo -u oragono /usr/bin/oragono initdb --conf /etc/oragono.conf
- sudo -u oragono /usr/bin/oragono mkcerts --conf /etc/oragono.conf
+post_upgrade() {
+ if (( "$(vercmp "$2" 2.1.0)" < 0 )); then
+ cat <<-EOF
+ ==> The tls certificate filenames in the default config have changed.
+ In /var/lib/oragono/:
+ tls.crt -> fullchain.pem
+ tls.key -> privkey.pem
+
+ To generate new self-signed certificates:
EOF
+ mkcert_howto
fi
}
+
+mkcert_howto() {
+ cat <<-EOF
+ cd /var/lib/oragono
+ sudo -u oragono /usr/bin/oragono mkcerts --conf /etc/oragono.conf
+ sudo -u oragono /usr/bin/oragono initdb --conf /etc/oragono.conf
+ EOF
+}
diff --git a/oragono.tmpfiles b/oragono.tmpfiles
index dd20132bdbac..98b5f1d385ee 100644
--- a/oragono.tmpfiles
+++ b/oragono.tmpfiles
@@ -1 +1,3 @@
-d /var/lib/oragono 0755 oragono oragono
+#Type Path Mode User Group Age Argument
+d /var/lib/oragono 0755 oragono oragono - -
+C /var/lib/oragono/ircd.motd 0644 oragono oragono - /usr/share/oragono/default.motd
diff --git a/path.patch b/path.patch
index 492ca5fc3c87..1173ee9d560a 100644
--- a/path.patch
+++ b/path.patch
@@ -1,19 +1,28 @@
-diff --git a/oragono.yaml b/oragono.yaml
-index 6c5aa75..eed4991 100644
---- a/oragono.yaml
-+++ b/oragono.yaml
-@@ -23,8 +23,8 @@ server:
- tls-listeners:
- # listener on ":6697"
+--- default.yaml.orig 2021-02-01 15:50:27.556589528 +0000
++++ default.yaml 2021-02-01 15:52:59.786583877 +0000
+@@ -50,8 +50,8 @@
+ # The standard SSL/TLS port for IRC is 6697. This will listen on all interfaces:
":6697":
-- key: tls.key
-- cert: tls.crt
-+ key: /var/lib/oragono/tls.key
-+ cert: /var/lib/oragono/tls.crt
+ tls:
+- cert: fullchain.pem
+- key: privkey.pem
++ cert: /var/lib/oragono/fullchain.pem
++ key: /var/lib/oragono/privkey.pem
+ # 'proxy' should typically be false. It's for cloud load balancers that
+ # always send a PROXY protocol header ahead of the connection. See the
+ # manual ("Reverse proxies") for more details.
+@@ -70,8 +70,8 @@
+ # ":8097":
+ # websocket: true
+ # tls:
+- # cert: fullchain.pem
+- # key: privkey.pem
++ # cert: /var/lib/oragono/fullchain.pem
++ # key: /var/lib/oragono/privkey.pem
- # strict transport security, to get clients to automagically use TLS
- sts:
-@@ -54,7 +54,7 @@ server:
+ # sets the permissions for Unix listen sockets. on a typical Linux system,
+ # the default is 0775 or 0755, which prevents other users/groups from connecting
+@@ -166,7 +166,7 @@
# motd filename
# if you change the motd, you should move it to ircd.motd
@@ -22,16 +31,16 @@ index 6c5aa75..eed4991 100644
# motd formatting codes
# if this is true, the motd is escaped using formatting codes like $c, $b, and $i
-@@ -340,7 +340,7 @@ debug:
+@@ -714,7 +714,7 @@
# datastore configuration
datastore:
# path to the datastore
- path: ircd.db
+ path: /var/lib/oragono/ircd.db
- # languages config
- languages:
-@@ -352,7 +352,7 @@ languages:
+ # if the database schema requires an upgrade, `autoupgrade` will attempt to
+ # perform it automatically on startup. the database will be backed
+@@ -743,7 +743,7 @@
default: en
# which directory contains our language files