aboutsummaryrefslogtreecommitdiff
path: root/sysutils/pydf
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2007-12-14 16:54:24 +0000
committerPav Lucistnik <pav@FreeBSD.org>2007-12-14 16:54:24 +0000
commit1123329b7cb15474f8ad5b8ab5eded79ff342353 (patch)
tree71f7ed15a8302c12c0a50c9c41a0d988f6fe4255 /sysutils/pydf
parentd644ec35d177c8a247897ffebde1f0813620a56f (diff)
downloadports-1123329b7cb15474f8ad5b8ab5eded79ff342353.tar.gz
ports-1123329b7cb15474f8ad5b8ab5eded79ff342353.zip
Notes
Diffstat (limited to 'sysutils/pydf')
-rw-r--r--sysutils/pydf/Makefile44
-rw-r--r--sysutils/pydf/distinfo3
-rw-r--r--sysutils/pydf/files/patch-pydf47
-rw-r--r--sysutils/pydf/files/pkg-message.in8
-rw-r--r--sysutils/pydf/pkg-descr4
5 files changed, 106 insertions, 0 deletions
diff --git a/sysutils/pydf/Makefile b/sysutils/pydf/Makefile
new file mode 100644
index 000000000000..2750f9fead24
--- /dev/null
+++ b/sysutils/pydf/Makefile
@@ -0,0 +1,44 @@
+# New ports collection makefile for: pydf
+# Date created: 29 November 2007
+# Whom: Baptiste Grenier <gwarf@gwarf.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= pydf
+PORTVERSION= 5
+CATEGORIES= sysutils
+MASTER_SITES= http://kassiopeia.juls.savba.sk/~garabik/software/pydf/
+DISTNAME= pydf_5
+
+MAINTAINER= gwarf@gwarf.org
+COMMENT= A python implementation of df
+
+SUB_FILES= pkg-message
+
+PLIST_FILES= bin/pydf etc/pydfrc.sample
+
+USE_PYTHON= true
+NO_BUILD= yes
+
+MAN1= pydf.1
+MANCOMPRESSED= no
+
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}| ; s|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/pydf
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/pydf ${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/pydfrc ${PREFIX}/etc/pydfrc.sample
+ ${INSTALL_MAN} ${WRKSRC}/pydf.1 ${PREFIX}/man/man1
+
+post-install:
+ @if [ ! -f ${PREFIX}/etc/pydfrc ]; then \
+ ${ECHO_MSG} ; \
+ ${CAT} ${PKGMESSAGE} ; \
+ ${ECHO_MSG} ; \
+ fi
+
+.include <bsd.port.mk>
diff --git a/sysutils/pydf/distinfo b/sysutils/pydf/distinfo
new file mode 100644
index 000000000000..e109d01b0538
--- /dev/null
+++ b/sysutils/pydf/distinfo
@@ -0,0 +1,3 @@
+MD5 (pydf_5.tar.gz) = d429dbf726e29ace398980fc8b80eb30
+SHA256 (pydf_5.tar.gz) = d9a845ce7f0f446fb3a426e7b9c6c7b6ea333e740dc558d132f814257e5d1d43
+SIZE (pydf_5.tar.gz) = 11901
diff --git a/sysutils/pydf/files/patch-pydf b/sysutils/pydf/files/patch-pydf
new file mode 100644
index 000000000000..0a216915da50
--- /dev/null
+++ b/sysutils/pydf/files/patch-pydf
@@ -0,0 +1,47 @@
+--- pydf.original Tue Dec 4 23:02:26 2007
++++ pydf Tue Dec 4 23:02:14 2007
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! %%PYTHON_CMD%%
+
+ import sys, os, string, types, commands, struct
+ from optparse import OptionParser
+@@ -166,7 +166,7 @@
+ #end of default definitions
+
+ # read configuration file
+-for i in ["/etc/pydfrc", os.environ['HOME']+"/.pydfrc"]:
++for i in ["%%PREFIX%%/etc/pydfrc", os.environ['HOME']+"/.pydfrc"]:
+ if os.path.isfile(i):
+ execfile(i)
+
+@@ -336,9 +336,9 @@
+ except OSError, IOError:
+ status = 10*[0]
+
+- fs_blocksize = status[F_BSIZE]
++ fs_blocksize = status[F_FRSIZE]
+ if fs_blocksize == 0:
+- fs_blocksize = status[F_FRSIZE]
++ fs_blocksize = status[F_BSIZE]
+ free = status[F_BFREE]
+ used = long(status[F_BLOCKS]-free)
+ size = status[F_BLOCKS]
+@@ -351,7 +351,7 @@
+ avail_f = myformat(avail, sizeformat, fs_blocksize)
+
+ try:
+- perc = round(100.*used/size, 1)
++ perc = round(100.*used/(avail+used), 1)
+ except ZeroDivisionError:
+ perc = 0
+ perc_f = str(perc)
+@@ -419,7 +419,7 @@
+ "test if fs (as type) is a special one"
+ "in addition, a filesystem is special if it has number of blocks equal to 0"
+ fs = fs.lower()
+- return fs in [ "tmpfs", "devpts", "proc", "sysfs", "usbfs" ]
++ return fs in [ "tmpfs", "devpts", "proc", "sysfs", "usbfs", "procfs", "devfs" ]
+
+
+
diff --git a/sysutils/pydf/files/pkg-message.in b/sysutils/pydf/files/pkg-message.in
new file mode 100644
index 000000000000..f20a9967c977
--- /dev/null
+++ b/sysutils/pydf/files/pkg-message.in
@@ -0,0 +1,8 @@
+
+=========================================================
+
+Please copy the file %%PREFIX%%/etc/pydfrc.sample
+to %%PREFIX%%/etc/pydfrc and edit your configuration.
+
+=========================================================
+
diff --git a/sysutils/pydf/pkg-descr b/sysutils/pydf/pkg-descr
new file mode 100644
index 000000000000..8a6677eefc03
--- /dev/null
+++ b/sysutils/pydf/pkg-descr
@@ -0,0 +1,4 @@
+pydf is all-singing, all-dancing, fully colourised df(1)-clone
+written in python.
+
+WWW: http://kassiopeia.juls.savba.sk/~garabik/software/pydf/