commit: cbce7f309d14a6f062ae2d94a5e5804639db2bab Author: ArsenShnurkov <Arsen.Shnurkov <AT> gmail <DOT> com> AuthorDate: Fri Jul 17 23:56:32 2015 +0000 Commit: Heather Cynede <cynede <AT> gentoo <DOT> org> CommitDate: Fri Jul 17 23:56:32 2015 +0000 URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=cbce7f30
www-servers/xsp added dev-dotnet/xsp/files/systemd/xsp.service | 10 +++ mono.webapp | 0 profiles/package.mask | 2 +- www-servers/xsp/files/2.2/mod-mono-server-r1.initd | 83 +++++++++++++++++++ www-servers/xsp/files/2.2/mod-mono-server.confd | 34 ++++++++ www-servers/xsp/files/2.2/mod-mono-server.initd | 81 +++++++++++++++++++ www-servers/xsp/files/2.2/xsp.confd | 12 +++ www-servers/xsp/files/2.2/xsp.initd | 38 +++++++++ www-servers/xsp/files/aclocal-fix.patch | 13 +++ www-servers/xsp/files/systemd/mono-xsp4.service | 15 ++++ www-servers/xsp/files/systemd/mono.webapp | 10 +++ www-servers/xsp/files/systemd/readme.txt | 1 + www-servers/xsp/files/xsp-2.10.2-endrequest.patch | 35 ++++++++ www-servers/xsp/metadata.xml | 12 +++ www-servers/xsp/xsp-2014.12-r2014120900.ebuild | 94 ++++++++++++++++++++++ www-servers/xsp/xsp-9999.ebuild | 66 +++++++++++++++ 16 files changed, 505 insertions(+), 1 deletion(-) diff --git a/dev-dotnet/xsp/files/systemd/xsp.service b/dev-dotnet/xsp/files/systemd/xsp.service new file mode 100644 index 0000000..f4b4c92 --- /dev/null +++ b/dev-dotnet/xsp/files/systemd/xsp.service @@ -0,0 +1,10 @@ +[Unit] +Description=xsp4 web server +After=syslog.target network.target + +[Service] +Type=simple +ExecStart=/usr/bin/xsp4 + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/mono.webapp b/mono.webapp new file mode 100644 index 0000000..e69de29 diff --git a/profiles/package.mask b/profiles/package.mask index e359986..6e3d01c 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -1,3 +1,3 @@ # mono 4.0 and 4.0.1 have serious bug with calls to .NET 2.0 3.0 3.5 libs, it's fixed in master # https://bugzilla.xamarin.com/show_bug.cgi?id=29665 -=dev-lang/mono-4.0* +#=dev-lang/mono-4.0* diff --git a/www-servers/xsp/files/2.2/mod-mono-server-r1.initd b/www-servers/xsp/files/2.2/mod-mono-server-r1.initd new file mode 100644 index 0000000..9e46646 --- /dev/null +++ b/www-servers/xsp/files/2.2/mod-mono-server-r1.initd @@ -0,0 +1,83 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: mod-mono-server-r1.initd,v 1.1 2012/01/22 12:54:29 pacho Exp $ + +depend() { + use net + after dotnet +} + +start() { + [ -z "$MonoServerRootDir" ] && \ + MonoServerRootDir="/usr/lib/xsp/test" + [ -z "$MonoApplications" ] && \ + MonoApplications="/mono:/usr/lib/xsp/test,/:." + [ -z "$UnixSocketFileName" ] && \ + UnixSocketFileName="/tmp/mod_mono_server" + [ -z "$MonoServerAddress" ] && \ + MonoServerAddress=127.0.0.1 + [ -z "$MonoServerPort" ] && \ + MonoServerPort=8080 + [ -z "$MonoServerVersion" ] && \ + MonoServerVersion=1 + + MONO_SERVER_OPTS="--root ${MonoServerRootDir} \ +--applications ${MonoApplications} --nonstop" + + [ -n "$MonoApplicationsConfigDir" ] && \ + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--appconfigdir ${MonoApplicationsConfigDir}" + + case "$MonoServerChannel" in + "tcp" ) + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--address ${MonoServerAddress} --port ${MonoServerPort}" + ;; + + "unix" ) + [ -f "$UnixSocketFileName" ] && rm -f $UnixSocketFileName + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--filename ${UnixSocketFileName}" + ;; + + * ) + eerror "Please set a valid value for MonoServerChannel" + return 1 + ;; + esac + + if [ ${MonoServerVersion} -eq 1 ]; then + modmonoserverpath=1.0/mod-mono-server.exe + elif [ ${MonoServerVersion} -eq 2 ]; then + modmonoserverpath=2.0/mod-mono-server2.exe + elif [ ${MonoServerVersion} -eq 4 ]; then + modmonoserverpath=4.0/mod-mono-server4.exe + else + eerror "MonoServerVersion was not properly set. Check your /etc/conf.d/mod-mono-server" + return 1 + fi + + export MONO_SHARED_DIR=/tmp + + ebegin "Starting mod-mono-server" + + start-stop-daemon --quiet --start \ + --background \ + --make-pidfile \ + --pidfile /var/run/aspnet/mod-mono-server.pid \ + --user aspnet \ + --exec /usr/bin/mono /usr/lib/mono/${modmonoserverpath} \ + -- $MONO_SERVER_OPTS + + eend $? +} + +stop() { + ebegin "Stopping mod-mono-server" + + start-stop-daemon --quiet --stop \ + --pidfile /var/run/aspnet/mod-mono-server.pid + + eend $? +} diff --git a/www-servers/xsp/files/2.2/mod-mono-server.confd b/www-servers/xsp/files/2.2/mod-mono-server.confd new file mode 100644 index 0000000..7cefdbe --- /dev/null +++ b/www-servers/xsp/files/2.2/mod-mono-server.confd @@ -0,0 +1,34 @@ +# Config file for /etc/init.d/mod-mono-server +# $Id: mod-mono-server.confd,v 1.1 2009/01/18 17:44:04 loki_val Exp $ + +# Configuration directives for mod-mono-server.exe. For more information on +# these variables, see the man page for xsp(1). + +# This is the document root; trailing slash is not necessary +#MonoServerRootDir="/usr/lib/xsp/test" + +# Directory to search for files with an `.webapp' extension. +#MonoApplicationsConfigDir="/usr/lib/xsp/test" + +# Comma separated list of directories (in the form virtual:real) for all +# applications managed by the server. For example: +# /app1:/var/www/localhost/htdocs/app1,/app2:/var/www/localhost/htdocs/app2 +MonoApplications="/mono:/usr/lib/xsp/test" + +# The communication channel used between mod-mono-server and mod_mono. +# unix - A unix socket +# tcp - A TCP connection +MonoServerChannel="unix" + +# When the comm. channel is "unix", the local filename used by the socket. +UnixSocketFileName="/tmp/mod_mono_server" + +# When the comm. channel is "tcp", IP address for the server to listen on. +#MonoServerAddress=127.0.0.1 + +# When the comm. channel is "tcp", port for the server to listen on. +#MonoServerPort=8080 + +# If you want to host .NET 2.0 applications you have to set this to 2. +# Otherwise, leave it unchaged +MonoServerVersion=1 diff --git a/www-servers/xsp/files/2.2/mod-mono-server.initd b/www-servers/xsp/files/2.2/mod-mono-server.initd new file mode 100644 index 0000000..a15d102 --- /dev/null +++ b/www-servers/xsp/files/2.2/mod-mono-server.initd @@ -0,0 +1,81 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: mod-mono-server.initd,v 1.1 2009/01/18 17:44:04 loki_val Exp $ + +depend() { + use net + after dotnet +} + +start() { + [ -z "$MonoServerRootDir" ] && \ + MonoServerRootDir="/usr/lib/xsp/test" + [ -z "$MonoApplications" ] && \ + MonoApplications="/mono:/usr/lib/xsp/test,/:." + [ -z "$UnixSocketFileName" ] && \ + UnixSocketFileName="/tmp/mod_mono_server" + [ -z "$MonoServerAddress" ] && \ + MonoServerAddress=127.0.0.1 + [ -z "$MonoServerPort" ] && \ + MonoServerPort=8080 + [ -z "$MonoServerVersion" ] && \ + MonoServerVersion=1 + + MONO_SERVER_OPTS="--root ${MonoServerRootDir} \ +--applications ${MonoApplications} --nonstop" + + [ -n "$MonoApplicationsConfigDir" ] && \ + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--appconfigdir ${MonoApplicationsConfigDir}" + + case "$MonoServerChannel" in + "tcp" ) + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--address ${MonoServerAddress} --port ${MonoServerPort}" + ;; + + "unix" ) + [ -f "$UnixSocketFileName" ] && rm -f $UnixSocketFileName + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--filename ${UnixSocketFileName}" + ;; + + * ) + eerror "Please set a valid value for MonoServerChannel" + return 1 + ;; + esac + + if [ ${MonoServerVersion} -eq 1 ]; then + modmonoserverpath=1.0/mod-mono-server.exe + elif [ ${MonoServerVersion} -eq 2 ]; then + modmonoserverpath=2.0/mod-mono-server2.exe + else + eerror "MonoServerVersion was not properly set. Check your /etc/conf.d/xsp" + return 1 + fi + + export MONO_SHARED_DIR=/tmp + + ebegin "Starting mod-mono-server" + + start-stop-daemon --quiet --start \ + --background \ + --make-pidfile \ + --pidfile /var/run/aspnet/mod-mono-server.pid \ + --chuid aspnet \ + --exec /usr/bin/mono /usr/lib/mono/${modmonoserverpath} \ + -- $MONO_SERVER_OPTS + + eend $? +} + +stop() { + ebegin "Stopping mod-mono-server" + + start-stop-daemon -o --quiet --stop \ + --pidfile /var/run/aspnet/mod-mono-server.pid + + eend $? +} diff --git a/www-servers/xsp/files/2.2/xsp.confd b/www-servers/xsp/files/2.2/xsp.confd new file mode 100644 index 0000000..45a79a5 --- /dev/null +++ b/www-servers/xsp/files/2.2/xsp.confd @@ -0,0 +1,12 @@ +# Config file for /etc/init.d/xsp +# $Id: xsp.confd,v 1.1 2009/01/18 17:44:04 loki_val Exp $ + +# This is the document root; trailing slash is not necessary +MonoServerRoot=/usr/lib/xsp/test + +# Port for the server to run on +MonoServerPort=8000 + +# If you want to host .NET 2.0 applications you have to set this to 2. +# Otherwise, leave it unchanged +MonoServerVersion=1 diff --git a/www-servers/xsp/files/2.2/xsp.initd b/www-servers/xsp/files/2.2/xsp.initd new file mode 100644 index 0000000..f156531 --- /dev/null +++ b/www-servers/xsp/files/2.2/xsp.initd @@ -0,0 +1,38 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: xsp.initd,v 1.1 2009/01/18 17:44:04 loki_val Exp $ + +depend() { + need net + after dotnet +} + +start() { + ebegin "Starting xsp" + + if [ ${MonoServerVersion} -eq 1 ]; then + xsppath=1.0/xsp.exe + elif [ ${MonoServerVersion} -eq 2 ]; then + xsppath=2.0/xsp2.exe + else + eerror "MonoServerVersion was not properly set. Check your config file" + return 1 + fi + + start-stop-daemon --quiet --start \ + --background \ + --make-pidfile \ + --pidfile /var/run/aspnet/xsp.pid \ + --chuid aspnet \ + --exec /usr/bin/mono /usr/lib/mono/${xsppath} -- --root ${MonoServerRoot} --port ${MonoServerPort} --nonstop + eend $? +} + +stop() { + ebegin "Stopping xsp" + start-stop-daemon -o --quiet --stop \ + --pidfile /var/run/aspnet/xsp.pid + eend $? +} + diff --git a/www-servers/xsp/files/aclocal-fix.patch b/www-servers/xsp/files/aclocal-fix.patch new file mode 100644 index 0000000..49a0005 --- /dev/null +++ b/www-servers/xsp/files/aclocal-fix.patch @@ -0,0 +1,13 @@ +--- Makefile_old.am 2013-07-30 09:11:50.033962122 +0400 ++++ Makefile.am 2013-07-30 09:12:20.843574793 +0400 +@@ -1,10 +1,2 @@ + SUBDIRS=build man src test tools scripts packaging lib + ACLOCAL_AMFLAGS += -I build/m4 +- +-if UNITTESTS +-SUBDIRS += unittests +-endif +- +-if BUILD_DOCS +-SUBDIRS += docs +-endif diff --git a/www-servers/xsp/files/systemd/mono-xsp4.service b/www-servers/xsp/files/systemd/mono-xsp4.service new file mode 100644 index 0000000..3e5f602 --- /dev/null +++ b/www-servers/xsp/files/systemd/mono-xsp4.service @@ -0,0 +1,15 @@ +[Unit] +Description=XSP 4.0 WebServer +Wants=network.target +ConditionFileNotEmpty=/etc/xsp4/mono.webapp +ConditionDirectoryNotEmpty=/etc/xsp4/conf.d + +[Service] +Type=simple +User=aspnet +Group=aspnet +ExecStart=/usr/bin/xsp4 --port 8084 --address 0.0.0.0 --appconfigdir /etc/xsp4 --nonstop +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/www-servers/xsp/files/systemd/mono.webapp b/www-servers/xsp/files/systemd/mono.webapp new file mode 100644 index 0000000..3f611b1 --- /dev/null +++ b/www-servers/xsp/files/systemd/mono.webapp @@ -0,0 +1,10 @@ +<web-application> + <name>Root</name> + <vpath>/</vpath> + <path>/usr/lib64/xsp/test</path> + <!-- vhost and port are ignored in xsp.exe --> + <vhost>my.host.name</vhost> + <vport>8084</vport> + <!-- <enabled> is true by default --> + <!-- <enabled>false</enabled> --> +</web-application> diff --git a/www-servers/xsp/files/systemd/readme.txt b/www-servers/xsp/files/systemd/readme.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/www-servers/xsp/files/systemd/readme.txt @@ -0,0 +1 @@ + diff --git a/www-servers/xsp/files/xsp-2.10.2-endrequest.patch b/www-servers/xsp/files/xsp-2.10.2-endrequest.patch new file mode 100644 index 0000000..ff702d3 --- /dev/null +++ b/www-servers/xsp/files/xsp-2.10.2-endrequest.patch @@ -0,0 +1,35 @@ +From d2c4a279942a4575b80618719646d0767c077e96 Mon Sep 17 00:00:00 2001 +From: Guillaume Pitel <[email protected]> +Date: Tue, 6 Mar 2012 17:20:24 +0100 +Subject: [PATCH] Added try/catch around EndRequest Record sending (Bug 3765 + https://bugzilla.xamarin.com/show_bug.cgi?id=3765) + +--- + src/Mono.WebServer.FastCgi/Connection.cs | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/Mono.WebServer.FastCgi/Connection.cs b/src/Mono.WebServer.FastCgi/Connection.cs +index 6c70824..0e9ef64 100644 +--- a/src/Mono.WebServer.FastCgi/Connection.cs ++++ b/src/Mono.WebServer.FastCgi/Connection.cs +@@ -319,10 +319,13 @@ public void Run () + { + EndRequestBody body = new EndRequestBody (appStatus, + protocolStatus); +- +- if (IsConnected) +- new Record (1, RecordType.EndRequest, requestID, +- body.GetData ()).Send (socket); ++ try { ++ if (IsConnected) ++ new Record (1, RecordType.EndRequest, requestID, ++ body.GetData ()).Send (socket); ++ } catch (System.Net.Sockets.SocketException) { ++ } ++ + + int index = GetRequestIndex (requestID); + +-- +1.7.10 + diff --git a/www-servers/xsp/metadata.xml b/www-servers/xsp/metadata.xml new file mode 100644 index 0000000..4a25235 --- /dev/null +++ b/www-servers/xsp/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>dotnet</herd> + <longdescription lang="en"> + XSP is a standalone web server written in C# that can be used to run + your ASP.NET applications. + </longdescription> + <use> + <flag name='developer'>creates .mdb files for either Release and Debug</flag> + </use> +</pkgmetadata> diff --git a/www-servers/xsp/xsp-2014.12-r2014120900.ebuild b/www-servers/xsp/xsp-2014.12-r2014120900.ebuild new file mode 100644 index 0000000..3440803 --- /dev/null +++ b/www-servers/xsp/xsp-2014.12-r2014120900.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +USE_DOTNET="net35 net40 net45" +PATCHDIR="${FILESDIR}/2.2/" + +inherit base eutils systemd dotnet user autotools autotools-utils + +DESCRIPTION="XSP is a small web server that can host ASP.NET pages" +HOMEPAGE="http://www.mono-project.com/ASP.NET" + +EGIT_COMMIT="e272a2c006211b6b03be2ef5bbb9e3f8fefd0768" +SRC_URI="http://github.com/mono/xsp/archive/${EGIT_COMMIT}.zip -> ${P}.zip" +S="${WORKDIR}/xsp-${EGIT_COMMIT}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="doc test developer" + +RDEPEND="dev-db/sqlite:3" +DEPEND="${RDEPEND}" + +src_prepare() { + epatch "${FILESDIR}/aclocal-fix.patch" + + if [ -z "$LIBTOOL" ]; then + LIBTOOL=`which glibtool 2>/dev/null` + if [ ! -x "$LIBTOOL" ]; then + LIBTOOL=`which libtool` + fi + fi + eaclocal -I build/m4/shamrock -I build/m4/shave $ACLOCAL_FLAGS + if test -z "$NO_LIBTOOLIZE"; then + ${LIBTOOL}ize --force --copy + fi + eautoconf +} + +src_configure() { + myeconfargs=("--enable-maintainer-mode") + use test && myeconfargs+=("--with_unit_tests") + use doc || myeconfargs+=("--disable-docs") + eautomake --gnu --add-missing --force --copy #nowarn + autotools-utils_src_configure + ./configure || die +} + +METAFILETOBUILD=xsp.sln + +src_compile() { + exbuild xsp.sln + if use developer; then + exbuild /p:DebugSymbols=True ${METAFILETOBUILD} + else + exbuild /p:DebugSymbols=False ${METAFILETOBUILD} + fi +} + +pkg_preinst() { + enewgroup aspnet + enewuser aspnet -1 -1 /tmp aspnet + + # enewuser www-data + # www-data - is from debian, i think it's the same as aspnet here +} + +src_install() { + mv_command="cp -ar" autotools-utils_src_install + newinitd "${PATCHDIR}"/xsp.initd xsp + newinitd "${PATCHDIR}"/mod-mono-server-r1.initd mod-mono-server + newconfd "${PATCHDIR}"/xsp.confd xsp + newconfd "${PATCHDIR}"/mod-mono-server.confd mod-mono-server + + insinto /etc/xsp4 + doins "${FILESDIR}"/systemd/mono.webapp + insinto /etc/xsp4/conf.d + doins "${FILESDIR}"/systemd/readme.txt + # mono-xsp4.service was original name from + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770458;filename=mono-xsp4.service;att=1;msg=5 + # I think that using the same commands as in debian + # systemctl start mono-xsp4.service + # systemctl start mono-xsp4 + # is better than to have shorter command + # systemctl start xsp + # + # insinto /usr/lib/systemd/system + systemd_dounit "${FILESDIR}"/systemd/mono-xsp4.service + + keepdir /var/run/aspnet +} diff --git a/www-servers/xsp/xsp-9999.ebuild b/www-servers/xsp/xsp-9999.ebuild new file mode 100644 index 0000000..5c22e64 --- /dev/null +++ b/www-servers/xsp/xsp-9999.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +USE_DOTNET="net35 net40 net45" +PATCHDIR="${FILESDIR}/2.2/" + +inherit base eutils dotnet user git-2 autotools autotools-utils + +DESCRIPTION="XSP is a small web server that can host ASP.NET pages" +HOMEPAGE="http://www.mono-project.com/ASP.NET" + +EGIT_REPO_URI="git://github.com/mono/${PN}.git" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="" +IUSE="doc test" + +RDEPEND="dev-db/sqlite:3" +DEPEND="${RDEPEND}" + +src_prepare() { + epatch "${FILESDIR}/aclocal-fix.patch" + + if [ -z "$LIBTOOL" ]; then + LIBTOOL=`which glibtool 2>/dev/null` + if [ ! -x "$LIBTOOL" ]; then + LIBTOOL=`which libtool` + fi + fi + eaclocal -I build/m4/shamrock -I build/m4/shave $ACLOCAL_FLAGS + if test -z "$NO_LIBTOOLIZE"; then + ${LIBTOOL}ize --force --copy + fi + eautoconf +} + +src_configure() { + myeconfargs=("--enable-maintainer-mode") + use test && myeconfargs+=("--with_unit_tests") + use doc || myeconfargs+=("--disable-docs") + eautomake --gnu --add-missing --force --copy #nowarn + autotools-utils_src_configure +} + +src_compile() { + autotools-utils_src_compile +} + +pkg_preinst() { + enewgroup aspnet + enewuser aspnet -1 -1 /tmp aspnet +} + +src_install() { + mv_command="cp -ar" autotools-utils_src_install + newinitd "${PATCHDIR}"/xsp.initd xsp + newinitd "${PATCHDIR}"/mod-mono-server-r1.initd mod-mono-server + newconfd "${PATCHDIR}"/xsp.confd xsp + newconfd "${PATCHDIR}"/mod-mono-server.confd mod-mono-server + + keepdir /var/run/aspnet +}
