file: bump to 5.27, move the magic file to a common sub-package. (#611)

* Bump to 5.27, update meta-data, add x86_gcc2 as 2nd arch.
* Move data/misc/magic.mgc to an arch-independent sub-package.
* Drop explicit call to autoreconf since configure works w/o it.
* Replace $dataDir/ by /system/data/ in man1/file.1, man4/magic.4
  and man3/libmagic.3 and also move the latter to file_devel.
This commit is contained in:
fbrosson
2016-05-25 23:37:47 +00:00
committed by waddlesplash
parent c73ec1cdc4
commit 4b0e75746d
3 changed files with 103 additions and 68 deletions

View File

@@ -1,61 +0,0 @@
SUMMARY="Identify a file's format by scanning binary data for patterns"
DESCRIPTION="This is Release 5.x of Ian Darwin's (copyright but distributable) file(1) \
command, an implementation of the Unix File(1) command. It knows the 'magic \
number' of several thousands of file types. This version is the standard \
'file' command for Linux, *BSD, and other systems. (See 'patchlevel.h' for the \
exact release number)."
HOMEPAGE="ftp://ftp.astron.com/pub/file/"
COPYRIGHT="1986-1999 Ian F. Darwin
1994-2013 Christos Zoulas"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="ftp://ftp.astron.com/pub/file/file-$portVersion.tar.gz"
CHECKSUM_SHA256="2ef32b4ec936b0ff7b59a021dce56086a716663b6df1138c7ea597d396bf50cf"
PATCHES="file-$portVersion.patchset"
ARCHITECTURES="x86 x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
file$secondaryArchSuffix = $portVersion compat >= 5
cmd:file$secondaryArchSuffix = $portVersion compat >= 5
lib:libmagic$secondaryArchSuffix = 1.0.0 compat >= 0
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
file${secondaryArchSuffix}_devel = $portVersion compat >= 0
devel:libmagic$secondaryArchSuffix = $portVersion compat >= 0
"
REQUIRES_devel="
file$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:autoreconf
cmd:aclocal
cmd:libtoolize
cmd:make
cmd:gcc$secondaryArchSuffix
"
BUILD()
{
autoreconf -fvi
runConfigure ./configure
make
}
INSTALL()
{
make install
prepareInstalledDevelLibs libmagic
packageEntries devel $developDir
}

View File

@@ -0,0 +1,96 @@
SUMMARY="Identify a file's format by scanning binary data for patterns"
DESCRIPTION="This is Release 5.x of Ian Darwin's (copyright but distributable) \
file(1) command, an implementation of the Unix File(1) command. It knows the \
'magic number' of several thousands of file types. This version is the \
standard 'file' command for Linux, *BSD, and other systems. (See \
'patchlevel.h' for the exact release number)."
HOMEPAGE="ftp://ftp.astron.com/pub/file/"
COPYRIGHT="1986-1999 Ian F. Darwin
1994-2016 Christos Zoulas"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="ftp://ftp.astron.com/pub/file/file-$portVersion.tar.gz"
CHECKSUM_SHA256="c2e7d509b1167c4915901ecd257ee924d229a348bf988df6d1934ef0fa34a1a7"
PATCHES="file-$portVersion.patchset"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
file$secondaryArchSuffix = $portVersion compat >= 5
cmd:file$secondaryArchSuffix = $portVersion compat >= 5
lib:libmagic$secondaryArchSuffix = 1.0.0 compat >= 0
"
REQUIRES="
haiku$secondaryArchSuffix
file_data == $portVersion
lib:libz$secondaryArchSuffix
"
if [ -z "$secondaryArchSuffix" ]; then
SUMMARY_data="Magic file for the file(1) command"
ARCHITECTURES_data="any"
PROVIDES_data="
file_data = $portVersion
"
REQUIRES_data=""
fi
PROVIDES_devel="
file${secondaryArchSuffix}_devel = $portVersion compat >= 0
devel:libmagic$secondaryArchSuffix = $portVersion compat >= 0
"
REQUIRES_devel="
file$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:autom4te
cmd:automake
cmd:gcc$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:sed
"
BUILD()
{
runConfigure ./configure
make
}
INSTALL()
{
make install
prepareInstalledDevelLib libmagic
fixPkgconfig
if [ -z "$secondaryArchSuffix" ]; then
packageEntries data \
$dataDir
maybe_manDir_man3=$manDir/man3
rmdir $manDir/man5
sed -i -e "s,$dataDir/,/system/$relativeDataDir/,g" \
$manDir/man1/file.1 \
$manDir/man3/libmagic.3 \
$manDir/man4/magic.4
else
maybe_manDir_man3=
rm -rf $dataDir $manDir
fi
packageEntries devel \
$developDir \
$maybe_manDir_man3
}
TEST()
{
make check
}

View File

@@ -5,7 +5,7 @@ Subject: Haiku patch
diff --git a/configure.ac b/configure.ac
index 676c0fb..6647330 100644
index 3c5f922..31cef67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,14 +128,14 @@ else
@@ -26,10 +26,10 @@ index 676c0fb..6647330 100644
WARNINGS=
AC_MSG_RESULT(no)
diff --git a/src/der.c b/src/der.c
index e003795..1c74e68 100644
index af5f149..3fc57fd 100644
--- a/src/der.c
+++ b/src/der.c
@@ -194,6 +194,7 @@ static int
@@ -199,6 +199,7 @@ static int
der_data(char *buf, size_t blen, uint32_t tag, const void *q, uint32_t len)
{
const uint8_t *d = q;
@@ -37,7 +37,7 @@ index e003795..1c74e68 100644
switch (tag) {
case DER_TAG_PRINTABLE_STRING:
case DER_TAG_UTF8_STRING:
@@ -204,7 +205,7 @@ der_data(char *buf, size_t blen, uint32_t tag, const void *q, uint32_t len)
@@ -209,7 +210,7 @@ der_data(char *buf, size_t blen, uint32_t tag, const void *q, uint32_t len)
break;
}
@@ -46,7 +46,7 @@ index e003795..1c74e68 100644
uint32_t z = i << 1;
if (z < blen - 2)
snprintf(buf + z, blen - z, "%.2x", d[i]);
@@ -217,12 +218,13 @@ der_offs(struct magic_set *ms, struct magic *m, size_t nbytes)
@@ -222,12 +223,13 @@ der_offs(struct magic_set *ms, struct magic *m, size_t nbytes)
{
const uint8_t *b = CAST(const void *, ms->search.s);
size_t offs = 0, len = ms->search.rm_len ? ms->search.rm_len : nbytes;
@@ -61,7 +61,7 @@ index e003795..1c74e68 100644
if (tlen == DER_BAD)
return -1;
DPRINTF(("%s2: %d %zu %u\n", __func__, ms->offset, offs, tlen));
@@ -251,6 +253,7 @@ der_cmp(struct magic_set *ms, struct magic *m)
@@ -256,6 +258,7 @@ der_cmp(struct magic_set *ms, struct magic *m)
size_t offs = 0, len = ms->search.s_len;
uint32_t tag, tlen;
char buf[128];
@@ -69,7 +69,7 @@ index e003795..1c74e68 100644
tag = gettag(b, &offs, len);
if (tag == DER_BAD)
@@ -264,7 +267,7 @@ der_cmp(struct magic_set *ms, struct magic *m)
@@ -269,7 +272,7 @@ der_cmp(struct magic_set *ms, struct magic *m)
if ((ms->flags & MAGIC_DEBUG) != 0)
fprintf(stderr, "%s: tag %p got=%s exp=%s\n", __func__, b,
buf, s);