caddy/caddy.spec

119 lines
3.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package caddy
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define project github.com/caddyserver/caddy
Name: caddy
Accepting request 989489 from home:dirkmueller:Factory - Update to version 2.5.2: * admin: expect quoted ETags (#4879) * headers: Only replace known placeholders (#4880) * reverseproxy: Err 503 if all upstreams unavailable * reverseproxy: Adjust new TLS Caddyfile directive names (#4872) * fileserver: Use safe redirects in file browser * admin: support ETag on config endpoints (#4579) * go.mod: Bump up quic-go to v0.28.0, fixes for BC breaks (#4867) * caddytls: Reuse issuer between PreCheck and Issue (#4866) * admin: Implement /adapt endpoint (close #4465) (#4846) * forwardauth: Fix case when `copy_headers` is omitted (#4856) * Expose several Caddy HTTP Matchers to the CEL Matcher (#4715) * reverseproxy: Fix double headers in response handlers (#4847) * reverseproxy: Fix panic when TLS is not configured (#4848) * reverseproxy: Skip TLS for certain configured ports (#4843) * go.mod: Update some dependencies * forwardauth: Support renaming copied headers, block support (#4783) * Add comment about xcaddy to main * headers: Support wildcards for delete ops (close #4830) (#4831) * reverseproxy: Dynamic ServerName for TLS upstreams (#4836) * reverseproxy: Make TLS renegotiation optional * reverseproxy: Add renegotiation param in TLS client (#4784) * caddyhttp: Log error from CEL evaluation (fix #4832) * reverseproxy: Correct the `tls_server_name` docs (#4827) * reverseproxy: HTTP 504 for upstream timeouts (#4824) * caddytls: Make peer certificate verification pluggable (#4389) * reverseproxy: api: Remove misleading 'healthy' value * go.mod: Update go-yaml to v3 * Fix #4822 and fix #4779 * reverseproxy: Add --internal-certs CLI flag #3589 (#4817) OBS-URL: https://build.opensuse.org/request/show/989489 OBS-URL: https://build.opensuse.org/package/show/server:http/caddy?expand=0&rev=14
2022-07-19 13:44:45 +02:00
Version: 2.5.2
Release: 0
Summary: Fast, multi-platform web server with automatic HTTPS
License: Apache-2.0
Group: Productivity/Networking/Web/Proxy
URL: https://caddyserver.com/
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: Caddyfile
Source3: caddy.service
Source4: index.html
Source5: bash-completion
Source6: zsh-completion
BuildRequires: golang-packaging
BuildRequires: systemd-rpm-macros
BuildRequires: golang(API) >= 1.17
%{?systemd_requires}
%{go_provides}
# Make sure that the binary is not getting stripped.
%{go_nostrip}
%description
Caddy is a powerful, extensible platform to serve your sites, services, and
apps, written in Go.
It operates primarily at L4 (transport layer) and L7 (application layer) of
the OSI model, though it has the ability to work with other layers.
%prep
%setup -q
%build
%{goprep} %{project}
# tarball causes "inconsistent vendoring"
tar -xf %{SOURCE1}
CGO_ENABLED=0
go build -v -buildmode=pie -mod=vendor -ldflags "-s -w" -o caddy cmd/caddy/main.go
%install
install -d %{buildroot}/%{_sbindir}
install -D -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
# configuration
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/Caddyfile
# service
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
# data directory
install -d -m 0750 %{buildroot}%{_sharedstatedir}/%{name}
# welcome page
install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/index.html
# bash completion
install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_datadir}/bash-completion/completions/%{name}
install -D -p -m 0644 %{SOURCE6} %{buildroot}%{_datadir}/zsh/site-functions/_%{name}
%pre
getent group %{name} >/dev/null || %{_sbindir}/groupadd -r %{name}
getent passwd %{name} >/dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /bin/false -c "Caddy web server" %{name}
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%{fillup_only -n %{name}}
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%license LICENSE
%doc AUTHORS README.md
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/Caddyfile
%attr(0750,%{name},%{name}) %dir %{_sharedstatedir}/%{name}
# filesystem owns all the parent directories here
%{_datadir}/bash-completion/completions/%{name}
# own parent directories in case zsh is not installed
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_%{name}
%changelog