--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include $(PKGROOT)/Include
+
+PKG_NAME = mdadm
+PKG_VER = 3.0-devel2
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Base
+PKG_URL = http://www.kernel.org/pub/linux/utils/raid/mdadm/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = The mdadm program controls Linux md devices (software RAID arrays).
+
+PKG_BUILD_DEPS+= groff
+
+define PKG_DESCRIPTION
+ The mdadm program is used to create, manage, and monitor Linux MD (software \
+ RAID) devices. As such, it provides similar functionality to the raidtools \
+ package. However, mdadm is a single program, and it can perform \
+ almost all functions without a configuration file, though a configuration \
+ file can be used to help with some common tasks.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+CFLAGS += -fno-strict-aliasing
+
+define STAGE_PREPARE_CMDS
+ cd $(DIR_APP) && sed -e "s/^INSTALL = .*/INSTALL = install/" -i Makefile
+endef
+
+define STAGE_BUILD
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS) CXFLAGS="$(CFLAGS)" \
+ SYSCONFDIR="/etc" MDASSEMBLE_AUTO=1
+endef
+
+define STAGE_INSTALL
+ cd $(DIR_APP) && make install BINDIR=/sbin DESTDIR=$(BUILDROOT)
+
+ -mkdir -pv $(BUILDROOT)/var/run/mdadm
+ chmod 700 $(BUILDROOT)/var/run/mdadm
+endef
--- /dev/null
+--- mdadm-3.0-devel2/mdopen.c.warn 2009-02-12 09:13:54.000000000 -0500
++++ mdadm-3.0-devel2/mdopen.c 2009-02-12 09:34:15.000000000 -0500
+@@ -88,8 +88,9 @@ void make_parts(char *dev, int cnt)
+ if (chmod(name, stb2.st_mode & 07777))
+ perror("chmod");
+ } else {
+- snprintf(sym, 10000, "%s%s%d", orig, odig?"p":"", i);
+- symlink(sym, name);
++ snprintf(sym, 1024, "%s%s%d", orig, odig?"p":"", i);
++ if (symlink(sym, name))
++ perror("symlink");
+ }
+ stat(name, &stb2);
+ add_dev(name, &stb2, 0, NULL);
+@@ -357,7 +358,8 @@ int create_mddev(char *dev, char *name,
+ strcpy(chosen, devname);
+ }
+ } else
+- symlink(devname, chosen);
++ if (symlink(devname, chosen))
++ perror("symlink");
+ if (use_mdp && strcmp(chosen, devname) != 0)
+ make_parts(chosen, parts);
+ }