]> git.pld-linux.org Git - packages/molly-guard.git/blame - molly-guard.spec
No aliases, back to PATH changes, but different
[packages/molly-guard.git] / molly-guard.spec
CommitLineData
4575b58b
ER
1Summary: protects machines from accidental shutdowns/reboots
2Name: molly-guard
3Version: 0.4.5
f43237d1 4Release: 1
4575b58b 5License: Artistic Licence 2.0
fcdba8ef 6Group: Applications/System
4575b58b
ER
7Source0: http://ftp.debian.org/debian/pool/main/m/molly-guard/%{name}_%{version}.orig.tar.gz
8# Source0-md5: bee1573a8740d5dcc25302490b18213a
9Source1: %{name}.sh
10Source2: %{name}.csh
11Patch1: docbook.patch
12Patch2: doubleslashes.patch
0be76124 13Patch3: bin_path.patch
4575b58b 14URL: http://ftp.debian.org/debian/pool/main/m/molly-guard
c08996d5 15BuildRequires: docbook-dtd42-xml
4575b58b 16BuildRequires: docbook-style-xsl
f43237d1
ER
17BuildRequires: libxslt-progs
18BuildRequires: sed >= 4.0
4575b58b 19Requires: procps
dcf09e70 20Requires: rc-scripts >= 0.4.8
4575b58b
ER
21BuildArch: noarch
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24%description
25The package installs a shell script that overrides the existing
26shutdown/reboot/halt/poweroff commands and first runs a set of
27scripts, which all have to exit successfully, before molly-guard
28invokes the real command.
29
30One of the scripts checks for existing SSH sessions. If any of the
31four commands are called interactively over an SSH session, the shell
32script prompts you to enter the name of the host you wish to shut
33down. This should adequately prevent you from accidental shutdowns and
34reboots.
35
36This shell script passes through the commands to the respective
37binaries in /sbin and should thus not get in the way if called
38non-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
54rm -rf $RPM_BUILD_ROOT
55install -d $RPM_BUILD_ROOT
f43237d1 56%{__make} install \
4575b58b
ER
57 etc_prefix=/ \
58 prefix=%{_prefix} \
59 DEST=$RPM_BUILD_ROOT
60
6f7310d6
MM
61install -d $RPM_BUILD_ROOT/etc/shrc.d
62cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT/etc/shrc.d
4575b58b
ER
63
64%clean
65rm -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*
This page took 0.352706 seconds and 4 git commands to generate.