]> git.pld-linux.org Git - packages/autopsy.git/commitdiff
- up to 2.21-1; added init script; added user/group autopsy (uid/gid 178);
authormguevara <mguevara@pld-linux.org>
Thu, 2 Jul 2009 00:00:58 +0000 (00:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  added pre/post/preun/postun actions; more requires and provides;
  added references to md5sum and sha1sum binaries to conf.pl

Changed files:
    autopsy.init -> 1.1
    autopsy.spec -> 1.9

autopsy.init [new file with mode: 0644]
autopsy.spec

diff --git a/autopsy.init b/autopsy.init
new file mode 100644 (file)
index 0000000..bcf472a
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# autopsy      This shell script takes care of starting and stopping
+#              Autopsy (The Sleuth Kit web interface).
+#
+# chkconfig:   345 92 15
+# description: Autopsy is a web interface for The Sleuth Kit
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down autopsy
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/autopsy ]; then
+               msg_starting autopsy
+               daemon --user autopsy --fork --waitfortime 1 /usr/bin/autopsy 
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/autopsy
+       else
+               msg_already_running autopsy
+       fi
+}
+
+stop() {
+       if [ -f /var/lock/subsys/autopsy ]; then
+               msg_stopping autopsy
+               killproc autopsy
+               rm -f /var/lock/subsys/autopsy
+       else
+               msg_not_running autopsy
+       fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/autopsy ]; then
+               stop
+               start
+       else
+               msg_not_running autopsy
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart|condrestart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
+  status)
+       status autopsy
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|condrestart|status}"
+       exit 3
+esac
+
+exit $RETVAL
index 51fd2551e83f8eabcd8db45cc8ec139811a0698e..5725139838744d2a0905fcb5424388978e1e40d7 100644 (file)
@@ -1,16 +1,17 @@
 # TODO
-#      - %%service stuff
-#      - add user autopsy with proper homedir rights
+#      - change use/require Appsort to Autopsy::lib::Appsort or Autopsy::Appsort and more
+#
 %include       /usr/lib/rpm/macros.perl
 Summary:       The Autopsy Forensic Browser - a graphical interface to The Sleuth Kit utilities
 Summary(pl.UTF-8):     Autopsy Forensic Browser - graficzny interfejs do narzÄ™dzi z The Sleuth Kit
 Name:          autopsy
-Version:       2.08
-Release:       0.3
+Version:       2.21
+Release:       1
 License:       GPL
 Group:         Applications
 Source0:       http://dl.sourceforge.net/autopsy/%{name}-%{version}.tar.gz
-# Source0-md5: 0ac9db9acf66742f8f01f3d8b0cf2f90
+# Source0-md5: 48d970749861cde7b850283636c6c4dd
+Source1:       %{name}.init
 URL:           http://www.sleuthkit.org/autopsy
 BuildRequires: rpm-perlprov >= 4.1-13
 Requires:      coreutils
@@ -20,6 +21,34 @@ Requires:    file
 Requires:      openssl
 Requires:      perl-Date-Manip
 Requires:      sleuthkit
+Requires(post,preun):  /sbin/chkconfig
+Requires(postun):      /usr/sbin/groupdel
+Requires(postun):      /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+# some script/macro finds that autopsy requires the following perl modules
+# which are provided in the package - as a workaround we provide them:
+# (but this pollutes a perl module namespace)
+Provides:      perl(Appsort)
+Provides:      perl(Appview)
+Provides:      perl(Args)
+Provides:      perl(Caseman)
+Provides:      perl(Data)
+Provides:      perl(Exec)
+Provides:      perl(File)
+Provides:      perl(Filesystem)
+Provides:      perl(Frame)
+Provides:      perl(Fs)
+Provides:      perl(Hash)
+Provides:      perl(Kwsrch)
+Provides:      perl(Main)
+Provides:      perl(Meta)
+Provides:      perl(Notes)
+Provides:      perl(Print)
+Provides:      perl(Timeline)
+Provides:      perl(Vs)
 # noarch?
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -73,6 +102,8 @@ cat > conf.pl <<-'EOF'
        # Directories
        $TSKDIR = '%{_bindir}';
        $FILE_EXE = '%{_bindir}/file';
+       $MD5_EXE = '%{_bindir}/md5sum';
+       $SHA1_EXE = '%{_bindir}/sha1sum';
        $NSRLDB = '';
 # FIXME: FHS: /var/{lib,run}/autopsy?
        $LOCKDIR = '/home/services/autopsy';
@@ -93,9 +124,28 @@ install pict/* $RPM_BUILD_ROOT%{perl_vendorlib}/Autopsy/pict
 
 install man/man1/* $RPM_BUILD_ROOT%{_mandir}/man1
 
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/autopsy
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+%groupadd -g 178 autopsy
+%useradd -u 178 -r -d /home/services/autopsy -s /bin/false -c "Autopsy user" -g autopsy autopsy
+
+%post
+/sbin/chkconfig --add autopsy
+
+%preun
+%service autopsy stop
+/sbin/chkconfig --del autopsy
+
+%postun
+%userremove autopsy
+%groupremove autopsy
+
+
 %files
 %defattr(644,root,root,755)
 %doc README.txt docs/sleuthkit-informer-13.txt
@@ -105,4 +155,5 @@ rm -rf $RPM_BUILD_ROOT
 %{perl_vendorlib}/Autopsy/lib
 %{perl_vendorlib}/Autopsy/pict
 %{_mandir}/man1/*
-/home/services/autopsy
+%attr(750,autopsy,autopsy) /home/services/autopsy
+%attr(754,root,root) /etc/rc.d/init.d/autopsy
This page took 0.126036 seconds and 4 git commands to generate.