forked from bglug-it/doraemon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
doraemon.spec
102 lines (86 loc) · 3.74 KB
/
doraemon.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
Summary: Helps client to join domain and maintain itself
Name: doraemon
Version: 1.2.1
Release: 2.ns6
URL: https://github.com/bglug-it/doraemon/
License: GPLv2+
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-root
Requires: python python-bottle python-crypto2.6 nethserver-base
Requires(post): chkconfig nethserver-base
Requires(preun): chkconfig initscripts nethserver-base
Source0: doraemon-1.2.1.tar.gz
BuildArch: noarch
%description
Helps client on a domain network to get information for its maintenance.
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
install -d %{buildroot}
install -d -m 755 %{buildroot}%{_sysconfdir}
install -m 644 doraemon.ini %{buildroot}%{_sysconfdir}/%{name}.ini
# Installo il servizio
install -d -m 755 %{buildroot}%{_initrddir}
install -m 755 initrd %{buildroot}%{_initrddir}/%{name}
# Installo lo script vero e proprio
install -d -m 755 %{buildroot}%{_bindir}
install -m 755 doraemon.py %{buildroot}%{_bindir}/%{name}.py
# Cartella del database
install -d %{buildroot}%{_sharedstatedir}/%{name}
# File per il rotate
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 doraemon.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# File di Nethserver
install -d %{buildroot}%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}
install -m 644 type %{buildroot}%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/type
install -m 644 status %{buildroot}%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/status
install -m 644 access %{buildroot}%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/access
install -m 644 TCPPort %{buildroot}%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/TCPPort
%post
if [ "$1" = 1 ]; then
/sbin/chkconfig --add %{name}
/sbin/service %{name} start >/dev/null 2>&1
/sbin/e-smith/db configuration set %{name} service status enabled TCPPort 3000 access private
/sbin/e-smith/signal-event runlevel-adjust
/sbin/e-smith/signal-event firewall-adjust
fi
%preun
if [ "$1" = 0 ]; then
/sbin/e-smith/db configuration delete %{name}
/sbin/service %{name} stop >/dev/null 2>&1
chkconfig --del %{name}
/sbin/e-smith/signal-event runlevel-adjust
/sbin/e-smith/signal-event firewall-adjust
fi
%clean
rm -rf %{buildroot}
%files
%defattr(644,root,root,755)
%doc README.md LICENSE
%config(noreplace) %{_sysconfdir}/%{name}.ini
%attr(755,-,-) %{_initrddir}/%{name}
%attr(755,-,-) %{_bindir}/%{name}.py
%dir %attr(755,-,-) %{_sharedstatedir}/%{name}
%{_sysconfdir}/logrotate.d/%{name}
%dir %attr(755,-,-) %{_sysconfdir}/e-smith/db/configuration/defaults/%{name}
%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/status
%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/type
%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/access
%{_sysconfdir}/e-smith/db/configuration/defaults/%{name}/TCPPort
%changelog
* Tue Oct 27 2015 Emiliano Vavassori <syntaxerrormmm-AT-gmail.com> - 1.2.1-2.ns6
- Packing corrections to rpm to fix upgrading issue
* Tue Oct 27 2015 Emiliano Vavassori <syntaxerrormmm-AT-gmail.com> - 1.2.1-1.ns6
- Packing new minor correction on how packages are extracted from db
* Mon Sep 11 2015 Emiliano Vavassori <syntaxerrormmm-AT-gmail.com> - 1.2.0-1.ns6
- Packing new version with ansible dynamic inventory support, epoptes server role support.
* Mon Sep 07 2015 Emiliano Vavassori <syntaxerrormmm-AT-gmail.com> - 1.1.1-1.ns6
- Packing new version with correct roles.
* Sun Sep 06 2015 Emiliano Vavassori <syntaxerrormmm-AT-gmail.com> - 1.1.0-1.ns6
- Packing new version with new functionalities.
* Wed Jul 15 2015 Emiliano Vavassori <syntaxerrormmm-AT-gmail.com> - 1.0.0-2.ns6
- Added logrotate file.
* Mon Jul 13 2015 Emiliano Vavassori <syntaxerrormmm-AT-gmail.com> - 1.0.0-1.ns6
- Unique binary for both ansiblehelper and mac2hostname.