diff --git a/SOURCES/soju.service b/SOURCES/soju.service new file mode 100644 index 0000000..0c62c09 --- /dev/null +++ b/SOURCES/soju.service @@ -0,0 +1,14 @@ +[Unit] +Description=soju +After=syslog.target +After=network.target + +[Service] +Type=simple +User=root +Group=root +ExecStart=/usr/bin/sojud -config /etc/soju/soju.conf +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/SPECS/soju.spec b/SPECS/soju.spec new file mode 100644 index 0000000..a380253 --- /dev/null +++ b/SPECS/soju.spec @@ -0,0 +1,65 @@ +%global _hardened_build 1 +%define debug_package %{nil} + +Name: soju +Version: 0.1.1 +Release: 1%{?dist} +Summary: A user-friendly IRC bouncer +Group: System/Library +License: MIT +URL: https://github.com/42wim/matterircd +Source0: soju.service +BuildRequires: golang + + +%description +A user-friendly IRC bouncer : + - Multi-user + - Support multiple clients for a single user, with proper backlog synchronization + - Support connecting to multiple upstream servers via a single IRC connection to the bouncer + + +%prep +%setup -q -T -c %{name}-%{version} +export GOPATH=`pwd` +mkdir -p src/git.sr.ht/~emersion/ +cd src/git.sr.ht/~emersion/ +git clone https://git.sr.ht/~emersion/soju + + +%build +export GOPATH=`pwd` +cd src/git.sr.ht/~emersion/soju +git checkout tags/v%{version} +go build -v -trimpath --ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid %{version}" -o sojud ./cmd/soju +go build -v -trimpath --ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid %{version}" -o soju-ctl ./cmd/sojuctl + + +%install +install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/soju.service +install -p -D -m 0555 src/git.sr.ht/~emersion/soju/sojud %{buildroot}%{_bindir}/sojud +install -p -D -m 0555 src/git.sr.ht/~emersion/soju/soju-ctl %{buildroot}%{_bindir}/soju-ctl +install -p -D -m 0644 src/git.sr.ht/~emersion/soju/config.in %{buildroot}%{_sysconfdir}/soju/soju.conf + + +%post +%systemd_post soju.service + + +%preun +%systemd_preun soju.service + + +%postun +%systemd_postun soju.service + + +%files +%doc +%config(noreplace) %{_sysconfdir}/soju/soju.conf +%{_unitdir}/soju.service +%{_bindir}/sojud +%{_bindir}/soju-ctl + + +%changelog