summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2013-01-11 10:43:38 +0000
committerTiziano Müller <dev-zero@gentoo.org>2013-01-11 10:43:38 +0000
commit6ac54511328c798c7da107a22f434b1cc0cd9093 (patch)
tree505d03d71b6b8f096685efbfa4db4606c4c5c3d6 /www-apps
parentInitial commit, required for www-apps/webdavcgi. (diff)
downloadgentoo-2-6ac54511328c798c7da107a22f434b1cc0cd9093.tar.gz
gentoo-2-6ac54511328c798c7da107a22f434b1cc0cd9093.tar.bz2
gentoo-2-6ac54511328c798c7da107a22f434b1cc0cd9093.zip
Initial commit, required for www-apps/webdavcgi.
(Portage version: 2.1.11.38/cvs/Linux x86_64, signed Manifest commit with key 0xAE9C1E30!)
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/webdavcgi/ChangeLog11
-rw-r--r--www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch21
-rw-r--r--www-apps/webdavcgi/files/postinstall-en.txt29
-rw-r--r--www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt32
-rwxr-xr-xwww-apps/webdavcgi/files/reconfig32
-rwxr-xr-xwww-apps/webdavcgi/files/reconfig-suid26
-rw-r--r--www-apps/webdavcgi/metadata.xml24
-rw-r--r--www-apps/webdavcgi/webdavcgi-0.8.3.ebuild105
8 files changed, 280 insertions, 0 deletions
diff --git a/www-apps/webdavcgi/ChangeLog b/www-apps/webdavcgi/ChangeLog
new file mode 100644
index 000000000000..3149e39314fb
--- /dev/null
+++ b/www-apps/webdavcgi/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for www-apps/webdavcgi
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/webdavcgi/ChangeLog,v 1.1 2013/01/11 10:43:38 dev-zero Exp $
+
+*webdavcgi-0.8.3 (11 Jan 2013)
+
+ 11 Jan 2013; Tiziano Müller <dev-zero@gentoo.org>
+ +files/0.8.3-logout-var-expansion.patch, +files/postinstall-en.txt,
+ +files/postinstall-webdavwrapper-en.txt, +files/reconfig,
+ +files/reconfig-suid, +metadata.xml, +webdavcgi-0.8.3.ebuild:
+ Initial commit, required for www-apps/webdavcgi.
diff --git a/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch b/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch
new file mode 100644
index 000000000000..739ff7f4c79b
--- /dev/null
+++ b/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch
@@ -0,0 +1,21 @@
+diff -ru cgi-bin.orig/logout-dist cgi-bin/logout-dist
+--- cgi-bin.orig/logout-dist 2011-03-22 17:25:52.000000000 +0100
++++ cgi-bin/logout-dist 2012-10-03 21:44:35.057437306 +0200
+@@ -34,13 +34,13 @@
+ # -----
+ ### REALM: the basic authentication realm
+ ### (must be equal to your AuthName value for Apache)
+-REALM="Change Me"
++REALM="${REALM:=Change Me}"
+
+ ### HOMEURL: the home URL
+-HOMEURL="/changemyhomeurl"
++HOMEURL="${HOMEURL:=/changemyhomeurl}"
+
+-### TIMEOUT: the refresh timeout for the logut page
+-TIMEOUT=0
++### TIMEOUT: the refresh timeout for the logout page
++TIMEOUT=${TIMEOUT:=0}
+
+ # SETUP END
+
diff --git a/www-apps/webdavcgi/files/postinstall-en.txt b/www-apps/webdavcgi/files/postinstall-en.txt
new file mode 100644
index 000000000000..8aa6f95d87a2
--- /dev/null
+++ b/www-apps/webdavcgi/files/postinstall-en.txt
@@ -0,0 +1,29 @@
+Before you can run WebDAV CGI you need to configure your web server and WebDAV
+CGI itself.
+
+The following configuration snippet serves as an example for the Apache HTTPD
+web server. You will have to adapt it to suite your own server and configuration
+needs.
+
+ ScriptAlias /cgi-bin/ "${VHOST_CGIBINDIR}/"
+
+ <Location /${VHOST_CGIBINDIR##*/}/>
+ AuthType Basic
+ AuthName "WebDAV-CGI"
+ AuthUserFile ${VHOST_ROOT}/etc/users.htpasswd
+ Require valid-user
+ Order Allow,Deny
+ Allow from all
+ </Location>
+
+ RewriteEngine On
+ RewriteRule ^/${VHOST_APPDIR}/logout /${VHOST_CGIBINDIR##*/}/logout [PT,E=REALM:WebDAV-CGI,E=HOMEURL:/${VHOST_APPDIR},L]
+ RewriteRule ^/${VHOST_APPDIR} /${VHOST_CGIBINDIR##*/}/webdav.pl [PT,E=WEBDAVCONF:${VHOST_ROOT}/etc/webdav.conf,E=PERLLIB:${VHOST_ROOT}/lib/perl,L]
+
+
+Afterwards you need to copy the default configuration file and edit it:
+cp -p ${VHOST_ROOT}/etc/{webdav.conf-dist,webdav.conf}
+\$EDITOR ${VHOST_ROOT}/etc/webdav.conf
+
+For further informations study the online documentation which is located at:
+http://webdavcgi.sourceforge.net/doc.html
diff --git a/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt b/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt
new file mode 100644
index 000000000000..5f30d81be7b6
--- /dev/null
+++ b/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt
@@ -0,0 +1,32 @@
+Before you can run WebDAV CGI you need to configure your web server and WebDAV
+CGI itself.
+
+The following configuration snippet serves as an example for the Apache HTTPD
+web server. You will have to adapt it to suite your own server and configuration
+needs.
+
+ ScriptAlias /cgi-bin/ "${VHOST_CGIBINDIR}/"
+
+ <Location /${VHOST_CGIBINDIR##*/}/>
+ AuthType Basic
+ AuthName "WebDAV-CGI"
+ AuthUserFile ${VHOST_ROOT}/etc/users.htpasswd
+ Require valid-user
+ Order Allow,Deny
+ Allow from all
+ </Location>
+
+ RewriteEngine On
+ RewriteRule ^/${VHOST_APPDIR}/logout /${VHOST_CGIBINDIR##*/}/logout [PT,E=REALM:WebDAV-CGI,E=HOMEURL:/${VHOST_APPDIR},L]
+ RewriteRule ^/${VHOST_APPDIR} /${VHOST_CGIBINDIR##*/}/webdavwrapper [PT,E=WEBDAVCONF:${VHOST_ROOT}/etc/webdav.conf,E=PERLLIB:${VHOST_ROOT}/lib/perl,L]
+
+
+Afterwards you need to copy the default configuration file and edit it:
+cp -p ${VHOST_ROOT}/etc/{webdav.conf-dist,webdav.conf}
+\$EDITOR ${VHOST_ROOT}/etc/webdav.conf
+
+Also make sure that all system users which should be able to login to WebDAV CGI
+are able to access the installed files below ${VHOST_ROOT}.
+
+For further informations study the online documentation which is located at:
+http://webdavcgi.sourceforge.net/doc.html
diff --git a/www-apps/webdavcgi/files/reconfig b/www-apps/webdavcgi/files/reconfig
new file mode 100755
index 000000000000..07710dd7c3e9
--- /dev/null
+++ b/www-apps/webdavcgi/files/reconfig
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+confDir="etc"
+distConfFile="webdav.conf-dist"
+
+sedCmd="/bin/sed"
+
+
+function die ()
+{
+ echo "reconfig error: $1" >&2
+ exit 1
+}
+
+
+if [ $1 != "install" ]; then
+ # nothing to be done, exit
+ exit 0
+fi
+
+# Set the correct path within the config file
+distConfFilePath="${VHOST_ROOT}/${confDir}/${distConfFile}"
+if ! ${sedCmd} -i -e "s|^\(\$INSTALL_BASE\)=.*|\1='${VHOST_ROOT}/';|" \
+ ${distConfFilePath}
+then
+ die "Setting INSTALL_BASE path in ${distConfFilePath} failed"
+fi
+
+
+# Adding logout support
+# see: http://webdavcgi.sourceforge.net/doc.html#logout
+echo "\$HEADER = '<div class=\"header\">WebDAV CGI - Web interface: You are logged in as <span title="'.`id -a`.'">' .\$ENV{REMOTE_USER}.'</span> (<a href="/logout">Logout</a>).</div>';" >> ${distConfFilePath}
diff --git a/www-apps/webdavcgi/files/reconfig-suid b/www-apps/webdavcgi/files/reconfig-suid
new file mode 100755
index 000000000000..d7fb87722614
--- /dev/null
+++ b/www-apps/webdavcgi/files/reconfig-suid
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+webDavWrapper="webdavwrapper"
+webDavWrapperPath="${VHOST_CGIBINDIR}/${webDavWrapper}"
+
+chmodCmd="/bin/chmod"
+chownCmd="/bin/chown"
+
+
+function die ()
+{
+ echo "reconfig error: $1" >&2
+ exit 1
+}
+
+if [ $1 = "install" ]; then
+ # In order to change the user and group ID at runtime, the webdavwrapper
+ # needs to be run as root (set-user-ID and set-group-ID bit)
+ if ! ${chownCmd} root:root ${webDavWrapperPath}; then
+ die "Chown for ${webDavWrapperPath} failed"
+ fi
+
+ if ! ${chmodCmd} 6755 ${webDavWrapperPath}; then
+ die "Setting SUID and SGID bit on ${webDavWrapperPath} failed"
+ fi
+fi
diff --git a/www-apps/webdavcgi/metadata.xml b/www-apps/webdavcgi/metadata.xml
new file mode 100644
index 000000000000..8a6e558dc2d6
--- /dev/null
+++ b/www-apps/webdavcgi/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>christian.affolter@stepping-stone.ch</email>
+ <description>Maintainer</description>
+ </maintainer>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <description>Proxy maintainer</description>
+ </maintainer>
+ <longdescription>
+ WebDAV CGI is a Perl CGI script that enables the WebDAV protocol
+ (class 1,2,3) for Web server to manage Web sites or to use a Web server
+ as a Web drive for files, or for calendar/addressbook sharing. If you
+ need correct permissions for files and folders you can install this
+ WebDAV CGI script and a UID/GID wrapper. The Apache module mod_dav does
+ not support UID/GID wrapping, so this implementation fills up this gap
+ as a complete replacement.
+ </longdescription>
+ <use>
+ <flag name="rcs">Adds support for a revision controlled backend with RCS (<pkg>dev-vcs/rcs</pkg>)</flag>
+ </use>
+</pkgmetadata>
diff --git a/www-apps/webdavcgi/webdavcgi-0.8.3.ebuild b/www-apps/webdavcgi/webdavcgi-0.8.3.ebuild
new file mode 100644
index 000000000000..20f27cd6735d
--- /dev/null
+++ b/www-apps/webdavcgi/webdavcgi-0.8.3.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/webdavcgi/webdavcgi-0.8.3.ebuild,v 1.1 2013/01/11 10:43:38 dev-zero Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs webapp
+
+DESCRIPTION="A Perl CGI for accessing and sharing files, or calendar/addressbooks via WebDAV."
+HOMEPAGE="http://webdavcgi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+WEBAPP_MANUAL_SLOT="yes"
+KEYWORDS="~amd64"
+IUSE="mysql postgres rcs samba +sqlite +suid"
+
+DEPEND=""
+RDEPEND="dev-perl/Archive-Zip
+ dev-perl/File-Copy-Link
+ dev-perl/PerlIO-gzip
+ dev-perl/Quota
+ dev-perl/TimeDate
+ dev-perl/URI
+ dev-perl/UUID-Tiny
+ dev-perl/XML-Simple
+ media-gfx/graphicsmagick[perl]
+ mysql? ( dev-perl/DBD-mysql )
+ perl-core/Module-Load
+ postgres? ( dev-perl/DBD-Pg )
+ rcs? ( dev-perl/Rcs )
+ samba? ( dev-perl/Filesys-SmbClient )
+ sqlite? ( dev-perl/DBD-SQLite )
+ virtual/perl-CGI
+ virtual/perl-File-Spec"
+
+need_httpd_cgi
+
+REQUIRED_USE="|| ( mysql postgres sqlite )"
+
+CGIBINDIR="cgi-bin"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV}-logout-var-expansion.patch"
+}
+
+src_compile() {
+ if use suid; then
+ $(tc-getCC) ${LDFLAGS} ${CFLAGS} \
+ -o "${CGIBINDIR}/webdavwrapper" \
+ helper/webdavwrapper.c || die "compile webdavwrapper failed"
+ fi
+}
+
+src_install() {
+ webapp_src_preinst
+
+ local htdocsDir='htdocs'
+ local confDir='etc'
+
+ local installDirs="$confDir lib locale"
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r "${htdocsDir}"/*
+
+ exeinto "${MY_CGIBINDIR}"
+ newexe "${CGIBINDIR}/logout-dist" logout
+
+ doexe "${CGIBINDIR}/webdav.pl"
+ use suid && doexe "${CGIBINDIR}/webdavwrapper"
+
+ local currentDir
+ for currentDir in ${installDirs}; do
+ dodir "${MY_HOSTROOTDIR}/${currentDir}"
+ insinto "${MY_HOSTROOTDIR}/${currentDir}"
+ doins -r "${currentDir}"/*
+ done
+
+ webapp_configfile "${MY_HOSTROOTDIR}/${confDir}"/{webdav.conf-dist,mime.types}
+
+ use mysql && webapp_sqlscript mysql sql/mysql.sql
+ use postgres && webapp_sqlscript postgres sql/postgresql.sql
+
+ dodoc CHANGELOG TODO
+ dohtml -r doc/*
+
+ webapp_hook_script "${FILESDIR}/reconfig"
+
+ webapp_src_install
+
+ # In order to change the user and group ID at runtime, the webdavwrapper
+ # needs to be run as root (set-user-ID and set-group-ID bit)
+ if use suid; then
+ einfo "Setting SUID and SGID bit for webdavwrapper"
+ fowners root:root "${MY_CGIBINDIR}/webdavwrapper"
+ fperms 6755 "${MY_CGIBINDIR}/webdavwrapper"
+ webapp_postinst_txt en "${FILESDIR}/postinstall-webdavwrapper-en.txt"
+ webapp_hook_script "${FILESDIR}/reconfig-suid"
+ else
+ ewarn "You have the 'suid' USE flag disabled"
+ ewarn "WebDAV CGI won't be able to switch user ids"
+ webapp_postinst_txt en "${FILESDIR}/postinstall-en.txt"
+ fi
+}