import gimgtools-0.02

gimgtools is a set of command-line tools to examine and manipulate
Garmin IMG (the map format) files. The included tools are:

* gimgunlock: Unlock a locked map so that it can be used on ALL devices.
* gimgxor: Unscramble XOR'd map files.
* gimginfo: Print information of the map.
* gimgextract: Extract the IMG sections.
* gimgch: Hexdump and compare section header of two or more IMGs.

ok sebastia@
This commit is contained in:
jasper 2013-05-13 06:57:01 +00:00
parent a55ffd784f
commit 045aa9fdfd
8 changed files with 102 additions and 0 deletions

28
geo/gimgtools/Makefile Normal file
View File

@ -0,0 +1,28 @@
# $OpenBSD: Makefile,v 1.1.1.1 2013/05/13 06:57:01 jasper Exp $
COMMENT= Garmin Image Tools
DISTNAME= gimgtools-0.02
CATEGORIES= geo
HOMEPAGE= https://github.com/wuyongzheng/gimgtools
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
MASTER_SITES= http://distfiles.nl/
WANTLIB += c m
USE_GMAKE= Yes
MAKE_ENV += CC=${CC} ECFLAGS="${CFLAGS}"
NO_TEST= Yes
do-install:
.for g in gimginfo gimgfixcmd gimgxor gimgunlock gimgch gimgextract cmdc
${INSTALL_PROGRAM} ${WRKSRC}/$g ${PREFIX}/bin/
.endfor
.include <bsd.port.mk>

2
geo/gimgtools/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (gimgtools-0.02.tar.gz) = vR5JuKN128O/JOjlG0g1ms4Ue8cER91vm8r3YEabzPo=
SIZE (gimgtools-0.02.tar.gz) = 28782

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2013/05/13 06:57:01 jasper Exp $
--- Makefile.orig Sun Mar 10 22:07:34 2013
+++ Makefile Sun Mar 10 22:14:58 2013
@@ -1,5 +1,5 @@
-CC = gcc
-CFLAGS = -Wall -D_FILE_OFFSET_BITS=64
+CC ?= gcc
+CFLAGS = -Wall -D_FILE_OFFSET_BITS=64 ${ECFLAGS}
GIMGLIB_SOURCES = gimglib.c util.c sf_typ.c sf_mps.c sf_tre.c sf_rgn.c sf_lbl.c sf_net.c sf_nod.c sf_gmp.c
GIMGLIB_OBJS = $(GIMGLIB_SOURCES:.c=.o)

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-gimgch_c,v 1.1.1.1 2013/05/13 06:57:01 jasper Exp $
Fix format string for off_t.
--- gimgch.c.orig Sun Mar 10 22:24:39 2013
+++ gimgch.c Sun Mar 10 22:24:46 2013
@@ -47,7 +47,7 @@ static void display_headers (int line_columns)
emptyid[strlen(headers[0]->id)] = '\0';
for (i = 0; i < header_num; i ++) {
- printf("%s %8x=foff %8x=flen %4x=hoff %4x=hlen %s %s\n",
+ printf("%s %8llx=foff %8x=flen %4x=hoff %4x=hlen %s %s\n",
headers[i]->id,
headers[i]->subfile_offset,
headers[i]->subfile_size,

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-gimgextract_c,v 1.1.1.1 2013/05/13 06:57:01 jasper Exp $
Fix format strings for off_t and int.
--- gimgextract.c.orig Sun Mar 10 22:25:18 2013
+++ gimgextract.c Sun Mar 10 22:26:21 2013
@@ -70,7 +70,7 @@ int main (int argc, char *argv[])
sf_offset = read_2byte_at(infp, offset + 0x20) * block_size;
sf_size = read_4byte_at(infp, offset + 0xc);
if (sf_offset == 0 || sf_size == 0)
- errexit("subfile %s has 0 offset or size: 0x%lx 0x%lx\n",
+ errexit("subfile %s has 0 offset or size: 0x%llx 0x%d\n",
sf_name, sf_offset, sf_size);
outfp = fopen(sf_name, "wb");

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-gimglib_c,v 1.1.1.1 2013/05/13 06:57:01 jasper Exp $
prev_block may be used unitialized.
--- gimglib.c.orig Sun Mar 10 22:19:00 2013
+++ gimglib.c Sun Mar 10 22:19:09 2013
@@ -104,7 +104,7 @@ static int parse_img (struct gimg_struct *img)
struct garmin_img *img_header = (struct garmin_img *)(img->base);
struct subfile_struct *subfile, *subfiles, *subfiles_tail, *orphans, *orphans_tail;
struct submap_struct *submap, *submaps, *submaps_tail;
- unsigned int block_size, fatstart, fatend, i, prev_block;
+ unsigned int block_size, fatstart, fatend, i, prev_block = 0;
if (img_header->xor_byte != 0) {
fprintf(stderr, "XOR is not 0. Fix it first.\n");

8
geo/gimgtools/pkg/DESCR Normal file
View File

@ -0,0 +1,8 @@
gimgtools is a set of command-line tools to examine and manipulate
Garmin IMG (the map format) files. The included tools are:
* gimgunlock: Unlock a locked map so that it can be used on ALL devices.
* gimgxor: Unscramble XOR'd map files.
* gimginfo: Print information of the map.
* gimgextract: Extract the IMG sections.
* gimgch: Hexdump and compare section header of two or more IMGs.

8
geo/gimgtools/pkg/PLIST Normal file
View File

@ -0,0 +1,8 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2013/05/13 06:57:01 jasper Exp $
@bin bin/cmdc
@bin bin/gimgch
@bin bin/gimgextract
@bin bin/gimgfixcmd
@bin bin/gimginfo
@bin bin/gimgunlock
@bin bin/gimgxor