aboutsummaryrefslogtreecommitdiff
path: root/net/ris
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-09-11 12:19:21 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-09-11 12:19:21 +0000
commitc533675418136697b11fb91e2a608ab68ecb0769 (patch)
tree0ec5455f08d140854c3acffbf0998decd79d0e8c /net/ris
parent7ddb8c6f86ec8e68fbdf64afd421075a580a76b8 (diff)
downloadports-c533675418136697b11fb91e2a608ab68ecb0769.tar.gz
ports-c533675418136697b11fb91e2a608ab68ecb0769.zip
Notes
Diffstat (limited to 'net/ris')
-rw-r--r--net/ris/Makefile51
-rw-r--r--net/ris/distinfo2
-rw-r--r--net/ris/files/binlsrv.sh.in41
-rw-r--r--net/ris/files/patch-binlsrv.py39
-rw-r--r--net/ris/files/patch-infparser.py37
-rw-r--r--net/ris/pkg-descr4
6 files changed, 174 insertions, 0 deletions
diff --git a/net/ris/Makefile b/net/ris/Makefile
new file mode 100644
index 000000000000..eedb3b0c5a7e
--- /dev/null
+++ b/net/ris/Makefile
@@ -0,0 +1,51 @@
+# New ports collection makefile for: ris
+# Date created: 3 September 2005
+# Whom: Alex Deiter <tiamat@komi.mts.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= ris
+PORTVERSION= 0.1
+CATEGORIES= net
+MASTER_SITES= http://oss.netfarm.it/guides/ \
+ http://freebsd.komi.mtsnet.ru/ports/distfiles/
+DISTNAME= ris-linux
+
+MAINTAINER= tiamat@komi.mts.ru
+COMMENT= OpenSource alternative to Microsoft Windows RIS
+
+RUN_DEPENDS= ${LOCALBASE}/libexec/in.tftpd:${PORTSDIR}/ftp/tftp-hpa
+
+USE_RC_SUBR= binlsrv.sh
+USE_REINPLACE= yes
+USE_PYTHON= yes
+NO_BUILD= yes
+
+VARDIR= ${DESTDIR}/var
+PID_FILE?= ${VARDIR}/run/binlsrv.pid
+DEVLIST_CACHE?= ${VARDIR}/db/devlist.cache
+
+PLIST_FILES= sbin/binlsrv.py sbin/decode.py \
+ sbin/fixloader.py sbin/infparser.py \
+ sbin/fixup-repository.sh
+
+SUB_LIST= PYTHON_CMD=${PYTHON_CMD} \
+ PID_FILE=${PID_FILE} \
+ DEVLIST_CACHE=${DEVLIST_CACHE}
+
+post-patch:
+.for SCRIPT in ${PLIST_FILES}
+ @${REINPLACE_CMD} -e \
+ 's|@PYTHON_CMD@|${PYTHON_CMD}|; \
+ s|@PID_FILE@|${PID_FILE}|; \
+ s|@DEVLIST_CACHE@|${DEVLIST_CACHE}|' \
+ ${WRKSRC}/${SCRIPT:S/sbin\///}
+.endfor
+
+do-install:
+.for SCRIPT in ${PLIST_FILES}
+ ${INSTALL_SCRIPT} ${WRKSRC}/${SCRIPT:S/sbin\///} ${PREFIX}/sbin
+.endfor
+
+.include <bsd.port.mk>
diff --git a/net/ris/distinfo b/net/ris/distinfo
new file mode 100644
index 000000000000..2a0cb9c1176c
--- /dev/null
+++ b/net/ris/distinfo
@@ -0,0 +1,2 @@
+MD5 (ris-linux.tar.gz) = 23b8e9c73d3a37e2e9b90bb8433e7ace
+SIZE (ris-linux.tar.gz) = 10805
diff --git a/net/ris/files/binlsrv.sh.in b/net/ris/files/binlsrv.sh.in
new file mode 100644
index 000000000000..bba45b8750c0
--- /dev/null
+++ b/net/ris/files/binlsrv.sh.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# PROVIDE: binlsrv
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+# Define these variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/binlsrv
+#
+# binlsrv_enable="YES"
+# binlsrv_infdir="/path/to/dir_with_inf_files"
+
+. /etc/rc.subr
+
+name="binlsrv"
+rcvar=`set_rcvar`
+command="%%PYTHON_CMD%%"
+command_args="%%PREFIX%%/sbin/${name}.py -d"
+required_dirs="${binlsrv_infdir}"
+pidfile="%%PID_FILE%%"
+start_precmd="binlsrv_start_precmd"
+stop_postcmd="binlsrv_stop_postcmd"
+
+binlsrv_start_precmd()
+{
+ %%PREFIX%%/sbin/infparser.py ${binlsrv_infdir}
+}
+
+binlsrv_stop_postcmd()
+{
+ rm -f ${pidfile}
+}
+
+load_rc_config "$name"
+: ${binlsrv_enable="NO"}
+: ${binlsrv_infdir=""}
+
+run_rc_command "$1"
diff --git a/net/ris/files/patch-binlsrv.py b/net/ris/files/patch-binlsrv.py
new file mode 100644
index 000000000000..1809045ff6a8
--- /dev/null
+++ b/net/ris/files/patch-binlsrv.py
@@ -0,0 +1,39 @@
+--- binlsrv.py.orig Fri Sep 2 14:15:31 2005
++++ binlsrv.py Fri Sep 2 14:21:11 2005
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#! @PYTHON_CMD@
+ # -*- Mode: Python; tab-width: 4 -*-
+ #
+ # Boot Information Negotiation Layer - OpenSource Implementation
+@@ -671,7 +671,12 @@
+
+ import sys
+
+- if (fork()): sys_exit()
++ pid=fork()
++ if (pid):
++ pidfile=open('@PID_FILE@', 'w')
++ pidfile.write('%d\n' % pid)
++ pidfile.close()
++ sys_exit()
+
+ close(sys.stdin.fileno())
+ sys.stdin = open('/dev/null')
+@@ -683,7 +688,7 @@
+ sys.stderr = Log(open(LOGFILE, 'a+'))
+
+ try:
+- devlist = load(open('devlist.cache'))
++ devlist = load(open('@DEVLIST_CACHE@'))
+ except:
+ print 'Could not load devlist.cache, build it with infparser.py'
+ sys_exit(-1)
+@@ -694,7 +699,6 @@
+ s = socket(AF_INET, SOCK_DGRAM)
+ s.bind(('', 4011))
+
+- print 'Binlserver started... pid %d' % getpid()
+ while 1:
+ addr, t, data = get_packet(s)
+ if t == FILEREQ:
diff --git a/net/ris/files/patch-infparser.py b/net/ris/files/patch-infparser.py
new file mode 100644
index 000000000000..b1fe739dcaea
--- /dev/null
+++ b/net/ris/files/patch-infparser.py
@@ -0,0 +1,37 @@
+--- infparser.py.orig Fri Sep 2 14:15:32 2005
++++ infparser.py Fri Sep 2 14:18:12 2005
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#! @PYTHON_CMD@
+ # -*- Mode: Python; tab-width: 4 -*-
+ #
+ # Inf Driver parser
+@@ -143,7 +143,7 @@
+ if name.endswith('.services'):
+ prefix = name.split('.services', 1)[0]
+ check = prefix.split('.')
+- if check[-1].startswith('nt'):
++ if check[-1].startswith('nt') and not check[-1].endswith('64'):
+ check = check[:-1]
+ check = check + ['services']
+ name = '.'.join(check)
+@@ -154,7 +154,7 @@
+ while check[-1].isdigit() and len(check)>1:
+ check = check[:-1]
+
+- if check[-1].startswith('nt'):
++ if check[-1].startswith('nt') and not check[-1].endswith('64'):
+ check = check[:-1]
+
+ name = '.'.join(check)
+@@ -283,8 +283,8 @@
+ if inffile.split('/').pop() not in exclude:
+ devlist.update(scan_inf(inffile))
+
+- print 'Compiled %d drivers' % len(devlist)
++ print 'Starting inf parser: compiled %d drivers.' % len(devlist)
+
+- fd = open('devlist.cache','w')
++ fd = open('@DEVLIST_CACHE@','w')
+ dump(devlist, fd)
+ fd.close()
diff --git a/net/ris/pkg-descr b/net/ris/pkg-descr
new file mode 100644
index 000000000000..83d637ced212
--- /dev/null
+++ b/net/ris/pkg-descr
@@ -0,0 +1,4 @@
+OpenSource alternative to Microsoft Windows RIS (Remote Installation Services).
+You can also use this stuff to install Microsoft Windows from the network.
+
+WWW: http://oss.netfarm.it/guides/