forked from vmware/photon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsul.spec
144 lines (126 loc) · 5.49 KB
/
consul.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
%global debug_package %{nil}
Name: consul
Version: 1.14.2
Release: 3%{?dist}
Summary: Consul is a tool for service discovery and configuration.
License: Mozilla Public License, version 2.0
Group: System Environment/Daemons
Vendor: VMware, Inc.
Distribution: Photon
URL: https://github.com/hashicorp/consul
Source0: https://github.com/hashicorp/consul/archive/refs/tags/%{name}-%{version}.tar.gz
%define sha512 %{name}-%{version}=58052afc7cc6536099b0bfe2ceca7ef4d0cb76cd08df67508b77b7c58719fd9617919228ccd5a5c150fcbbaca550299baa5e26586d6ca1296f7b84f5760ae11f
Source1: %{name}.service
Source2: %{name}.sysusers
BuildRequires: systemd-devel
BuildRequires: go
BuildRequires: ca-certificates
Requires(pre): systemd-rpm-macros
Requires: systemd
%description
Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable.
Consul provides several key features:
* Service Discovery - Consul makes it simple for services to register themselves and to discover other services via a DNS or HTTP interface.
- External services such as SaaS providers can be registered as well.
* Health Checking - Health Checking enables Consul to quickly alert operators about any issues in a cluster.
- The integration with service discovery prevents routing traffic to unhealthy hosts and enables service level circuit breakers.
* Key/Value Storage - A flexible key/value store enables storing dynamic configuration, feature flagging, coordination, leader election and more.
- The simple HTTP API makes it easy to use anywhere.
* Multi-Datacenter - Consul is built to be datacenter aware, and can support any number of regions without complex configuration.
%prep
%autosetup -p1
%build
go build -v -o %{name}
%install
install -vdm 755 %{buildroot}%{_bindir}
install %{name} %{buildroot}%{_bindir}
install -vdm 755 %{buildroot}%{_sysconfdir}/%{name}.d
install -vdm 755 %{buildroot}%{_unitdir}
install -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}
install -vdm 755 %{buildroot}%{_sharedstatedir}/%{name}
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.sysusers
%pre
%sysusers_create_compat %{SOURCE2}
%post
/sbin/ldconfig
%systemd_post %{name}.service
if [ $1 -ge 1 ]; then
chown -PR %{name}:%{name} %{_sharedstatedir}/%{name}
fi
%postun
if [ $1 -eq 0 ]; then
# this is delete operation
if getent passwd %{name} >/dev/null; then
userdel %{name}
fi
if getent group %{name} >/dev/null; then
groupdel %{name}
fi
fi
/sbin/ldconfig
%systemd_postun_with_restart %{name}.service
%preun
/sbin/ldconfig
%systemd_preun %{name}.service
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_unitdir}/%{name}.service
%dir %{_sysconfdir}/%{name}.d
%dir %{_sharedstatedir}/%{name}
%{_sysusersdir}/%{name}.sysusers
%changelog
* Sun Mar 12 2023 Piyush Gupta <[email protected]> 1.14.2-3
- Bump up version to compile with new go
* Fri Mar 10 2023 Mukul Sikka <[email protected]> 1.14.2-2
- Use systemd-rpm-macros for user creation
* Tue Dec 13 2022 Gerrit Photon <[email protected]> 1.14.2-1
- Automatic Version Bump
* Mon Nov 21 2022 Piyush Gupta <[email protected]> 1.11.4-4
- Bump up version to compile with new go
* Wed Oct 26 2022 Piyush Gupta <[email protected]> 1.11.4-3
- Bump up version to compile with new go
* Fri Jun 17 2022 Piyush Gupta <[email protected]> 1.11.4-2
- Bump up version to compile with new go
* Tue Apr 05 2022 Shreenidhi Shedi <[email protected]> 1.11.4-1
- Upgradeto v1.11.4 & fix spec issues
* Thu Mar 17 2022 Nitesh Kumar <[email protected]> 1.10.8-1
- Version upgrade to 1.10.8, fixes CVE-2022-24687
* Tue Dec 21 2021 Nitesh Kumar <[email protected]> 1.10.4-1
- Version upgrade to 1.10.4, fixes CVE-2021-41805
* Tue Aug 03 2021 Nitesh Kumar <[email protected]> 1.10.1-1
- Version upgrade to 1.10.1, fixes CVE-2021-32574
* Fri Jun 11 2021 Piyush Gupta <[email protected]> 1.9.5-2
- Bump up version to compile with new go
* Mon Apr 12 2021 Gerrit Photon <[email protected]> 1.9.5-1
- Automatic Version Bump
* Fri Feb 05 2021 Harinadh D <[email protected]> 1.9.1-3
- Bump up version to compile with new go
* Fri Jan 15 2021 Piyush Gupta<[email protected]> 1.9.1-2
- Bump up version to compile with new go
* Wed Dec 16 2020 Shreenidhi Shedi <[email protected]> 1.9.1-1
- Bump version to fix CVE-2020-28053
* Tue Nov 17 2020 Shreenidhi Shedi <[email protected]> 1.8.5-1
- Upgrade to v1.8.5, fixes CVE-2020-25201
* Mon Sep 21 2020 Gerrit Photon <[email protected]> 1.8.4-1
- Automatic Version Bump
* Wed Aug 12 2020 Gerrit Photon <[email protected]> 1.8.3-1
- Automatic Version Bump
* Thu Jul 09 2020 Shreenidhi Shedi <[email protected]> 1.8.0-1
- Upgrade to version 1.8.0
* Tue Mar 10 2020 Shreenidhi Shedi <[email protected]> 1.7.1-1
- Version upgrade to 1.7.1; fixes CVE-2020-7219 & CVE-2020-7955
* Tue Oct 22 2019 Ashwin H <[email protected]> 1.2.3-4
- Bump up version to compile with go 1.13.3
* Fri Aug 30 2019 Ashwin H <[email protected]> 1.2.3-3
- Bump up version to compile with new go
* Mon Jun 03 2019 Siju Maliakkal <[email protected]> 1.2.3-2
- Applied patch for CVE-2018-19653
* Mon Oct 22 2018 Ajay Kaher <[email protected]> 1.2.3-1
- Upgraded to version 1.2.3
* Mon Jul 09 2018 Alexey Makhalov <[email protected]> 1.1.0-2
- Modify command line parameters in .service file.
* Thu Jun 28 2018 Ankit Jain <[email protected]> 1.1.0-1
- Initial build. First version