--- yaws-1.91.orig/debian/yaws.install
+++ yaws-1.91/debian/yaws.install
@@ -0,0 +1,8 @@
+debian/tmp/usr/bin				/usr/
+debian/tmp/usr/share/man/man1			/usr/share/man/
+debian/tmp/usr/share/man/man5/yaws.conf.5	/usr/share/man/man5/
+debian/conf/yaws.conf				/etc/yaws/
+debian/conf/localhost.conf			/etc/yaws/conf.avail/
+debian/conf/localhost-ssl.conf			/etc/yaws/conf.avail/
+debian/index.html				/usr/share/yaws/
+www/icons/yaws.gif				/usr/share/yaws/
--- yaws-1.91.orig/debian/yaws.README.Debian
+++ yaws-1.91/debian/yaws.README.Debian
@@ -0,0 +1,17 @@
+Yaws allows one to use PAM for authentication purposes. Though epam binary
+which is used for that isn't suid root (this doesn't allow to authenticate
+using shadow system passwords). The local administrator may want to
+override permissions for /usr/lib/yaws/priv/epam.
+
+To make it sgid shadow run
+
+dpkg-statoverride --add root shadow 02755 /usr/lib/yaws/priv/epam
+
+To make it suid root run
+
+dpkg-statoverride --add root yaws 04750 /usr/lib/yaws/priv/epam
+
+In the latter case only yaws (in fact, all users in group yaws) will be
+able to execute the binary.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 15 Jan 2010 14:30:39 +0300
--- yaws-1.91.orig/debian/index.html
+++ yaws-1.91/debian/index.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test Page for Yaws Installation</title>
+</head>
+<!-- Background white, links blue (unvisited), navy (visited), red
+(active) -->
+<body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
+vlink="#000080" alink="#FF0000">
+<p>If you can see this, it means that the installation of the <a
+href="http://yaws.hyber.org">Yaws web
+server</a> software on this system was successful. You may now add
+content to this directory and replace this page.</p>
+
+<div align="center">
+<img src="yaws.gif" alt="Yaws Logo" width="230" height="49" />
+</div>
+<h2 align="center">Seeing this instead of the website you
+expected?</h2>
+
+<p>This page is here because the site administrator has changed the
+configuration of this web server. Please <strong>contact the person
+responsible for maintaining this server with questions.</strong>
+The Yaws web server software this site administrator is using has 
+nothing to do with maintaining this site and cannot help resolve
+configuration issues.</p>
+
+</body>
+</html>
+
--- yaws-1.91.orig/debian/yaws.prerm
+++ yaws-1.91/debian/yaws.prerm
@@ -0,0 +1,31 @@
+#! /bin/sh
+# prerm script for yaws
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/doc/packaging-manual/
+
+case "$1" in
+    remove|upgrade|deconfigure|failed-upgrade)
+    ;;
+
+    *)
+	echo "prerm called with unknown argument \`$1'" >&2
+	exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
--- yaws-1.91.orig/debian/yaws-chat.links
+++ yaws-1.91/debian/yaws-chat.links
@@ -0,0 +1 @@
+usr/share/yaws-chat	usr/lib/yaws/chat/priv/docroot
--- yaws-1.91.orig/debian/yaws.postinst
+++ yaws-1.91/debian/yaws.postinst
@@ -0,0 +1,104 @@
+#! /bin/sh
+# postinst script for yaws
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/doc/packaging-manual/
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+    configure)
+	# Create yaws user
+	adduser --quiet --system --shell /bin/sh --group --home /var/cache/yaws yaws
+	# Moving home directory if it's still in /var/run
+	usermod --home /var/cache/yaws --move-home yaws >/dev/null 2>/dev/null
+
+	# Fixing config directory permissions
+	chown root:yaws /etc/yaws
+	chmod 750 /etc/yaws
+
+	# Yaws configs may contain sensitive information (passwords)
+	chown root:yaws /etc/yaws/yaws.conf
+	chmod 640 /etc/yaws/yaws.conf
+
+	chown -R root:yaws /etc/yaws/conf.avail
+	chmod 640 /etc/yaws/conf.avail/*
+
+	# Create config symlinks
+	# Do it only if it's a fresh install or upgrade from version
+	# less than 1.66-2 (which is the first version with multiple
+	# configs), allowing admin to safely remove it.
+
+	if dpkg --compare-versions "$2" lt "1.66-2" ; then
+	    for f in localhost.conf localhost-ssl.conf ; do
+		if [ ! -f /etc/yaws/conf.d/$f ] ; then
+		    echo "Creating config symlink /etc/yaws/conf.d/$f"
+		    ln -s ../conf.avail/$f /etc/yaws/conf.d/
+		fi
+	    done
+	fi
+
+	# Making /etc/yaws/yaws-cert.pem and /etc/yaws/yaws-key.pem
+	# if they do not exist.
+	( cd /etc/yaws
+	if [ ! -f yaws-cert.pem ] || [ ! -f yaws-key.pem ] ; then
+	    HOST=$(hostname -s 2>/dev/null || echo localhost)
+	    DOMAIN=$(hostname -d 2>/dev/null || echo localdomain)
+	    openssl req -new -x509 -days 365 -nodes \
+			-out yaws-cert.pem \
+			-keyout yaws-key.pem > /dev/null 2>&1 <<+++
+.
+.
+.
+$DOMAIN
+$HOST
+localhost
+root@$HOST.$DOMAIN
++++
+	    echo "Created /etc/yaws/yaws-cert.pem and /etc/yaws/yaws-key.pem for localhost ONLY"
+	fi )
+
+	# Make yaws certificates readable only by the server
+	chown root:yaws /etc/yaws/*.pem
+	chmod 640 /etc/yaws/*.pem
+
+	# Only user yaws and root are allowed to create
+	# yaws control files
+	chown -R yaws:yaws /var/cache/yaws
+	chmod 750 /var/cache/yaws
+
+	install -o yaws -g adm  -m 750 -d /var/log/yaws
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
--- yaws-1.91.orig/debian/compat
+++ yaws-1.91/debian/compat
@@ -0,0 +1 @@
+5
--- yaws-1.91.orig/debian/rules
+++ yaws-1.91/debian/rules
@@ -1,17 +1,29 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
 # Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+VSN=1.91
+
+export HOME := $(CURDIR)/debian
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
-
+export QUILT_PATCHES := debian/patches
 
 # These are used for cross-compiling and for saving the configure script
 # from having to guess our platform (since we know it already)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
+DESTDIR=$(CURDIR)/debian/yaws
+DESTDIR1=$(CURDIR)/debian/erlang-yaws
+TMPDIR=$(CURDIR)/debian/tmp
+
+-include vsn.mk
 
 CFLAGS = -Wall -g
 
@@ -20,88 +32,201 @@
 else
 	CFLAGS += -O2
 endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-	INSTALL_PROGRAM += -s
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	TYPE = debug
 endif
 
-config.status: configure
+patch: patch-stamp
+patch-stamp:
 	dh_testdir
-	# Add here commands to configure the package.
-	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
+	quilt push -a || test $$? = 2
+	touch patch-stamp
 
+unpatch: patch-stamp
+	dh_testdir
+	quilt pop -a || test $$? = 2
+	rm -rf .pc
+	rm -f patch-stamp
 
-build: build-stamp
-
-build-stamp:  config.status
+config.status: patch-stamp configure
 	dh_testdir
+	# Add here commands to configure the package.
+	CFLAGS="$(CFLAGS)" \
+	./configure --host=$(DEB_HOST_GNU_TYPE) \
+		    --build=$(DEB_BUILD_GNU_TYPE) \
+		    --prefix=/usr \
+		    --mandir=\$${prefix}/share/man \
+		    --infodir=\$${prefix}/share/info \
+		    --sysconfdir=/etc \
+		    --localstatedir=/var
+	ln -s . yaws
 
-	# Add here commands to compile the package.
-	$(MAKE)
-	#/usr/bin/docbook-to-man debian/yaws.sgml > yaws.1
 
-	touch build-stamp
+build: build-arch build-indep
 
-clean:
+build-arch: build-arch-stamp
+build-arch-stamp: config.status
 	dh_testdir
-	dh_testroot
-	rm -f build-stamp config.status
-
-	# Add here commands to clean up after the build process.
-	-$(MAKE) clean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-	cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-	cp -f /usr/share/misc/config.guess config.guess
-endif
+	#
+	# Compile the package.
+	mkdir -p examples/ebin
+	TYPE="$(TYPE)" $(MAKE) DLL_LIBS=-lc
+	$(MAKE) docs
+	#
+	touch build-arch-stamp
 
+build-indep: build-indep-stamp
+build-indep-stamp: config.status
+	dh_testdir
+	#
+	# Build applications included into yaws distribution
+	for appdir in applications/* ; do \
+	    (cd $$appdir ; \
+	     mkdir -p ebin ; \
+	     TYPE="$(TYPE)" $(MAKE) || exit 1) \
+	done
+	#
+	touch build-indep-stamp
 
-	dh_clean 
+clean: clean-patched unpatch
+	dh_testdir
+	dh_testroot
+	dh_clean
 
-install: build
+clean-patched: patch-stamp
 	dh_testdir
 	dh_testroot
-	dh_clean -k 
-	dh_installdirs
+	#
+	# Clean up applications included into yaws distribution
+	[ ! -f include.mk ] || \
+	for appdir in applications/* ; do \
+	    (cd $$appdir ; \
+	     $(MAKE) clean || exit 1 ; \
+	     $(MAKE) cleandocs || exit 1) \
+	done
+	#
+	# Clean up after the build process.
+	[ ! -f include.mk ] || $(MAKE) clean
+	[ ! -f include.mk ] || $(MAKE) conf_clean
+	#
+	rm -f build-*-stamp 
+	rm -f yaws erl_crash.dump
+	rm -f debian/yaws-*.postinst debian/yaws-*.postrm
 
-	# Add here commands to install the package into debian/yaws.
-	$(MAKE) install prefix=$(CURDIR)/debian/yaws INSTALLPREFIX=$(CURDIR)/debian/yaws/usr DESTDIR=$(CURDIR)/debian/yaws
+install-arch: build-arch
+	dh_testdir
+	dh_testroot
+	dh_installdirs -a
+	#
+	# Install the package into debian/yaws.
+	$(MAKE) install DESTDIR=$(TMPDIR)
+	#
+	# Fix location of epam binary
+	mv $(TMPDIR)/usr/lib/yaws/priv/lib/epam $(TMPDIR)/usr/lib/yaws/priv/
+	#
+	# Fix permissions on examples
+	chmod a-x $(TMPDIR)/var/yaws/www/testdir/index.html
+	#
+	# Remove duplicated headers
+	rm -f $(TMPDIR)/usr/lib/yaws/*.hrl
+	#
+	# Remove useless .empty files and .xvpics directory
+	find $(TMPDIR) -type f -name '.*' -print -exec rm -rf \{\} \;
+	#
+	# Remove empty directories
+	rm -rf $(TMPDIR)/usr/lib/yaws/examples/
 
+install-indep: build-indep
+	dh_testdir
+	dh_testroot
+	dh_installdirs -i
+	#
+	# Install applications (and READMEs) included into yaws distribution
+	# Application beams go to /usr/lib/yaws
+	# Other application files go to /usr/share/yaws-application/docroot
+	for appdir in applications/* ; do \
+	    (cd $$appdir ; \
+	     app=`basename $$appdir` ; \
+	     $(MAKE) install DESTDIR=$(DESTDIR)-$$app \
+	     		     EBININSTALLDIR=$(DESTDIR)-$$app/usr/lib/yaws/$$app/ebin \
+	     		     CHATINSTALLDIR=$(DESTDIR)-chat/usr/share/yaws-chat \
+	     		     MAILINSTALLDIR=$(DESTDIR)-mail/usr/share/yaws-mail \
+	     		     WIKIINSTALLDIR=$(DESTDIR)-wiki/var/lib/yaws-wiki || exit 1) \
+	done
+	#
+	# Fix permissions of application files
+	for appdir in applications/* ; do \
+	    app=`basename $$appdir` ; \
+	    find $(DESTDIR)-$$app -type f -exec chmod a-x \{\} \; ; \
+	done
+	#
+	# Remove useless empty files
+	for appdir in applications/* ; do \
+	    app=`basename $$appdir` ; \
+	    find $(DESTDIR)-$$app -type f -name '.*' -print -exec rm -f \{\} \; ; \
+	done
+	#
+	# Generate postinst and postrm scripts for applications
+	for appdir in applications/* ; do \
+	    app=`basename $$appdir` ; \
+	    sed -e "s/@APPLICATION@/$$app/g" \
+	    	debian/yaws-application.postinst.in >debian/yaws-$$app.postinst || exit 1; \
+	    sed -e "s/@APPLICATION@/$$app/g" \
+	    	debian/yaws-application.postrm.in >debian/yaws-$$app.postrm || exit 1 ; \
+	done
 
 # Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
+binary-indep: install-arch install-indep
+	dh_testdir -i
+	dh_testroot -i
+	dh_installchangelogs -i ChangeLog
+	dh_installdocs -i
+	dh_installexamples -i
+	dh_install -i
+	dh_installinit -i
+	dh_installman -i
+	dh_link -i
+	dh_strip -i
+	dh_compress -i -X.erl -X.beam -X.yaws -X.pdf -X .ps
+	dh_fixperms -i
+	dh_installdeb -i
+	dh_shlibdeps -i
+	erlang-depends -i
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i
 
 # Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs ChangeLog
-	dh_installdocs
-	dh_installexamples
-#	dh_install
-#	dh_installmenu
-#	dh_installdebconf	
-#	dh_installlogrotate
-#	dh_installemacsen
-#	dh_installpam
-#	dh_installmime
-#	dh_installinit
-#	dh_installcron
-#	dh_installinfo
-	dh_installman
-	dh_link
-	dh_strip
-	dh_compress
-	dh_fixperms
-#	dh_perl
-#	dh_python
-#	dh_makeshlibs
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
+binary-arch: install-arch
+	dh_testdir -a
+	dh_testroot -a
+	dh_installchangelogs -a ChangeLog
+	dh_installdocs -a
+	dh_installexamples -a
+	dh_install -a
+	install -m 644 debian/erlang-yaws.lintian-overrides \
+		$(DESTDIR1)/usr/share/lintian/overrides/erlang-yaws
+	dh_installinit -a
+	dh_installman -a
+	dh_link -a
+	dh_strip -a
+	dh_compress -a -X.erl -X.beam -X.yaws -X.pdf -X.ps
+	dh_fixperms -a
+	dh_installdeb -a
+	dh_shlibdeps -a
+	erlang-depends -a
+	dh_gencontrol -a
+	dh_md5sums -a
+	dh_builddeb -a
+
+binary: binary-arch binary-indep
+
+get-orig-source:
+	wget -O - http://yaws.hyber.org/download/yaws-$(VSN).tar.gz | tar zx
+	tar zcf yaws_$(VSN).orig.tar.gz yaws-$(VSN)
+	rm -r yaws-$(VSN)
+	rm yaws
 
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
+.PHONY: build build-indep build-arch clean binary-indep binary-arch binary \
+	install-arch install-indep get-orig-source patch unpatch clean-patched
--- yaws-1.91.orig/debian/yaws-application.postrm.in
+++ yaws-1.91/debian/yaws-application.postrm.in
@@ -0,0 +1,54 @@
+#! /bin/sh
+# postrm script for yaws-@APPLICATION@
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter> <new-version>
+# for details, see /usr/doc/packaging-manual/
+
+case "$1" in
+    remove)
+	# Remove config symlink, which was created in postinst script
+	f=yaws-@APPLICATION@.conf
+	if [ -h /etc/yaws/conf.d/$f ] && (! readlink -e /etc/yaws/conf.d/$f || \
+		 [ "`readlink /etc/yaws/conf.d/$f`" = "../conf.avail/$f" ]) ; then
+	    rm /etc/yaws/conf.d/$f
+	fi
+
+	# Reload yaws configuration (for yet unknown reason,
+	# invoke-rc.d yaws reload doesn't work here, so restart).
+	if [ -x "/etc/init.d/yaws" ]; then
+	    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d yaws restart || exit $?
+	    else
+		/etc/init.d/yaws restart || exit $?
+	    fi
+	fi
+    ;;
+
+    purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
--- yaws-1.91.orig/debian/changelog
+++ yaws-1.91/debian/changelog
@@ -0,0 +1,528 @@
+yaws (1.91-2) unstable; urgency=high
+
+  * Added patch by Uwe Dauernheim which fixes directory traversal bug
+    (closes: #650009).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 26 Nov 2011 19:34:12 +0400
+
+yaws (1.91-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Tue, 09 Aug 2011 23:26:01 +0400
+
+yaws (1.90-2) unstable; urgency=low
+
+  * Removed -m32 and -m64 gcc command line option which led to FTBFS on
+    ia64 and s390 architectures.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Mon, 13 Jun 2011 16:34:40 +0400
+
+yaws (1.90-1) unstable; urgency=low
+
+  * New upstream release.
+  * Bumped standards version to 3.9.2.
+  * Fixed a few spelling errors in package descriptions.
+  * Fixed a bug in yaws.conf(5) manpage.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Mon, 13 Jun 2011 15:34:55 +0400
+
+yaws (1.89-1) experimental; urgency=low
+
+  * New upstream release.
+  * Synchrinized config file with the upstream version.
+  * Bumped standards version to 3.9.1.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 19 Nov 2010 09:19:07 +0300
+
+yaws (1.88-2) unstable; urgency=low
+
+  * Split out Yaws application to a separate package erlang-yaws, which
+    simplifies using Yaws in embedded mode. The yaws binary package now
+    includes additional binaries and configs necessary to run a standalone
+    Yaws daemon.
+  * Bumped standards version to 3.9.0.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 23 Jul 2010 17:38:18 +0400
+
+yaws (1.88-1) unstable; urgency=low
+
+  * New upstream release.
+  * Bumped standards version to 3.8.4.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Wed, 24 Mar 2010 15:43:06 +0300
+
+yaws (1.87-1) unstable; urgency=low
+
+  * New upstream release.
+  * Moved Yaws binaries to /usr/lib/yaws directory to follow upstream closer
+    and to make sure that private Yaws modules don't clash with any other
+    application. The drawback is that now one has to add -pa /usr/lib/yaws/ebin
+    to the command line if he wants to use Yaws in embedded mode.
+  * Split out yaws-doc package which contains documentation in PDF and
+    examples.
+  * Added README.Debian in which clarified how to change epam permissions in
+    case when it has to be suid or sgid binary.
+  * Don't create /var/run/yaws in Yaws init script because this directory is
+    no longer used. Also, change working dir to /var/cache/yaws before starting
+    the daemon because Erlang issues warnings about inaccessible modules if
+    the current dir isn't readable by yaws user.
+  * Fixed a few spelling errors in manpages.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 15 Jan 2010 23:41:06 +0300
+
+yaws (1.86-2) unstable; urgency=low
+
+  * Renamed \ifpdf macro to \ifpdfoutput in yaws.tex documentation file because
+    it clashes with ifpdf package which is sourced by geometry package in
+    TeXLive 2009 (closes: #560759).
+  * Added texlive-font-utils to build dependencies because epstopdf script has
+    been moved to it from texlive-extra-utils in TeXLive 2009.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 12 Dec 2009 19:19:32 +0300
+
+yaws (1.86-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 11 Dec 2009 19:37:09 +0300
+
+yaws (1.85-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 30 Oct 2009 22:36:02 +0300
+
+yaws (1.84-2) unstable; urgency=low
+
+  * New maintainer's email address pkg-erlang-devel@lists.alioth.debian.org.
+  * Added VCS headers to debian/control.
+  * Added README.source with a link to /usr/share/doc/quilt/README.source
+    where one can find info on how to apply a series of patches to an original
+    source tarball.
+  * Bumped standards version to 3.8.3.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 17 Oct 2009 17:23:15 +0400
+
+yaws (1.84-1) unstable; urgency=low
+
+  * New upstream release.
+  * Removed Torsten Werner from the uploaders list as per his request.
+  * Replaced build dependency on erlang-nox by dependency on erlang-edoc and
+    erlang-mnesia because erlang-nox became a transitional package and will
+    be removed in the future.
+  * Added ${erlang:Depends} variable to binary packages dependencies. This
+    allows to calculate dependencies automatically. This means that erlang-dev
+    build dependency version became 1:13.b.1-3 or higher.
+  * Bumped standards version to 3.8.1.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 09 Aug 2009 12:17:53 +0400
+
+yaws (1.82-2) unstable; urgency=low
+
+  * Fixed default config name (in 1.82 specifying /etc/yaws in configure
+    script call moved default config to /etc/yaws/yaws).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 12 Jun 2009 19:21:31 +0400
+
+yaws (1.82-1) unstable; urgency=low
+
+  * New upstream release.
+  * Moved yaws-yapp, yaws-mail, yaws-chat and yaws-wiki back to web section.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 07 Jun 2009 12:10:30 +0400
+
+yaws (1.81-2) unstable; urgency=low
+
+  * Moved epam binary from priv/lib to priv directory where YAWS expects to
+    find it (closes: #522158).
+  * Added build-dependency on erlang-dev (>= 1:13.b) to make transition to
+    Erlang R13B easier.
+  * Bumped standards version to 3.8.1.
+  * Moved the package to httpd section.
+  * Removed /var/run/yaws directory from the binary package.
+  * Overridden lintian warning virtual-package-depends-without-real-package-
+    depends because the virtual packages erlang-abi-* are provided only to
+    simplify transition to another version of Erlang interface ABI, and
+    yaws package already depends on erlang-base which provides erlang-abi-*.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 01 May 2009 21:00:29 +0400
+
+yaws (1.81-1) unstable; urgency=low
+
+  * New upstrteam release which in particular fixes cleanup in man directory
+    (closes: #519655).
+  * Added zip and bzip2 to suggested dependencies as this would allow YAWS
+    to deliver zipped or bzipped contents in addition to gzipped one (tar and
+    gzip are required packages, so they always present). (closes: #512814).
+  * Added several TeXLive packages to build-dependencies to build Postscript
+    and PDF documentation which isn't prebuilt now.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 14 Mar 2009 08:39:45 +0300
+
+yaws (1.80-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Mon, 16 Feb 2009 13:29:33 +0300
+
+yaws (1.77-3) unstable; urgency=low
+
+  * Fixed init.d script to wait until yaws daemon is actually started.
+  * Removed unnecessary displayed messages from yaws postinstall script.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 21 Dec 2008 14:16:33 +0300
+
+yaws (1.77-2) unstable; urgency=low
+
+  * Removed unnecessary package grep-dctrl from build dependencies.
+  * Protected hostname -s and hostname -d calls in postinst script to prevent
+    its failure in case when hostname is incorrectly configured. It's harmless
+    to replace hostname by "localhost" because it's used only for generating
+    a reference SSL certificate which is to be replaced by a proper one.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 29 Aug 2008 00:46:52 +0400
+
+yaws (1.77-1) unstable; urgency=low
+
+  * New upstream release.
+  * Bumped standards version to 3.8.0.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 20 Jun 2008 09:55:41 +0400
+
+yaws (1.76-4) unstable; urgency=low
+
+  * Fixed bug with processing YAWS control file if it is parseable by
+    file:consult/1 but doesn't have a meaningful content.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 08 Jun 2008 21:32:14 +0400
+
+yaws (1.76-3) unstable; urgency=low
+
+  * Added a patch which fixes typo in eacces error code.
+  * Catched error code 3 in YAWS init script when stopping the server. This
+    error code means that the server isn't running (closes: #483153).
+
+ -- Sergei Golovan <sgolovan@debian.org>  Tue, 27 May 2008 22:43:16 +0400
+
+yaws (1.76-2) unstable; urgency=low
+
+  * Added checks for error code 2 after quilt invocation which means that all
+    patches are already pushed/popped. This allows to convert the source
+    package to 3.0 (quilt) format (closes: #482713).
+  * Cleaned up debian/rules.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 25 May 2008 13:14:53 +0400
+
+yaws (1.76-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fixed build-dependencies (removed -1 suffix from erlang-dev version).
+  * Removed HOSTNAME variable from postinstall script because it might be
+    confused with bash environment variable.
+  * Added a patch which fixes two minor bugs in manpages.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 04 Apr 2008 22:01:09 +0400
+
+yaws (1.75-1) unstable; urgency=low
+
+  * New upstream release.
+  * Added a requirement for $remote_fs into init.d script because YAWS needs
+    mounted /usr to run (closes: #464025).
+  * Removed empty directories /usr/lib/erlang/lib/yaws-*/examples/* from the
+    binary package.
+  * Overridden lintian warnings about empty directories /usr/lib/yaws/ebin
+    and /usr/lib/yaws/include. They are necessary for YAWS with default config
+    to start.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 17 Feb 2008 17:21:35 +0300
+
+yaws (1.74-2) unstable; urgency=low
+
+  * Added a hack to build YAWS on hurd-i386 architecture.
+  * Bumped standards-version to 3.7.3.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Fri, 04 Jan 2008 13:56:19 +0300
+
+yaws (1.74-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 29 Dec 2007 21:26:24 +0300
+
+yaws (1.73-2) unstable; urgency=low
+
+  * Remove /etc/mail/yaws-webmail.conf if it wasn't modified by a user when
+    upgrading from pre-split yaws package (version 1.66-1 or older). This
+    config file is moved to yaws-mail package and therefore isn't needed in
+    main package anymore (closes: #454962).
+  * Moved yaws pages cache from /var/run/yaws (which may be on a tmpfs) to
+    /var/cache/yaws and create /var/run/yaws in init.d script if necessary
+    (closes: #456300).
+  * Added Homepage field to debian control file.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sun, 16 Dec 2007 16:37:33 +0300
+
+yaws (1.73-1) unstable; urgency=low
+
+  * New upstream bugfix release.
+  * Removed patch which fixed SSL connections as it is included into upstream
+    distribution.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Tue, 02 Oct 2007 19:10:52 +0400
+
+yaws (1.72-1) unstable; urgency=low
+
+  * New upstream release (fixes image files which were broken in 1.70
+    release).
+  * Added patch by John Webb which fixes SSL connections to Yaws.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Thu, 20 Sep 2007 15:51:36 +0400
+
+yaws (1.70-1) unstable; urgency=low
+
+  * New upstream release.
+  * Replaced deprecated ${Source-Version} substitution variable by
+    ${binary:Version} in debian control file.
+  * Rewritten clean target in debian/rules to ignore only missing Makefile
+    error (in fact, it is a missing include.mk error).
+  * Made clean-patched target in debian/rules depend on patch-stamp.
+  * Redefined HOME environment variable to fix Erlang compiler warnings in
+    case when HOME points to an existent inaccessible directory.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Wed, 12 Sep 2007 21:43:35 +0400
+
+yaws (1.68-5) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Fixed licence agreement in debian/copyright (closes: #440402).
+  * Added Sergei Golovan <sgolovan@debian.org> to uploaders list.
+  * Bumped debhelper compatibility level to 5.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 01 Sep 2007 12:36:30 +0400
+
+yaws (1.68-4) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Added dependency on erlang ABI virtual package.
+  * Relaxed dependency on erlang-dev (moved it to Suggests from Recommends).
+  * Added Yaws homepage to the package description.
+  * Added build-indep and build-arch targets to debian/rules.
+
+ -- Torsten Werner <twerner@debian.org>  Tue, 26 Jun 2007 19:49:46 +0400
+
+yaws (1.68-3) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Fixed cleaning up after build (closes: #424093).
+
+ -- Torsten Werner <twerner@debian.org>  Thu, 17 May 2007 20:39:42 +0400
+
+yaws (1.68-2) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Moved document roots away from /var/www. Yaws document root is now ar
+    /usr/share/yaws, yaws-chat and yaws-mail document roots are in
+    /usr/share/yaws-chat and yaws-mail respectively. Yaws-wiki requires write
+    access to its document root, so it is placed to /var/lib/yaws-wiki.
+
+ -- Torsten Werner <twerner@debian.org>  Mon, 07 May 2007 23:14:59 +0400
+
+yaws (1.68-1) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * New upstream release.
+  * Removed patch for multiple config files support (it's included in
+    upstream distribution).
+  * Removed patch, which added DESTDIR variable support, (it's included
+    in upstream distribution).
+
+ -- Torsten Werner <twerner@debian.org>  Fri, 09 Feb 2007 19:14:42 +0300
+
+yaws (1.66-2) experimental; urgency=low
+
+  [ Sergei Golovan ]
+  * Added patch and unpatch targets to debian/rules.
+  * Made clean target in debian/rules clean up yaws applications.
+  * Renamed and documented patches in debian/patches.
+  * Moved creating yaws user from preinst to postinst script as required
+    by Debian Policy.
+  * Split the package into five binary packages. Separated all
+    applications, supplied with Yaws (chat, mail, wiki, yapp) to their
+    own packages.
+  * Added patch to support multiple configs, rewritten Yaws config to
+    source all files in /etc/yaws/conf.d directory, making installing/
+    removing applications/virtual hosts easier.
+  * Added emergency exits in debian/rules in case of errors inside for
+    loops (thanks to Christoph Berg for pointing out the problem).
+  * Strictened config directory permissions (thanks to Christoph Berg for
+    pointing out the problem).
+  * Replaced SSL certificates supplied with upstream tarball by generated
+    in postinst script.
+
+ -- Torsten Werner <twerner@debian.org>  Sat, 13 Jan 2007 19:08:09 +0300
+
+yaws (1.66-1) experimental; urgency=low
+
+  [ Torsten Werner ]
+  * Remove redundant Build-Depends because they are already fulfilled by
+    erlang-dev.
+  * Switched to erlang-depends.
+  * Refactored the package a bit by introducing dh_install.
+  * Fixed some dpatches.
+  * Switch from dpatch to quilt.
+
+  [ Sergei Golovan ]
+  * New upstream release.
+
+ -- Torsten Werner <twerner@debian.org>  Fri, 15 Dec 2006 22:59:40 +0100
+
+yaws (1.65-2) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Fixed shared-lib-without-dependency-information lintian warning
+    by explicitly linking setuid_drv.so to libc.
+
+ -- Erlang Packagers <erlang-pkg-devel@lists.berlios.de>  Thu, 14 Sep 2006 22:42:00 +0400
+
+yaws (1.65-1) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * New upstream version.
+  * Moved Yaws applications to /usr/lib/yaws/<applicationname>
+    directories, and moved applications' docroots to
+    /usr/lib/yaws/<applicationname>/priv/docroot directories. Users,
+    who want to use these applications can copy or link docroots to
+    /var/www or whatever.
+  * Overridden image-file-in-usr-lib lintian warning.
+  * Added erlang-nox to Build-Depends because it is required to
+    build documentation for new yaws application yapp.
+  * Added LSB keyword section to init.d script.
+  * Removed patches which corrected including Yaws headers. They are
+    included to upstream.
+  * Added Yaws logo to the default web page.
+
+ -- Erlang Packagers <erlang-pkg-devel@lists.berlios.de>  Wed, 13 Sep 2006 10:09:08 +0400
+
+yaws (1.64-2) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * Again use /etc/mime.types to build.
+  * Added versioned dependency on erlang.
+
+ -- Erlang Packagers <erlang-pkg-devel@lists.berlios.de>  Sun, 23 Jul 2006 14:47:10 +0400
+
+yaws (1.64-1) unstable; urgency=low
+
+  [ Sergei Golovan ]
+  * New upstream version.
+  * Removed patches from yaws_cgi.erl and yaws_ctl.erl because they
+    are included in upstream.
+  * Added chat, mail, and wiki applications included into yaws
+    distribution.
+  * Added erlang-dev to Recommends section of debian/control (yaws
+    dynamic pages may require some development files in order to be
+    compiled in-place).
+  * Overrided lintian warning shared-lib-without-dependency-information
+    (the library setuid_drv.so is not to link binaries with it).
+  * Changed /etc/yaws/yaws.conf permissions to 600 because it may contain
+    authentication data.
+
+ -- Erlang Packagers <erlang-pkg-devel@lists.berlios.de>  Fri, 14 Jul 2006 21:45:31 +0400
+
+yaws (1.63-2) unstable; urgency=low
+
+  * Fixed Maintainer address in debian/control.
+
+  [ Sergei Golovan ]
+  * Added /usr/lib/yaws/ebin and /usr/lib/yaws/include to directory
+    list.
+  * Removed username option from yaws.conf since it isn't supported
+    anymore.
+  * Set environment variable SCRIPT_FILENAME to make php-cgi of
+    version 4.3.2 and above working.
+  * Added two new variable sto yaws.default. YAWS_USER allows to run yaws
+    from nonroot user. YAWS_ID specifies daemon id (instead of two
+    different places - yaws.conf and yaws.init)
+  * Moved configs to /etc/yaws directory.
+  * Create new user yaws during installation.
+  * Patched yaws_ctl.erl to fix insecure controlling of Yaws daemon.
+
+ -- Erlang Packagers <erlang-pkg-devel@lists.berlios.de>  Thu, 06 Jul 2006 01:03:02 +0400
+
+yaws (1.63-1) unstable; urgency=low
+
+  * New upstream release
+  * New mainteners: Erlang Packagers.
+
+  [ Francois-Denis Gonthier ]
+  * Closes: #366341. No longer depends on Erlang only.
+  * Closes: #356272. Cleans log on purge.
+  * Closes: #353189. We don't need to depend on erlang-src.  In all cases
+    erlang-src is in the archive now so it's not longer a bug.
+
+  [ Sergei Golovan ]
+  * Updated Build-Depends to use erlang 10.b.10.
+  * Moved yaws erlang binaries and includes from /usr/lib/yaws to
+    /usr/lib/erlang/lib/yaws-1.63. This makes yaws modules development
+    easier.
+  * Made yaws using /usr/lib/yaws as its application directory
+    instead of /usr/lib/yaws/examples.
+  * Removed yaws headers from /usr/lib/erlang/lib/yaws-1.63. They
+    duplicate the files in include subdir.
+  * Added two new options to yaws.conf.
+  * Added commented virtual host examples to yaws.conf.
+  * Added get-orig-source target to debian/rules.
+
+ -- Erlang Packagers <erlang-pkg-devel@lists.berlios.de>  Tue, 20 Jun 2006 11:23:24 +0400
+
+yaws (1.58-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/control: Removed the build dependency on erlang-src, which doesn't
+    exist. Added a build dependency on libpam0g-dev. Closes: #353189.
+  * debian/yaws.postrm: Added. Now removes /var/log/yaws on purge
+    (see policy 10.8, Log files, last paragraph). Closes: #356272.
+
+ -- Lars Wirzenius <liw@iki.fi>  Fri, 10 Mar 2006 18:35:58 +0000
+
+yaws (1.58-1) unstable; urgency=low
+
+  * New upstream release.
+  * Updated debhelper build dep. 
+
+ -- Will Newton <will@debian.org>  Wed, 15 Feb 2006 20:28:08 +0000
+
+yaws (1.57-1) unstable; urgency=low
+
+  * New upstream release.
+  * Use /etc/mime.types for build. (Closes: #317557)
+  * Bumped standards version to 3.6.2.
+
+ -- Will Newton <will@debian.org>  Wed, 17 Aug 2005 19:33:58 +0100
+
+yaws (1.56-1) unstable; urgency=low
+
+  * New upstream version.
+    - Fixes source disclosure security issue.
+
+ -- Will Newton <will@debian.org>  Thu, 16 Jun 2005 17:37:07 +0100
+
+yaws (1.55-2) unstable; urgency=low
+
+  * Provide httpd-cgi. (Closes: #312911) 
+
+ -- Will Newton <will@debian.org>  Sat, 11 Jun 2005 12:12:14 +0100
+
+yaws (1.55-1) unstable; urgency=low
+
+  * New upstream version. 
+
+ -- Will Newton <will@debian.org>  Fri, 10 Jun 2005 16:02:30 +0100
+
+yaws (1.54-1) unstable; urgency=low
+
+  * Initial release (Closes: #211544)
+
+ -- Will Newton <will@debian.org>  Thu, 19 May 2005 20:55:25 +0100
+
--- yaws-1.91.orig/debian/copyright
+++ yaws-1.91/debian/copyright
@@ -0,0 +1,34 @@
+This package was debianized by Will Newton <will@debian.org> on
+Thu, 19 May 2005 20:55:25 +0100.
+
+It was downloaded from http://yaws.hyber.org/
+
+Author: Claes Wikstrom <klacke@hyber.org>
+
+Copyright (c) 2006, Claes Wikstrom, klacke@hyber.org
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of "Yaws" nor the names of its contributors may be
+      used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
--- yaws-1.91.orig/debian/erlang-yaws.install
+++ yaws-1.91/debian/erlang-yaws.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib				/usr/
+debian/tmp/usr/share/man/man5/yaws_api.5	/usr/share/man/man5/
--- yaws-1.91.orig/debian/erlang-yaws.dirs
+++ yaws-1.91/debian/erlang-yaws.dirs
@@ -0,0 +1 @@
+usr/share/lintian/overrides
--- yaws-1.91.orig/debian/yaws-chat.install
+++ yaws-1.91/debian/yaws-chat.install
@@ -0,0 +1 @@
+debian/conf/yaws-chat.conf /etc/yaws/conf.avail/
--- yaws-1.91.orig/debian/control
+++ yaws-1.91/debian/control
@@ -0,0 +1,86 @@
+Source: yaws
+Section: httpd
+Priority: optional
+Maintainer: Debian Erlang Packagers <pkg-erlang-devel@lists.alioth.debian.org>
+Uploaders: Sergei Golovan <sgolovan@debian.org>
+Build-Depends: debhelper (>= 5.0.0), autotools-dev, mime-support, libpam0g-dev,
+ erlang-dev (>= 1:13.b.1-3), erlang-edoc, erlang-mnesia,
+ texlive-latex-base, texlive-latex-recommended, texlive-fonts-recommended,
+ texlive-font-utils, texlive-extra-utils, ghostscript, quilt
+Standards-Version: 3.9.2
+Homepage: http://yaws.hyber.org/
+Vcs-Svn: svn://svn.debian.org//svn/pkg-erlang/yaws/trunk/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-erlang/yaws/trunk/
+
+Package: yaws
+Architecture: all
+Provides: httpd, httpd-cgi
+Depends: erlang-yaws (>= ${binary:Version}), adduser, openssl, ${misc:Depends}
+Suggests: yaws-doc, yaws-chat, yaws-mail, yaws-wiki, yaws-yapp
+Description: High performance HTTP 1.1 webserver written in Erlang
+ Yaws is a high performance HTTP 1.1 webserver written in Erlang. It is a 
+ multithreaded webserver where one Erlang light weight process is used to
+ handle each client. Two separate modes of operation are supported.
+ .
+ This package includes binaries and config to run Yaws in standalone mode
+ where it works as a regular webserver daemon.
+
+Package: erlang-yaws
+Architecture: any
+Depends: ${erlang-abi:Depends}, ${erlang:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Suggests: ${erlang-dev:Depends}, yaws, yaws-doc, zip, bzip2
+Replaces: yaws (<< 1.88-2)
+Description: Erlang application which implements HTTP webserver
+ Yaws is a high performance HTTP 1.1 webserver written in Erlang. It is a 
+ multithreaded webserver where one Erlang light weight process is used to
+ handle each client. Two separate modes of operation are supported.
+ .
+ This package includes Erlang Yaws application suitable to work in embedded
+ mode where it runs as a webserver in another Erlang application.
+
+Package: yaws-doc
+Section: doc
+Architecture: all
+Depends: ${misc:Depends}
+Suggests: erlang-yaws, yaws
+Replaces: yaws (<< 1.87)
+Description: Documentation and examples for Yaws web server
+ Yaws is a high performance HTTP 1.1 webserver written in Erlang. It is a 
+ multithreaded webserver where one Erlang light weight process is used to
+ handle each client.
+ .
+ This package includes Yaws documentation and examples.
+
+Package: yaws-chat
+Section: web
+Architecture: all
+Depends: ${erlang:Depends}, yaws (>= ${binary:Version}), ${misc:Depends}
+Description: Chat application for Yaws web server
+ Yaws-chat allows one to create a very simple web-based chatroom.
+
+Package: yaws-mail
+Section: web
+Architecture: all
+Depends: ${erlang:Depends}, yaws (>= ${binary:Version}), ${misc:Depends}
+Description: Webmail application for Yaws web server
+ Yaws-mail is a small stateless webmail application. It requires
+ SMTP and POP3 servers to operate and does not store email locally.
+
+Package: yaws-wiki
+Section: web
+Architecture: all
+Depends: ${erlang:Depends}, yaws (>= ${binary:Version}), ${misc:Depends}
+Description: Wiki application for Yaws web server
+ Yaws-wiki is a small wiki application, written in Erlang for Yaws
+ web server.
+
+Package: yaws-yapp
+Section: web
+Architecture: all
+Depends: ${erlang:Depends}, yaws (>= ${binary:Version}), ${misc:Depends}
+Description: Provides an easy way to deploy applications for Yaws web server
+ Yaws-yapp (Yaws application handler) is a helper application.
+ It takes care of adding, and removing, the applications into a running
+ server. When anyone access the server with an URL that matches the path
+ for an added application, the docroot will be temporarily switched
+ to where the web pages for that application are located.
--- yaws-1.91.orig/debian/yaws-yapp.docs
+++ yaws-1.91/debian/yaws-yapp.docs
@@ -0,0 +1 @@
+applications/yapp/README
--- yaws-1.91.orig/debian/yaws-mail.links
+++ yaws-1.91/debian/yaws-mail.links
@@ -0,0 +1 @@
+usr/share/yaws-mail	usr/lib/yaws/mail/priv/docroot
--- yaws-1.91.orig/debian/yaws.dirs
+++ yaws-1.91/debian/yaws.dirs
@@ -0,0 +1,6 @@
+etc/yaws/conf.avail
+etc/yaws/conf.d
+usr/bin
+usr/lib/yaws/custom/ebin
+usr/lib/yaws/custom/include
+usr/share/yaws
--- yaws-1.91.orig/debian/yaws-doc.install
+++ yaws-1.91/debian/yaws-doc.install
@@ -0,0 +1 @@
+debian/tmp/var/yaws/*	usr/share/doc/yaws-doc/examples/
--- yaws-1.91.orig/debian/yaws-wiki.install
+++ yaws-1.91/debian/yaws-wiki.install
@@ -0,0 +1 @@
+debian/conf/yaws-wiki.conf /etc/yaws/conf.avail/
--- yaws-1.91.orig/debian/yaws-yapp.install
+++ yaws-1.91/debian/yaws-yapp.install
@@ -0,0 +1 @@
+debian/conf/yaws-yapp.conf /etc/yaws/conf.avail/
--- yaws-1.91.orig/debian/yaws-application.postinst.in
+++ yaws-1.91/debian/yaws-application.postinst.in
@@ -0,0 +1,66 @@
+#! /bin/sh
+# postinst script for yaws-@APPLICATION@
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/doc/packaging-manual/
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+    configure)
+	# Wiki requires write permissions, so give them to make wiki working
+	# out-of-the-box
+	if [ "@APPLICATION@" = "wiki" ] ; then
+	    chown yaws:yaws /var/lib/yaws-@APPLICATION@
+	fi
+
+	# Create config symlink
+	f=yaws-@APPLICATION@.conf
+	if [ -f /etc/yaws/conf.avail/$f ] && [ ! -f /etc/yaws/conf.d/$f ] ; then
+	    echo "Creating config symlink /etc/yaws/conf.d/$f"
+	    ln -s ../conf.avail/$f /etc/yaws/conf.d/
+	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# Reload yaws configuration (for yet unknown reason, invoke-rc.d yaws reload
+# doesn't work here, so restart).
+if [ -x "/etc/init.d/yaws" ]; then
+    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+	invoke-rc.d yaws restart || exit $?
+    else
+	/etc/init.d/yaws restart || exit $?
+    fi
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
--- yaws-1.91.orig/debian/erlang-yaws.lintian-overrides
+++ yaws-1.91/debian/erlang-yaws.lintian-overrides
@@ -0,0 +1 @@
+erlang-yaws: virtual-package-depends-without-real-package-depends
--- yaws-1.91.orig/debian/yaws-mail.docs
+++ yaws-1.91/debian/yaws-mail.docs
@@ -0,0 +1,2 @@
+applications/mail/README
+applications/mail/TODO
--- yaws-1.91.orig/debian/yaws.preinst
+++ yaws-1.91/debian/yaws.preinst
@@ -0,0 +1,47 @@
+#! /bin/sh
+# preinst script for yaws
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+
+case "$1" in
+    install)
+    ;;
+
+    upgrade)
+	# Remove /etc/mail/yaws-webmail.conf if it isn't modified by user
+	if dpkg --compare-versions "$2" lt-nl "1.66-2" ; then
+	    cf="/etc/mail/yaws-webmail.conf"
+	    if [ -f $cf ] ; then
+		md5sumold=$(dpkg-query -W -f='${Conffiles}' yaws | grep $cf | awk '//{print $2}')
+		md5sumnew=$(md5sum $cf | awk '//{print $1}')
+		if [ "$md5sumold" = "$md5sumnew" ] ; then
+		    rm -f $cf
+		fi
+	    fi
+	fi
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
--- yaws-1.91.orig/debian/yaws-wiki.docs
+++ yaws-1.91/debian/yaws-wiki.docs
@@ -0,0 +1 @@
+applications/wiki/README
--- yaws-1.91.orig/debian/yaws-doc.dirs
+++ yaws-1.91/debian/yaws-doc.dirs
@@ -0,0 +1 @@
+/usr/share/doc/yaws-doc/examples
--- yaws-1.91.orig/debian/yaws.default
+++ yaws-1.91/debian/yaws.default
@@ -0,0 +1,21 @@
+# Defaults for yaws initscript
+# sourced by /etc/init.d/yaws
+# installed at /etc/default/yaws by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+# Default user which runs yaws web server.
+# If you want yaws to listen privileged port 80, set it to root
+# or install fd_server from http://jungerl.sourceforge.net/
+YAWS_USER=yaws
+
+# Default yaws daemon id (when it starts from init script).
+# Put only alphanumeric symbols to the YAWS_ID variable.
+YAWS_ID=debian_yaws
+
+# Additional options that are passed to the Daemon.
+# -heart restarts the daemon if it crashes
+DAEMON_OPTS="-heart"
+
--- yaws-1.91.orig/debian/yaws-wiki.links
+++ yaws-1.91/debian/yaws-wiki.links
@@ -0,0 +1,2 @@
+var/lib/yaws-wiki	usr/lib/yaws/wiki/priv/docroot
+var/lib/yaws-wiki	usr/share/yaws-wiki
--- yaws-1.91.orig/debian/yaws.init
+++ yaws-1.91/debian/yaws.init
@@ -0,0 +1,108 @@
+#! /bin/sh
+#
+# Start/stop Yaws web server
+#
+# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+# Modified for Debian by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+# Modified for yaws #by Will Newton <will@debian.org>
+# and Sergei Golovan <sgolovan@nes.ru>
+
+### BEGIN INIT INFO
+# Provides:          yaws
+# Required-Start:    $remote_fs $network
+# Required-Stop:     $remote_fs $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts Yaws web server
+# Description:       Starts Yaws web server, a high perfomance
+#                    HTTP 1.1 webserver written in Erlang.
+### END INIT INFO
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/yaws
+NAME="yaws web server"
+DESC=yaws
+YAWS_USER=yaws
+YAWS_USER_HOME=/var/cache/yaws
+YAWS_ID=debian_yaws
+
+test -x $DAEMON || exit 0
+
+# Include yaws defaults if available
+if [ -f /etc/default/yaws ] ; then
+    . /etc/default/yaws
+fi
+
+daemon()
+{
+    cd $YAWS_USER_HOME
+    script="$DAEMON -I $YAWS_ID $@"
+    su $YAWS_USER -c "$script"
+}
+
+start()
+{
+    daemon -D $DAEMON_OPTS
+
+    cnt=0
+    while ! (daemon -S >/dev/null || test $? = 3) ; do
+	echo -n .
+	cnt=`expr $cnt + 1`
+	if [ $cnt -ge 10 ] ; then
+	    echo -n " failed"
+	    break
+	fi
+	sleep 1
+    done
+}
+
+stop()
+{
+    daemon -s >/dev/null || test $? = 3
+
+    cnt=0
+    while ! (daemon -S >/dev/null || test $? = 3) ; do
+	echo -n .
+	cnt=`expr $cnt + 1`
+	if [ $cnt -ge 10 ] ; then
+	    echo -n " failed"
+	    break
+	fi
+	sleep 1
+    done
+}
+
+case "$1" in
+    start)
+	echo -n "Starting $DESC: "
+	start
+	echo "$NAME."
+    ;;
+    stop)
+	echo -n "Stopping $DESC: "
+	stop
+	echo "$NAME."
+    ;;
+    status)
+	daemon -S
+    ;;
+    reload|force-reload)
+	echo "Reloading $DESC configuration files."
+	daemon -h
+    ;;
+    restart)
+	echo -n "Restarting $DESC: "
+	stop
+	start
+	echo "$NAME."
+    ;;
+    *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2
+	exit 1
+    ;;
+esac
+
+exit 0
--- yaws-1.91.orig/debian/yaws-mail.install
+++ yaws-1.91/debian/yaws-mail.install
@@ -0,0 +1 @@
+debian/conf/yaws-mail.conf /etc/yaws/conf.avail/
--- yaws-1.91.orig/debian/yaws-doc.links
+++ yaws-1.91/debian/yaws-doc.links
@@ -0,0 +1 @@
+usr/share/doc/yaws-doc/examples/www/yaws.pdf	usr/share/doc/yaws-doc/yaws.pdf
--- yaws-1.91.orig/debian/erlang-yaws.README.Debian
+++ yaws-1.91/debian/erlang-yaws.README.Debian
@@ -0,0 +1,9 @@
+Yaws application is installed into /usr/lib/yaws directory, so to run it
+you have to add option
+    -pa /usr/lib/yaws/ebin
+to Erlang process command line. Also, if you develop using Yaws don't
+forget to add
+    -I/usr/lib/yaws/include
+to Erlang compiler options.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Wed, 05 May 2010 21:44:51 +0400
--- yaws-1.91.orig/debian/yaws-yapp.links
+++ yaws-1.91/debian/yaws-yapp.links
@@ -0,0 +1 @@
+usr/share/yaws-yapp	usr/lib/yaws/yapp/priv/docroot
--- yaws-1.91.orig/debian/README.source
+++ yaws-1.91/debian/README.source
@@ -0,0 +1,8 @@
+This package uses quilt to manage all modifications to the upstream
+source. Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+To get detailed instructions on how to apply the series of patches
+and modify them, please read /usr/share/doc/quilt/README.source
+
+ -- Sergei Golovan <sgolovan@debian.org>  Sat, 17 Oct 2009 17:23:05 +0400
--- yaws-1.91.orig/debian/yaws.postrm
+++ yaws-1.91/debian/yaws.postrm
@@ -0,0 +1,60 @@
+#! /bin/sh
+# postrm script for yaws
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see /usr/doc/packaging-manual/
+
+case "$1" in
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    purge)
+	# Remove certificate and key, which were generated in postinst script
+	rm -f /etc/yaws/yaws-cert.pem 2>/dev/null
+	rm -f /etc/yaws/yaws-key.pem 2>/dev/null
+
+	# Remove stale symlinks, which were created in postinst script
+	for f in localhost.conf localhost-ssl.conf ; do
+	    if [ -h /etc/yaws/conf.d/$f ] && ! readlink -e /etc/yaws/conf.d/$f ; then
+		rm /etc/yaws/conf.d/$f
+	    fi
+	done
+
+	# Remove /etc/yaws/conf.d and /etc/yaws/ if they're empty
+	# (we won't remove user-created files)
+	(cd /etc && rmdir --parents --ignore-fail-on-non-empty yaws/conf.d)
+
+	rm -f /etc/default/yaws 2>/dev/null
+	rm -rf /var/log/yaws 2>/dev/null
+	rm -rf /var/run/yaws 2>/dev/null
+	rm -rf /var/cache/yaws 2>/dev/null
+
+	deluser yaws 2>/dev/null || true
+	delgroup yaws 2>/dev/null || true
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
--- yaws-1.91.orig/debian/watch
+++ yaws-1.91/debian/watch
@@ -0,0 +1,22 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# See uscan(1) for format
+
+# Compulsory line, this is a version 3 file
+version=3
+
+# Uncomment to examine a Webpage 
+# <Webpage URL> <string match>
+#http://www.example.com/downloads.php yaws-(.*)\.tar\.gz
+
+# Uncomment to examine a Webserver directory
+#http://www.example.com/pub/yaws-(.*)\.tar\.gz
+
+# Uncommment to examine a FTP server
+#ftp://ftp.example.com/pub/yaws-(.*)\.tar\.gz debian uupdate
+
+# Uncomment to use Roland's hack for sourceforge based projects - YMMV!
+#http://people.debian.org/~lolando/sfdlr.php?project=yaws yaws-([\d.]*).tar.gz
+
+http://yaws.hyber.org/download/yaws-(.*)\.tar\.gz
--- yaws-1.91.orig/debian/patches/dirtraversal.diff
+++ yaws-1.91/debian/patches/dirtraversal.diff
@@ -0,0 +1,29 @@
+Author: Uwe Dauernheim
+Description: The patch offers a quickfix for directory traversal vulnerability.
+Bug: https://github.com/klacke/yaws/issues/69
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650009
+Last-updated: Sat, 26 Nov 2011 19:30:04 +0400
+
+--- yaws-1.91.orig/src/yaws_api.erl
++++ yaws-1.91/src/yaws_api.erl
+@@ -818,12 +818,14 @@
+ path_norm_reverse("/" ++ T) -> start_dir(0, "/", T);
+ path_norm_reverse(       T) -> start_dir(0,  "", T).
+ 
+-start_dir(N, Path, [$\\|T]    ) -> start_dir(N, Path, [$/|T]);
+-start_dir(N, Path, ".."       ) -> rest_dir(N, Path, "");
+-start_dir(N, Path, "/"   ++ T ) -> start_dir(N    , Path, T);
+-start_dir(N, Path, "./"  ++ T ) -> start_dir(N    , Path, T);
+-start_dir(N, Path, "../" ++ T ) -> start_dir(N + 1, Path, T);
+-start_dir(N, Path,          T ) -> rest_dir (N    , Path, T).
++start_dir(N, Path, [$\\|T]     ) -> start_dir(N, Path, [$/|T]);
++start_dir(N, Path, ".."        ) -> rest_dir(N, Path, "");
++start_dir(N, Path, "/"    ++ T ) -> start_dir(N    , Path, T);
++start_dir(N, Path, "./"   ++ T ) -> start_dir(N    , Path, T);
++start_dir(N, Path, ".\\"  ++ T ) -> start_dir(N    , Path, T);
++start_dir(N, Path, "../"  ++ T ) -> start_dir(N + 1, Path, T);
++start_dir(N, Path, "..\\" ++ T ) -> start_dir(N + 1, Path, T);
++start_dir(N, Path,           T ) -> rest_dir (N    , Path, T).
+ 
+ rest_dir (_N, Path, []         ) -> case Path of
+                                         [] -> "/";
--- yaws-1.91.orig/debian/patches/docs.diff
+++ yaws-1.91/debian/patches/docs.diff
@@ -0,0 +1,27 @@
+Patch removes dependency om non-free latex2html package when building
+docs. Also, it renames \ifpdf to \ifpdfoutput to avoid clash with ifpdf
+package (sourced by geometry package in TeXLive 2009).
+
+--- yaws-1.91.orig/doc/Makefile
++++ yaws-1.91/doc/Makefile
+@@ -17,9 +17,6 @@
+ 	@if [ -z "$(PDFLATEX)" ]; then \
+ 		echo "Need pdflatex"; exit 1; \
+ 	fi
+-	@if [ -z "`which latex2html`" ]; then \
+-		echo "Need latex2html"; exit 1; \
+-	fi
+ 
+ 
+ 
+--- yaws-1.91.orig/doc/yaws.tex
++++ yaws-1.91/doc/yaws.tex
+@@ -34,7 +34,7 @@
+ 
+ \usepackage[T1]{fontenc}
+ \usepackage{xspace}
+-\usepackage{html}
++%\usepackage{html}
+ 
+ \makeatother
+ \begin{document}
--- yaws-1.91.orig/debian/patches/mime.diff
+++ yaws-1.91/debian/patches/mime.diff
@@ -0,0 +1,14 @@
+Patch makes using system wide mime.types instead of possibly outdated
+mime.types, supplied by upstream.
+
+--- yaws-1.91.orig/src/mime_type_c.erl
++++ yaws-1.91/src/mime_type_c.erl
+@@ -21,7 +21,7 @@
+ 
+ 
+ c() ->
+-    {ok, F} = file:open("mime.types", [read]),
++    {ok, F} = file:open("/etc/mime.types", [read]),
+     io:format("Compiling mime.types ... > mime_types.erl ~n", []),
+     {ok, B} = file:read_file("charset.def"),
+     case string:tokens(binary_to_list(B)," \r\n\t" ++ [0, 12]) of
--- yaws-1.91.orig/debian/patches/series
+++ yaws-1.91/debian/patches/series
@@ -0,0 +1,10 @@
+clean.diff
+mime.diff
+install.diff
+installapps.diff
+gnu.diff
+man.diff
+ctl.diff
+docs.diff
+m32m64.diff
+dirtraversal.diff
--- yaws-1.91.orig/debian/patches/ctl.diff
+++ yaws-1.91/debian/patches/ctl.diff
@@ -0,0 +1,28 @@
+Patch adds processing the case when ctlfile is parsable but its
+content is invalid.
+
+--- yaws-1.91.orig/src/yaws_ctl.erl
++++ yaws-1.91/src/yaws_ctl.erl
+@@ -397,6 +397,8 @@
+                 Err ->
+                     Err
+             end;
++        {ok, Terms} ->
++            {error, {content, Terms}};
+         Err ->
+             Err
+     end.
+@@ -417,6 +419,13 @@
+             io:format("No yaws system responds~n",[]),
+             timer:sleep(10),
+             erlang:halt(2);
++        {error, {content,Terms}} ->
++            io:format("The ctlfile ~s is readable but its content~n"
++                      "~p~n"
++                      "isn't in YAWS control file format~n",
++                      [yaws:ctl_file(SID),Terms]),
++            timer:sleep(10),
++            erlang:halt(2);
+         {error, Reason} ->
+             io:format("You failed to read the ctlfile ~s~n"
+                       "error was: <~p>~n"
--- yaws-1.91.orig/debian/patches/gnu.diff
+++ yaws-1.91/debian/patches/gnu.diff
@@ -0,0 +1,37 @@
+Patch by Sergei Golovan allows YWAS to build on hurd-i386 architecture.
+
+--- yaws-1.91.orig/configure
++++ yaws-1.91/configure
+@@ -4212,6 +4212,16 @@
+            FPIC=-fPIC
+ 
+            ;;
++        *gnu*)
++           cat >>confdefs.h <<\_ACEOF
++#define GNU 1
++_ACEOF
++
++           LD_SHARED="gcc -shared"
++
++           FPIC=-fpic
++
++           ;;
+          *cygwin*)
+            # Extract the first word of "werl", so it can be a program name with args.
+ set dummy werl; ac_word=$2
+--- yaws-1.91.orig/configure.in
++++ yaws-1.91/configure.in
+@@ -299,6 +299,13 @@
+            FPIC=-fPIC
+            AC_SUBST(FPIC)
+            ;;
++        *gnu*)
++           AC_DEFINE(GNU)
++           LD_SHARED="gcc -shared"
++           AC_SUBST(LD_SHARED)
++           FPIC=-fPIC
++           AC_SUBST(FPIC)
++           ;;
+          *cygwin*)
+            AC_PATH_PROG(WERL, werl)
+            AC_SUBST(WERL)
--- yaws-1.91.orig/debian/patches/install.diff
+++ yaws-1.91/debian/patches/install.diff
@@ -0,0 +1,25 @@
+Patch fixes logdir and etcdir. Also yaws paths in the examples are
+corrected.
+
+--- yaws-1.91.orig/scripts/Makefile
++++ yaws-1.91/scripts/Makefile
+@@ -13,7 +13,7 @@
+ 	VARDIR='$(VARDIR)' ./local-install true
+ 
+ yaws.conf:
+-	YAWSDIR='$(PREFIX)/lib/yaws' LOGDIR='$(PREFIX)/var/log/yaws' \
++	YAWSDIR='$(PREFIX)/lib/yaws' LOGDIR='$(VARDIR)/log/yaws' \
+ 	VARDIR='$(VARDIR)' PORT=80 DOCROOT='$(VARDIR)/yaws/www' \
+ 	CERTDIR='$(ETCDIR)/yaws' SSLPORT=443 ./gen-yaws-conf > $@
+ 
+--- yaws-1.91.orig/scripts/Install
++++ yaws-1.91/scripts/Install
+@@ -19,7 +19,7 @@
+ v=${vardir}
+ 
+ install -d ${destdir}${prefix}/bin
+-install -d ${destdir}${prefix}/etc
++install -d ${destdir}${etcdir}
+ install -d ${destdir}${vardir}/log/yaws
+ 
+ cat yaws.template | \
--- yaws-1.91.orig/debian/patches/installapps.diff
+++ yaws-1.91/debian/patches/installapps.diff
@@ -0,0 +1,20 @@
+Patch makes yaws applications installing under /usr/lib/yaws directory
+and docs installing to /usr/share/doc/yaws directory.
+
+--- yaws-1.91.orig/applications/yapp/Makefile
++++ yaws-1.91/applications/yapp/Makefile
+@@ -24,8 +24,10 @@
+ 	rm -rf doc/*.html doc/edoc-info doc/stylesheet.css doc/*.png
+ 
+ install: all docs
+-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/$(APPNAME)/ebin
+-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/$(APPNAME)/priv/docroot
+-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/$(APPNAME)/doc
+-	(tar cf - ebin priv doc) | (cd $(DESTDIR)$(PREFIX)/lib/yapp; tar xf - )
++	$(INSTALL) -d $(DESTDIR)/usr/lib/yaws/$(APPNAME)/ebin
++	$(INSTALL) -d $(DESTDIR)/usr/share/yaws-$(APPNAME)
++	$(INSTALL) -d $(DESTDIR)/usr/share/doc/yaws-$(APPNAME)/doc
++	(tar cf - ebin) | (cd $(DESTDIR)/usr/lib/yaws/$(APPNAME); tar xf - )
++	(cd priv/docroot; tar cf - .) | (cd $(DESTDIR)/usr/share/yaws-$(APPNAME); tar xf - )
++	(tar cf - doc) | (cd $(DESTDIR)/usr/share/doc/yaws-$(APPNAME); tar xf - )
+ 
--- yaws-1.91.orig/debian/patches/clean.diff
+++ yaws-1.91/debian/patches/clean.diff
@@ -0,0 +1,44 @@
+Patch fixes cleaning up after build process.
+
+--- yaws-1.91.orig/Makefile
++++ yaws-1.91/Makefile
+@@ -45,6 +45,7 @@
+ 
+ conf_clean:
+ 	-rm include.mk config.cache config.status config.log 2> /dev/null
++	-rm test/support/include.mk test/support/include.sh $(PKGCONFIG_FILES) 2> /dev/null
+ 
+ local_install: all
+ 	(cd scripts && $(MAKE) local_install)
+--- yaws-1.91.orig/doc/Makefile
++++ yaws-1.91/doc/Makefile
+@@ -41,6 +41,7 @@
+ 
+ clean:
+ 	rm  -f *.ps *.dvi *.log *.aux *.pdf *.toc *.beam 2> /dev/null || true
++	rm  -f *.out ../www/yaws.ps ../www/yaws.pdf 2> /dev/null || true
+ 
+ install:
+ 	-install -d $(DESTDIR)$(PREFIX)/share/doc/yaws
+--- yaws-1.91.orig/applications/wiki/scripts/Makefile
++++ yaws-1.91/applications/wiki/scripts/Makefile
+@@ -27,7 +27,7 @@
+ 	chmod +x $@
+ 
+ clean:
+-	rm importFiles getPassword updateWiki
++	rm -f $(SCRIPTS)
+ 
+ 
+ install:
+--- yaws-1.91.orig/applications/yapp/Makefile
++++ yaws-1.91/applications/yapp/Makefile
+@@ -21,7 +21,7 @@
+ 	$(ERL) -noshell  -run edoc_run application "'$(APPNAME)'" '"."' '$(DOC_OPTS)' -s init stop
+ 
+ cleandocs:
+-	rm -rf doc/*.html doc/edoc-info doc/stylesheet.css
++	rm -rf doc/*.html doc/edoc-info doc/stylesheet.css doc/*.png
+ 
+ install: all docs
+ 	$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/$(APPNAME)/ebin
--- yaws-1.91.orig/debian/patches/man.diff
+++ yaws-1.91/debian/patches/man.diff
@@ -0,0 +1,76 @@
+Patch fixes erros in yaws manual pages.
+
+--- yaws-1.91.orig/man/yaws.conf.5
++++ yaws-1.91/man/yaws.conf.5
+@@ -261,11 +261,11 @@
+ .SH SERVER PART
+ Yaws can virthost several web servers on the same IP address as well
+ as several web servers on different IP addresses. This includes SSL servers.
+-.pp
++.PP
+ Each virtual host is defined within a matching pair of \fB<server ServerName>\fR
+ and \fB</server>\fR. The ServerName will be the name of the webserver.
+ 
+-.pp
++.PP
+ The following directives are allowed inside a server definition.
+ .TP
+ \fBport = Port\fR
+@@ -345,7 +345,7 @@
+ 
+ \fBModule:write_log(ServerName, Type, State, Infos)\fR
+ .RS 12
+-When it needs to log a message, \Yaws\ will call this function. The parameter
++When it needs to log a message, Yaws will call this function. The parameter
+ Infos is \fI{Ip,Req,InHdrs,OutHdrs,Time}\fR for an access log and
+ \fI{Ip,Path,Item}\fR for an auth log, where:
+ 
+@@ -394,7 +394,7 @@
+ 
+ <extra_cgi_vars dir='/path/to/some/scripts'>
+ var = val
+-...
++\&...
+ </extra_cgi_vars>
+ .fi
+ 
+@@ -595,7 +595,7 @@
+ At startup of the server, Module:start/1 will be called.
+ The #sconf{} record (defined in yaws.hrl) will be used
+ as the input argument. This makes it possible for a user
+-application to syncronize the startup with the yaws server
++application to synchronize the startup with the yaws server
+ as well as getting hold of user specific configuration data,
+ see the explanation for the <opaque> context.
+ 
+@@ -971,7 +971,7 @@
+ </server>
+ .fi
+ 
+-.pp
++.PP
+ And this example shows a similar setup but two web servers on the same
+ IP address.
+ 
+--- yaws-1.91.orig/man/yaws_api.5
++++ yaws-1.91/man/yaws_api.5
+@@ -197,8 +197,8 @@
+ from a process. The other process can call this function to deliver
+ these chunks. It requires the \fBout/1\fR function to return the
+ value \fB{streamcontent, MimeType, FirstChunk}\fR to work.
+-YawsPid is the process identifier of the yaws process delivering the original
+-.yaws file. That is self() in the yaws code.
++YawsPid is the process identifier of the yaws process delivering the
++original .yaws file. That is self() in the yaws code.
+ The Pid must typically be passed (somehow) to the producer of the stream.
+ 
+ .TP
+@@ -618,7 +618,7 @@
+ 
+ .TP
+ \fB{streamcontent_with_timeout, MimeType, FirstChunk, Timeout}\fR
+-Similar to above, but with an explicit timeout. The deafult timeout
++Similar to above, but with an explicit timeout. The default timeout
+ is 30 secs. I.e if the application fails to deliver data to the
+ Yaws process, the streaming will stop. This is often not the
+ desired behaviour in Comet/Ajax applications.  It's possible to
--- yaws-1.91.orig/debian/patches/m32m64.diff
+++ yaws-1.91/debian/patches/m32m64.diff
@@ -0,0 +1,45 @@
+Patch by Sergei Golovan removes -m32 or -m64 gcc command line options
+(which lead to FTBFS) for all non-x86* architectures.
+
+--- yaws-1.91.orig/configure
++++ yaws-1.91/configure
+@@ -4062,15 +4062,15 @@
+   { $as_echo "$as_me:${as_lineno-$LINENO}: found 64-bit Erlang" >&5
+ $as_echo "$as_me: found 64-bit Erlang" >&6;}
+                    case "$host_cpu" in
+-                       x86_64) CBIT= ;;
+-                       *) CBIT=-m64 ;;
++                       i?86) CBIT=-m64 ;;
++                       *) CBIT= ;;
+                    esac
+ else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: found 32-bit Erlang" >&5
+ $as_echo "$as_me: found 32-bit Erlang" >&6;}
+                    case "$host_cpu" in
+-                       i?86) CBIT= ;;
+-                       *) CBIT=-m32 ;;
++                       x86_64) CBIT=-m32 ;;
++                       *) CBIT= ;;
+                    esac
+ fi
+ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+--- yaws-1.91.orig/configure.in
++++ yaws-1.91/configure.in
+@@ -227,13 +227,13 @@
+                             end end)])],
+ 	       [AC_MSG_NOTICE(found 64-bit Erlang)
+                    case "$host_cpu" in
+-                       x86_64) CBIT= ;;
+-                       *) CBIT=-m64 ;;
++                       i?86) CBIT=-m64 ;;
++                       *) CBIT= ;;
+                    esac],
+ 	       [AC_MSG_NOTICE(found 32-bit Erlang)
+                    case "$host_cpu" in
+-                       i?86) CBIT= ;;
+-                       *) CBIT=-m32 ;;
++                       x86_64) CBIT=-m32 ;;
++                       *) CBIT= ;;
+                    esac])
+            CFLAGS="$CFLAGS $CBIT"
+            LD_SHARED="$CC $CBIT -shared"
--- yaws-1.91.orig/debian/conf/localhost.conf
+++ yaws-1.91/debian/conf/localhost.conf
@@ -0,0 +1,20 @@
+# Configuration file for Yaws HTTP daemon
+
+# This config defines virtual server localhost. It is
+# enabled by default. If you want to disable it, remove
+# symlink from /etc/yaws/conf.d/.
+
+# Instead you may edit this file and after that reload
+# yaws configureation using invoke-rc.d yaws reload
+
+# (If you want to use privileged port, run yaws as root,
+# setting YAWS_USER in /etc/default/yaws, or use port
+# redirection, e.g. via iptables.)
+
+<server localhost>
+    port = 8080
+    listen = 0.0.0.0
+    docroot = /usr/share/yaws
+    # dir_listings = true
+</server>
+
--- yaws-1.91.orig/debian/conf/yaws-wiki.conf
+++ yaws-1.91/debian/conf/yaws-wiki.conf
@@ -0,0 +1,17 @@
+# Configuration file for yaws-wiki
+
+# This the path to a directory where wiki
+# beam code is placed. The daemon will add this
+# directory to its search path
+
+ebin_dir = /usr/lib/yaws/wiki/ebin
+
+# Edit the following virtual server definition to
+# enable yaws wiki.
+
+#<server wiki>
+# port = 8080
+# listen = 0.0.0.0
+# docroot = /var/lib/yaws-wiki
+#</server>
+
--- yaws-1.91.orig/debian/conf/yaws-yapp.conf
+++ yaws-1.91/debian/conf/yaws-yapp.conf
@@ -0,0 +1,31 @@
+# Configuration file for yaws-yapp
+
+# This the path to a directory where yapp
+# beam code is placed. The daemon will add this
+# directory to its search path
+
+ebin_dir = /usr/lib/yaws/yapp/ebin
+
+
+# Start yapp at startup
+ 
+runmod = yapp
+
+# To enable yapp, also you should create Mnesia database
+# scheme for running with Yaws.
+
+# Edit the following virtual server definition to
+# enable web-GUI to list/add/remove Yaws applications.
+
+#<server yapp>
+#    port = 8080
+#    listen = 0.0.0.0
+#    docroot = /usr/share/yaws-yapp
+#    dir_listings = true
+#    arg_rewrite_mod = yapp	
+#    <opaque>
+#  	yapp_server_id = yappexample
+#  	bootstrap_yapps = yapp
+#    </opaque>
+#</server>
+
--- yaws-1.91.orig/debian/conf/yaws-chat.conf
+++ yaws-1.91/debian/conf/yaws-chat.conf
@@ -0,0 +1,17 @@
+# Configuration file for yaws-chat
+
+# This the path to a directory where chat
+# beam code is placed. The daemon will add this
+# directory to its search path
+
+ebin_dir = /usr/lib/yaws/chat/ebin
+
+# Edit the following virtual server definition to
+# enable chat server.
+
+#<server chat>
+# port = 8080
+# listen = 0.0.0.0
+# docroot = /usr/share/yaws-chat
+#</server>
+
--- yaws-1.91.orig/debian/conf/localhost-ssl.conf
+++ yaws-1.91/debian/conf/localhost-ssl.conf
@@ -0,0 +1,24 @@
+# Configuration file for Yaws HTTP daemon
+
+# This config defines SSL-enabled virtual server localhost.
+# It is enabled by default. If you want to disable it, remove
+# symlink from /etc/yaws/conf.d/.
+
+# Instead you may edit this file and after that reload
+# yaws configureation using invoke-rc.d yaws reload
+
+# (If you want to use privileged port, run yaws as root,
+# setting YAWS_USER in /etc/default/yaws, or use port
+# redirection, e.g. via iptables.)
+
+<server localhost>
+    port = 8443
+    listen = 0.0.0.0
+    docroot = /usr/share/yaws
+    # dir_listings = true
+    <ssl>  
+        keyfile = /etc/yaws/yaws-key.pem
+        certfile = /etc/yaws/yaws-cert.pem
+    </ssl>
+</server>
+
--- yaws-1.91.orig/debian/conf/yaws.conf
+++ yaws-1.91/debian/conf/yaws.conf
@@ -0,0 +1,196 @@
+# conf for yaws
+
+
+# first we have a set of globals
+# That apply to all virtual servers
+
+
+# This is the directory where all logfiles for
+# all virtual servers will be written
+
+logdir = /var/log/yaws
+
+
+# This the path to a directory where additional
+# beam code can be placed. The daemon will add this
+# directory to its search path
+
+ebin_dir = /usr/lib/yaws/custom/ebin
+
+
+# This is a directory where application specific .hrl
+# files can be placed. application specifig .yaws code can
+# then include these .hrl files
+
+include_dir = /usr/lib/yaws/custom/include
+
+
+# Set this to an integer value to control
+# max number of connections from clients into the server
+
+max_connections = nolimit
+
+
+# Normally, yaws does not restrict the number of times a connection is
+# kept alive using keepalive. Setting this parameter to an integer X
+# will ensure that connections are closed once they have been used X times.
+# This can be a useful to guard against long running connections
+# collecting too much garbage in the erlang VM.
+
+keepalive_maxuses = nolimit
+
+
+# Override the garbage collection option parameters for processes
+# which handle new connections. Useful for systems which expect long lived
+# connections which handle a lot of data. The default value is erlangs
+# default. Valid options are {fullsweep_after, X} and/or {min_heap_size, Y} where
+# X and Y are integers. See erlangs erlang:spawn_opt/4 function for more details.
+# The value type is a quoted string containing an erlang proplist
+
+process_options = "[]"
+
+
+# This is a debug variable, possible values are http | traffic | false
+# It is also possible to set the trace (possibly to the tty) while
+# invoking yaws from the shell as in
+# yaws -i -T -x (see man yaws)
+
+trace = false
+
+
+# Enable this if we want to use the old OTP ssl implementation
+# OTP R13B03 is known to work with this flag set         to false (default)
+
+use_old_ssl = false
+
+
+# it is possible to have yaws start additional 
+# application specific code at startup
+
+# runmod = mymodule
+
+
+# By default yaws will copy the erlang error_log and
+# end write it to a wrap log called report.log (in the logdir)
+# this feature can be turned off. This would typically
+# be the case when yaws runs within another larger app
+
+copy_error_log = true
+
+
+# Logs are wrap logs
+
+log_wrap_size = 1000000
+
+
+# Possibly resolve all hostnames in logfiles so webalizer
+# can produce the nice geography piechart
+
+log_resolve_hostname = false
+
+
+# fail completely or not if yaws fails 
+# to bind a listen socket
+
+fail_on_bind_err = true
+
+
+# If HTTP auth is used, it is possible to have a specific
+# auth log.
+
+auth_log = true
+
+
+# When we're running multiple yaws systems on the same 
+# host, we need to give each yaws system an individual
+# name. Yaws will write a number of runtime files under
+# /tmp/yaws/${id}
+# The default value is "default"
+#
+# In Debian system init script supplies id from the command
+# line, so it's not necessary to specify it here
+
+#id = debian_yaws
+
+
+# earlier versions of Yaws picked the first virtual host
+# in a list of hosts with the same IP/PORT when the Host:
+# header doesn't match any name on any Host
+# This is often nice in testing environments but not
+# acceptable in real live hosting scenarios
+
+pick_first_virthost_on_nomatch = true
+
+
+# If the HTTP client session is to be kept alive, wait this many
+# milliseconds for a new request before timing out the connection. Note
+# that infinity is a valid value but it's not recommended.
+
+keepalive_timeout = 30000
+
+
+# All unices are broken since it's not possible to bind to
+# a privileged port (< 1024) unless uid==0
+# There is a contrib in jungerl which makes it possible by means 
+# of an external setuid root programm called fdsrv to listen to
+# to privileged port.
+# If we use this feature, it requires fdsrv to be properly installed.
+# Doesn't yet work with SSL.
+# Read http://yaws.hyber.org/privbind.yaws for more info and a better
+# solution than fd_srv
+
+use_fdsrv = false
+
+
+# Load external config files. To add virtual server, don't
+# edit this config file. Instead, put additional config to
+# /etc/yaws/config.d/ and it will be sourced during yaws
+# reload.
+
+subconfigdir = /etc/yaws/conf.d
+
+
+# And then a set of virtual server examples
+# (If you want to use privileged port, run yaws as root,
+# setting YAWS_USER in /etc/default/yaws, or use port
+# redirection, e.g. via iptables.)
+
+# All virtual server examples are commented out.
+
+# First two virthosted servers on the same IP (0.0.0.0)
+# in this case, but an explicit IP can be given as well
+
+#<server www>
+#    port = 8080
+#    listen = 0.0.0.0
+#    docroot = /var/www/yaws
+#</server>
+
+#<server localhost>
+#    port = 8080
+#    listen = 0.0.0.0
+#    docroot = /var/www/yaws-webdav
+#    dir_listings = true
+#    dav = true
+#    <auth>
+#        realm = foobar
+#        dir = /
+#        user = foo:bar
+#        user = baz:bar
+#    </auth>
+#</server>
+
+
+# And then an ssl server
+
+#<server www>
+#    port = 8443
+#    docroot = /var/www/yaws-ssl
+#    listen = 0.0.0.0
+#    dir_listings = true
+#    <ssl>  
+#        keyfile = /etc/yaws/yaws-key.pem
+#        certfile = /etc/yaws/yaws-cert.pem
+#    </ssl>
+#</server>
+
--- yaws-1.91.orig/debian/conf/yaws-mail.conf
+++ yaws-1.91/debian/conf/yaws-mail.conf
@@ -0,0 +1,17 @@
+# Configuration file for yaws-mail
+
+# This the path to a directory where mail
+# beam code is placed. The daemon will add this
+# directory to its search path
+
+ebin_dir = /usr/lib/yaws/mail/ebin
+
+# Edit the following virtual server definition to
+# enable webmail application.
+
+#<server mail>
+# port = 8080
+# listen = 0.0.0.0
+# docroot = /usr/share/yaws-mail
+#</server>
+
