Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Apr 2014 07:42:57 GMT
From:      C Hutchinson <portmaster@bsdforge.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/189009: [new port] devel textproc - c2mdoc : Script to generate mdoc(7) markup from C functions
Message-ID:  <201404260742.s3Q7gvIX007826@cgiserv.freebsd.org>
Resent-Message-ID: <201404260750.s3Q7o0YD053104@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         189009
>Category:       ports
>Synopsis:       [new port] devel textproc - c2mdoc : Script to generate mdoc(7) markup from C functions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 26 07:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     C Hutchinson
>Release:        releng_8, releng_9
>Organization:
>Environment:
>Description:
c2mdoc
provides 2 scripts
c2mdoc
c2mdoc.awk
requires devel/cproto
maintainer-request

>How-To-Repeat:

>Fix:
commit attached.

Patch attached with submission follows:

# 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:
#
#	c2mdoc
#	c2mdoc/Makefile
#	c2mdoc/pkg-descr
#	c2mdoc/files
#	c2mdoc/files/c2mdoc
#	c2mdoc/files/c2mdoc.awk
#
echo c - c2mdoc
mkdir -p c2mdoc > /dev/null 2>&1
echo x - c2mdoc/Makefile
sed 's/^X//' >c2mdoc/Makefile << 'd6da80dbadd53f0c81a46b243e22264b'
X# Created by: C Hutchinson <portmaster@bsdforge.com>
X# devel/c2mdoc/Makefile 2014-04-24 22:53:40
X#
X
XPORTNAME=	c2mdoc
XPORTVERSION=	20140424
XCATEGORIES=	devel textproc
XMASTER_SITES=	#
XDISTFILES=
X
XMAINTAINER=	portmaster@bsdforge.com
XCOMMENT=	Script to generate mdoc(7) markup from C functions
X
XRUN_DEPENDS=	cproto:${PORTSDIR}/devel/cproto
X
XNOMAN=
X
XNO_BUILD=	yes
XNO_WRKSUBDIR=	yes
X
XPLIST_FILES=	bin/c2mdoc libexec/c2mdoc.awk
X
Xdo-install:
X	${INSTALL_SCRIPT} ${FILESDIR}/c2mdoc.awk ${PREFIX}/libexec
X	${CP} ${FILESDIR}/c2mdoc ${WRKDIR}
X	${REINPLACE_CMD} -e "s|%%LIBEXECDIR%%|${PREFIX}/libexec|g;" \
X		${WRKDIR}/c2mdoc
X	${INSTALL_SCRIPT} ${WRKDIR}/c2mdoc ${PREFIX}/bin
X
X.include <bsd.port.mk>
d6da80dbadd53f0c81a46b243e22264b
echo x - c2mdoc/pkg-descr
sed 's/^X//' >c2mdoc/pkg-descr << '06a14ca49a3e3cded6300165a67d2b83'
Xc2mdoc is a shell and awk script wrapper which abuses devel/cproto's
Xparser to spit out function prototypes in a format ready to paste into
XFreeBSD developer documentation. c2man already claims to do such a
Xthing, but seems crippled in the face of our kernel source. The
Xtoolchain used by this port whinges but still generates markup.
06a14ca49a3e3cded6300165a67d2b83
echo c - c2mdoc/files
mkdir -p c2mdoc/files > /dev/null 2>&1
echo x - c2mdoc/files/c2mdoc
sed 's/^X//' >c2mdoc/files/c2mdoc << '816655b3d6326e394840fbc4b0faf0a3'
X#!/bin/sh
X#
X# c2mdoc -- Front-end which abuses the cproto parser to spit out
X#           mdoc(7) format prototypes for use in FreeBSD documentation.
X#
X
XAWKSCRIPT="%%LIBEXECDIR%%/c2mdoc.awk"
XCPROTO='-P"int\tf\t(\ta\t,\tb\t)" -pq -f3'
XCPROTO_BIN=cproto
Xexport CPROTO
X
X${CPROTO_BIN} $1 | \
X	grep -v '/\*.*\*/' | \
X	sed -e 's/[,();]//g' | \
X	${AWKSCRIPT}
816655b3d6326e394840fbc4b0faf0a3
echo x - c2mdoc/files/c2mdoc.awk
sed 's/^X//' >c2mdoc/files/c2mdoc.awk << 'e9d0b7c42e4c62c4b5d9fa3c99fae0cc'
X#!/usr/bin/awk -f
X#
X# c2mdoc.awk -- Takes tabulated output from cproto(1) and turns it into
X#               mdoc(7) markup.
X#
XBEGIN { FS="\t" }
X{
X	printf ".Ft %s\n", $1 ;
X	printf ".Fn %s", $2 ;
X	for (i = 4; i < NF; i++)
X		printf " \"%s\"", $i
X	printf "\n" ;
X}
e9d0b7c42e4c62c4b5d9fa3c99fae0cc
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404260742.s3Q7gvIX007826>