94 lines
2.4 KiB
RPMSpec
94 lines
2.4 KiB
RPMSpec
%define debug_package %{nil}
|
||
%define subrel beta3
|
||
%define binname linux_amd64
|
||
|
||
Name: traefik
|
||
Version: 3.0.0
|
||
%if "=%{subrel}" == "="
|
||
Release: 1%{?dist}
|
||
%else
|
||
Release: %{subrel}.1%{?dist}
|
||
%endif
|
||
Summary: Træfɪk, a modern reverse proxy
|
||
ExclusiveArch: x86_64
|
||
|
||
Group: System Environment/Daemons
|
||
License: MIT
|
||
URL: https://traefik.io/
|
||
%if "=%{subrel}" == "="
|
||
Source0: %{name}_v%{version}_%{binname}.tar.gz
|
||
%else
|
||
Source0: %{name}_v%{version}-%{subrel}_%{binname}.tar.gz
|
||
%endif
|
||
Source1: traefik.service
|
||
Source2: traefik.sysconfig
|
||
Source3: https://raw.githubusercontent.com/containous/traefik/master/traefik.sample.toml
|
||
|
||
BuildRequires: systemd-units
|
||
|
||
Requires(pre): shadow-utils
|
||
Requires: glibc
|
||
Requires: systemd
|
||
|
||
%description
|
||
Træfɪk is a modern HTTP reverse proxy and load balancer made to deploy
|
||
microservices with ease. It supports several backends (Docker, Swarm,
|
||
Mesos/Marathon, Consul, Etcd, Zookeeper, BoltDB, Rest API, file...) to manage
|
||
its configuration automatically and dynamically.
|
||
|
||
%prep
|
||
%setup -q -c %{name}
|
||
|
||
%build
|
||
|
||
|
||
%install
|
||
install -D %{name} %{buildroot}%{_bindir}/%{name}
|
||
install -D %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
||
install -D %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
||
install -D %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/traefik.toml
|
||
|
||
%pre
|
||
getent group %{name} >/dev/null || groupadd -r %{name}
|
||
getent passwd %{name} >/dev/null || \
|
||
useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \
|
||
-c "%{name} user" %{name}
|
||
exit 0
|
||
|
||
%post
|
||
%systemd_post %{name}.service
|
||
|
||
%preun
|
||
%systemd_preun %{name}.service
|
||
|
||
%postun
|
||
case "$1" in
|
||
0)
|
||
# This is an uninstallation.
|
||
getent passwd %{name} >/dev/null && userdel %{name}
|
||
getent group %{name} >/dev/null && groupdel %{name}
|
||
;;
|
||
1)
|
||
# This is an upgrade.
|
||
;;
|
||
esac
|
||
%systemd_postun_with_restart %{name}.service
|
||
|
||
%clean
|
||
rm -rf %{buildroot}
|
||
|
||
%files
|
||
%doc CHANGELOG.md LICENSE.md
|
||
%defattr(-,root,root,-)
|
||
%attr(755, root, root) %{_bindir}/traefik
|
||
%dir %attr(750, root, %{name}) %{_sysconfdir}/%{name}
|
||
%attr(644, root, root) %{_unitdir}/%{name}.service
|
||
%config(noreplace) %attr(640, root, %{name}) %{_sysconfdir}/sysconfig/%{name}
|
||
%config(noreplace) %attr(640, root, %{name}) %{_sysconfdir}/%{name}/traefik.toml
|
||
|
||
|
||
%changelog
|
||
* Sat Jul 15 2023 Daniel Steiner <daniel.steiner@dsteiner.ch>
|
||
- First build on Fedora 38, Version: v3.0.0 Beta 3.
|
||
|