Skip to content

Commit

Permalink
for rpmautospec [skip changelog]
Browse files Browse the repository at this point in the history
  • Loading branch information
kilesduli committed Oct 3, 2024
1 parent 5f3a4a8 commit 9d7df77
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
95 changes: 95 additions & 0 deletions artalk.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
%global goipath github.com/artalkjs/artalk/v2
Version: 2.9.1
%gometa -f
Name: artalk
Release: %autorelease
Summary: A Self-hosted Comment System
License: MIT
URL: https://artalk.js.org/
Source0: %{name}-%{version}-vendored.tar.gz
# track this script
Source1: vendor-tarball.sh
Source2: https://github.com/ArtalkJS/Artalk/releases/download/v%{version}/artalk_ui.tar.gz
Source3: artalk.sysusers
Source4: artalk.service
Patch1: 0001-fix-go-test-ld-undefined-error-by-remove-clickhouse.patch
Patch2: 0002-remove-upgrade-command.patch
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%{?sysusers_requires_compat}


%description
Artalk is an intuitive yet feature-rich comment system, ready for immediate deployment into any blog, website, or web application.


%gopkg


%prep
%autosetup -p1
tar --strip-components=1 -xzf %{SOURCE2} --directory=public
%goprep -k -e
chmod -Rf a+rX,u+w,g-w,o-w .


%build
%gobuild -o %{gobuilddir}/bin/artalk %{goipath}


%install
%gopkginstall

# command
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

# sysusers
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf

# data directory (work dir)
install -d -m 0750 %{buildroot}%{_sharedstatedir}/artalk

# config
install -D -p -m 0644 ./conf/artalk.example.yml %{buildroot}%{_sysconfdir}/artalk/artalk.yml

# systemd units
install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/artalk.service


%check
%gocheck


%pre
%sysusers_create_compat %{SOURCE3}


%post
%systemd_post artalk.service


%preun
%systemd_preun artalk.service


%postun
%systemd_postun_with_restart artalk.service


%files
%doc CONTRIBUTING.md README.md
%license LICENSE
%{_bindir}/artalk
%{_unitdir}/artalk.service
%{_sysusersdir}/%{name}.conf
%dir %{_sysconfdir}/artalk
%config(noreplace) %{_sysconfdir}/artalk/artalk.yml
%attr(0750,artalk,artalk) %dir %{_sharedstatedir}/artalk


%gopkgfiles


%changelog
%autochangelog
32 changes: 32 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
* Wed Oct 02 2024 duli <[email protected]> - 2.9.1-11
- improve vendor-tarball.sh to make it reproducible

* Wed Oct 02 2024 duli <[email protected]> - 2.9.1-10
- remove upgrade command

* Wed Oct 02 2024 duli <[email protected]> - 2.9.1-9
- add package testing

* Wed Oct 02 2024 duli <[email protected]> - 2.9.1-8
- reuse %%gobuild instead of go build -mod=vendor

* Wed Oct 02 2024 duli <[email protected]> - 2.9.1-7
- change the way vendor artalk

* Tue Oct 01 2024 duli <[email protected]> - 2.9.1-6
- reorganize spec file

* Tue Oct 01 2024 duli <[email protected]> - 2.9.1-5
- add systemd service

* Tue Oct 01 2024 duli <[email protected]> - 2.9.1-4
- add config file

* Tue Oct 01 2024 duli <[email protected]> - 2.9.1-3
- fix: ui files lack

* Tue Oct 01 2024 duli <[email protected]> - 2.9.1-2
- add artalk user and group

* Mon Sep 30 2024 duli <[email protected]> - 2.9.1-1
- initial commit

0 comments on commit 9d7df77

Please sign in to comment.