aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorWen Heping <wen@FreeBSD.org>2010-04-07 03:00:06 +0000
committerWen Heping <wen@FreeBSD.org>2010-04-07 03:00:06 +0000
commit635b901ad647a80446cdf844c796799e2ebfae9a (patch)
tree0e3a586b76159966a4be04e648121bd009d4f6b0 /sysutils
parentffd34867196e6207b57d78f84b25ad957ee3956f (diff)
downloadports-635b901ad647a80446cdf844c796799e2ebfae9a.tar.gz
ports-635b901ad647a80446cdf844c796799e2ebfae9a.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/moosefs-chunkserver/Makefile53
-rw-r--r--sysutils/moosefs-chunkserver/distinfo3
-rw-r--r--sysutils/moosefs-chunkserver/files/mfschunkserver.in35
-rw-r--r--sysutils/moosefs-chunkserver/files/pkg-deinstall.in11
-rw-r--r--sysutils/moosefs-chunkserver/files/pkg-install.in37
-rw-r--r--sysutils/moosefs-chunkserver/files/pkg-message.in13
-rw-r--r--sysutils/moosefs-chunkserver/pkg-descr7
-rw-r--r--sysutils/moosefs-chunkserver/pkg-plist7
9 files changed, 167 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 6aeb40003dcb..27e77802161d 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -495,6 +495,7 @@
SUBDIR += monitord
SUBDIR += monkeytail
SUBDIR += mono-kmod
+ SUBDIR += moosefs-chunkserver
SUBDIR += moosefs-master
SUBDIR += moreutils
SUBDIR += most
diff --git a/sysutils/moosefs-chunkserver/Makefile b/sysutils/moosefs-chunkserver/Makefile
new file mode 100644
index 000000000000..8a085e09b43a
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/Makefile
@@ -0,0 +1,53 @@
+# New ports collection makefile for: moosefs-chunkserver
+# Date created: 1 April 2010
+# Whom: Chifeng Qu <chifeng@gmail.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= moosefs
+PORTVERSION= 1.6.14
+CATEGORIES= sysutils
+MASTER_SITES= SF/moosefs/moosefs/${PORTVERSION}/
+PKGNAMESUFFIX= -chunkserver
+DISTNAME= mfs-${PORTVERSION}
+
+MAINTAINER= chifeng@gmail.com
+COMMENT= Storing files data and synchronizing it among themselves
+
+GNU_CONFIGURE= yes
+USE_RC_SUBR+= mfschunkserver
+MFS_WORKDIR= /var
+
+MAN5= mfschunkserver.cfg.5 mfshdd.cfg.5
+MAN8= mfschunkserver.8
+
+SUB_FILES+= pkg-install pkg-message pkg-deinstall
+SUB_LIST+= MFS_WORKDIR="${MFS_WORKDIR}"
+
+CONFIGURE_ARGS= --localstatedir=${MFS_WORKDIR} \
+ --bindir=${PREFIX}/sbin \
+ --with-default-user=${MFSUSER} \
+ --with-default-group=${MFSGROUP} \
+ --disable-mfsmaster \
+ --disable-mfsmount \
+ --disable-mfscgi \
+ --disable-mfscgiserv \
+ --enable-mfschunkserver
+
+.include <bsd.port.pre.mk>
+
+post-patch:
+ ${REINPLACE_CMD} -e 's;^general_mans;#general_mans;g' ${WRKSRC}/doc/Makefile.am \
+ ${WRKSRC}/doc/Makefile.in
+
+post-install:
+.for FILE in mfschunkserver mfshdd
+ @if [ ! -f ${PREFIX}/etc/${i}.cfg ]; then \
+ ${CP} ${PREFIX}/etc/${FILE}.cfg.dist ${PREFIX}/etc/${FILE}.cfg ; \
+ fi
+.endfor
+ PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/moosefs-chunkserver/distinfo b/sysutils/moosefs-chunkserver/distinfo
new file mode 100644
index 000000000000..ba8b366a3794
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/distinfo
@@ -0,0 +1,3 @@
+MD5 (mfs-1.6.14.tar.gz) = 746e742011f6ada5ec64152c4fd2ddbd
+SHA256 (mfs-1.6.14.tar.gz) = 8c29a71d391cb77e528459aced3f12bdbff813baed2a43461c3e1818f2492411
+SIZE (mfs-1.6.14.tar.gz) = 641406
diff --git a/sysutils/moosefs-chunkserver/files/mfschunkserver.in b/sysutils/moosefs-chunkserver/files/mfschunkserver.in
new file mode 100644
index 000000000000..d22ecdea135d
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/files/mfschunkserver.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: mfschunkserver
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf or or /etc/rc.conf to enable mfschunkserver:
+#
+# mfschunkserver_enable="YES"
+#
+
+. /etc/rc.subr
+
+name=mfschunkserver
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/${name}
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+ rm -f $pidfile
+}
+
+# set defaults
+mfschunkserver_enable=${mfschunkserver_enable:-"NO"}
+mfschunkserver_flags=${mfschunkserver_flags:-"-c %%PREFIX%%/etc/mfschunkserver.cfg"}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/sysutils/moosefs-chunkserver/files/pkg-deinstall.in b/sysutils/moosefs-chunkserver/files/pkg-deinstall.in
new file mode 100644
index 000000000000..bec0d963dc2c
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/files/pkg-deinstall.in
@@ -0,0 +1,11 @@
+#!/bin/sh
+# $FreeBSD$
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+
+WORKDIR=%%MFS_WORKDIR%%/mfs
+
+if [ "$2" = "POST-DEINSTALL" ]; then
+ echo "=> Deleting ${WORKDIR} if empty..."
+ rm -d ${WORKDIR} 2>/dev/null || true
+fi
diff --git a/sysutils/moosefs-chunkserver/files/pkg-install.in b/sysutils/moosefs-chunkserver/files/pkg-install.in
new file mode 100644
index 000000000000..99a254a25607
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/files/pkg-install.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+PATH=/bin:/usr/sbin
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+ USER=mfs
+ GROUP=${USER}
+ UID=925
+ GID=${UID}
+
+ if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+ if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d /nonexistent -s /sbin/nologin -c "MySQL Daemon"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi
+exit 0
diff --git a/sysutils/moosefs-chunkserver/files/pkg-message.in b/sysutils/moosefs-chunkserver/files/pkg-message.in
new file mode 100644
index 000000000000..e3737856b228
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/files/pkg-message.in
@@ -0,0 +1,13 @@
+************************************************************************
+
+Three startup scripts has been installed as:
+
+%%PREFIX%%/etc/rc.d/mfschunkserver
+
+Use it to start/stop the mfsmaster, mfsmetalogge and mfschunkserver
+services after you have added the following line to your rc.conf
+file respectively:
+
+mfschunkserver_enable="YES"
+
+************************************************************************
diff --git a/sysutils/moosefs-chunkserver/pkg-descr b/sysutils/moosefs-chunkserver/pkg-descr
new file mode 100644
index 000000000000..95a66e87e532
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/pkg-descr
@@ -0,0 +1,7 @@
+MooseFS is a fault tolerant, network distributed file system.
+
+mfschunkserver is any number of commodity servers storing files
+data and synchronizing it among themselves (if a certain file
+is supposed to exist in more than one copy).
+
+WWW: http://www.moosefs.org/
diff --git a/sysutils/moosefs-chunkserver/pkg-plist b/sysutils/moosefs-chunkserver/pkg-plist
new file mode 100644
index 000000000000..7fe14b1decd8
--- /dev/null
+++ b/sysutils/moosefs-chunkserver/pkg-plist
@@ -0,0 +1,7 @@
+@exec if [ ! -f %D/etc/mfshdd.cfg ]; then /bin/cp %D/etc/mfshdd.cfg.dist %D/etc/mfshdd.cfg; fi
+@exec if [ ! -f %D/etc/mfschunkserver.cfg ]; then /bin/cp %D/etc/mfschunkserver.cfg.dist %D/etc/mfschunkserver.cfg; fi
+@unexec if cmp -s %D/etc/mfshdd.cfg.dist %D/etc/mfshdd.cfg; then rm -f %D/etc/mfshdd.cfg; fi
+@unexec if cmp -s %D/etc/mfschunkserver.cfg.dist %D/etc/mfschunkserver.cfg; then rm -f %D/etc/mfschunkserver.cfg; fi
+etc/mfschunkserver.cfg.dist
+etc/mfshdd.cfg.dist
+sbin/mfschunkserver