summaryrefslogtreecommitdiffstats
path: root/fake_ilo.spec
blob: 78f3f21e7a6f20218c446d3ee2b2a3430e848317 (plain)
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
%global debug_package %{nil}

Name:         fake_ilo
License:      CC0
Version:      0.1
Release:      1%{?dist}
Summary:      iLO emulator which can power cycle libvirt VMs
Group:        FIXME
Source:       %{name}-%{version}.tar.gz

Requires:     python
Requires:     openssl

%description
FIXME

%prep
%setup -q

%build

%install
mkdir -p %{buildroot}{/usr/bin,/etc/init.d,/etc/fake_ilo,/usr/lib/systemd/system}
make DESTDIR=%{buildroot} install
rm -rf %{buildroot}/etc/init.d
cp fake_ilo.service %{buildroot}/usr/lib/systemd/system

%files
%doc LICENSE
%doc README.md
%dir /etc/fake_ilo
%ghost /etc/fake_ilo/server.key
%ghost /etc/fake_ilo/server.crt
%{_bindir}/ilo.py
/usr/lib/systemd/system/fake_ilo.service

%post
if test -f "/etc/fake_ilo"; then
	exit 0
fi
subject="/C=UN/ST=unknown/L=unknown/O=libvirt/CN=$(hostname -f)"
openssl req -x509 -newkey rsa:2048 \
	-keyout /etc/fake_ilo/server.key \
	-out /etc/fake_ilo/server.crt \
	-nodes -days 9999 -subj "$subject"

%changelog
* Fri Mar 10 2017 Gerd Hoffmann <kraxel@redhat.com> 0.1-1
- new package built with tito