summaryrefslogtreecommitdiff
path: root/core/file
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-04-10 02:58:52 -0700
committerMichael Forney <mforney@mforney.org>2016-04-15 02:10:08 -0700
commitdbb513d4572e2eed5e540b7b7fb7e9c8f544cb04 (patch)
tree2260140732591d6ca455e493305884c21f063b3f /core/file
parent5f753e71fa37011b9bf7bcec482fe4a4a904dc9e (diff)
Add some initial packages
Diffstat (limited to 'core/file')
-rw-r--r--core/file/gen.rc114
m---------core/file/src0
2 files changed, 114 insertions, 0 deletions
diff --git a/core/file/gen.rc b/core/file/gen.rc
new file mode 100644
index 00000000..b5c16c8b
--- /dev/null
+++ b/core/file/gen.rc
@@ -0,0 +1,114 @@
+version=5.25
+cflags\
+ -DHAVE_ASCTIME_R'='1\
+ -DHAVE_CTIME_R'='1\
+ -DHAVE_FORK'='1\
+ -DHAVE_FREELOCALE'='1\
+ -DHAVE_GETLINE'='1\
+ -DHAVE_GETOPT_H'='1\
+ -DHAVE_GMTIME_R'='1\
+ -DHAVE_INTTYPES_H'='1\
+ -DHAVE_LIMITS_H'='1\
+ -DHAVE_LOCALE_H'='1\
+ -DHAVE_LOCALTIME_R'='1\
+ -DHAVE_MBRTOWC'='1\
+ -DHAVE_MBSTATE_T'='1\
+ -DHAVE_MKOSTEMP'='1\
+ -DHAVE_MKSTEMP'='1\
+ -DHAVE_MMAP'='1\
+ -DHAVE_NEWLOCALE'='1\
+ -DHAVE_PREAD'='1\
+ -DHAVE_SIGNAL_H'='1\
+ -DHAVE_STDDEF_H'='1\
+ -DHAVE_STDINT_H'='1\
+ -DHAVE_STDLIB_H'='1\
+ -DHAVE_STRERROR'='1\
+ -DHAVE_STRINGS_H'='1\
+ -DHAVE_STRING_H'='1\
+ -DHAVE_STRNDUP'='1\
+ -DHAVE_STRTOF'='1\
+ -DHAVE_STRTOUL'='1\
+ -DHAVE_STRUCT_OPTION'='1\
+ -DHAVE_STRUCT_STAT_ST_RDEV'='1\
+ -DHAVE_STRUCT_TM_TM_GMTOFF'='1\
+ -DHAVE_STRUCT_TM_TM_ZONE'='1\
+ -DHAVE_SYS_MMAN_H'='1\
+ -DHAVE_SYS_TIME_H'='1\
+ -DHAVE_SYS_WAIT_H'='1\
+ -DHAVE_UNISTD_H'='1\
+ -DHAVE_USELOCALE'='1\
+ -DHAVE_UTIME'='1\
+ -DHAVE_UTIMES'='1\
+ -DHAVE_UTIME_H'='1\
+ -DHAVE_WCHAR_H'='1\
+ -DHAVE_WCTYPE_H'='1\
+ -DHAVE_WCWIDTH'='1\
+ -DHAVE_ZLIB_H'='1\
+ \
+ -DHAVE_ASPRINTF'='1\
+ -DHAVE_GETOPT_LONG'='1\
+ -DHAVE_MEMORY_H'='1\
+ -DHAVE_SIG_T'='1\
+ -DHAVE_STRCASESTR'='1\
+ -DHAVE_STRLCAT'='1\
+ -DHAVE_STRLCPY'='1\
+ -DHAVE_VASPRINTF'='1\
+ -DHAVE_VISIBILITY'='1\
+ \
+ -DBUILTIN_ELF'='1\
+ -DELFCORE'='1\
+ -DVERSION'='\"$version\"\
+ -DMAGIC'='\"/share/file/magic\"\
+ -D_GNU_SOURCE\
+ -Wall\
+ -I core/zlib/include\
+ -I '$outdir'/include
+
+# TODO: check for visibility, xlocale.h, memory.h, vasprintf, asprintf,
+# strlcpy, strlcat, strcasestr, fmtcheck, getopt_long, sig_t, tm_zone,
+# tm_gmtoff
+
+cd src/magic
+magic_outs=magic/^( Header Localstuff )
+for(src in Header Localstuff) build '$outdir'/magic/$src copy '$srcdir'/src/magic/$src
+cd Magdir
+srcs=*
+magic_outs=( $magic_outs magic/$srcs )
+for(src in $srcs) build '$outdir'/magic/$src copy '$srcdir'/src/magic/Magdir/$src
+
+rule magic 'cd $outdir && file -C -m magic'
+build '$outdir'/magic.mgc magic '|' '$outdir'/$magic_outs
+
+ninja_vars='expr = s@X.YY@'`{echo $version | tr -d .}^@ \
+ build '$outdir'/include/magic.h sed '$srcdir'/src/src/magic.h.in
+ninja_vars='expr = -e s@__CSECTION__@1@g -e s@__FSECTION__@5@g -e s@__VERSION__@'$version'@g -e s@__MAGIC__@/share/file/magic@g' \
+ build '$outdir'/file.1 sed '$srcdir'/src/doc/file.man
+
+srcs=(\
+ src/magic.c\
+ src/apprentice.c\
+ src/softmagic.c\
+ src/ascmagic.c\
+ src/encoding.c\
+ src/compress.c\
+ src/is_tar.c\
+ src/readelf.c\
+ src/print.c\
+ src/fsmagic.c\
+ src/funcs.c\
+ src/apptype.c\
+ src/cdf.c\
+ src/cdf_time.c\
+ src/readcdf.c\
+ \
+ src/fmtcheck.c\
+) {
+ for(src in $srcs) cc $src '|' '$outdir/include/magic.h' '||' core/zlib/stamp
+ ar libmagic.a $srcs.o
+}
+
+exe file src/file.c libmagic.a
+
+file bin/file '$outdir'/file 755
+file share/man/man1/file.1 '$outdir'/file.1 644
+file share/file/magic.mgc '$outdir'/magic.mgc 644
diff --git a/core/file/src b/core/file/src
new file mode 160000
+Subproject f45db89ddc91692b662fffbabbdafc7bc4c00f5