]>
Commit | Line | Data |
---|---|---|
4575b58b ER |
1 | Summary: protects machines from accidental shutdowns/reboots |
2 | Name: molly-guard | |
3 | Version: 0.4.5 | |
f43237d1 | 4 | Release: 1 |
4575b58b | 5 | License: Artistic Licence 2.0 |
fcdba8ef | 6 | Group: Applications/System |
4575b58b ER |
7 | Source0: http://ftp.debian.org/debian/pool/main/m/molly-guard/%{name}_%{version}.orig.tar.gz |
8 | # Source0-md5: bee1573a8740d5dcc25302490b18213a | |
9 | Source1: %{name}.sh | |
10 | Source2: %{name}.csh | |
11 | Patch1: docbook.patch | |
12 | Patch2: doubleslashes.patch | |
0be76124 | 13 | Patch3: bin_path.patch |
4575b58b | 14 | URL: http://ftp.debian.org/debian/pool/main/m/molly-guard |
c08996d5 | 15 | BuildRequires: docbook-dtd42-xml |
4575b58b | 16 | BuildRequires: docbook-style-xsl |
f43237d1 ER |
17 | BuildRequires: libxslt-progs |
18 | BuildRequires: sed >= 4.0 | |
4575b58b | 19 | Requires: procps |
dcf09e70 | 20 | Requires: rc-scripts >= 0.4.8 |
4575b58b ER |
21 | BuildArch: noarch |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
25 | The package installs a shell script that overrides the existing | |
26 | shutdown/reboot/halt/poweroff commands and first runs a set of | |
27 | scripts, which all have to exit successfully, before molly-guard | |
28 | invokes the real command. | |
29 | ||
30 | One of the scripts checks for existing SSH sessions. If any of the | |
31 | four commands are called interactively over an SSH session, the shell | |
32 | script prompts you to enter the name of the host you wish to shut | |
33 | down. This should adequately prevent you from accidental shutdowns and | |
34 | reboots. | |
35 | ||
36 | This shell script passes through the commands to the respective | |
37 | binaries in /sbin and should thus not get in the way if called | |
38 | non-interactively, or locally. | |
39 | ||
40 | %prep | |
41 | %setup -q | |
42 | %patch1 -p1 | |
43 | %patch2 -p1 | |
0be76124 | 44 | %patch3 -p1 |
f43237d1 ER |
45 | %{__sed} -i -e '/install/ s/-oroot -[og]root//' Makefile |
46 | %{__sed} -i -e '/chown/ s/root.root/%(id -un)/' Makefile | |
4575b58b ER |
47 | |
48 | %build | |
f43237d1 | 49 | %{__make} shutdown \ |
4575b58b ER |
50 | etc_prefix=/ \ |
51 | prefix=%{_prefix} | |
52 | ||
53 | %install | |
54 | rm -rf $RPM_BUILD_ROOT | |
55 | install -d $RPM_BUILD_ROOT | |
f43237d1 | 56 | %{__make} install \ |
4575b58b ER |
57 | etc_prefix=/ \ |
58 | prefix=%{_prefix} \ | |
59 | DEST=$RPM_BUILD_ROOT | |
60 | ||
6f7310d6 MM |
61 | install -d $RPM_BUILD_ROOT/etc/shrc.d |
62 | cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT/etc/shrc.d | |
4575b58b ER |
63 | |
64 | %clean | |
65 | rm -fr $RPM_BUILD_ROOT | |
66 | ||
67 | %files | |
68 | %defattr(644,root,root,755) | |
69 | %doc ChangeLog | |
6f7310d6 MM |
70 | %config(noreplace) %verify(not md5 mtime size) /etc/shrc.d/molly-guard.csh |
71 | %config(noreplace) %verify(not md5 mtime size) /etc/shrc.d/molly-guard.sh | |
4575b58b ER |
72 | %dir %{_sysconfdir}/%{name} |
73 | %dir %{_sysconfdir}/%{name}/run.d | |
7890848a | 74 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/run.d/* |
4575b58b | 75 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/rc |
0be76124 MM |
76 | %dir %{_datadir}/%{name}/bin |
77 | %attr(755,root,root) %{_datadir}/%{name}/bin/halt | |
78 | %attr(755,root,root) %{_datadir}/%{name}/bin/poweroff | |
79 | %attr(755,root,root) %{_datadir}/%{name}/bin/reboot | |
80 | %attr(755,root,root) %{_datadir}/%{name}/bin/shutdown | |
4575b58b ER |
81 | %dir %{_datadir}/%{name} |
82 | %attr(755,root,root) %{_datadir}/%{name}/shutdown | |
83 | %{_mandir}/man8/%{name}.8* |