Index: /branches/eam_branches/ipp-pstamp-20260421/pstamp/Makefile.am
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/pstamp/Makefile.am	(revision 43044)
+++ /branches/eam_branches/ipp-pstamp-20260421/pstamp/Makefile.am	(revision 43045)
@@ -1,3 +1,3 @@
-SUBDIRS = src scripts
+SUBDIRS = src scripts web
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -8,2 +8,12 @@
 
 CLEANFILES = *~ core core.*
+
+cgi:
+	$(MAKE) -C web cgi
+
+install-cgi:
+	$(MAKE) -C web install-cgi
+
+uninstall-cgi:
+	$(MAKE) -C web uninstall-cgi
+
Index: /branches/eam_branches/ipp-pstamp-20260421/pstamp/configure.ac
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/pstamp/configure.ac	(revision 43044)
+++ /branches/eam_branches/ipp-pstamp-20260421/pstamp/configure.ac	(revision 43045)
@@ -18,4 +18,10 @@
 AC_PROG_LIBTOOL
 AC_SYS_LARGEFILE
+
+AC_ARG_WITH([cgidir],
+  [AS_HELP_STRING([--with-cgidir=DIR],
+                  [directory for CGI programs])],
+  [cgidir="$withval"],
+  [cgidir=""])
 
 dnl ------------------------------------------------------------
@@ -55,4 +61,5 @@
 AC_SUBST([PPSTAMP_CFLAGS])
 AC_SUBST([PPSTAMP_LIBS])
+AC_SUBST([cgidir])
 
 AC_CONFIG_FILES([
@@ -60,4 +67,5 @@
   src/Makefile
   scripts/Makefile
+  web/Makefile
   ppstamp.pc
 ])
Index: /branches/eam_branches/ipp-pstamp-20260421/pstamp/web/Makefile.am
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/pstamp/web/Makefile.am	(revision 43045)
+++ /branches/eam_branches/ipp-pstamp-20260421/pstamp/web/Makefile.am	(revision 43045)
@@ -0,0 +1,60 @@
+
+installdir = $(libdir)
+
+# install_files = 
+# install_SCRIPTS = $(install_files)
+
+ACLOCAL_AMFLAGS = -I m4
+
+cgi_config = authenticate.php pstampconfig.php
+
+cgi_scripts = \
+  dblogin.php \
+  dsroot.php \
+  findskycell.php \
+  getinfo.php \
+  index.php \
+  logout.php \
+  pshome.php \
+  pstamp_links.php \
+  pstamp.php \
+  request.php \
+  status.php \
+  submitted.php \
+  upload.php
+
+EXTRA_DIST = $(cgi_scripts) $(cgi_config)
+
+install-cgi:
+	@if test -z "$(cgidir)"; then \
+	  echo "Error: cgidir is not set. Use --with-cgidir=DIR"; \
+	  exit 1; \
+	fi
+	$(MKDIR_P) $(DESTDIR)$(cgidir)
+	@for f in $(cgi_scripts); do \
+	  $(INSTALL_SCRIPT) $$f $(DESTDIR)$(cgidir)/$$f; \
+	done
+
+	@for f in $(cgi_config); do \
+	  if test ! -f "$(DESTDIR)$(cgidir)/$$f"; then \
+	    $(INSTALL_DATA) $$f "$(DESTDIR)$(cgidir)/$$f"; \
+	    echo ""; \
+	    echo "Installed new $$f file:"; \
+	    echo "  $(DESTDIR)$(cgidir)/$$f"; \
+	    echo "Please edit it and add the required settings."; \
+	    echo ""; \
+	  else \
+	    echo ""; \
+	    echo "Preserving existing file:"; \
+	    echo "  $(DESTDIR)$(DESTDIR)$(cgidir)/$$f"; \
+	    echo "Template not reinstalled, so local edits were kept."; \
+	    echo ""; \
+	  fi \
+	done
+
+uninstall-cgi:
+	@for f in $(cgi_scripts); do \
+	  rm -f $(DESTDIR)$(cgidir)/$$f; \
+	done
+
+cgi: install-cgi
