+++ /dev/null
- Makefile | 41 ++++++++++++++++++++---------------------
- 1 file changed, 20 insertions(+), 21 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 0c41d8a..4149412 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,8 +1,9 @@
-
--PREFIX = /usr/local
--CFLAGS = -g -Wall -fPIC
-+PREFIX ?= /usr/localxs
-+CFLAGS ?= -g -Wall -fPIC
- #CFLAGS = -g -DUSE_CPL
- #CC = g++
-+AR ?= ar
-
- LIBOBJ = shpopen.o dbfopen.o safileio.o shptree.o
- SHPBIN = shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump \
-@@ -10,7 +11,7 @@ SHPBIN = shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump \
-
- default: all
-
--all: $(SHPBIN) shptest lib
-+all: $(SHPBIN) lib
-
- shpopen.o: shpopen.c shapefil.h
- $(CC) $(CFLAGS) -c shpopen.c
-@@ -25,46 +26,46 @@ safileio.o: safileio.c shapefil.h
- $(CC) $(CFLAGS) -c safileio.c
-
- shpcreate: shpcreate.c shpopen.o safileio.o
-- $(CC) $(CFLAGS) shpcreate.c shpopen.o safileio.o $(LINKOPT) -o shpcreate
-+ $(CC) $(CFLAGS) $(LDFLAGS) shpcreate.c shpopen.o safileio.o -o shpcreate
-
- shpadd: shpadd.c shpopen.o safileio.o
-- $(CC) $(CFLAGS) shpadd.c shpopen.o safileio.o $(LINKOPT) -o shpadd
-+ $(CC) $(CFLAGS) $(LDFLAGS) shpadd.c shpopen.o safileio.o -o shpadd
-
- shpdump: shpdump.c shpopen.o safileio.o
-- $(CC) $(CFLAGS) shpdump.c shpopen.o safileio.o $(LINKOPT) -o shpdump
-+ $(CC) $(CFLAGS) $(LDFLAGS) shpdump.c shpopen.o safileio.o -o shpdump
-
- shprewind: shprewind.c shpopen.o safileio.o
-- $(CC) $(CFLAGS) shprewind.c shpopen.o safileio.o $(LINKOPT) -o shprewind
-+ $(CC) $(CFLAGS) $(LDFLAGS) shprewind.c shpopen.o safileio.o -o shprewind
-
- dbfcreate: dbfcreate.c dbfopen.o safileio.o
-- $(CC) $(CFLAGS) dbfcreate.c dbfopen.o safileio.o $(LINKOPT) -o dbfcreate
-+ $(CC) $(CFLAGS) $(LDFLAGS) dbfcreate.c dbfopen.o safileio.o -o dbfcreate
-
- dbfadd: dbfadd.c dbfopen.o safileio.o
-- $(CC) $(CFLAGS) dbfadd.c dbfopen.o safileio.o $(LINKOPT) -o dbfadd
-+ $(CC) $(CFLAGS) $(LDFLAGS) dbfadd.c dbfopen.o safileio.o -o dbfadd
-
- dbfdump: dbfdump.c dbfopen.o safileio.o
-- $(CC) $(CFLAGS) dbfdump.c dbfopen.o safileio.o $(LINKOPT) -o dbfdump
-+ $(CC) $(CFLAGS) $(LDFLAGS) dbfdump.c dbfopen.o safileio.o -o dbfdump
-
- shptest: shptest.c shpopen.o safileio.o
-- $(CC) $(CFLAGS) shptest.c shpopen.o safileio.o $(LINKOPT) -o shptest
-+ $(CC) $(CFLAGS) $(LDFLAGS) shptest.c shpopen.o safileio.o -o shptest
-
- shputils: shputils.c shpopen.o safileio.o dbfopen.o
-- $(CC) $(CFLAGS) shputils.c shpopen.o safileio.o dbfopen.o $(LINKOPT) -o shputils
-+ $(CC) $(CFLAGS) $(LDFLAGS) shputils.c shpopen.o safileio.o dbfopen.o -o shputils
-
- shptreedump: shptreedump.c shptree.o shpopen.o safileio.o
-- $(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o safileio.o $(LINKOPT) \
-+ $(CC) $(CFLAGS) $(LDFLAGS) shptreedump.c shptree.o shpopen.o safileio.o \
- -o shptreedump
-
- clean:
- rm -f *.o shptest $(SHPBIN) libshp.a
-
--test: test2 test3
-+test: shptest test2 test3
-
- #
- # Note this stream only works if example data is accessable.
- # Fetch ftp://gdal.velocet.ca/pub/outgoing/shape_eg_data.zip
- #
--test1:
-+test1: shptest
- @./stream1.sh > s1.out
- @if test "`diff s1.out stream1.out`" = '' ; then \
- echo "******* Stream 1 Succeeded *********"; \
-@@ -74,7 +75,7 @@ test1:
- diff s1.out stream1.out; \
- fi
-
--test2:
-+test2: shptest
- @./stream2.sh > s2.out
- @if test "`diff s2.out stream2.out`" = '' ; then \
- echo "******* Stream 2 Succeeded *********"; \
-@@ -85,7 +86,7 @@ test2:
- diff s2.out stream2.out; \
- fi
-
--test3:
-+test3: shptest
- @./makeshape.sh > s3.out
- @if test "`diff s3.out stream3.out`" = '' ; then \
- echo "******* Stream 3 Succeeded *********"; \
-@@ -97,10 +98,8 @@ test3:
- fi
-
-
--lib: libshp.a
--
--libshp.a: $(LIBOBJ)
-- ar r libshp.a $(LIBOBJ)
-+lib: $(LIBOBJ)
-+ $(AR) r libshp.a $(LIBOBJ)
-
- lib_install: libshp.a
- cp libshp.a $(PREFIX)/lib
+++ /dev/null
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=4
-inherit eutils toolchain-funcs multilib versionator
-
-DESCRIPTION="Library for manipulating ESRI Shapefiles"
-HOMEPAGE="http://shapelib.maptools.org/"
-SRC_URI="http://download.osgeo.org/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2 LGPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ppc ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux"
-IUSE="static-libs"
-
-DEPEND=""
-RDEPEND=""
-
-static_to_shared() {
- local libstatic=${1}; shift
- local libname=$(basename ${libstatic%.a})
- local soname=${libname}$(get_libname $(get_version_component_range 1-2))
- local libdir=$(dirname ${libstatic})
-
- einfo "Making ${soname} from ${libstatic}"
- if [[ ${CHOST} == *-darwin* ]] ; then
- ${LINK:-$(tc-getCC)} ${LDFLAGS} \
- -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
- -Wl,-all_load -Wl,${libstatic} \
- "$@" -o ${libdir}/${soname} || die "${soname} failed"
- else
- ${LINK:-$(tc-getCC)} ${LDFLAGS} \
- -shared -Wl,-soname=${soname} \
- -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
- "$@" -o ${libdir}/${soname} || die "${soname} failed"
- [[ $(get_version_component_count) -gt 1 ]] && \
- ln -s ${soname} ${libdir}/${libname}$(get_libname $(get_major_version))
- ln -s ${soname} ${libdir}/${libname}$(get_libname)
- fi
-}
-
-src_prepare() {
- epatch "${FILESDIR}"/${P}-respect-user.patch
- tc-export CC AR
-}
-
-src_compile() {
- emake CFLAGS="${CFLAGS} -fPIC" lib
- static_to_shared lib*.a
- rm *.o *.a
- emake
-}
-
-src_test() {
- emake test
-}
-
-src_install() {
- dobin shp{create,dump,add} dbf{create,dump,add}
- insinto /usr/include/libshp
- doins shapefil.h
- use test && dobin shptest
- dolib.so lib*$(get_libname)*
- dodoc ChangeLog README*
- use static-libs && dolib.a lib*.a
-}