packages: autopsy/autopsy.spec, autopsy/autopsy.init (NEW) - up to 2.21-1; ...

mguevara mguevara at pld-linux.org
Thu Jul 2 02:01:04 CEST 2009


Author: mguevara                     Date: Thu Jul  2 00:01:04 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- up to 2.21-1; added init script; added user/group autopsy (uid/gid 178);
  added pre/post/preun/postun actions; more requires and provides;
  added references to md5sum and sha1sum binaries to conf.pl

---- Files affected:
packages/autopsy:
   autopsy.spec (1.8 -> 1.9) , autopsy.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/autopsy/autopsy.spec
diff -u packages/autopsy/autopsy.spec:1.8 packages/autopsy/autopsy.spec:1.9
--- packages/autopsy/autopsy.spec:1.8	Mon Feb 12 23:09:09 2007
+++ packages/autopsy/autopsy.spec	Thu Jul  2 02:00:58 2009
@@ -1,17 +1,18 @@
 # $Revision$, $Date$
 # 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
@@ -21,6 +22,34 @@
 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)
 
@@ -74,6 +103,8 @@
 	# 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';
@@ -94,9 +125,28 @@
 
 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
@@ -106,7 +156,8 @@
 %{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
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -114,6 +165,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.9  2009/07/02 00:00:58  mguevara
+- up to 2.21-1; added init script; added user/group autopsy (uid/gid 178);
+  added pre/post/preun/postun actions; more requires and provides;
+  added references to md5sum and sha1sum binaries to conf.pl
+
 Revision 1.8  2007/02/12 22:09:09  glen
 - tabs in preamble
 

================================================================
Index: packages/autopsy/autopsy.init
diff -u /dev/null packages/autopsy/autopsy.init:1.1
--- /dev/null	Thu Jul  2 02:01:04 2009
+++ packages/autopsy/autopsy.init	Thu Jul  2 02:00:58 2009
@@ -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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/autopsy/autopsy.spec?r1=1.8&r2=1.9&f=u



More information about the pld-cvs-commit mailing list