]> git.pld-linux.org Git - packages/caddy.git/blob - caddy.spec
less noisy build by default
[packages/caddy.git] / caddy.spec
1 # TODO
2 # - initscripts https://github.com/mholt/caddy/tree/master/dist/init
3 #
4 # Conditional build:
5 %bcond_with     tests           # build with tests
6
7 Summary:        Fast, cross-platform HTTP/2 web server with automatic HTTPS
8 Name:           caddy
9 Version:        0.10.7
10 Release:        0.1
11 License:        Apache v2.0
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)
18
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}
23
24 %description
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.
28
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.
34
35 %prep
36 %setup -q
37
38 GOPATH=$(pwd)/vendor
39 set -- $GOPATH/*
40 install -d $GOPATH/src
41 mv "$@" vendor/src
42
43 install -d $GOPATH/src/github.com/mholt
44 ln -s ../../../.. $GOPATH/src/github.com/mholt/caddy
45
46 %build
47 export GOPATH=$(pwd)/vendor
48
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}"
52
53 %gobuild -o caddy.bin
54
55 %install
56 rm -rf $RPM_BUILD_ROOT
57 install -d $RPM_BUILD_ROOT%{_sbindir}
58 install -p %{name}.bin $RPM_BUILD_ROOT%{_sbindir}/%{name}
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 %files
64 %defattr(644,root,root,755)
65 %doc README.md
66 %attr(755,root,root) %{_sbindir}/%{name}
This page took 0.434849 seconds and 3 git commands to generate.