diff options
author | Chin-San Huang <chinsan@FreeBSD.org> | 2008-02-25 09:36:32 +0000 |
---|---|---|
committer | Chin-San Huang <chinsan@FreeBSD.org> | 2008-02-25 09:36:32 +0000 |
commit | 987cf63f4c2e26e25798e3a4d3f9435cc642a6c4 (patch) | |
tree | 90178a895aad364d288eb0ac3e5a8c608bf2690b /devel/shapelib | |
parent | bc4bf4d5fb7913df51a1367452d8fb6c0bd2ee01 (diff) | |
download | ports-987cf63f4c2e26e25798e3a4d3f9435cc642a6c4.tar.gz ports-987cf63f4c2e26e25798e3a4d3f9435cc642a6c4.zip |
Notes
Diffstat (limited to 'devel/shapelib')
-rw-r--r-- | devel/shapelib/Makefile | 45 | ||||
-rw-r--r-- | devel/shapelib/files/patch-Makefile | 57 | ||||
-rw-r--r-- | devel/shapelib/files/patch-contrib-Makefile | 48 | ||||
-rw-r--r-- | devel/shapelib/files/patch-shapefil.h | 11 | ||||
-rw-r--r-- | devel/shapelib/files/patch-shputils.c | 20 | ||||
-rw-r--r-- | devel/shapelib/pkg-plist | 28 |
6 files changed, 185 insertions, 24 deletions
diff --git a/devel/shapelib/Makefile b/devel/shapelib/Makefile index 67b7b67341a9..e0f07e1b9304 100644 --- a/devel/shapelib/Makefile +++ b/devel/shapelib/Makefile @@ -7,24 +7,49 @@ PORTNAME= shapelib PORTVERSION= 1.2.10 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel -MASTER_SITES= http://dl.maptools.org/dl/shapelib/ +MASTER_SITES= http://dl.maptools.org/dl/shapelib/ \ + http://sunpoet.net/distfiles/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= sunpoet@sunpoet.net COMMENT= C API for reading and writing ArcView Shapefiles USE_AUTOTOOLS= libtool:15:env -ALL_TARGET= lib USE_LDCONFIG= yes -INSTALL_TARGET= lib_install + +OPTIONS= PROJ4 "Cartographic Projections library" off + +.include <bsd.port.pre.mk> + +.if defined(WITH_PROJ4) +LIB_DEPENDS+= proj.5:${PORTSDIR}/graphics/proj +PLIST_SUB+= PROJ4="" +PROJ4= -DPROJ4 +.else +PLIST_SUB+= PROJ4="@comment " +PROJ4= -DNO_PROJ4 +.endif + +.if ${ARCH} == "amd64" || ${ARCH} == "i386" || ${ARCH} == "ia64" +ENDIAN= -D_LITTLE_ENDIAN +.else # powerpc & sparc64 +ENDIAN= -D_BIG_ENDIAN +.endif post-patch: - @${REINPLACE_CMD} -e 's#%%PREFIX%%#${PREFIX}#g' \ + @${REINPLACE_CMD} \ + -e 's#%%INSTALL%%#${INSTALL}#g' \ -e 's#%%LIBTOOL%%#${LIBTOOL}#g' \ - -e 's#%%INSTALL%%#${INSTALL}#g' ${WRKSRC}/Makefile + -e 's#%%PREFIX%%#${PREFIX}#g' \ + -e 's#%%ENDIAN%%#${ENDIAN}#g' \ + -e 's#%%PROJ4%%#${PROJ4}#g' \ + ${WRKSRC}/Makefile ${WRKSRC}/contrib/Makefile + post-install: - ${MKDIR} ${PREFIX}/share/doc/shapelib - ${INSTALL_DATA} ${WRKSRC}/*.html ${PREFIX}/share/doc/shapelib +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/*.html ${DOCSDIR} +.endif -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/devel/shapelib/files/patch-Makefile b/devel/shapelib/files/patch-Makefile index 11c3cff776da..7211a6b294a0 100644 --- a/devel/shapelib/files/patch-Makefile +++ b/devel/shapelib/files/patch-Makefile @@ -1,11 +1,48 @@ ---- Makefile.orig Mon Apr 7 13:03:22 2003 -+++ Makefile Fri Feb 3 02:16:16 2006 -@@ -2,3 +2,3 @@ - #LINKOPT = /usr/local/lib/libdbmalloc.a +--- Makefile.orig 2003-04-07 21:03:22.000000000 +0800 ++++ Makefile 2008-02-25 13:53:10.000000000 +0800 +@@ -1,10 +1,35 @@ +- +-#LINKOPT = /usr/local/lib/libdbmalloc.a -CFLAGS = -g -+#CFLAGS = -g ++#LINKOPT = %%PREFIX%%/lib/libdbmalloc.a ++CFLAGS += -g + + default: all + +-all: shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shptest ++TOOLS= shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shptest \ ++ shputils shptreedump ++ ++CONTRIBTOOLS= ++ ++#all: lib shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump \ ++# shptest shputils shptreedump ++ ++all: lib tools contrib_tools ++ ++install: lib_install tools_install contrib_install ++ ++tools: ++.for _TOOL in $(TOOLS) ++ $(CC) $(CFLAGS) -I. $(_TOOL).c -o $(_TOOL) .libs/libshp.a ++.endfor ++ ++contrib_tools: ++ (cd contrib; ${MAKE} %%PROJ4%% all; cd ..) ++ ++tools_install: ++.for _TOOL in ${TOOLS} ++ %%INSTALL%% -c -m 755 ${_TOOL} %%PREFIX%%/bin/${_TOOL} ++.endfor ++ ++contrib_install: ++ (cd contrib; ${MAKE} %%PROJ4%% install; cd ..) + + shpopen.o: shpopen.c shapefil.h + $(CC) $(CFLAGS) -c shpopen.c +@@ -92,51 +117,18 @@ + -@@ -94,49 +94,16 @@ # ----------------------------------------------------------------------------- -# The following is contributed by Jan-Oliver Wagner, and should allow for -# creating shared libraries on most platforms with gcc, and libtool installed. @@ -44,10 +81,10 @@ - ranlib .libs/libshp.a - rm -fr .libs/libshp.lax - (cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la) -+ %%LIBTOOL%% --mode=compile $(CC) -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include $(CFLAGS) -c shpopen.c -+ %%LIBTOOL%% --mode=compile $(CC) -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include $(CFLAGS) -c shptree.c -+ %%LIBTOOL%% --mode=compile $(CC) -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include $(CFLAGS) -c dbfopen.c -+ %%LIBTOOL%% --mode=link $(CC) $(CFLAGS) -o libshp.la -rpath %%PREFIX%%lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo ++ %%LIBTOOL%% --mode=compile --tag=CXX $(CC) -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I%%PREFIX%%/include $(CFLAGS) -c shpopen.c ++ %%LIBTOOL%% --mode=compile --tag=CXX $(CC) -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I%%PREFIX%%/include $(CFLAGS) -c shptree.c ++ %%LIBTOOL%% --mode=compile --tag=CXX $(CC) -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I%%PREFIX%%/include $(CFLAGS) -c dbfopen.c ++ %%LIBTOOL%% --mode=link --tag=CXX $(CC) $(CFLAGS) -o libshp.la -rpath %%PREFIX%%/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo lib_install: - cp .libs/libshp.la .libs/libshp.lai diff --git a/devel/shapelib/files/patch-contrib-Makefile b/devel/shapelib/files/patch-contrib-Makefile new file mode 100644 index 000000000000..b4bd99573822 --- /dev/null +++ b/devel/shapelib/files/patch-contrib-Makefile @@ -0,0 +1,48 @@ +--- contrib/Makefile.orig 2003-04-07 21:03:22.000000000 +0800 ++++ contrib/Makefile 2008-02-25 13:54:58.000000000 +0800 +@@ -3,9 +3,9 @@ + #CFLAGS = -g + + # Endian: define either _LITTLE_ENDIAN or _BIG_ENDIAN +-ENDIAN = -D_LITTLE_ENDIAN ++#ENDIAN = -D_LITTLE_ENDIAN + +-CFLAGS = -g -I.. -DPROJ4 $(ENDIAN) -DDEBUG -DDEBUG2 ++CFLAGS += -g -I.. -DDEBUG -DDEBUG2 %%ENDIAN%% %%PROJ4%% -I%%PREFIX%%/include -L%%PREFIX%%/lib + + SHPOBJ = ../shpopen.o ../dbfopen.o + +@@ -15,7 +15,32 @@ + + default: all + +-all: shpdxf shpproj dbfinfo shpcentrd shpdata shpwkb dbfinfo dbfcat shpinfo shpfix shpcat ++#all: shpdxf shpproj dbfinfo shpcentrd shpdata shpwkb dbfinfo dbfcat shpinfo shpfix shpcat ++ ++.if defined(PROJ4) ++all: allprog allproj ++install: allprog_install allproj_install ++.else ++all: allprog ++install: allprog_install ++.endif ++ ++ALLPROG= dbfcat dbfinfo shpcat shpdxf shpfix ++ALLPROJ= shpcentrd shpdata shpinfo shpproj shpwkb ++ ++allprog: $(ALLPROG) ++ ++allprog_install: $(ALLPROG) ++.for _ALLPROG in ${ALLPROG} ++ %%INSTALL%% -c -m 755 ${_ALLPROG} %%PREFIX%%/bin/${_ALLPROG} ++.endfor ++ ++allproj: $(ALLPROJ) ++ ++allproj_install: $(ALLPROJ) ++.for _ALLPROJ in ${ALLPROJ} ++ %%INSTALL%% -c -m 755 ${_ALLPROJ} %%PREFIX%%/bin/${_ALLPROJ} ++.endfor + + clean: + rm -f shpdxf shpproj dbfinfo shpcentrd shpdata shpwkb dbfcat dbfinfo shpinfo shpfix shpcat *.o diff --git a/devel/shapelib/files/patch-shapefil.h b/devel/shapelib/files/patch-shapefil.h new file mode 100644 index 000000000000..249b77879a5c --- /dev/null +++ b/devel/shapelib/files/patch-shapefil.h @@ -0,0 +1,11 @@ +--- shapefil.h.orig Mon Apr 7 21:03:22 2003 ++++ shapefil.h Fri Jan 12 01:46:29 2007 +@@ -115,6 +115,8 @@ + */ + + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> + + #ifdef USE_DBMALLOC + #include <dbmalloc.h> diff --git a/devel/shapelib/files/patch-shputils.c b/devel/shapelib/files/patch-shputils.c new file mode 100644 index 000000000000..11ebe51b0d65 --- /dev/null +++ b/devel/shapelib/files/patch-shputils.c @@ -0,0 +1,20 @@ +--- shputils.c.orig Mon Apr 7 21:03:22 2003 ++++ shputils.c Tue Dec 12 21:28:33 2006 +@@ -274,7 +274,7 @@ + if (factor == 0) + { + if (infactor ==0) +- { puts("ERROR: Input unit must be defined before output unit"); exit(); } ++ { puts("ERROR: Input unit must be defined before output unit"); exit( 1 ); } + factor=infactor/outfactor; + } + printf("Output file coordinate values will be factored by %lg\n",factor); +@@ -319,7 +319,7 @@ + { + ti = DBFGetFieldCount( hDBF ); + showitems(); +- exit(0); ++ exit( 0 ); + } + + if (iclip) check_theme_bnd(); diff --git a/devel/shapelib/pkg-plist b/devel/shapelib/pkg-plist index 0d23fe02cc2a..12857d64d04a 100644 --- a/devel/shapelib/pkg-plist +++ b/devel/shapelib/pkg-plist @@ -1,9 +1,29 @@ +bin/shpcreate +bin/shpadd +bin/shpdump +bin/shprewind +bin/dbfcreate +bin/dbfadd +bin/dbfdump +bin/shptest +bin/shputils +bin/shptreedump +bin/dbfcat +bin/dbfinfo +bin/shpcat +bin/shpdxf +bin/shpfix +%%PROJ4%%bin/shpcentrd +%%PROJ4%%bin/shpdata +%%PROJ4%%bin/shpinfo +%%PROJ4%%bin/shpproj +%%PROJ4%%bin/shpwkb include/shapefil.h lib/libshp.a lib/libshp.la lib/libshp.so lib/libshp.so.1 -share/doc/shapelib/dbf_api.html -share/doc/shapelib/shapelib.html -share/doc/shapelib/shp_api.html -@dirrm share/doc/shapelib +%%PORTDOCS%%%%DOCSDIR%%/dbf_api.html +%%PORTDOCS%%%%DOCSDIR%%/shapelib.html +%%PORTDOCS%%%%DOCSDIR%%/shp_api.html +%%PORTDOCS%%@dirrm %%DOCSDIR%% |