-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec
70 lines (52 loc) · 1.92 KB
/
spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Name: fast-https
Version: 1.0.0
Release: 1%{?dist}
Summary: fast-https web server
Group: Development/Tools
License: GPL
URL: https://gitee.com/src-openeuler/fast-https
Source0: %{name}-%{version}.tar.gz
# BuildRequires: golang
# Requires:
%description
fast-https web server
%prep
%setup -q -c -T
wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz
tar xvf go1.22.4.linux-amd64.tar.gz
export PATH=$PATH:`pwd`/go/bin
tar -zxvf %{_sourcedir}/%{name}-%{version}.tar.gz
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
%build
export PATH=$PATH:`pwd`/go/bin
go build -ldflags="-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -tags=rpm .
%install
# //usr/bin
# //share/fast-https
install -d %{buildroot}/%{_bindir}
install -d %{buildroot}/%{_datadir}/%{name}/config
install -d %{buildroot}/%{_datadir}/%{name}/config/conf.d
install -d %{buildroot}/%{_datadir}/%{name}/config/cert
install -d %{buildroot}/%{_datadir}/%{name}/httpdoc/root
install -d %{buildroot}/%{_datadir}/%{name}/logs
# Installing the binary
install -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
# Installing additional files config
install -m 0644 config/fast-https.json %{buildroot}/%{_datadir}/%{name}/config/fast-https.json
install -m 0644 config/mime.json %{buildroot}/%{_datadir}/%{name}/config/mime.json
# Installing additional files httpdoc
install -m 0644 httpdoc/root/favicon.ico %{buildroot}/%{_datadir}/%{name}/httpdoc/root/favicon.ico
install -m 0644 httpdoc/root/index.html %{buildroot}/%{_datadir}/%{name}/httpdoc/root/index.html
%files
%{_bindir}/%{name}
%{_datadir}/%{name}/config/fast-https.json
%{_datadir}/%{name}/config/mime.json
%{_datadir}/%{name}/httpdoc/root/favicon.ico
%{_datadir}/%{name}/httpdoc/root/index.html
%dir %{_datadir}/%{name}/config/conf.d
%dir %{_datadir}/%{name}/config/cert
%dir %{_datadir}/%{name}/logs
%doc README.md
%license LICENSE
%changelog