diff --git a/SOURCES/mercury@.service b/SOURCES/mercury@.service new file mode 100644 index 0000000..2a02dbb --- /dev/null +++ b/SOURCES/mercury@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mercury +After=syslog.target +After=network.target + +[Service] +# Modify these two values and uncomment them if you have +# repos with lots of files and get an HTTP error 500 because +# of that +### +#LimitMEMLOCK=infinity +#LimitNOFILE=65535 +Type=simple +ExecStart=/usr/bin/mercury -config /etc/mercury/$i.toml + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/mercury@.timer b/SOURCES/mercury@.timer new file mode 100644 index 0000000..d8a3440 --- /dev/null +++ b/SOURCES/mercury@.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Mercury + +[Timer] +OnUnitActiveSec=10s +OnBootSec=10s +OnCalendar=*-*-* *:00/30:05 + +[Install] +WantedBy=multi-user.target diff --git a/SPECS/mercury.spec b/SPECS/mercury.spec new file mode 100644 index 0000000..e7a8c80 --- /dev/null +++ b/SPECS/mercury.spec @@ -0,0 +1,66 @@ +%global _hardened_build 1 + +Name : mercury +Version : 20220601 +Release : 1%{dist} +License : MIT +URL : https://github.com/kgaughan/mercury +Summary : A Planet-style feed aggregator +Source0 : mercury@.service +Source1 : mercury@.timer +BuildRequires: golang +BuildRequires: git +Requires : git + + +%description +Mercury is intended a replacement for Sam Ruby's Planet Venus. +A planet is a kind of feed aggregator. +It takes a list of newsfeeds (Atom, RSS, &c.), splices them together, and spits a set of HTML pages and/or a feed. + + +%prep +%setup -T -q -c %{name}-%{version} +export GOPATH=`pwd` +mkdir -p go/src/github.com/kgaughan +cd go/src/github.com/kgaughan +git clone https://github.com/kgaughan/mercury + + +%build +export GOPATH=`pwd` +export GO111MODULE=on +cd go/src/github.com/kgaughan/mercury +go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'main.Version="%{version}"' -X 'main.MakeVersion="%{release}"'" + + +%install +install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/mercury@.service +install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/mercury@.timer +mkdir -p %{buildroot}/%{_sysconfdir}/%{name}/ +install -p -D -m 0644 go/src/github.com/kgaughan/mercury/mercury.toml %{buildroot}%{_sysconfdir}/%{name}/config.toml +cp -rv go/src/github.com/kgaughan/mercury/theme/ %{buildroot}%{_sysconfdir}/%{name}/theme/ +install -p -D -m 0555 go/src/github.com/kgaughan/mercury/mercury %{buildroot}%{_bindir}/mercury + + +%post +%systemd_post mercury@.service + + +%preun +%systemd_preun mercury@.service + + +%postun +%systemd_postun mercury@.service + + +%files +%config(noreplace) %{_sysconfdir}/%{name}/config.toml +%config(noreplace) %{_sysconfdir}/%{name}/theme/ +%{_bindir}/mercury +%{_unitdir}/mercury@.service +%{_unitdir}/mercury@.timer + + +%changelog