testing/ufsutils: new aport

This commit is contained in:
William Pitcock 2013-03-26 05:46:03 -05:00
parent 7b81504d72
commit 7957e68443
2 changed files with 177 additions and 0 deletions

54
testing/ufsutils/APKBUILD Normal file
View File

@ -0,0 +1,54 @@
# Contributor:
# Maintainer:
pkgname=ufsutils
pkgver=8.2
pkgrel=0
pkgdesc="utilities to manage the UFS, UFS2 and FFS filesystems"
url="http://packages.debian.org/sid/ufsutils"
arch="all"
license="BSD"
depends=""
depends_dev="libbsd-dev"
makedepends="$depends_dev libedit-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="http://ftp.de.debian.org/debian/pool/main/u/ufsutils/ufsutils_8.2.orig.tar.gz
http://ftp.de.debian.org/debian/pool/main/u/ufsutils/ufsutils_8.2-3.debian.tar.gz
uclibc-no-fstab.patch"
_builddir="$srcdir/ufsutils-$pkgver"
prepare() {
local i
cd "$_builddir"
mv "$srcdir"/debian "$_builddir"
for i in debian/patches/*.patch; do
msg $i; patch -p1 -i $i || return 1
done
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
make -j1 || return 1
}
package() {
cd "$_builddir"
mkdir -p "$pkgdir"/usr/bin "$pkgdir"/usr/lib "$pkgdir"/usr/include \
"$pkgdir"/usr/sbin "$pkgdir"/usr/share/man/man8
make DESTDIR="$pkgdir" prefix="/usr" install || return 1
}
md5sums="e36f879da29e227e4d6494afc0c13559 ufsutils_8.2.orig.tar.gz
82077eb8980d3f9567910f61892c56f1 ufsutils_8.2-3.debian.tar.gz
e63bb9f49b387e90d4a9bf9fef318b4a uclibc-no-fstab.patch"
sha256sums="6298d2a94fb601f6951bf81ce074e6af597e8867ac210d8ff73348aeb3738bd9 ufsutils_8.2.orig.tar.gz
6040ad18ddbf9fa37b87b084fe6cf19c50f63456d15b6726067c558f8383b795 ufsutils_8.2-3.debian.tar.gz
8b581291d83dcdee402b2e441ca4e4026ba88d46a89a88182c65e6e7a85d99e7 uclibc-no-fstab.patch"
sha512sums="f378372c2493c16fe8cb3977f4ed2d104e747895e97d7642d21b5e87a2a03ac696bbac093e534e13c2f1dc4638741edcbbb0ddec5abcbfa6b4f7401efbf7cf14 ufsutils_8.2.orig.tar.gz
7bc925e742eaf4e1837ca4b46afa7966490234492eeb40ad8fabf71550a79890f3294780c2dbdf3593a82fc8e0708cf4c72baba81f4fec9a884cfa545c8895c8 ufsutils_8.2-3.debian.tar.gz
f3ba783768fcc0d595f715f3cf71ef64a13f7d3c7b9a6841b4681aceaa6c3c13a15a8d030e0e2141cd73c09cc52a15b315f4b05b63e61eaa0e08a74ff3331ca0 uclibc-no-fstab.patch"

View File

@ -0,0 +1,123 @@
--- ufsutils-8.2.orig/lib/libufs/type.c
+++ ufsutils-8.2/lib/libufs/type.c
@@ -39,7 +39,9 @@
#include <errno.h>
#include <fcntl.h>
-#include <fstab.h>
+#ifndef __UCLIBC__
+# include <fstab.h>
+#endif
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
@@ -86,7 +88,9 @@
ufs_disk_fillout_blank(struct uufsd *disk, const char *name)
{
struct stat st;
+#ifndef __UCLIBC__
struct fstab *fs;
+#endif
struct statfs sfs;
const char *oname;
char dev[MAXPATHLEN];
@@ -114,6 +118,7 @@
} else if (ret >= 0 && (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) {
/* This is what we need, do nothing. */
;
+#ifndef __UCLIBC__
} else if ((fs = getfsfile(name)) != NULL) {
/*
* The given mount point is listed in /etc/fstab.
@@ -125,6 +130,7 @@
* statfs(2) will point us at different file system.
*/
name = fs->fs_spec;
+#endif
} else if (ret >= 0 && S_ISDIR(st.st_mode)) {
/*
* The mount point is not listed in /etc/fstab, so it may be
--- ufsutils-8.2.orig/sbin/dumpfs/dumpfs.c
+++ ufsutils-8.2/sbin/dumpfs/dumpfs.c
@@ -66,7 +66,6 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <fstab.h>
#include <libufs.h>
#include <time.h>
#include <stdint.h>
--- ufsutils-8.2.orig/sbin/fsck_ffs/fsutil.c
+++ ufsutils-8.2/sbin/fsck_ffs/fsutil.c
@@ -53,7 +53,6 @@
#include <errno.h>
#include <string.h>
#include <ctype.h>
-#include <fstab.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
--- ufsutils-8.2.orig/sbin/fsck_ffs/main.c
+++ ufsutils-8.2/sbin/fsck_ffs/main.c
@@ -64,7 +64,9 @@
#include <err.h>
#include <errno.h>
-#include <fstab.h>
+#ifndef __UCLIBC__
+# include <fstab.h>
+#endif
#include <grp.h>
#include <mntopts.h>
#include <paths.h>
--- ufsutils-8.2.orig/sbin/fsck_ffs/utilities.c
+++ ufsutils-8.2/sbin/fsck_ffs/utilities.c
@@ -47,7 +47,9 @@
#include <errno.h>
#include <string.h>
#include <ctype.h>
-#include <fstab.h>
+#ifndef __UCLIBC__
+# include <fstab.h>
+#endif
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
@@ -61,7 +63,9 @@
{
struct stat stblock;
char *newname, *cp;
+#ifndef __UCLIBC__
struct fstab *fsinfo;
+#endif
int retried = 0, len;
static char device[MAXPATHLEN];
@@ -91,6 +95,7 @@
if (len > 0 && origname[len] == '/')
/* remove trailing slash */
origname[len] = '\0';
+#ifndef __UCLIBC__
if ((fsinfo = getfsfile(origname)) == NULL) {
printf(
"Can't resolve %s to character special device.\n",
@@ -98,6 +103,9 @@
return (origname);
}
newname = fsinfo->fs_spec;
+#else
+ return (origname);
+#endif
retried++;
goto retry;
}
--- ufsutils-8.2.orig/sbin/tunefs/tunefs.c
+++ ufsutils-8.2/sbin/tunefs/tunefs.c
@@ -63,7 +63,6 @@
#include <ctype.h>
#include <err.h>
#include <fcntl.h>
-#include <fstab.h>
#include <libufs.h>
#include <paths.h>
#include <stdio.h>