#============================================================================= # Overview of build options: # # End of build options #----------------------------------------------------------------------------- ##trace %global debug_package %{nil} # parallism is not supported so force single job compilation %global _smp_mflags -j1 %global version 0.20.1 %global release 1 %global gitdate 20220130 %global commit xxx %global shortcommit %(c=%{commit}; echo ${c:0:7}) # set this to "0" if not building a dev/beta/rc release %global beta_or_rc 0 #============================================================================= # general #----------------------------------------------------------------------------- Name: gotosocial Version: %{version} %if %{beta_or_rc} Release: 0.%{release}.%{gitdate}git%{shortcommit}%{?dist} %else Release: %{release}%{?dist} %endif Summary: Fast, fun, ActivityPub server, powered by Go License: AGPL-3.0-only URL: https://codeberg.org/superseriousbusiness/gotosocial %if %{beta_or_rc} Source0: https://codeberg.org/superseriousbusiness/gotosocial/archive/%{commit}/gotosocial-%{version}-git%{shortcommit}.tar.gz %else Source0: https://codeberg.org/superseriousbusiness/gotosocial/releases/download/v%{version}/gotosocial-%{version}-source-code.tar.gz %endif # go-swagger is not packaged so include the binary from # https://github.com/go-swagger/go-swagger #Source1: swagger_linux_amd64 #Source2: swagger_linux_arm64 Source1: gotosocial-sysusers.conf Source2: gotosocial-tmpfiles.conf Patch0: gotosocial-use-fhs-directories-0.20.0.patch BuildRequires: git-core >= 2.51.0 BuildRequires: golang >= 1.24.8 # see Source1 #BuildRequires: go-swagger #BuildRequires: make BuildRequires: nodejs >= 24 BuildRequires: npm BuildRequires: yarnpkg BuildRequires: systemd %{?systemd_requires} %description GoToSocial is an ActivityPub social network server, written in Golang. With GoToSocial, you can keep in touch with your friends, post, read, and share images and articles. All without being tracked or advertised to! #%%package nginx #Summary: Nginx configuration for %%{name} #Group: Development/Tools #Requires: %%{name} #Requires: nginx #%%description nginx #Nginx configuration files for %%{name} #============================================================================= # prep #----------------------------------------------------------------------------- %prep %if %{beta_or_rc} %autosetup -p1 -n %{name} %else %autosetup -p1 -c %{name}-%{version} -n %{name}-%{version} %endif # set version in the build script sed -i -e"s|\${VERSION.*}|%{version}|" scripts/build.sh # # copy swagger # %%ifarch x86_64 # cp -av %%{SOURCE1} swagger # %%endif # %%ifarch aarch64 # cp -av %%{SOURCE2} swagger # %%endif # chmod 0755 swagger # set port to 8008 which has no SELinux AVC issues sed -ie -e's|^port: 8080|port: 8008|' example/config.yaml #============================================================================= # build #----------------------------------------------------------------------------- %build #./swagger generate spec --scan-models --exclude-deps -o web/assets/swagger.yaml #sed -i -e "s/REPLACE_ME/%%{version}/" web/assets/swagger.yaml ./scripts/build.sh # generate web assets yarn --cwd ./web/source install --frozen-lockfile yarn --cwd ./web/source ts-patch install yarn --cwd ./web/source build #? node web/source #============================================================================= # install #----------------------------------------------------------------------------- %install install -d -m0755 %{buildroot}%{_sysconfdir}/%{name} install -d -m0755 %{buildroot}%{_rundir}/%{name} install -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name}/storage install -d -m0755 %{buildroot}%{_localstatedir}/log/%{name} install -d -m0755 %{buildroot}%{_sysusersdir} install -d -m0755 %{buildroot}%{_tmpfilesdir} install -d -m0755 %{buildroot}%{_unitdir} install -v -D -m0755 %{name} -t %{buildroot}%{_bindir} install -v -D -m0640 example/config.yaml -t %{buildroot}%{_sysconfdir}/%{name} install -v -D -m0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf install -v -D -m0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -v -D -m0644 example/%{name}.service -t %{buildroot}%{_unitdir} install -v -d %{buildroot}%{_datadir}/%{name} cp -v -a web/assets/* %{buildroot}%{_datadir}/%{name} cp -v -a web/template %{buildroot}%{_sysconfdir}/%{name} #============================================================================= # files #----------------------------------------------------------------------------- %files %license LICENSE %doc README.md CONTRIBUTING.md ROADMAP.md example/config.yaml %{_bindir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/config.yaml %config(noreplace) %{_sysconfdir}/%{name}/template/*.tmpl %{_datadir}/%{name} %{_sysusersdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf %{_unitdir}/%{name}.service %{_rundir}/%{name} %{_localstatedir}/lib/%{name} %{_localstatedir}/log/%{name} #============================================================================= # post #----------------------------------------------------------------------------- %post /sbin/restorecon -F -R /etc/gotosocial \ /run/gotosocial \ /usr/bin/gotosocial \ /usr/lib/systemd/system/gotosocial* \ /usr/share/gotosocial \ /var/lib/gotosocial \ /var/log/gotosocial &> /dev/null systemctl daemon-reload %systemd_post gotosocial.service #============================================================================= # preun #----------------------------------------------------------------------------- %preun %systemd_preun gotosocial.service #============================================================================= # postun #----------------------------------------------------------------------------- %postun %systemd_postun_with_restart gotosocial.service #============================================================================= # changelog #----------------------------------------------------------------------------- %changelog * Sat Oct 18 2025 Patrick Laimbock - 0.20.1-1 - update to version 0.20.1 * Tue Oct 14 2025 Patrick Laimbock - 0.20.0-1 - update to version 0.20.0 * Wed Jul 17 2024 Patrick Laimbock - 0.16.0-1 - update to version 0.16.0 - require golang >= 1.22 - require nodejs >= 18 - update swagger_linux_amd64 to v0.31.0 (2024-05-12) * Sun Aug 27 2023 Patrick Laimbock - 0.11.1-3 - set accounts-registration-open to false in config.yaml * Sat Aug 26 2023 Patrick Laimbock - 0.11.1-2 - force SELinux security contexts restore of all gotosocial files in %%post - in config.yaml set port to 8008 to prevent an SELinux AVC - clean up * Thu Aug 24 2023 Patrick Laimbock - 0.11.1-1 - initial version 0.11.1 for EL9