Index: trunk/server/common/oursrc/php_scripts/Makefile.in
===================================================================
--- trunk/server/common/oursrc/php_scripts/Makefile.in	(revision 1234)
+++ trunk/server/common/oursrc/php_scripts/Makefile.in	(revision 1234)
@@ -0,0 +1,22 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+MODS = scripts
+
+all-local: $(patsubst %,.libs/%.so,$(MODS))
+
+.libs/%.so: %.c
+	$(CC) $(CFLAGS) -c $<
+
+install:
+	install -p -m755 -D .libs/scripts.so $(DESTDIR)/usr/lib64/php/modules/scripts.so
+
+clean:
+	rm -f $(MODS:=.so) $(MODS:=.o) $(MODS:=.la) $(MODS:=.lo) $(MODS:=.slo) $(MODS:=.lai)
+	rm -rf .libs modules
+
+distclean: clean
+	rm -f configure config.* Makefile
+	rm -rf auto*.cache
Index: trunk/server/common/oursrc/php_scripts/build.sh
===================================================================
--- trunk/server/common/oursrc/php_scripts/build.sh	(revision 1233)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#!/bin/bash
-
-mkdir -p test/
-cp -a config.m4 php_scripts.c php_scripts.h test/
-cd test/
-phpize
-./configure
-make
-exit
-
-cd ../
-echo '*****'
-php -c php.ini test.php
-echo '*****'
-php-cgi test.php
-echo '*****'
-php-cgi -c php.ini test.php
-echo '*****'
Index: trunk/server/common/oursrc/php_scripts/config.m4
===================================================================
--- trunk/server/common/oursrc/php_scripts/config.m4	(revision 1233)
+++ 	(revision )
@@ -1,7 +1,0 @@
-PHP_ARG_ENABLE(scripts, whether to enable scripts.mit.edu support,
-[ --enable-scripts   Enable scripts.mit.edu support])
-
-if test "$PHP_SCRIPTS" != "no"; then
-  AC_DEFINE(HAVE_SCRIPTS, 1, [Whether you have scripts.mit.edu support])
-  PHP_NEW_EXTENSION(scripts, php_scripts.c, $ext_shared)
-fi
Index: trunk/server/common/oursrc/php_scripts/mrproper
===================================================================
--- trunk/server/common/oursrc/php_scripts/mrproper	(revision 1234)
+++ trunk/server/common/oursrc/php_scripts/mrproper	(revision 1234)
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+rm -f scripts.so
+rm -f configure config.* Makefile
+rm -rf auto*.cache
+rm -rf .libs
Index: trunk/server/common/oursrc/php_scripts/php.ini
===================================================================
--- trunk/server/common/oursrc/php_scripts/php.ini	(revision 1233)
+++ 	(revision )
@@ -1,5 +1,0 @@
-;display_startup_errors = On
-extension_dir = /root/php_scripts/test/modules/
-extension = ../../../../root/php_scripts/test/modules/scripts.so
-;zend_extension_ts = ../../../../root/php_scripts/test/modules/scripts.so
-error_reporting = E_ALL
Index: trunk/server/common/oursrc/php_scripts/php_scripts-config.m4
===================================================================
--- trunk/server/common/oursrc/php_scripts/php_scripts-config.m4	(revision 1234)
+++ trunk/server/common/oursrc/php_scripts/php_scripts-config.m4	(revision 1234)
@@ -0,0 +1,7 @@
+PHP_ARG_ENABLE(scripts, whether to enable scripts.mit.edu support,
+[ --enable-scripts   Enable scripts.mit.edu support])
+
+if test "$PHP_SCRIPTS" != "no"; then
+  AC_DEFINE(HAVE_SCRIPTS, 1, [Whether you have scripts.mit.edu support])
+  PHP_NEW_EXTENSION(scripts, php_scripts.c, $ext_shared)
+fi
Index: trunk/server/common/oursrc/php_scripts/test.php
===================================================================
--- trunk/server/common/oursrc/php_scripts/test.php	(revision 1233)
+++ 	(revision )
@@ -1,7 +1,0 @@
-<?php
-
-dl('scripts.so');
-dl('scripts.so');
-if (1/0) {
-    echo 'dbz';
-}
Index: trunk/server/doc/install-howto.sh
===================================================================
--- trunk/server/doc/install-howto.sh	(revision 1233)
+++ trunk/server/doc/install-howto.sh	(revision 1234)
@@ -172,11 +172,4 @@
 # echo 'import site, os.path; site.addsitedir(os.path.expanduser("~/lib/python2.6/site-packages"))' > /usr/lib/python2.6/site-packages/00scripts-home.pth
 
-# Build and install the scripts php module that enhances error logging info
-# XXX This thing really ought to be packaged
-# cp -r /srv/repository/server/common/oursrc/php_scripts /root
-# cd /root/php_scripts
-# ./build.sh
-# cp test/modules/scripts.so /usr/lib64/php/modules
-
 # Install the credentials.  There are a lot of things to remember here:
 #   o You probably installed the machine keytab long ago
Index: trunk/server/fedora/Makefile
===================================================================
--- trunk/server/fedora/Makefile	(revision 1233)
+++ trunk/server/fedora/Makefile	(revision 1234)
@@ -21,5 +21,5 @@
 upstream_yum	= krb5 httpd openssh pysvn php
 upstream	= openafs $(upstream_yum)
-oursrc		= execsys tokensys accountadm httpdmods logview sql-signup nss_nonlocal nss_nonlocal.i386 whoisd mit-zephyr nss-ldapd nss-ldapd.i386 athrun scripts-base
+oursrc		= execsys tokensys accountadm httpdmods logview sql-signup nss_nonlocal nss_nonlocal.i386 whoisd mit-zephyr nss-ldapd nss-ldapd.i386 athrun php_scripts scripts-base
 allsrc		= $(upstream) $(oursrc)
 oursrcdir	= ${PWD}/../common/oursrc
Index: trunk/server/fedora/specs/php_scripts.spec
===================================================================
--- trunk/server/fedora/specs/php_scripts.spec	(revision 1234)
+++ trunk/server/fedora/specs/php_scripts.spec	(revision 1234)
@@ -0,0 +1,40 @@
+Summary: scripts.mit.edu php logging module
+Group: Applications/System
+Name: php_scripts
+Version: 0.%{scriptsversion}
+Release: 0
+Vendor: The scripts.mit.edu Team (scripts@mit.edu)
+URL: http://scripts.mit.edu
+License: GPL
+Source: %{name}.tar.gz 
+BuildRoot: %{_tmppath}/%(%{__id_u} -n)-%{name}-%{version}-root
+%define debug_package %{nil}
+
+%description 
+
+scripts.mit.edu php logging module
+
+%prep
+%setup -q -n %{name}
+
+%build
+cp php_scripts-config.m4 config.m4
+phpize
+./configure
+make
+
+%install
+[ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
+install -D .libs/scripts.so $RPM_BUILD_ROOT/usr/lib64/php/modules/scripts.so
+
+%clean
+[ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(0755, root, root)
+/usr/lib64/php/modules/scripts.so
+
+%changelog
+
+* Fri Jul 03 2009  Mitchell Berger <mitchb@MIT.EDU> 0.00
+- initial version
