summaryrefslogtreecommitdiff
blob: a803dddf5dcd436bafe0d659482b0f6974e7a5ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

USE_DOTNET="net35 net40 net45"
PATCHDIR="${FILESDIR}/2.2/"

inherit autotools dotnet systemd user

EGIT_COMMIT="e272a2c006211b6b03be2ef5bbb9e3f8fefd0768"
DESCRIPTION="XSP is a small web server that can host ASP.NET pages"
HOMEPAGE="http://www.mono-project.com/ASP.NET"
SRC_URI="https://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"
RESTRICT="!test? ( test )"

RDEPEND="dev-db/sqlite:3"
DEPEND="${RDEPEND}"

METAFILETOBUILD=xsp.sln

PATCHES=(
	"${FILESDIR}/aclocal-fix.patch"
)

src_prepare() {
	default

	eaclocal -I build/m4/shamrock -I build/m4/shave ${ACLOCAL_FLAGS}
	if test -z "${NO_LIBTOOLIZE}" ; then
		_elibtoolize --force --copy
	fi

	eautoconf
    eautomake --gnu --add-missing --force --copy
}

src_configure() {
	local myeconfargs=(
		"--enable-maintainer-mode"
	)

	use test && myeconfargs+=( "--with_unit_tests" )
	use doc || myeconfargs+=( "--disable-docs" )

	econf "${myeconfargs[@]}"
}

#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() {
	default

	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

	# 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
}