debian/0000755000000000000000000000000011762627436007204 5ustar debian/changelog0000644000000000000000000000672611762624352011063 0ustar shapelib (1.2.10-7) unstable; urgency=low * Team Upload * Remove patch 0001 (Disable proj_api.h include), this was never used * Apply patch from Simon Ruderich to use all hardening flags (Closes: #672465) -- Arto Jantunen Sun, 03 Jun 2012 12:01:04 +0300 shapelib (1.2.10-6) unstable; urgency=low * Team Upload * Update to the dh tool (and debhelper compat 9) * Stop distributing libtool .la file * Enable multiarch (Closes: #670632) * Update Standards-Version, no (further) changes * Add section to the source package (thanks lintian) * Modify short description to not start with an article (thanks lintian) * Add Vcs-* fields to debian/control * Convert to source-format 3.0 (quilt) * Update libtool patch to fully use system libtool without any kludges (Closes: #316945) * Add patch to dynamically link the shp* binaries to libshp * Add patch to stop setting CFLAGS in the Makefile, allowing debhelper to set it instead -- Arto Jantunen Tue, 08 May 2012 22:59:51 +0300 shapelib (1.2.10-5) unstable; urgency=low * Long due upload. * Maintainership moved to DebianGis team. Thanks Noèl. * Policy changed to 3.8.3. * Debhelper level set to 7. * debian/rules revised to use dh_install and dh_prep. * debian/control now has better descriptions. * debian/control variables changed to 3.7+ versions. * debian/watch revised. (closes: #539342) * Fixed debian/changelog typo. * Added copyright notice in debian/control. * Removed obsolete (?) man2html build-dep. * Ack previous couple of NMUs, as merged. (closes: #553256, #497160) * Long descriptions revised. (closes: #556606) -- Francesco Paolo Lovergine Sun, 29 Nov 2009 08:46:41 +0100 shapelib (1.2.10-3) unstable; urgency=low * closing fixed NMU bug (closes: Bug#308238) * Updated Standards-Version * added watch file -- Noèl Köthe Fri, 08 Apr 2005 10:51:19 +0200 shapelib (1.2.10-2.1) unstable; urgency=low * Non-maintainer upload. * Bug fix: "libshp1: Segfault when freeing a buffer in DBFClose().", thanks to M Joonas Pihlaja (Closes: #308238). * Change section of libshp-dev to libdevel to match override -- Frank Lichtenheld Mon, 16 May 2005 23:02:24 +0200 shapelib (1.2.10-2) unstable; urgency=low * added dbfmtsafe.patch from M Joonas Pihlaja Thanks alot Joonas! * added manpages from M Joonas Pihlaja Thanks for your work Joonas! (closes: Bug#148037) -- Noèl Köthe Fri, 08 Apr 2005 10:51:19 +0200 shapelib (1.2.10-1) unstable; urgency=low * new upstream release * upstream fixed crashs when there's no .shx file (closes: Bug#219703) * updated shapelib homepage URL in control and copyright * updated my name to correct spelling * updated Standards-Version * added /usr/bin/shprewind to the package -- Noèl Köthe Fri, 09 Apr 2004 16:27:05 +0200 shapelib (1.2.9-3) unstable; urgency=low * corrected description (closes: Bug#163766) -- Noel Koethe Mon, 14 Oct 2002 20:02:00 +0200 shapelib (1.2.9-2) unstable; urgency=low * corrected libary dependency (shapelib1->libshp1) -- Noel Koethe Sun, 18 Aug 2002 16:33:00 +0200 shapelib (1.2.9-1) unstable; urgency=low * Initial Release. (Closes: Bug#146385) -- Noel Koethe Thu, 9 May 2002 13:34:01 +0200 debian/compat0000644000000000000000000000000211762624352010374 0ustar 9 debian/control0000644000000000000000000000356211762624352010607 0ustar Source: shapelib Priority: optional Section: libs Maintainer: Debian GIS Project Uploaders: Francesco Paolo Lovergine Build-Depends: debhelper (>= 9), libtool Standards-Version: 3.9.3 Homepage: http://shapelib.maptools.org/ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-grass/shapelib.git Vcs-Git: git://anonscm.debian.org/pkg-grass/shapelib.git Package: shapelib Section: graphics Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Multi-Arch: foreign Description: Library for reading and writing ArcView Shapefiles - tools The Shapefile format is a working and interchange format promoted by ESRI for simple vector data with attributes. It is apparently the only file format that can be edited in ARCView 2/3, and can also be exported and imported in Arc/Info. . This package contains a useful set of tools to manage shapefiles. Package: libshp-dev Section: libdevel Architecture: any Depends: libshp1 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: Library for reading and writing ArcView Shapefiles - development files The Shapefile format is a working and interchange format promoted by ESRI for simple vector data with attributes. It is apparently the only file format that can be edited in ARCView 2/3, and can also be exported and imported in Arc/Info. . This package includes the development files. Package: libshp1 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same Description: Library for reading and writing ArcView Shapefiles The Shapefile format is a working and interchange format promoted by ESRI for simple vector data with attributes. It is apparently the only file format that can be edited in ARCView 2/3, and can also be exported and imported in Arc/Info. . This package includes the shared library. debian/copyright0000644000000000000000000000065411762624352011136 0ustar This package was debianized by Noèl Köthe on Thu, 9 May 2002 13:34:01 +0200. It was downloaded from http://shapelib.maptools.org/ Upstream Author: Frank Warmerdam Copyright: Copyright (c) 1999, Frank Warmerdam. Copyright (c) 1999 Carl Anderson. Copyright (C) 1992, 1996 Free Software Foundation, Inc. Released under the terms of the LGPL; see /usr/share/common-licenses/LGPL. debian/dirs0000644000000000000000000000002111762624352010053 0ustar usr/bin usr/sbin debian/docs0000644000000000000000000000001411762624352010044 0ustar README.tree debian/libshp-dev.dirs0000644000000000000000000000002411762624352012112 0ustar usr/lib usr/include debian/libshp-dev.install0000644000000000000000000000006111762624352012620 0ustar usr/include/* usr/lib/*/lib*.a usr/lib/*/lib*.so debian/libshp1.dirs0000644000000000000000000000001011762624352011412 0ustar usr/lib debian/libshp1.install0000644000000000000000000000002411762624352012124 0ustar usr/lib/*/lib*.so.* debian/patches/0000755000000000000000000000000011762624352010625 5ustar debian/patches/0001-Add-manpages.patch0000644000000000000000000005772611762624352014526 0ustar From: M Joonas Pihlaja Date: Fri, 8 Apr 2005 10:51:19 +0200 Subject: [PATCH] Add manpages Debian-bug: http://bugs.debian.org/148037 --- man/Makefile | 16 +++ man/dbfadd.1 | 61 +++++++++++ man/dbfcreate.1 | 88 +++++++++++++++ man/dbfdump.1 | 111 +++++++++++++++++++ man/shpadd.1 | 85 +++++++++++++++ man/shpcreate.1 | 68 ++++++++++++ man/shpdump.1 | 316 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ man/shprewind.1 | 88 +++++++++++++++ man/shptest.1 | 89 ++++++++++++++++ 9 files changed, 922 insertions(+), 0 deletions(-) create mode 100644 man/Makefile create mode 100644 man/dbfadd.1 create mode 100644 man/dbfcreate.1 create mode 100644 man/dbfdump.1 create mode 100644 man/shpadd.1 create mode 100644 man/shpcreate.1 create mode 100644 man/shpdump.1 create mode 100644 man/shprewind.1 create mode 100644 man/shptest.1 diff --git a/man/Makefile b/man/Makefile new file mode 100644 index 0000000..1bf4918 --- /dev/null +++ b/man/Makefile @@ -0,0 +1,16 @@ +SOURCES=dbfdump.1 dbfcreate.1 dbfadd.1 shpdump.1 shpadd.1 shpcreate.1 shprewind.1 shptest.1 +TARGETS=$(addsuffix .cat, $(SOURCES)) $(addsuffix .ps, $(SOURCES)) $(addsuffix .html, $(SOURCES)) + +%.1.cat: %.1 + groff -man -Tascii $^ >$@ + +%.1.ps: %.1 + groff -man -Tps $^ >$@ + +%.1.html: %.1 + man2html $^ >$@ + +all: $(TARGETS) + +clean: + $(RM) *.1.cat *.1.ps *.1.html *~ diff --git a/man/dbfadd.1 b/man/dbfadd.1 new file mode 100644 index 0000000..fea9a8a --- /dev/null +++ b/man/dbfadd.1 @@ -0,0 +1,61 @@ +.\" Process this file with +.\" groff -man -Tascii dbfadd.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +dbfadd \- add a row to an xBase DBF file +.SH SYNOPSIS +.B dbfadd +.I filename fieldvalues... +.SH DESCRIPTION +Adds a row to the DBF file named by +.I filename +with column values given by the +.I fieldvalues +options that follow. A +.B NULL +value is denoted by an empty argument. +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +Missing +.I filename +or +.I fieldvalues +arguments. +.TP +.B 2 +Failed to open +.I filename +for reading and appending. +.TP +.B 3 +Too few values in +.I fieldvalues... +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI DBFOpen( filename ",""rb+"") failed." +.TP +.RI Got\ count1 " fields, but require " count2 +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. +Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote this man page. +.SH BUGS +Field values that are too large to fit in a field are silently +truncated from the right. Numeric field values that can't be parsed by +.BR atof (3) +get undefined values. +.SH "SEE ALSO" +.BR dbfcreate (1), +.BR dbfdump (1), +.BR dbf_dump (1), +.BR shpadd (1), +.BR shpcreate (1), +.BR shpdump (1), +.BR shprewind (1) diff --git a/man/dbfcreate.1 b/man/dbfcreate.1 new file mode 100644 index 0000000..58436e5 --- /dev/null +++ b/man/dbfcreate.1 @@ -0,0 +1,88 @@ +.\" Process this file with +.\" groff -man -Tascii dbfcreate.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +dbfcreate \- Create an empty xBase DBF file +.SH SYNOPSIS +.B dbfcreate +.IR "filename" "[[\-s " "fieldname width" "] | [\-n " "fieldname width decimals" ]] ... +.SH DESCRIPTION +Creates an empty DBF file called +.I filename +with columns described by all the +.B \-s +and +.B \-n +options that follow. +.SH OPTIONS +.TP +.BI "\-s " "fieldname width" +adds a column named +.I fieldname +taking textual values of at most +.I width +characters. +.TP +.BI \-n\ fieldname\ width\ decimals +adds a column named +.I fieldname +taking numeric values of at most +.I width +digits and precision of at most +.I decimals +decimal places. The number of digits of precision should be included in +.IR width . +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +Missing +.I filename +argument. +.TP +.B 2 +Failed to create the file +.I filename +for writing. +.TP +.B 3 +Missing +.IR fieldname , width ", or " decimals +argument for a +.B \-s +or +.B \-n +option. +.TP +.B 4 +Failed to add a column given by a +.B \-s +or +.B \-n +option. +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI DBFCreate( filename ") failed." +.TP +.RI DBFAddField( fieldname ",FTString," width ",0) failed." +.TP +.RI DBFAddField( fieldname ",FTDouble," width "," decimals ") failed." +.TP +.RI "Argument incomplete, or unrecognised: " arg +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. +Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote this man page. +.SH "SEE ALSO" +.BR dbfadd (1), +.BR dbfdump (1), +.BR dbf_dump (1), +.BR shpadd (1), +.BR shpcreate (1), +.BR shpdump (1), +.BR shprewind (1) diff --git a/man/dbfdump.1 b/man/dbfdump.1 new file mode 100644 index 0000000..e7a8574 --- /dev/null +++ b/man/dbfdump.1 @@ -0,0 +1,111 @@ +.\" Process this file with +.\" groff -man -Tascii dbfdump.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +dbfdump \- dump xBase DBF files as text +.SH SYNOPSIS +.B dbfdump [\-h] [\-m] [\-r] +.I file +.SH DESCRIPTION +Dumps the contents of +.I file +to standard output. The first line contains the field names appearing +in +.I file, +and each of the following lines contains the field values of a +record. Field names and values are padded by spaces to their field +widths. Empty fields are printed as the string "(NULL)". +.SH OPTIONS +.TP +.B \-h +Prints the column field definitions before other output. Each field +definition consists of a line of the form + +.RI "Field: " index ", Type=" type ", Title=`" "name" "', Width=" "width" ", Decimals=" precision + +where +.I index +is the zero offset column number of the field; the +.I type +indicates the datatype of the field value and is either "Integer", +"Real" or "String"; +.I name +is the field's name; +.I width +is the number of bytes reserved for the field's value; and +.I precision +is the number of decimal places of precision for "Real" type +fields, and is zero for "Integer" and "String" type fields. +.TP +.B \-m +Prints each record in multiline format separated by empty lines. +The first line of a record gives the number of the record in the form + +Records: +.I record_index + +where +.I record_index +is the zero offset number of the record in the file, and +then each field of the record appears on its own line in the format + +.IR name : +.I value + +.TP +.B \-r +Prints the exact bytes occurring in +.I file +for field values and suppresses printing "(NULL)" for +empty values. +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +Missing +.I file +argument. +.TP +.B 2 +Failed to open +.I file. +.TP +.B 3 +There are no fields in +.I file. +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI DBFOpen( file ",""r"") failed." +.TP +There are no fields in this table! +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote +this man page. +.SH BUGS +Unless the +.B \-r +option is given, values in numeric fields that overflow the +.B int +or +.B double +types of the +.B C +language are printed as plus or minus a huge number. For integer +fields the huge value is +.B HUGE_VALL +from and for real fields it is +.BR HUGE_VALF . +.SH "SEE ALSO" +.BR dbf_dump (1), +.BR dbfcreate (1), +.BR dbfadd (1), +.BR shpadd (1), +.BR shpcreate (1), +.BR shpdump (1), +.BR shprewind (1) diff --git a/man/shpadd.1 b/man/shpadd.1 new file mode 100644 index 0000000..f57576a --- /dev/null +++ b/man/shpadd.1 @@ -0,0 +1,85 @@ +.\" Process this file with +.\" groff -man -Tascii shpadd.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +shpadd \- append a shape to an ESRI shapefile +.SH SYNOPSIS +.B shpadd +.I file +.RI "[[" "x y" "] [+]]*" +.SH DESCRIPTION +Appends a shape to the shapefile determined from +.IR file . +The geometric data of the new shape consists of lists of +.I X/Y +points on the command line grouped into +.IR parts , +with points in different parts separated by a plus +.RB ( + ) +sign. If no points or parts are given then a shape of type +.B NullShape +is appended to the shapefile, and otherwise the type of the new shape +is determined by the shapefile's header. See +.BR shpdump (1) +for a description of shape types and how geometric data for parts are +interpreted for a specific type. No geometric restrictions set by the +shapefile specification are enforced by +.BR shpadd (1). + +Shapefiles actually consist of two files with the same basename and +extensions +.BR .shp \ and\ .shx " (or " .SHP \ and\ .SHX ") " +containing the shape data and shape index respectively. The files +to open are determined by first stripping any filename extension +from +.I file +and attempting to open the files +.IB file .shp +or +.IB file .SHP, +and +.IB file .shx +or +.IB file .SHX +for the respective data and index files. + +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +Missing +.I file +argument, the shapefile can't be opened, or the program +ran out of memory. +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI "Unable to open:" file +.TP +.RI "Out of memory" +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote +this man page. +.SH BUGS +Coordinate values that can't be +be parsed by +.BR sscanf (3) +get undefined values. There's no way to give measure or +.I Z +data to vertices in a shape, but those are always set to zero +if the shapefile's shape type requires those values. +.B MultiPatch +shape types aren't supported. +.SH "SEE ALSO" +.BR dbfadd (1), +.BR dbfcreate (1), +.BR dbfdump (1), +.BR dbf_dump (1), +.BR shpcreate (1), +.BR shpdump (1), +.BR shprewind (1) diff --git a/man/shpcreate.1 b/man/shpcreate.1 new file mode 100644 index 0000000..4fa69a8 --- /dev/null +++ b/man/shpcreate.1 @@ -0,0 +1,68 @@ +.\" Process this file with +.\" groff -man -Tascii shpcreate.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +shpcreate \- create an empty ESRI shapefile +.SH SYNOPSIS +.B shpcreate +.I file shapetype +.SH DESCRIPTION +Creates an empty shapefile supporting shapes of the given type +.IR shapetype . +Shapefiles actually consist of two files with the same basename and +extensions +.BR .shp \ and\ .shx " (or " .SHP \ and\ .SHX ") " +containing the shape data and shape index respectively. The files +to create are determined by first stripping any filename extension +from +.I file +and attempting to create the files +.IB file .shp +or +.IB file .SHP, +and +.IB file .shx +or +.IB file .SHX +for the respective data and index files. The supported values for the +.I shapetype +argument are: +.BR point ", " arc ", " polygon ", and " multipoint . +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +Missing +.I file +or +.I shapetype +argument. +.TP +.B 2 +Unknown +.IR shapetype . +.TP +.B 3 +Unable to create the shapefile. +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI "Shape Type `" shapetype "' not recognised." +.TP +.RI "Unable to create:" file +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote +this man page. +.SH "SEE ALSO" +.BR dbfadd (1), +.BR dbfcreate (1), +.BR dbfdump (1), +.BR dbf_dump (1), +.BR shpadd (1), +.BR shpdump (1), +.BR shprewind (1) diff --git a/man/shpdump.1 b/man/shpdump.1 new file mode 100644 index 0000000..455d702 --- /dev/null +++ b/man/shpdump.1 @@ -0,0 +1,316 @@ +.\" Process this file with +.\" groff -man -Tascii shpdump.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +shpdump \- dump an ESRI shapefile as text +.SH SYNOPSIS +.B shpdump [\-validate] +.I file +.SH DESCRIPTION +Prints the contents of the shapefile +.I file +to standard output in textual format. Shapefiles actually consist +of two files with the same basename and extensions +.BR .shp \ and\ .shx " (or " .SHP \ and\ .SHX ") " +containing the shape data and shape index respectively. The files +to open are determined by first stripping any filename extension +from +.I file +and attempting to open the files +.IB file .shp +or +.IB file .SHP, +and +.IB file .shx +or +.IB file .SHX +for the respective data and index files. + +Output consists of a header giving number and type of shapes in the +file and the bounds for the minimum and maximum +.IR X ,\ Y ,\ Z ", and " M +values appearing in the shapes. The header is followed by the +geometric data for each shape in the file. All shapes in the file +should be of the same type, except that +.B NullShape +typed shapes may be intermixed with any other type. The header has +the form +.RS + +Shapefile Type: +.I type +# of Shapes: +.I count + +File Bounds: +.RI ( minX , minY , minZ , minM ) + to\ +.RI ( maxX , maxY , maxZ , maxM ) + +.RE +See section +.B SHAPE TYPES +below for the list of possible shape types. + +Next for each shape in the file a header giving +it's +.IR shape_index , +it's type +.IR type , +number of vertices +.IR nVertices , +number of parts +.IR nParts , +and bounding box is given, followed by the vertex data of each part. +.RS + +Shape:\ +.IR shape_index \ ( type )\ nVertices= nVertices ,\ nParts= nParts + Bounds: +.RI ( minX , minY , minZ , minM ) + to\ +.RI ( maxX , maxY , maxZ , maxM ) + +.RI " " "vertices of the first part" + +.RI "+ " "vertices of the second part..." + +.RI "+ " "vertices of the last part" + +.RE +The +.I shape_index +of a shape is the number of the shape starting from zero in the shape +file. Each vertex has the form +.RS + +.RI ( X , Y , Z , M ) + +.RE +If there are multiple parts then the type of the part is appended +appended to first vertex of each part, and the first vertex of the +second and following parts is preceded by a plus +.RB ( + ) +sign. The part type is +.B Ring +for all shape types except +.B MultiPatch +where it is the type of a surface patch. See below for the description +of possible part types. +.SH SHAPE TYPES +Each type of shape except +.B MultiPatch +typed shapes comes in three flavours: The normal unsuffixed type, where +points lie in +.IR X/Y -space; +a type with suffix +.B M +where points lie in +.IR X/Y -space +and additionally have a +.I measure +value in +.IR M -space; +and finally a type with suffix +.B Z +where points lie in +.IR X/Y/Z -space +and also have a measure value in +.IR M -space. +.\" +.TP +.B NullShape +A shape without data. Shapes of this type may be intermixed with +other shapes and are sometimes used to represented deleted or missing +geometric data for a shape. +.\" +.TP +.B Point " or " PointZ " or " PointM +A single point. +.\" +.TP +.BR Arc " or " ArcZ " or " ArcM +Piecewise linear paths. Shapes of this type may consist of multiple +parts which may or may not intersect and/or connect. Arcs are called +.BR PolyLine s +in the shapefile specification. +.\" +.TP +.BR Polygon " or " PolygonZ " or " PolygonM +Polygon shapes consist of one or more parts, called +.IR rings , +that each define a closed path. Rings must contain at least four +vertices with the first and last vertices being equal, and must not +self-intersect. For shapes of type +.BR Polygon , +the rings define a polygon with optional holes by giving the vertices +of inner rings a counterclockwise orientation and the vertices of +outer rings a clockwise orientation. Intersection and orientation +is always computed in +.IR X/Y -space +and never in +.IR X/Y/M -space. +.\" +.TP +.BR MultiPoint " or " MultiPointZ " or " MultiPointM +A set of points. +.\" +.TP +.BR MultiPatch +A +.B MultiPatch +represents one or more surfaces in +.IR X/Y/Z -space, +and consists of a number of parts called it's +.IR "surface patches" . +Each surface patch describes a either a surface or a hole in another +surface, depending on the type of the patch. Patches may share a +common boundary but may not otherwise intersect. The type of a patch +may be one of +.RS +.TP +.B TriangleStrip +A set of connected triangles. The first three points +define the first triangle and every following point defines +a new triangle using the new point and the two previous points. +.TP +.B TriangleFan +A set of connected triangles. The first three points define the first +triangle and every following point defines a new triangle using the +previous point, the current point, and the first point, thus forming a +fan of triangles around the first point. +.TP +.B OuterRing +The outer ring of a sequence of rings defining a polygon with holes. +All following parts of type +.B InnerRing +are taken to be the holes of the polygon. The sequence of rings +ends with the first +.RB non- InnerRing +typed part or the part of the shape, whichever comes first. +.TP +.B InnerRing +An inner ring in a sequence of rings defining a polygon with holes. +This type of part may only follow an +.B OuterRing +or other +.B InnerRing +typed parts. +.TP +.B FirstRing +The first in a sequence of rings defining a polygon of +unspecified type. The following parts of type +.B Ring +defines the other rings in the polygon. This type of part is used when +the innerness or outerness of a polygon isn't known or applicable. The sequence of rings +defining the polygon ends with the first +.BR non- Ring +typed part or the last part of the shape, whichever comes first. +.TP +.B Ring +A ring in a sequence of rings defining a polygon of unspecified type. +It may only follow a +.B FirstRing +or other +.B Ring +typed parts. +.TP +.B UknownPartType +This type is returned for parts whose type isn't recognised. +.RE +.\" +.TP +.B UnknownShapeType +This type is returned for shapes whose type isn't recognised. +.SH OPTIONS +.TP +.B \-validate +Performs validation on the orientation of inner and outer rings in +.BR Polygon ", " PolygonZ ", and " PolygonM +objects. According to the shapefile specification outer rings should +be given a clockwise orientation, and inner rings that define holes a +counterclockwise orientation. If some rings of a shape are oriented +the wrong way around then the following message is output after +dumping that shape: + +.IR count " rings wound in the wrong direction." + +In addition the total number of shapes with problem rings is output +after the last shape has been dumped: + +.IR count " object has invalid ring orderings." + +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +No shapefile +.I file +was given or it couldn't be opened. +.SH EXAMPLE +.PP +.RS +$ shpdump shapefile.shp + +Shapefile Type: Arc # of Shapes: 3 + +File Bounds: ( 3531586.750, 7253086.100,0,0) + to ( 3536417.463, 7778375.875,0,0) + +Shape:0 (Arc) nVertices=2, nParts=1 + Bounds:( 3536397.797, 7253086.100, 0, 0) + to ( 3536417.463, 7253163.597, 0, 0) + ( 3536397.797, 7253163.597, 0, 0) Ring + ( 3536417.463, 7253086.100, 0, 0) + +Shape:1 (Arc) nVertices=3, nParts=1 + Bounds:( 3458966.390, 7373335.808, 0, 0) + to ( 3459141.856, 7373474.681, 0, 0) + ( 3458966.390, 7373474.681, 0, 0) Ring + ( 3458979.042, 7373466.273, 0, 0) + ( 3459141.856, 7373335.808, 0, 0) + +Shape:2 (Arc) nVertices=7, nParts=1 + Bounds:( 3531586.750, 7777880.500, 0, 0) + to ( 3532930.206, 7778375.875, 0, 0) + ( 3531586.750, 7777880.500, 0, 0) Ring + ( 3532228.265, 7778072.455, 0, 0) + ( 3532310.897, 7778119.445, 0, 0) + ( 3532367.866, 7778144.877, 0, 0) + ( 3532440.559, 7778168.920, 0, 0) + ( 3532506.504, 7778190.785, 0, 0) + ( 3532930.206, 7778375.875, 0, 0) + +$ +.RE +.PP +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI "Unable to open:" file +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote +this man page. +.SH BUGS +The +.B \-validate +option supports only one outer ring in a polygonal shape +and assumes that the first ring in a shape is the outer ring. It doesn't support +polygons inside +.B MultiPatch +shapes. The +.IR X " and " Y +coordinates of a point are printed to three decimal places only. +.SH "SEE ALSO" +.BR dbfadd (1), +.BR dbfcreate (1), +.BR dbfdump (1), +.BR dbf_dump (1), +.BR shpadd (1), +.BR shpcreate (1), +.BR shprewind (1) diff --git a/man/shprewind.1 b/man/shprewind.1 new file mode 100644 index 0000000..00200f0 --- /dev/null +++ b/man/shprewind.1 @@ -0,0 +1,88 @@ +.\" Process this file with +.\" groff -man -Tascii shprewind.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +shprewind \- fix polygon ring orientations in ESRI shapefiles +.SH SYNOPSIS +.B shprewind +.I infile outfile +.SH DESCRIPTION +Makes a copy of the shapefile +.I infile +to +.I outfile +and fixes the orientation of points in the rings of +.BR Polygon ", " PolygonZ ", and " PolygonM +typed shapes to conform to the shapefile specification. According to the +specification, the vertices of outer rings should be oriented +clockwise on the +.I X/Y +plane, and those of inner rings counterclockwise. + +Shapefiles actually consist of two files with the same basename and +extensions +.BR .shp \ and\ .shx " (or " .SHP \ and\ .SHX ") " +containing the shape data and shape index respectively. The files +to open are determined by first stripping any filename extension +from +.I infile +and attempting to open the files +.IB infile .shp +or +.IB infile .SHP, +and +.IB infile .shx +or +.IB infile .SHX +for the respective data and index files. The files to create +from +.I outfile +are determined by stripping any filename extension from +.I outfile +and appending +.B .shp +and +.B .shx +suffixes for the respective data and index files. +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +Missing +.I infile +or +.I outfile +arguments, failed to open shapefile +.I infile +or create shapefile +.IR outfile. +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI "Unable to open:" infile +.TP +.RI "Unable to create:" outfile +.TP +.IR count " objects rewound." +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote +this man page. +.SH BUGS +The implementation assumes that there is at most one outer ring in +each shape, that it is the first ring in a shape, and all other +rings in a shape are inner rings. Polygons inside +.B MultiPatch +shape types aren't rewound. +.SH "SEE ALSO" +.BR dbfadd (1), +.BR dbfcreate (1), +.BR dbfdump (1), +.BR dbf_dump (1), +.BR shpadd (1), +.BR shpcreate (1), +.BR shpdump (1) diff --git a/man/shptest.1 b/man/shptest.1 new file mode 100644 index 0000000..7ab016e --- /dev/null +++ b/man/shptest.1 @@ -0,0 +1,89 @@ +.\" Process this file with +.\" groff -man -Tascii shptest.1 +.\" +.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands" +.SH NAME +shptest \- create some shapefiles for testing +.SH SYNOPSIS +.B shptest +.I num +.SH DESCRIPTION +Writes out a shapefile consisting of files +.RI test num .shp +and +.RI test num .shx +in the current directory. The +.I num +argument specifies the type of shapes in the shapefile to create and takes +values from: +.TP +.B 0 +.B NullShape +.TP +.B 1 +.B Point +.TP +.B 2 +.B PointZ +.TP +.B 3 +.B PointM +.TP +.B 4 +.B MultiPoint +.TP +.B 5 +.B MultiPointZ +.TP +.B 6 +.B MultiPointM +.TP +.B 7 +.B Arc +.TP +.B 8 +.B ArcZ +.TP +.B 9 +.B ArcM +.TP +.B 10 +.B Polygon +.TP +.B 11 +.B PolygonZ +.TP +.B 12 +.B PolygonM +.TP +.B 13 +.B MultiPatch +.SH EXIT STATUS +.TP +.B 0 +Successful program execution. +.TP +.B 1 +Missing argument. +.TP +.B 10 +Test +.RI ` num ' +not recognised. +.SH DIAGNOSTICS +The following diagnostics may be issued on stdout: +.TP +.RI "Test `" num "' not recognised." +.SH AUTHORS +Frank Warmerdam (warmerdam@pobox.com) is the maintainer of the +.B shapelib +shapefile library. Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote +this man page. +.SH "SEE ALSO" +.BR dbfadd (1), +.BR dbfcreate (1), +.BR dbfdump (1), +.BR dbf_dump (1), +.BR shpcreate (1), +.BR shpdump (1), +.BR shprewind (1) -- debian/patches/0002-Thread-safety-fixes.patch0000644000000000000000000001417511762624352016051 0ustar From: M Joonas Pihlaja Date: Fri, 8 Apr 2005 10:51:19 +0200 Subject: [PATCH] Thread safety fixes --- dbfopen.c | 60 +++++++++++++++++++++++++++++++++--------------------------- shapefil.h | 5 +++++ 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/dbfopen.c b/dbfopen.c index 43b25ac..178ae18 100644 --- a/dbfopen.c +++ b/dbfopen.c @@ -197,8 +197,6 @@ static char rcsid[] = # define TRUE 1 #endif -static int nStringFieldLen = 0; -static char * pszStringField = NULL; /************************************************************************/ /* SfRealloc() */ @@ -431,6 +429,12 @@ DBFOpen( const char * pszFilename, const char * pszAccess ) psDBF->panFieldOffset[iField-1] + psDBF->panFieldSize[iField-1]; } +/* -------------------------------------------------------------------- */ +/* Initialize our temporary input fields. */ +/* -------------------------------------------------------------------- */ + psDBF->nStringFieldLen = 0; + psDBF->pszStringField = NULL; + return( psDBF ); } @@ -489,14 +493,12 @@ DBFClose(DBFHandle psDBF) free( psDBF->pszHeader ); free( psDBF->pszCurrentRecord ); - free( psDBF ); - - if( pszStringField != NULL ) + if( psDBF->pszStringField != NULL ) { - free( pszStringField ); - pszStringField = NULL; - nStringFieldLen = 0; + free( psDBF->pszStringField ); } + + free( psDBF ); } /************************************************************************/ @@ -571,6 +573,12 @@ DBFCreate( const char * pszFilename ) psDBF->bNoHeader = TRUE; +/* --------------------------------------------------------------------*/ +/* Initialize our temporary input fields.*/ +/* --------------------------------------------------------------------*/ + psDBF->nStringFieldLen = 0; + psDBF->pszStringField = NULL; + return( psDBF ); } @@ -691,7 +699,6 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField, unsigned char *pabyRec; void *pReturnField = NULL; - static double dDoubleField; /* -------------------------------------------------------------------- */ /* Verify selection. */ @@ -734,30 +741,31 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField, /* -------------------------------------------------------------------- */ /* Ensure our field buffer is large enough to hold this buffer. */ /* -------------------------------------------------------------------- */ - if( psDBF->panFieldSize[iField]+1 > nStringFieldLen ) + if( psDBF->panFieldSize[iField]+1 > psDBF->nStringFieldLen ) { - nStringFieldLen = psDBF->panFieldSize[iField]*2 + 10; - pszStringField = (char *) SfRealloc(pszStringField,nStringFieldLen); + psDBF->nStringFieldLen = psDBF->panFieldSize[iField]*2 + 10; + psDBF->pszStringField = (char *) SfRealloc(psDBF->pszStringField, + psDBF->nStringFieldLen); } /* -------------------------------------------------------------------- */ /* Extract the requested field. */ /* -------------------------------------------------------------------- */ - strncpy( pszStringField, + strncpy( psDBF->pszStringField, ((const char *) pabyRec) + psDBF->panFieldOffset[iField], psDBF->panFieldSize[iField] ); - pszStringField[psDBF->panFieldSize[iField]] = '\0'; + psDBF->pszStringField[psDBF->panFieldSize[iField]] = '\0'; - pReturnField = pszStringField; + pReturnField = psDBF->pszStringField; /* -------------------------------------------------------------------- */ /* Decode the field. */ /* -------------------------------------------------------------------- */ if( chReqType == 'N' ) { - dDoubleField = atof(pszStringField); + psDBF->dDoubleField = atof(psDBF->pszStringField); - pReturnField = &dDoubleField; + pReturnField = &psDBF->dDoubleField; } /* -------------------------------------------------------------------- */ @@ -768,7 +776,7 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField, { char *pchSrc, *pchDst; - pchDst = pchSrc = pszStringField; + pchDst = pchSrc = psDBF->pszStringField; while( *pchSrc == ' ' ) pchSrc++; @@ -776,7 +784,7 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField, *(pchDst++) = *(pchSrc++); *pchDst = '\0'; - while( pchDst != pszStringField && *(--pchDst) == ' ' ) + while( pchDst != psDBF->pszStringField && *(--pchDst) == ' ' ) *pchDst = '\0'; } #endif @@ -1351,9 +1359,6 @@ DBFReadTuple(DBFHandle psDBF, int hEntity ) { int nRecordOffset; unsigned char *pabyRec; - static char *pReturnTuple = NULL; - - static int nTupleLen = 0; /* -------------------------------------------------------------------- */ /* Have we read the record? */ @@ -1375,14 +1380,15 @@ DBFReadTuple(DBFHandle psDBF, int hEntity ) pabyRec = (unsigned char *) psDBF->pszCurrentRecord; - if ( nTupleLen < psDBF->nRecordLength) { - nTupleLen = psDBF->nRecordLength; - pReturnTuple = (char *) SfRealloc(pReturnTuple, psDBF->nRecordLength); + if ( psDBF->nStringFieldLen < psDBF->nRecordLength) { + psDBF->nStringFieldLen = psDBF->nRecordLength; + psDBF->pszStringField = (char *) SfRealloc(psDBF->pszStringField, + psDBF->nRecordLength); } - memcpy ( pReturnTuple, pabyRec, psDBF->nRecordLength ); + memcpy ( psDBF->pszStringField, pabyRec, psDBF->nRecordLength ); - return( pReturnTuple ); + return( psDBF->pszStringField ); } /************************************************************************/ diff --git a/shapefil.h b/shapefil.h index 19ba921..0244ba1 100644 --- a/shapefil.h +++ b/shapefil.h @@ -401,6 +401,11 @@ typedef struct int bNoHeader; int bUpdated; + + int nStringFieldLen; + char *pszStringField; + + double dDoubleField; } DBFInfo; typedef DBFInfo * DBFHandle; -- debian/patches/0003-Properly-use-libtool.patch0000644000000000000000000001001311762624352016271 0ustar From: Riku Voipio Date: Tue, 4 Nov 2008 14:46:56 +0200 Subject: [PATCH] Properly use libtool The problem is that shapelib throws away a seemingly good libtool linked library and replaces it with something hacks in together almost right. Bug-Debian: http://bugs.debian.org/497160 --- Makefile | 32 +++++--------------------------- 1 files changed, 5 insertions(+), 27 deletions(-) Index: shapelib-1.2.10/Makefile =================================================================== --- shapelib-1.2.10.orig/Makefile 2012-05-11 11:23:01.000000000 +0200 +++ shapelib-1.2.10/Makefile 2012-05-11 11:23:05.000000000 +0200 @@ -99,37 +99,15 @@ LIBSHP_VERSION=1.0.1 # still once to be changed manually (see for 1:1:0), sorry lib: - /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shpopen.c - gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c -fPIC -DPIC shpopen.c -o .libs/shpopen.lo - gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shpopen.c -o shpopen.o >/dev/null 2>&1 - mv -f .libs/shpopen.lo shpopen.lo - /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shptree.c - rm -f .libs/shptree.lo - gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c -fPIC -DPIC shptree.c -o .libs/shptree.lo - gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shptree.c -o shptree.o >/dev/null 2>&1 - mv -f .libs/shptree.lo shptree.lo - /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c dbfopen.c - rm -f .libs/dbfopen.lo - gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c -fPIC -DPIC dbfopen.c -o .libs/dbfopen.lo - gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c dbfopen.c -o dbfopen.o >/dev/null 2>&1 - mv -f .libs/dbfopen.lo dbfopen.lo - /bin/sh ./libtool --mode=link gcc -g -O2 -o libshp.la -rpath /usr/local/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo - rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.* - rm -fr .libs/libshp.lax - mkdir .libs/libshp.lax - /usr/bin/ld -G -h libshp.so.1 -o .libs/libshp.so.$(LIBSHP_VERSION) shpopen.lo shptree.lo dbfopen.lo -lc - - (cd .libs && rm -f libshp.so.1 && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so.1) - (cd .libs && rm -f libshp.so && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so) - ar cru .libs/libshp.a shpopen.o shptree.o dbfopen.o - ranlib .libs/libshp.a - rm -fr .libs/libshp.lax - (cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la) + libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. $(CPPFLAGS) $(CFLAGS) -c shpopen.c + libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. $(CPPFLAGS) $(CFLAGS) -c shptree.c + libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. $(CPPFLAGS) $(CFLAGS) -c dbfopen.c + libtool --mode=link gcc $(CFLAGS) $(LDFLAGS) -o libshp.la -rpath /usr/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo lib_install: cp .libs/libshp.la .libs/libshp.lai /bin/sh ./mkinstalldirs /usr/local/lib - /bin/sh ./libtool --mode=install /usr/bin/install -c libshp.la /usr/local/lib/libshp.la + libtool --mode=install /usr/bin/install -c libshp.la /usr/local/lib/libshp.la /usr/bin/install -c .libs/libshp.so.$(LIBSHP_VERSION) /usr/local/lib/libshp.so.$(LIBSHP_VERSION) (cd /usr/local/lib && rm -f libshp.so.1 && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so.1) (cd /usr/local/lib && rm -f libshp.so && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so) debian/patches/0004-Dynamically-link-the-shp-binaries-to-libshp.patch0000644000000000000000000000736011762624352022475 0ustar From: Arto Jantunen Date: Tue, 8 May 2012 14:19:20 +0300 Subject: [PATCH] Dynamically link the shp* binaries to libshp Also use CPPFLAGS and LDFLAGS, necessary for hardening flags. --- Makefile | 55 ++++++++++++++++++++++++------------------------------- 1 files changed, 24 insertions(+), 31 deletions(-) Index: shapelib-1.2.10/Makefile =================================================================== --- shapelib-1.2.10.orig/Makefile 2012-05-11 11:23:05.000000000 +0200 +++ shapelib-1.2.10/Makefile 2012-05-11 11:23:09.000000000 +0200 @@ -6,45 +6,36 @@ all: shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shptest -shpopen.o: shpopen.c shapefil.h - $(CC) $(CFLAGS) -c shpopen.c +shpcreate: shpcreate.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) shpcreate.c $(LINKOPT) -o shpcreate .libs/libshp.so -shptree.o: shptree.c shapefil.h - $(CC) $(CFLAGS) -c shptree.c +shpadd: shpadd.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) shpadd.c $(LINKOPT) -o shpadd .libs/libshp.so -dbfopen.o: dbfopen.c shapefil.h - $(CC) $(CFLAGS) -c dbfopen.c +shpdump: shpdump.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) shpdump.c $(LINKOPT) -o shpdump .libs/libshp.so -shpcreate: shpcreate.c shpopen.o - $(CC) $(CFLAGS) shpcreate.c shpopen.o $(LINKOPT) -o shpcreate +shprewind: shprewind.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) shprewind.c $(LINKOPT) -o shprewind .libs/libshp.so -shpadd: shpadd.c shpopen.o - $(CC) $(CFLAGS) shpadd.c shpopen.o $(LINKOPT) -o shpadd +dbfcreate: dbfcreate.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) dbfcreate.c $(LINKOPT) -o dbfcreate .libs/libshp.so -shpdump: shpdump.c shpopen.o - $(CC) $(CFLAGS) shpdump.c shpopen.o $(LINKOPT) -o shpdump +dbfadd: dbfadd.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) dbfadd.c $(LINKOPT) -o dbfadd .libs/libshp.so -shprewind: shprewind.c shpopen.o - $(CC) $(CFLAGS) shprewind.c shpopen.o $(LINKOPT) -o shprewind +dbfdump: dbfdump.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) dbfdump.c $(LINKOPT) -o dbfdump .libs/libshp.so -dbfcreate: dbfcreate.c dbfopen.o - $(CC) $(CFLAGS) dbfcreate.c dbfopen.o $(LINKOPT) -o dbfcreate +shptest: shptest.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) shptest.c $(LINKOPT) -o shptest .libs/libshp.so -dbfadd: dbfadd.c dbfopen.o - $(CC) $(CFLAGS) dbfadd.c dbfopen.o $(LINKOPT) -o dbfadd +shputils: shputils.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) shputils.c $(LINKOPT) -o shputils .libs/libshp.so -dbfdump: dbfdump.c dbfopen.o - $(CC) $(CFLAGS) dbfdump.c dbfopen.o $(LINKOPT) -o dbfdump - -shptest: shptest.c shpopen.o - $(CC) $(CFLAGS) shptest.c shpopen.o $(LINKOPT) -o shptest - -shputils: shputils.c shpopen.o dbfopen.o - $(CC) $(CFLAGS) shputils.c shpopen.o dbfopen.o $(LINKOPT) -o shputils - -shptreedump: shptreedump.c shptree.o shpopen.o - $(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o $(LINKOPT) \ - -o shptreedump +shptreedump: shptreedump.c .libs/libshp.so + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) shptreedump.c $(LINKOPT) \ + -o shptreedump .libs/libshp.so clean: rm -f *.o dbfdump dbfcreate dbfadd shpdump shpcreate shpadd shputils @@ -98,7 +89,9 @@ SHPLIB_VERSION=1.2.9 LIBSHP_VERSION=1.0.1 # still once to be changed manually (see for 1:1:0), sorry -lib: +lib: .libs/libshp.so + +.libs/libshp.so: libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. $(CPPFLAGS) $(CFLAGS) -c shpopen.c libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. $(CPPFLAGS) $(CFLAGS) -c shptree.c libtool --mode=compile gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. $(CPPFLAGS) $(CFLAGS) -c dbfopen.c debian/patches/0005-Stop-setting-CFLAGS-in-the-Makefile.patch0000644000000000000000000000062611762624352020466 0ustar From: Arto Jantunen Date: Tue, 8 May 2012 14:31:56 +0300 Subject: [PATCH] Stop setting CFLAGS in the Makefile --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 3e53d15..6a614f1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ #LINKOPT = /usr/local/lib/libdbmalloc.a -CFLAGS = -g +#CFLAGS = -g default: all -- debian/patches/series0000644000000000000000000000027511762624352012046 0ustar 0001-Add-manpages.patch 0002-Thread-safety-fixes.patch 0003-Properly-use-libtool.patch 0004-Dynamically-link-the-shp-binaries-to-libshp.patch 0005-Stop-setting-CFLAGS-in-the-Makefile.patch debian/rules0000755000000000000000000000150711762624352010261 0ustar #!/usr/bin/make -f DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) %: dh $@ override_dh_auto_test: override_dh_auto_build: mv shprewind shprewind.bak dh_auto_build override_dh_auto_clean: dh_auto_clean mv shprewind.bak shprewind || true override_dh_auto_install: # have to copy the files by hand.:( mkdir -p debian/tmp/usr/bin/ mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) mkdir debian/tmp/usr/include/ cp dbfadd dbfcreate dbfdump shpadd shpcreate shpdump shprewind \ shptest debian/tmp/usr/bin/ cp .libs/libshp.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ cp .libs/libshp.so.1.0.1 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ ln -s libshp.so.1.0.1 libshp.so ln -s libshp.so.1.0.1 libshp.so.1 mv libshp.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ cp shapefil.h debian/tmp/usr/include/ debian/shapelib.dirs0000644000000000000000000000001011762624352011637 0ustar usr/bin debian/shapelib.docs0000644000000000000000000000005011762624352011632 0ustar dbf_api.html shapelib.html shp_api.html debian/shapelib.install0000644000000000000000000000001211762624352012346 0ustar usr/bin/* debian/shapelib.manpages0000644000000000000000000000001111762624352012472 0ustar man/*.1 debian/source/0000755000000000000000000000000011762624352010476 5ustar debian/source/format0000644000000000000000000000001411762624352011704 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000011211762624352010221 0ustar version=3 http://dl.maptools.org/dl/shapelib/ shapelib-([\d\.]+)\.tar\.gz