From 599d8ef054d361982a48216063b04038fe2bcb7a Mon Sep 17 00:00:00 2001
From: "jrayhawk+piny.be@omgwallhack.org" <jrayhawk@dev.piny.svcs.cs.pdx.edu>
Date: Tue, 21 Dec 2010 01:00:37 -0800
Subject: Adding build and config infrastructure for Piny CGIs

---
 builddebs                                    |  2 +-
 pinyconfigs/etc/apache2/sites-available/piny | 12 ++++++++++++
 pinyweb/Makefile                             |  5 +++++
 pinyweb/cgi-bin/piny-newuser.cgi             |  9 +++++++++
 pinyweb/debian/changelog                     |  5 +++++
 pinyweb/debian/compat                        |  1 +
 pinyweb/debian/control                       | 14 ++++++++++++++
 pinyweb/debian/copyright                     |  3 +++
 pinyweb/debian/rules                         |  4 ++++
 pinyweb/debian/source/format                 |  1 +
 10 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 pinyweb/Makefile
 create mode 100644 pinyweb/cgi-bin/piny-newuser.cgi
 create mode 100644 pinyweb/debian/changelog
 create mode 100644 pinyweb/debian/compat
 create mode 100644 pinyweb/debian/control
 create mode 100644 pinyweb/debian/copyright
 create mode 100755 pinyweb/debian/rules
 create mode 100644 pinyweb/debian/source/format

diff --git a/builddebs b/builddebs
index d06c554..25b6147 100755
--- a/builddebs
+++ b/builddebs
@@ -17,7 +17,7 @@ read -n 1 SIGN
 echo
 if [ "$SIGN" == "y" ]; then SIGNARGS=""; else SIGNARGS="-uc -us"; fi
 
-for SOURCE in libpiny piny pinyadmin pinyconfigs; do (cd "$SOURCE"; debuild $SIGNARGS -tc "$@"); done
+for SOURCE in libpiny piny pinyweb pinyadmin pinyconfigs; do (cd "$SOURCE"; debuild $SIGNARGS -tc "$@"); done
 
 echo
 echo -n "Install packages on this machine? (y/N) "
diff --git a/pinyconfigs/etc/apache2/sites-available/piny b/pinyconfigs/etc/apache2/sites-available/piny
index 05808f4..6dbbf87 100644
--- a/pinyconfigs/etc/apache2/sites-available/piny
+++ b/pinyconfigs/etc/apache2/sites-available/piny
@@ -48,7 +48,19 @@
 		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
 	</Directory>
 
+	<Directory "/usr/lib/cgi-bin/piny">
+	        AuthPAM_Enabled on
+	        AuthGROUP_Enabled on
+	        AuthPAM_FallThrough off
+	        AuthBasicAuthoritative off
+	        AuthType Basic
+	        AuthName "User account for piny.be needed."
+	        Require valid-user
+	</Directory>
+
         ScriptAlias /cgit /usr/lib/cgi-bin/cgit.cgi
+        ScriptAlias /piny-newuser /usr/lib/cgi-bin/piny-newuser.cgi
+        ScriptAlias /piny/ /usr/lib/cgi-bin/piny/
 
 	Include /etc/apache2/piny-enabled
 
diff --git a/pinyweb/Makefile b/pinyweb/Makefile
new file mode 100644
index 0000000..5b1f010
--- /dev/null
+++ b/pinyweb/Makefile
@@ -0,0 +1,5 @@
+build:
+
+install:
+	install -o root -g root -m 755 -d $(DESTDIR)/usr/lib/cgi-bin
+	install -o root -g root -m 755 cgi-bin/* $(DESTDIR)/usr/lib/cgi-bin
diff --git a/pinyweb/cgi-bin/piny-newuser.cgi b/pinyweb/cgi-bin/piny-newuser.cgi
new file mode 100644
index 0000000..d10c6ba
--- /dev/null
+++ b/pinyweb/cgi-bin/piny-newuser.cgi
@@ -0,0 +1,9 @@
+#!/usr/bin/perl
+
+use warnings;
+
+use CGI;
+
+print 'Content-type: text/plain
+
+hello'
diff --git a/pinyweb/debian/changelog b/pinyweb/debian/changelog
new file mode 100644
index 0000000..e8e9f8d
--- /dev/null
+++ b/pinyweb/debian/changelog
@@ -0,0 +1,5 @@
+pinyweb (0.1) unstable; urgency=low
+
+  * Initial release.
+
+ -- jrayhawk+piny.be@omgwallhack.org <jrayhawk@dev.piny.svcs.cs.pdx.edu>  Mon, 20 Dec 2010 22:38:02 -0800
diff --git a/pinyweb/debian/compat b/pinyweb/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/pinyweb/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/pinyweb/debian/control b/pinyweb/debian/control
new file mode 100644
index 0000000..6abae90
--- /dev/null
+++ b/pinyweb/debian/control
@@ -0,0 +1,14 @@
+Source: pinyweb
+Maintainer: Julian Blake Kongslie <jblake@omgwallhack.org>
+Section: admin
+Build-depends: debhelper (>= 7)
+Priority: extra
+Homepage: http://www.piny.be/piny-code/
+Standards-version: 3.8.4
+
+Package: pinyweb
+Architecture: all
+Depends: ${perl:Depends}, ${misc:Depends}, libpiny-perl (>= 0.14)
+Description: CGIs for managing piny repositories
+ The CGI programs for day-to-day administrative tasks in the Piny
+ infrastructure.
diff --git a/pinyweb/debian/copyright b/pinyweb/debian/copyright
new file mode 100644
index 0000000..9d12aab
--- /dev/null
+++ b/pinyweb/debian/copyright
@@ -0,0 +1,3 @@
+Copyright © 2010 Joe Rayhawk <jrayhawk@omgwallhack.org>
+Copyright © 2010 Julian Blake Kongslie <jblake@omgwallhack.org>
+Licensed under the BSD 3-clause license.
diff --git a/pinyweb/debian/rules b/pinyweb/debian/rules
new file mode 100755
index 0000000..2d33f6a
--- /dev/null
+++ b/pinyweb/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@
diff --git a/pinyweb/debian/source/format b/pinyweb/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/pinyweb/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
-- 
cgit v1.2.3