2 # - initscripts https://github.com/mholt/caddy/tree/master/dist/init
5 %bcond_with tests # build with tests
7 Summary: Fast, cross-platform HTTP/2 web server with automatic HTTPS
12 Group: Networking/Daemons/HTTP
13 Source0: https://github.com/mholt/caddy/archive/v%{version}/%{name}-%{version}.tar.gz
14 # Source0-md5: cbf02596335f0977c7d04f90afecc696
15 URL: https://caddyserver.com/
16 BuildRequires: golang >= 1.8
17 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19 %define _enable_debug_packages 0
20 %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v %{?debug:-x} %{?**};
21 %define gopath %{_libdir}/golang
22 %define import_path github.com/mholt/%{name}
25 Caddy is a lightweight, general-purpose web server for Windows, Mac,
26 Linux, BSD and Android. It is a capable alternative to other popular
27 and easy to use web servers.
29 The most notable features are HTTP/2, Let's Encrypt support, Virtual
30 Hosts, TLS + SNI, and easy configuration with a Caddyfile. In
31 development, you usually put one Caddyfile with each site. In
32 production, Caddy serves HTTPS by default and manages all
33 cryptographic assets for you.
40 install -d $GOPATH/src
43 install -d $GOPATH/src/github.com/mholt
44 ln -s ../../../.. $GOPATH/src/github.com/mholt/caddy
47 export GOPATH=$(pwd)/vendor
49 # command extraced by running "build.bash" from git tree
50 # however only gitTag is relevant for release build
51 LDFLAGS="-X main.gitTag=v%{version}"
56 rm -rf $RPM_BUILD_ROOT
57 install -d $RPM_BUILD_ROOT%{_sbindir}
58 install -p %{name}.bin $RPM_BUILD_ROOT%{_sbindir}/%{name}
61 rm -rf $RPM_BUILD_ROOT
64 %defattr(644,root,root,755)
66 %attr(755,root,root) %{_sbindir}/%{name}