1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-10 07:04:03 +00:00

Add du2ps 2.1, filter for converting output of du to PostScript file.

PR:		27848
Submitted by:	Yoshihiko Sarumaru <mistral@imasy.or.jp>
This commit is contained in:
OKAZAKI Tetsurou 2001-06-26 21:03:15 +00:00
parent 786bdb22a7
commit 88f263f5c0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=44477
10 changed files with 203 additions and 0 deletions

View File

@ -38,6 +38,7 @@
SUBDIR += dirdiff
SUBDIR += diskusage
SUBDIR += doconfig
SUBDIR += du2ps
SUBDIR += dvdtape
SUBDIR += eject
SUBDIR += extipl

31
sysutils/du2ps/Makefile Normal file
View File

@ -0,0 +1,31 @@
# New ports collection makefile for: du2ps
# Date created: 31 May 2001
# Whom: Yoshihiko Sarumaru <mistral@imasy.or.jp>
#
# $FreeBSD$
#
PORTNAME= du2ps
PORTVERSION= 2.1
CATEGORIES= sysutils
MASTER_SITES= http://www.shobi-u.ac.jp/~tnagae/src/ps-c/du2ps/du2ps-2.1/
EXTRACT_SUFX= .tgz
MAINTAINER= mistral@imasy.or.jp
# Nkf is required for just converting character code of japanese manual
BUILD_DEPENDS= nkf:${PORTSDIR}/japanese/nkf
MAKEFILE= makefile
ALL_TARGET=
MAN1= du2ps.1
MANLANG= "" ja
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/du2ps ${PREFIX}/bin/du2ps
${INSTALL_MAN} ${FILESDIR}/du2ps.1 ${PREFIX}/man/man1/du2ps.1
nkf -e ${WRKSRC}/du2ps.man > ${WRKDIR}/du2ps.1.ja
${INSTALL_MAN} ${WRKDIR}/du2ps.1.ja ${PREFIX}/man/ja/man1/du2ps.1
.include <bsd.port.mk>

1
sysutils/du2ps/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (du2ps-2.1.tgz) = f39e4724cb1a8831f0355fbeb8d819a6

View File

@ -0,0 +1,108 @@
.\"
.\" Copyleft by nagae@an.ip.titech.ac.jp and mac@research.co.jp
.\" du2ps.man
.TH du2ps 1 "Mar 2, 1994"
.SH NAME
du2ps \- filter for converting output of du to PostScript file
.SH SYNOPSIS
.B du2ps
[
.I options
]
<
.I du_out_file
>
.I ps_file
.SH DESCRIPTION
The
.B du2ps
reads output of
.BR du (1),
then generate a figure of hierarchical structure and utilization of
directory as one page PostScript file.
.PP
Each directory is illustrated as rectangle in utilization order with
height corresponding to its utilization, and sub directories are placed
branched from left to right recursively.
.SH OPTIONS
.TP
.B \-land
Layout in landscape.
Default is in portrait.
.TP
.B \-sa
Place directories in alphabetical order.
Default is in utilization order.
.TP
.B \-b4
.TP
.B \-b5
.TP
.B \-us
Switch page size to B4, B5, or US letter. Default is A4.
.TP
.BI \-ff " name"
Specify font name for text. Default is Times-Roman.
.TP
.BI \-fs " size"
Specify font size. Default is 8.0 [pt].
.TP
.BI \-ms " size"
Specify margin around page. Default is 50.0 [pt].
.TP
.BI \-lw " size"
Line width for drawing rectangle area. Default is 0.5 [pt].
.TP
.BI \-ncols " num"
Specify number of rectangle columns (maximum directory depth).
Default is 7 for portrait and 10 for landscape.
.TP
.BI \-eps " width height"
Output in EPS format.
.I Width
and
.I height
are the width and height of BoundingBox.
.SH EXAMPLES
.B " du | du2ps | lpr
.IP
The most left directory name becomes ``.'', and ``The number of disk
blocks used at .'' will be displayed at the upper left corner.
.
.B " du /home/taro/work | du2ps | lpr
.PP
.B " du ~taro/work | du2ps | lpr
.IP
The most left directory name becomes ``work'', and
``The number of disk blocks used at /home/taro/work''
will be displayed at the upper left corner.
.PP
.B " du ../../ps | du2ps -us -fs 16 > tmp.ps; gs tmp.ps
.IP
The most left directory name becomes ``ps'', and
``The number of disk blocks used at ../../ps''
will be displayed at the upper left corner.
The ``-us'' option makes entire page to fit paper, because default size of
GhostScript is US letter.
.PP
.B " du ~taro/work ~taro/bin | du2ps -eps 200 300 > fig1.eps
.IP
The most left directory name becomes ``taro'', and
``The number of disk blocks used at /home/taro''
will be display at the upper left corner.
Output will be commented with ``%%BoundingBox: 0 0 200 300''.
.PP
.B " du work bin | du2ps -eps 100 100 -fs 4 > fig2.eps
.IP
The most left directory name becomes ``..'', and
``The number of disk blocks used at''
will be display at the upper left corner.
.SH SEE ALSO
.BR du (1),
.BR xdu (1)
.SH AUTHORS
Takanori Nagae <nagae@an.ip.titech.ac.jp> and
Shigeru Makino <mac@research.co.jp>
.PP
The du2ps is based on xdu.
The author of xdu is Phillip C. Dykstra <phil@BRL.MIL>.

View File

@ -0,0 +1,11 @@
--- du2ps.h.orig Tue Mar 15 18:17:00 1994
+++ du2ps.h Fri Jun 1 15:39:04 2001
@@ -51,6 +51,8 @@
#define FONT_FAMILY "Times-Roman"
#define LINE_WIDTH 0.5
#define HEAD_SEP 5.0
+#define A3_WIDTH 841.889764
+#define A3_HEIGHT 1190.55118
#define A4_WIDTH 595.275591
#define A4_HEIGHT 841.889764
#define B4_WIDTH 728.503937

View File

@ -0,0 +1,21 @@
--- getopt.c.orig Wed Mar 16 11:41:27 1994
+++ getopt.c Fri Jun 1 15:40:02 2001
@@ -22,6 +22,7 @@
"du2ps [options] < infile > outfile",
"OPTIONS:",
" -land ... landscape",
+ " -a3 ... A3",
" -b4 ... B4",
" -b5 ... B5",
" -us ... US letter",
@@ -62,6 +63,10 @@
i++;
} else if(!strcmp("-sa", argv[i])){
cmp = cmp_alph;
+ i++;
+ } else if(!strcmp("-a3", argv[i])){
+ paper_width = A3_WIDTH;
+ paper_height = A3_HEIGHT;
i++;
} else if(!strcmp("-b4", argv[i])){
paper_width = B4_WIDTH;

View File

@ -0,0 +1,12 @@
--- nodeop.c.orig Tue Mar 15 18:15:58 1994
+++ nodeop.c Wed Jun 6 15:03:28 2001
@@ -142,7 +142,8 @@
/* for each child */
for(np = nodep->child; NODE_NULL != np; np = np->peer){
- double height = h * np->size / nodep->size;
+ /* When nodep->size is 0, 'divided by zero' will be raised */
+ double height = (nodep->size != 0 ? h * np->size / nodep->size : 0);
drawrect(np, y, height, depth);

View File

@ -0,0 +1 @@
Filter for converting output of du to PostScript file

16
sysutils/du2ps/pkg-descr Normal file
View File

@ -0,0 +1,16 @@
The du2ps reads output of du(1), then generates a figure of
hierarchical structure and utilization of each directory.
The du2ps is a similar program to xdu, but it produces result as
a PostScript file.
The default paper is ISO A4, but you can select Letter or ISO A3/B4/B5.
You can also specify font name, font size, number of columns and other
options.
Author: Takanori Nagae <nagae@an.ip.titech.ac.jp> and
Shigeru Makino <mac@research.co.jp>
WWW: http://www.shobi-u.ac.jp/~tnagae/
-
Yoshihiko Sarumaru <mistral@imasy.or.jp>

1
sysutils/du2ps/pkg-plist Normal file
View File

@ -0,0 +1 @@
bin/du2ps