-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpython-cb-skyatp-connector.spec
69 lines (51 loc) · 1.55 KB
/
python-cb-skyatp-connector.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
%define name python-cb-skyatp-connector
%define version 0.9
%define unmangled_version 0.9
%define release 2
%global _enable_debug_package 0
%global debug_package %{nil}
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
Summary: Carbon Black Sky ATP Bridge
Name: %{name}
Version: %{version}
Release: %{release}
Source: %{name}-%{unmangled_version}.tar.gz
License: MIT
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: x86_64
Vendor: Carbon Black Inc.
Url: http://www.carbonblack.com/
%description
UNKNOWN
%prep
%setup -n %{name}-%{unmangled_version}
%build
pyinstaller cb-skyatp-connector.spec
%pre
if [ -f "/etc/cb/integrations/skyatp/carbonblack-skyatp-connector.conf" ]; then
cp /etc/cb/integrations/skyatp/carbonblack-skyatp-connector.conf /tmp/__bridge.conf.backup
fi
%install
python setup.py install_cb --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%post
#!/bin/sh
mkdir -p /usr/share/cb/integrations/skyatp/db
chkconfig --add cb-skyatp-connector
chkconfig --level 345 cb-skyatp-connector on
# not auto-starting because conf needs to be updated
#/etc/init.d/cb-skyatp-connector start
if [ -f "/tmp/__bridge.conf.backup" ]; then
mv /tmp/__bridge.conf.backup /etc/cb/integrations/skyatp/carbonblack-skyatp-connector.conf
fi
%preun
#!/bin/sh
/etc/init.d/cb-skyatp-connector stop
chkconfig --del cb-skyatp-connector
%files -f INSTALLED_FILES
%defattr(-,root,root)
%config
/etc/cb/integrations/skyatp/carbonblack-skyatp-connector.conf.template