-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathcfengine-nova.spec.in
More file actions
181 lines (151 loc) · 4.62 KB
/
cfengine-nova.spec.in
File metadata and controls
181 lines (151 loc) · 4.62 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
%define prefix %{buildprefix}
Summary: The CFEngine Configuration System
Name: cfengine-nova
Version: @@VERSION@@
# {?dist} adds a dot-separated OS codename (like .el6 or .fc30)
Release: @@RELEASE@@%{?dist}
Vendor: Northern.tech AS
License: COSL
Group: Applications/System
Url: https://cfengine.com
BuildRoot: %{_topdir}/%{name}-%{version}-%{release}-buildroot
Obsoletes: cfengine3 < @@VERSION@@, cf-community < @@VERSION@@
Requires: coreutils
# "Recommends" is only supported on RHEL 8+
%if %{?rhel}%{!?rhel:0} >= 8
Recommends: gzip
%endif
# we require selinux-policy package version that matches or exceeds our build system version
# this guarantees that our compiled selinux policy will work.
%if %{?rhel}%{!?rhel:0} >= 8
Requires: selinux-policy >= @@SELINUX_POLICY_VERSION@@
%endif
AutoReqProv: no
%if %{?with_debugsym}%{!?with_debugsym:0}
%define debug_package {nil}
%endif
%description
CFEngine is the standalone, open-source datacenter management platform run by
leading enterprises since 1993. Customize your IT systems, align to network,
business and regulatory needs, monitor problems, automatically repair and
maintain systems.
%install
#rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{prefix}
cp -a %{prefix}/* $RPM_BUILD_ROOT%{prefix}
cp -a %{_basedir}/cfengine/dist/* $RPM_BUILD_ROOT
# ENT-11901
# For el9+ and suse-15+ we started seeing issues from other packages not expecting init scripts
%if %{?rhel}%{!?rhel:0} >= 9 || %{?suse_version}%{!?suse_version:0} >= 1500
rm -f $RPM_BUILD_ROOT/etc/sysconfig/cfengine3
rm -f $RPM_BUILD_ROOT/etc/profile.d/cfengine.sh
rm -f $RPM_BUILD_ROOT/etc/init.d/cfengine3
%endif
# Remove useless stuff
rm -f $RPM_BUILD_ROOT%{prefix}/lib/libpromises.la
rm -f $RPM_BUILD_ROOT%{prefix}/lib/libpromises.so
rm -f $RPM_BUILD_ROOT%{prefix}/lib/cfengine-enterprise.la
rm -rf $RPM_BUILD_ROOT%{prefix}/share/CoreBase
rm -f $RPM_BUILD_ROOT%{prefix}/bin/getfacl
rm -f $RPM_BUILD_ROOT%{prefix}/bin/openssl
rm -f $RPM_BUILD_ROOT%{prefix}/bin/curl
rm -f $RPM_BUILD_ROOT%{prefix}/bin/wcurl
rm -rf $RPM_BUILD_ROOT%{prefix}/ssl
# Remove enterprise systemd units
rm -rf $RPM_BUILD_ROOT/usr/lib/systemd/system/cf-apache.service
rm -rf $RPM_BUILD_ROOT/usr/lib/systemd/system/cf-php-fpm.service
rm -rf $RPM_BUILD_ROOT/usr/lib/systemd/system/cf-hub.service
rm -rf $RPM_BUILD_ROOT/usr/lib/systemd/system/cf-reactor.service
rm -rf $RPM_BUILD_ROOT/usr/lib/systemd/system/cf-postgres.service
%clean
#rm -rf $RPM_BUILD_ROOT
# Script is inserted here.
%pre
# Script is inserted here.
%post
# Script is inserted here.
%preun
%posttrans
#
# Work around bug in CFEngine <= 3.6.1. Search for
# BROKEN_UPGRADE_NEED_TO_RESTART_DAEMONS.txt in the repository.
#
# This section can be removed completely when we no longer support upgrading
# from the 3.6 series.
#
if [ -f %{prefix}/BROKEN_UPGRADE_NEED_TO_RESTART_DAEMONS.txt ]; then
platform_service cfengine3 start
rm -f %{prefix}/BROKEN_UPGRADE_NEED_TO_RESTART_DAEMONS.txt
fi
exit 0
%files
# Executables
%defattr(755,root,root,755)
# Main program
%dir %prefix
%dir %prefix/bin
%prefix/bin/cf-agent
%prefix/bin/cf-check
%prefix/bin/cf-execd
%prefix/bin/cf-key
%prefix/bin/cf-monitord
%prefix/bin/cf-net
%prefix/bin/cf-promises
%prefix/bin/cf-runagent
%prefix/bin/cf-secret
%prefix/bin/cf-serverd
%prefix/bin/cf-support
%prefix/bin/cf-upgrade
# Libraries
%dir %prefix/lib
%prefix/lib/lib*.so*
%prefix/lib/cfengine-enterprise.so
# Auxiliary programs
%prefix/bin/rpmvercmp
# LMDB utilities
%prefix/bin/lmdump
%prefix/bin/lmmgr
%prefix/bin/mdb_copy
%prefix/bin/mdb_stat
%prefix/bin/mdb_dump
%prefix/bin/mdb_load
# Python stuff (if any)
%dir %prefix/lib/python
%prefix/lib/python/*
# diffutils
%prefix/bin/diff
%prefix/bin/sdiff
%prefix/bin/cmp
%prefix/bin/diff3
%if %{?rhel}%{!?rhel:0} > 7
# SELinux policy
%dir %prefix/selinux
%prefix/selinux/cfengine-enterprise.pp
%prefix/selinux/cfengine-enterprise.te
%prefix/selinux/cfengine-enterprise.fc
%endif
# Globally installed configs, scripts
# ENT-11901
# For el9+ we started seeing issues from other packages not expecting init scripts
%if %{?rhel}%{!?rhel:0} < 9 && %{?suse_version}%{!?suse_version:0} < 1500
%attr(755,root,root) /etc/init.d/cfengine3
%attr(644,root,root) /etc/sysconfig/cfengine3
%attr(755,root,root) /etc/profile.d/cfengine.sh
%endif
# Systemd units
%defattr(644,root,root,755)
/usr/lib/systemd/system/cfengine3.service
/usr/lib/systemd/system/cf-execd.service
/usr/lib/systemd/system/cf-monitord.service
/usr/lib/systemd/system/cf-serverd.service
# Documentation
%defattr(644,root,root,755)
%dir %prefix/share
%prefix/share/doc
# Private directories
%defattr(600,root,root,700)
%dir %prefix/ppkeys
%dir %prefix/outputs
%dir %prefix/inputs
%dir %prefix/modules
%changelog