summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2005-07-17 12:40:59 +0000
committerAlin Năstac <mrness@gentoo.org>2005-07-17 12:40:59 +0000
commit50524400777c6a137cef3e79981be07316e12180 (patch)
tree875da86e2f6e4956abefd50c54142bd882253792 /net-dialup/linesrv/linesrv-2.1.21-r1.ebuild
parent* bump! (diff)
downloadgentoo-2-50524400777c6a137cef3e79981be07316e12180.tar.gz
gentoo-2-50524400777c6a137cef3e79981be07316e12180.tar.bz2
gentoo-2-50524400777c6a137cef3e79981be07316e12180.zip
remove old; sanitize config file path; install CGI scripts as a web application (#54620)
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'net-dialup/linesrv/linesrv-2.1.21-r1.ebuild')
-rw-r--r--net-dialup/linesrv/linesrv-2.1.21-r1.ebuild107
1 files changed, 107 insertions, 0 deletions
diff --git a/net-dialup/linesrv/linesrv-2.1.21-r1.ebuild b/net-dialup/linesrv/linesrv-2.1.21-r1.ebuild
new file mode 100644
index 000000000000..8a41f22e9dfc
--- /dev/null
+++ b/net-dialup/linesrv/linesrv-2.1.21-r1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/linesrv/linesrv-2.1.21-r1.ebuild,v 1.1 2005/07/17 12:40:59 mrness Exp $
+
+inherit webapp flag-o-matic
+
+DESCRIPTION="Client/Server system to control the Internet link of a masquerading server"
+HOMEPAGE="http://linecontrol.srf.ch/"
+SRC_URI="http://linecontrol.srf.ch/down/${P}.src.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~sparc ~x86"
+# if someone disables pam but wants user authentication
+# to be supported, then crypt is needed.
+IUSE="pam mysql crypt"
+
+# requesting glibc instead of virtual/libc
+# because we might need crypt. And as far as I
+# (S. Fuchs, author of linesrv) remember, there's
+# glibc specific stuff in linesrv.
+DEPEND=">=sys-libs/glibc-2.2.0
+ pam? ( >=sys-libs/pam-0.75 )
+ mysql? ( >=dev-db/mysql-4 )"
+
+S=${WORKDIR}/${PN}-2.1
+
+WEBAPP_MANUAL_SLOT=yes
+
+src_unpack() {
+ unpack ${A}
+
+ sed -i -e 's:/etc/linesrv.conf:/etc/linesrv/linesrv.conf:' \
+ ${S}/server/cfg.h \
+ ${S}/lclog/lclog.c \
+ ${S}/htmlstatus/htmlstatus.c
+}
+
+src_compile() {
+ append-ldflags -Wl,-z,now #don't use lazy bindings
+
+ local myconf=""
+ # sfuchs: configure script of linesrv 2 is quite bad...
+ # prefer pam, if disabled try crypt
+ # the configure script will disable authentication if
+ # neither pam nor crypt is available.
+ if ! use pam ; then
+ myconf="${myconf} --disable-pamauth"
+ if use crypt; then
+ myconf="${myconf} --enable-cryptauth"
+ fi
+ fi
+ # --enable-mysql is not supported... stupid, I know.
+ use mysql || myconf="${myconf} --disable-mysql"
+ econf ${myconf} || die "bad configure"
+ emake || die "build failed"
+}
+
+src_install() {
+ webapp_src_preinst
+ dodir /usr/share/linesrv /var/log/linesrv
+
+ dosbin server/linesrv
+
+ mknod ${D}/usr/share/linesrv/logpipe p
+ exeinto /usr/share/linesrv ; doexe server/config/complete_syntax/halt-wrapper
+
+ doman debian/*.{5,8}
+
+ dodoc server/{INSTALL,NEWS,README}
+ newdoc htmlstatus/README README.htmlstatus
+ newdoc lclog/INSTALL INSTALL.lclog
+ newdoc ${FILESDIR}/linesrv.conf linesrv.conf.sample
+ docinto complete_syntax ; dodoc server/config/complete_syntax/*
+
+ insinto /etc/linesrv ; newins ${FILESDIR}/linesrv.conf linesrv.conf
+ newinitd ${FILESDIR}/linesrv.rc6 linesrv
+ if use pam ; then
+ insinto /etc/pam.d
+ newins ${FILESDIR}/linecontrol.pam linecontrol
+ newins ${FILESDIR}/lcshutdown.pam lcshutdown
+ fi
+
+ exeinto ${MY_CGIBINDIR} ; doexe lclog/lclog htmlstatus/htmlstatus
+ insinto ${MY_HTDOCSDIR}/lclog ; doins lclog/html/*
+ webapp_src_install
+
+ #TODO: change FILESDIR files and remove this lines
+ #when versions older than 2.1.21-r1 are removed
+ use pam && \
+ sed -i -e 's:/etc/linesrv[.]:/etc/linesrv/linesrv.:' ${D}/etc/pam.d/*
+ sed -i -e 's:/etc/linesrv.conf:/etc/linesrv/linesrv.conf:' ${D}/etc/init.d/${PN}
+}
+
+pkg_preinst() {
+ webapp_pkg_preinst
+ if [ -f "${ROOT}/etc/linesrv.conf" ]; then
+ [ -d "${ROOT}/etc/linesrv" ] || mkdir "${ROOT}/etc/linesrv"
+ mv "${ROOT}/etc/linesrv.conf" "${ROOT}/etc/linesrv/linesrv.conf"
+ fi
+}
+
+pkg_postinst() {
+ einfo "The first stage of the installation is done. Now you need to setup your virtual hosts via webapp-config"
+ einfo "Please read man webapp-config for a detailed description of the process and some examples"
+ webapp_pkg_postinst
+}