Bug 85630 - New port: net/ris (OpenSource alternative to Microsoft Windows RIS)
Summary: New port: net/ris (OpenSource alternative to Microsoft Windows RIS)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pav Lucistnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-02 12:00 UTC by Alex Deiter
Modified: 2005-09-11 13:20 UTC (History)
0 users

See Also:


Attachments
file.shar (5.57 KB, text/plain)
2005-09-02 12:00 UTC, Alex Deiter
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Deiter 2005-09-02 12:00:32 UTC
New port: ris

OpenSource alternative to Microsoft Windows RIS.
You can also use this stuff to install Microsoft Windows from the network.

WWW: http://oss.netfarm.it/guides/
Comment 1 Alex Deiter 2005-09-03 21:54:34 UTC
make portlint happy:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       ris
#       ris/pkg-descr
#       ris/Makefile
#       ris/files
#       ris/files/binlsrv.sh.in
#       ris/files/patch-infparser.py
#       ris/files/patch-binlsrv.py
#       ris/distinfo
#
echo c - ris
mkdir -p ris > /dev/null 2>&1
echo x - ris/pkg-descr
sed 's/^X//' >ris/pkg-descr << 'END-of-ris/pkg-descr'
XOpenSource alternative to Microsoft Windows RIS.
XYou can also use this stuff to install Microsoft Windows from the network.
X
XWWW: http://oss.netfarm.it/guides/
END-of-ris/pkg-descr
echo x - ris/Makefile
sed 's/^X//' >ris/Makefile << 'END-of-ris/Makefile'
X# New ports collection makefile for:   ris
X# Date created:                3 September 2005
X# Whom:                        Alex Deiter <tiamat@komi.mts.ru>
X#
X# $FreeBSD: ports/net/ris/Makefile,v 1.5 2005/09/03 18:42:17 tiamat Exp $
X#
X
XPORTNAME=      ris
XPORTVERSION=   0.1
XCATEGORIES=    net
XMASTER_SITES=  http://oss.netfarm.it/guides/ \
X               http://freebsd.komi.mtsnet.ru/ports/distfiles/
XDISTNAME=      ris-linux
X
XMAINTAINER=    tiamat@komi.mts.ru
XCOMMENT=       OpenSource alternative to Microsoft Windows RIS
X
XRUN_DEPENDS=   ${LOCALBASE}/libexec/in.tftpd:${PORTSDIR}/ftp/tftp-hpa
X
XUSE_RC_SUBR=   binlsrv.sh
XUSE_REINPLACE= yes
XUSE_PYTHON=    yes
XNO_BUILD=      yes
X
XVARDIR=                ${DESTDIR}/var
XPID_FILE?=     ${VARDIR}/run/binlsrv.pid
XDEVLIST_CACHE?=        ${VARDIR}/db/devlist.cache
X
XPLIST_FILES=   sbin/binlsrv.py sbin/decode.py \
X               sbin/fixloader.py sbin/infparser.py \
X               sbin/fixup-repository.sh
X
XSUB_LIST=      PYTHON_CMD=${PYTHON_CMD} \
X               PID_FILE=${PID_FILE} \
X               DEVLIST_CACHE=${DEVLIST_CACHE}
X
Xpost-patch:
X.for SCRIPT in ${PLIST_FILES}
X       @${REINPLACE_CMD} -e \
X               's|@PYTHON_CMD@|${PYTHON_CMD}|; \
X               s|@PID_FILE@|${PID_FILE}|; \
X               s|@DEVLIST_CACHE@|${DEVLIST_CACHE}|' \
X               ${WRKSRC}/${SCRIPT:S/sbin\///}
X.endfor
X
Xdo-install:
X.for SCRIPT in ${PLIST_FILES}
X       @${INSTALL_SCRIPT} ${WRKSRC}/${SCRIPT:S/sbin\///} ${PREFIX}/sbin
X.endfor
X
X.include <bsd.port.mk>
END-of-ris/Makefile
echo c - ris/files
mkdir -p ris/files > /dev/null 2>&1
echo x - ris/files/binlsrv.sh.in
sed 's/^X//' >ris/files/binlsrv.sh.in << 'END-of-ris/files/binlsrv.sh.in'
X#!/bin/sh
X
X# PROVIDE: binlsrv
X# REQUIRE: DAEMON
X# BEFORE: LOGIN
X# KEYWORD: FreeBSD shutdown
X
X# Define these variables in one of these files:
X#      /etc/rc.conf
X#      /etc/rc.conf.local
X#      /etc/rc.conf.d/binlsrv
X#
X# binlsrv_enable="YES"
X# binlsrv_infdir="/path/to/dir_with_inf_files"
X
X. /etc/rc.subr
X
Xname="binlsrv"
Xrcvar=`set_rcvar`
Xcommand="%%PYTHON_CMD%%"
Xcommand_args="%%PREFIX%%/sbin/${name}.py -d"
Xrequired_dirs="${binlsrv_infdir}"
Xpidfile="%%PID_FILE%%"
Xstart_precmd="binlsrv_start_precmd"
Xstop_postcmd="binlsrv_stop_postcmd"
X
Xbinlsrv_start_precmd()
X{
X       %%PREFIX%%/sbin/infparser.py ${binlsrv_infdir}
X}
X
Xbinlsrv_stop_postcmd()
X{
X       rm -f ${pidfile}
X}
X
Xload_rc_config "$name"
X: ${binlsrv_enable="NO"}
X: ${binlsrv_infdir=""}
X
Xrun_rc_command "$1"
END-of-ris/files/binlsrv.sh.in
echo x - ris/files/patch-infparser.py
sed 's/^X//' >ris/files/patch-infparser.py <<
'END-of-ris/files/patch-infparser.py'
X--- infparser.py.orig  Fri Sep  2 14:15:32 2005
X+++ infparser.py       Fri Sep  2 14:18:12 2005
X@@ -1,4 +1,4 @@
X-#!/usr/bin/env python
X+#! @PYTHON_CMD@
X # -*- Mode: Python; tab-width: 4 -*-
X #
X # Inf Driver parser
X@@ -143,7 +143,7 @@
X     if name.endswith('.services'):
X         prefix = name.split('.services', 1)[0]
X         check = prefix.split('.')
X-        if check[-1].startswith('nt'):
X+        if check[-1].startswith('nt') and not check[-1].endswith('64'):
X             check = check[:-1]
X         check = check + ['services']
X         name = '.'.join(check)
X@@ -154,7 +154,7 @@
X     while check[-1].isdigit() and len(check)>1:
X         check = check[:-1]
X
X-    if check[-1].startswith('nt'):
X+    if check[-1].startswith('nt') and not check[-1].endswith('64'):
X         check = check[:-1]
X
X     name = '.'.join(check)
X@@ -283,8 +283,8 @@
X         if inffile.split('/').pop() not in exclude:
X             devlist.update(scan_inf(inffile))
X
X-    print 'Compiled %d drivers' % len(devlist)
X+    print 'Starting inf parser: compiled %d drivers.' % len(devlist)
X
X-    fd = open('devlist.cache','w')
X+    fd = open('@DEVLIST_CACHE@','w')
X     dump(devlist, fd)
X     fd.close()
END-of-ris/files/patch-infparser.py
echo x - ris/files/patch-binlsrv.py
sed 's/^X//' >ris/files/patch-binlsrv.py <<
'END-of-ris/files/patch-binlsrv.py'
X--- binlsrv.py.orig    Fri Sep  2 14:15:31 2005
X+++ binlsrv.py Fri Sep  2 14:21:11 2005
X@@ -1,4 +1,4 @@
X-#!/usr/bin/env python
X+#! @PYTHON_CMD@
X # -*- Mode: Python; tab-width: 4 -*-
X #
X # Boot Information Negotiation Layer - OpenSource Implementation
X@@ -671,7 +671,12 @@
X
X         import sys
X
X-        if (fork()): sys_exit()
X+        pid=fork()
X+        if (pid):
X+           pidfile=open('@PID_FILE@', 'w')
X+           pidfile.write('%d\n' % pid)
X+           pidfile.close()
X+           sys_exit()
X
X         close(sys.stdin.fileno())
X         sys.stdin  = open('/dev/null')
X@@ -683,7 +688,7 @@
X         sys.stderr = Log(open(LOGFILE, 'a+'))
X
X     try:
X-        devlist = load(open('devlist.cache'))
X+        devlist = load(open('@DEVLIST_CACHE@'))
X     except:
X         print 'Could not load devlist.cache, build it with infparser.py'
X         sys_exit(-1)
X@@ -694,7 +699,6 @@
X     s = socket(AF_INET, SOCK_DGRAM)
X     s.bind(('', 4011))
X
X-    print 'Binlserver started... pid %d' % getpid()
X     while 1:
X         addr, t, data = get_packet(s)
X         if t == FILEREQ:
END-of-ris/files/patch-binlsrv.py
echo x - ris/distinfo
sed 's/^X//' >ris/distinfo << 'END-of-ris/distinfo'
XMD5 (ris-linux.tar.gz) = 23b8e9c73d3a37e2e9b90bb8433e7ace
XSIZE (ris-linux.tar.gz) = 10805
END-of-ris/distinfo
exit

Thanks!

-- 
Alex Deiter
Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2005-09-10 23:51:15 UTC
State Changed
From-To: open->feedback

Your mailer have reformatted the shar (spaces, line wraps), the copy which 
arrived is unusable. Please fix your mailer and resend. 


Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2005-09-10 23:51:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

Poke
Comment 4 Alex Deiter 2005-09-11 10:42:33 UTC
I am sorry. Here correct shar acrhive.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	ris
#	ris/pkg-descr
#	ris/Makefile
#	ris/files
#	ris/files/binlsrv.sh.in
#	ris/files/patch-infparser.py
#	ris/files/patch-binlsrv.py
#	ris/distinfo
#
echo c - ris
mkdir -p ris > /dev/null 2>&1
echo x - ris/pkg-descr
sed 's/^X//' >ris/pkg-descr << 'END-of-ris/pkg-descr'
XOpenSource alternative to Microsoft Windows RIS.
XYou can also use this stuff to install Microsoft Windows from the network.
X
XWWW: http://oss.netfarm.it/guides/
END-of-ris/pkg-descr
echo x - ris/Makefile
sed 's/^X//' >ris/Makefile << 'END-of-ris/Makefile'
X# New ports collection makefile for:	ris
X# Date created:		3 September 2005
X# Whom:			Alex Deiter <tiamat@komi.mts.ru>
X#
X# $FreeBSD: ports/net/ris/Makefile,v 1.5 2005/09/03 18:42:17 tiamat Exp $
X#
X
XPORTNAME=	ris
XPORTVERSION=	0.1
XCATEGORIES=	net
XMASTER_SITES=	http://oss.netfarm.it/guides/ \
X		http://freebsd.komi.mtsnet.ru/ports/distfiles/
XDISTNAME=	ris-linux
X
XMAINTAINER=	tiamat@komi.mts.ru
XCOMMENT=	OpenSource alternative to Microsoft Windows RIS
X
XRUN_DEPENDS=	${LOCALBASE}/libexec/in.tftpd:${PORTSDIR}/ftp/tftp-hpa
X
XUSE_RC_SUBR=	binlsrv.sh
XUSE_REINPLACE=	yes
XUSE_PYTHON=	yes
XNO_BUILD=	yes
X
XVARDIR=		${DESTDIR}/var
XPID_FILE?=	${VARDIR}/run/binlsrv.pid
XDEVLIST_CACHE?=	${VARDIR}/db/devlist.cache
X
XPLIST_FILES=	sbin/binlsrv.py sbin/decode.py \
X		sbin/fixloader.py sbin/infparser.py \
X		sbin/fixup-repository.sh
X
XSUB_LIST=	PYTHON_CMD=${PYTHON_CMD} \
X		PID_FILE=${PID_FILE} \
X		DEVLIST_CACHE=${DEVLIST_CACHE}
X
Xpost-patch:
X.for SCRIPT in ${PLIST_FILES}
X	@${REINPLACE_CMD} -e \
X		's|@PYTHON_CMD@|${PYTHON_CMD}|; \
X		s|@PID_FILE@|${PID_FILE}|; \
X		s|@DEVLIST_CACHE@|${DEVLIST_CACHE}|' \
X		${WRKSRC}/${SCRIPT:S/sbin\///}
X.endfor
X
Xdo-install:
X.for SCRIPT in ${PLIST_FILES}
X	@${INSTALL_SCRIPT} ${WRKSRC}/${SCRIPT:S/sbin\///} ${PREFIX}/sbin
X.endfor
X
X.include <bsd.port.mk>
END-of-ris/Makefile
echo c - ris/files
mkdir -p ris/files > /dev/null 2>&1
echo x - ris/files/binlsrv.sh.in
sed 's/^X//' >ris/files/binlsrv.sh.in << 'END-of-ris/files/binlsrv.sh.in'
X#!/bin/sh
X
X# PROVIDE: binlsrv
X# REQUIRE: DAEMON
X# BEFORE: LOGIN
X# KEYWORD: FreeBSD shutdown
X
X# Define these variables in one of these files:
X#	/etc/rc.conf
X#	/etc/rc.conf.local
X#	/etc/rc.conf.d/binlsrv
X#
X# binlsrv_enable="YES"
X# binlsrv_infdir="/path/to/dir_with_inf_files"
X
X. /etc/rc.subr
X
Xname="binlsrv"
Xrcvar=`set_rcvar`
Xcommand="%%PYTHON_CMD%%"
Xcommand_args="%%PREFIX%%/sbin/${name}.py -d"
Xrequired_dirs="${binlsrv_infdir}"
Xpidfile="%%PID_FILE%%"
Xstart_precmd="binlsrv_start_precmd"
Xstop_postcmd="binlsrv_stop_postcmd"
X
Xbinlsrv_start_precmd()
X{
X	%%PREFIX%%/sbin/infparser.py ${binlsrv_infdir}
X}
X
Xbinlsrv_stop_postcmd()
X{
X	rm -f ${pidfile}
X}
X
Xload_rc_config "$name"
X: ${binlsrv_enable="NO"}
X: ${binlsrv_infdir=""}
X
Xrun_rc_command "$1"
END-of-ris/files/binlsrv.sh.in
echo x - ris/files/patch-infparser.py
sed 's/^X//' >ris/files/patch-infparser.py << 'END-of-ris/files/patch-infparser.py'
X--- infparser.py.orig	Fri Sep  2 14:15:32 2005
X+++ infparser.py	Fri Sep  2 14:18:12 2005
X@@ -1,4 +1,4 @@
X-#!/usr/bin/env python
X+#! @PYTHON_CMD@
X # -*- Mode: Python; tab-width: 4 -*-
X #
X # Inf Driver parser
X@@ -143,7 +143,7 @@
X     if name.endswith('.services'):
X         prefix = name.split('.services', 1)[0]
X         check = prefix.split('.')
X-        if check[-1].startswith('nt'):
X+        if check[-1].startswith('nt') and not check[-1].endswith('64'):
X             check = check[:-1]
X         check = check + ['services']
X         name = '.'.join(check)
X@@ -154,7 +154,7 @@
X     while check[-1].isdigit() and len(check)>1:
X         check = check[:-1]
X     
X-    if check[-1].startswith('nt'):
X+    if check[-1].startswith('nt') and not check[-1].endswith('64'):
X         check = check[:-1]
X 
X     name = '.'.join(check)
X@@ -283,8 +283,8 @@
X         if inffile.split('/').pop() not in exclude:
X             devlist.update(scan_inf(inffile))
X     
X-    print 'Compiled %d drivers' % len(devlist)
X+    print 'Starting inf parser: compiled %d drivers.' % len(devlist)
X 
X-    fd = open('devlist.cache','w')
X+    fd = open('@DEVLIST_CACHE@','w')
X     dump(devlist, fd)
X     fd.close()
END-of-ris/files/patch-infparser.py
echo x - ris/files/patch-binlsrv.py
sed 's/^X//' >ris/files/patch-binlsrv.py << 'END-of-ris/files/patch-binlsrv.py'
X--- binlsrv.py.orig	Fri Sep  2 14:15:31 2005
X+++ binlsrv.py	Fri Sep  2 14:21:11 2005
X@@ -1,4 +1,4 @@
X-#!/usr/bin/env python
X+#! @PYTHON_CMD@
X # -*- Mode: Python; tab-width: 4 -*-
X #
X # Boot Information Negotiation Layer - OpenSource Implementation
X@@ -671,7 +671,12 @@
X 
X         import sys
X 
X-        if (fork()): sys_exit()
X+        pid=fork()
X+        if (pid):
X+           pidfile=open('@PID_FILE@', 'w')
X+           pidfile.write('%d\n' % pid)
X+           pidfile.close()
X+           sys_exit()
X         
X         close(sys.stdin.fileno())
X         sys.stdin  = open('/dev/null')
X@@ -683,7 +688,7 @@
X         sys.stderr = Log(open(LOGFILE, 'a+'))
X 
X     try:
X-        devlist = load(open('devlist.cache'))
X+        devlist = load(open('@DEVLIST_CACHE@'))
X     except:
X         print 'Could not load devlist.cache, build it with infparser.py'
X         sys_exit(-1)
X@@ -694,7 +699,6 @@
X     s = socket(AF_INET, SOCK_DGRAM)
X     s.bind(('', 4011))
X     
X-    print 'Binlserver started... pid %d' % getpid()
X     while 1:
X         addr, t, data = get_packet(s)
X         if t == FILEREQ:
END-of-ris/files/patch-binlsrv.py
echo x - ris/distinfo
sed 's/^X//' >ris/distinfo << 'END-of-ris/distinfo'
XMD5 (ris-linux.tar.gz) = 23b8e9c73d3a37e2e9b90bb8433e7ace
XSIZE (ris-linux.tar.gz) = 10805
END-of-ris/distinfo
exit

Thanks a lot!
Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2005-09-11 13:20:07 UTC
State Changed
From-To: feedback->closed

New port added, thank you!