summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2012-08-02 23:24:26 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2012-08-02 23:24:26 +0000
commit745969e13986cd48fbb7c94c36da7df3834b2bed (patch)
tree34f69a6c7e98219dd4d08299242f3176c913b54d /sci-libs/shapelib
parentLinux patches 3.0.37, 3.0.38 and 3.0.39 (diff)
downloadgentoo-2-745969e13986cd48fbb7c94c36da7df3834b2bed.tar.gz
gentoo-2-745969e13986cd48fbb7c94c36da7df3834b2bed.tar.bz2
gentoo-2-745969e13986cd48fbb7c94c36da7df3834b2bed.zip
added a patch to respect user flags, fixed bad installation, define tests
(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)
Diffstat (limited to 'sci-libs/shapelib')
-rw-r--r--sci-libs/shapelib/ChangeLog9
-rw-r--r--sci-libs/shapelib/files/shapelib-1.3.0-respect-user.patch108
-rw-r--r--sci-libs/shapelib/shapelib-1.3.0-r1.ebuild63
-rw-r--r--sci-libs/shapelib/shapelib-1.3.0.ebuild42
4 files changed, 179 insertions, 43 deletions
diff --git a/sci-libs/shapelib/ChangeLog b/sci-libs/shapelib/ChangeLog
index 11da23b0b161..58cd1c507fd3 100644
--- a/sci-libs/shapelib/ChangeLog
+++ b/sci-libs/shapelib/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sci-libs/shapelib
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/shapelib/ChangeLog,v 1.15 2012/08/02 19:01:46 bicatali Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/shapelib/ChangeLog,v 1.16 2012/08/02 23:24:26 bicatali Exp $
+
+*shapelib-1.3.0-r1 (02 Aug 2012)
+
+ 02 Aug 2012; Sébastien Fabbro <bicatali@gentoo.org>
+ +files/shapelib-1.3.0-respect-user.patch, +shapelib-1.3.0-r1.ebuild,
+ -shapelib-1.3.0.ebuild:
+ added a patch to respect user flags, fixed bad installation, define tests
*shapelib-1.3.0 (02 Aug 2012)
diff --git a/sci-libs/shapelib/files/shapelib-1.3.0-respect-user.patch b/sci-libs/shapelib/files/shapelib-1.3.0-respect-user.patch
new file mode 100644
index 000000000000..0b0c5bcef7cc
--- /dev/null
+++ b/sci-libs/shapelib/files/shapelib-1.3.0-respect-user.patch
@@ -0,0 +1,108 @@
+--- Makefile.orig 2012-08-02 23:51:00.000000000 +0100
++++ Makefile 2012-08-03 00:19:37.000000000 +0100
+@@ -1,6 +1,6 @@
+
+-PREFIX = /usr/local
+-CFLAGS = -g -Wall -fPIC
++PREFIX ?= /usr/localxs
++CFLAGS ?= -g -Wall -fPIC
+ #CFLAGS = -g -DUSE_CPL
+ #CC = g++
+
+@@ -10,7 +10,7 @@
+
+ default: all
+
+-all: $(SHPBIN) shptest lib
++all: $(SHPBIN) lib
+
+ shpopen.o: shpopen.c shapefil.h
+ $(CC) $(CFLAGS) -c shpopen.c
+@@ -25,46 +25,46 @@
+ $(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 +74,7 @@
+ 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 +85,7 @@
+ 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,9 +97,7 @@
+ fi
+
+
+-lib: libshp.a
+-
+-libshp.a: $(LIBOBJ)
++lib: $(LIBOBJ)
+ ar r libshp.a $(LIBOBJ)
+
+ lib_install: libshp.a
diff --git a/sci-libs/shapelib/shapelib-1.3.0-r1.ebuild b/sci-libs/shapelib/shapelib-1.3.0-r1.ebuild
new file mode 100644
index 000000000000..636678f87610
--- /dev/null
+++ b/sci-libs/shapelib/shapelib-1.3.0-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/shapelib/shapelib-1.3.0-r1.ebuild,v 1.1 2012/08/02 23:24:26 bicatali Exp $
+
+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 ~ppc ~x86 ~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
+}
+
+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,test,add} dbf{create,dump,add}
+ dolib.so lib*$(get_libname)*
+ dodoc ChangeLog README*
+ use static-libs && dolib.a lib*.a
+}
diff --git a/sci-libs/shapelib/shapelib-1.3.0.ebuild b/sci-libs/shapelib/shapelib-1.3.0.ebuild
deleted file mode 100644
index 2158bfae0669..000000000000
--- a/sci-libs/shapelib/shapelib-1.3.0.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/shapelib/shapelib-1.3.0.ebuild,v 1.1 2012/08/02 19:01:46 bicatali Exp $
-
-EAPI=4
-inherit eutils toolchain-funcs multilib
-
-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 ~ppc ~x86 ~amd64-linux ~x86-linux"
-IUSE="static-libs"
-
-DEPEND=""
-RDEPEND=""
-
-src_prepare() {
- sed -i \
- -e "s:/usr/local:\$(DESTDIR)/${EPREFIX}/usr:g" \
- -e "s:/usr/lib:/usr/$(get_libdir):g" \
- -e "s:SHPLIB_VERSION=1.2.9:SHPLIB_VERSION=${PV}:g" \
- -e "s:-g:${CFLAGS}:" \
- -e "s:-g -O2:${CFLAGS}:g" \
- -e 's:$(LINKOPT):$(LDFLAGS):' \
- -e "s:link gcc :link $(tc-getCC) ${LDFLAGS}:" \
- Makefile || die "sed failed"
-}
-
-src_compile() {
- emake all
- emake lib
-}
-
-src_install() {
- dobin shp{create,dump,test,add} dbf{create,dump,add}
- emake DESTDIR="${D}" lib_install
- dodoc ChangeLog README*
- use static-libs || rm -f "${ED}"/usr/$(get_libdir)/lib*.a
-}