diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2013-02-27 15:17:27 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2013-02-27 15:17:27 +0000 |
commit | ee0bd5ce84cb709a5f3d0d1ca75fd09d064de23d (patch) | |
tree | ac7dd387a00035673e15d98a810245f4ff997eef /net-libs | |
parent | Old. (diff) | |
download | gentoo-2-ee0bd5ce84cb709a5f3d0d1ca75fd09d064de23d.tar.gz gentoo-2-ee0bd5ce84cb709a5f3d0d1ca75fd09d064de23d.tar.bz2 gentoo-2-ee0bd5ce84cb709a5f3d0d1ca75fd09d064de23d.zip |
Build shared library and install headers.
(Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'net-libs')
-rw-r--r-- | net-libs/libutp/ChangeLog | 8 | ||||
-rw-r--r-- | net-libs/libutp/files/Makefile | 48 | ||||
-rw-r--r-- | net-libs/libutp/libutp-0_pre20130213-r1.ebuild | 43 |
3 files changed, 98 insertions, 1 deletions
diff --git a/net-libs/libutp/ChangeLog b/net-libs/libutp/ChangeLog index 917d641f4351..52a06034ee3f 100644 --- a/net-libs/libutp/ChangeLog +++ b/net-libs/libutp/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-libs/libutp # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libutp/ChangeLog,v 1.1 2013/02/13 20:06:49 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libutp/ChangeLog,v 1.2 2013/02/27 15:17:27 ssuominen Exp $ + +*libutp-0_pre20130213-r1 (27 Feb 2013) + + 27 Feb 2013; Samuli Suominen <ssuominen@gentoo.org> + +libutp-0_pre20130213-r1.ebuild, +files/Makefile: + Build shared library and install headers. *libutp-0_pre20130213 (13 Feb 2013) diff --git a/net-libs/libutp/files/Makefile b/net-libs/libutp/files/Makefile new file mode 100644 index 000000000000..c11d04facbf2 --- /dev/null +++ b/net-libs/libutp/files/Makefile @@ -0,0 +1,48 @@ +AR ?= ar +CXX ?= g++ +# CPP and CXXFLAGS from original Makefile +CPPFLAGS += -DPOSIX +CXXFLAGS += -fno-exceptions -fno-rtti -Wall -I . -I utp_config_lib +RANLIB ?= ranlib +LIBDIR ?= /usr/lib + +name = libutp +# No versioning upstream since they only build static archive +major = 0 +minor = 0.0 +version = $(major).$(minor) + +# Copy SRCS= from original Makefile +src = utp.cpp utp_utils.cpp +lo = $(addsuffix .lo,$(basename ${src})) +o = $(addsuffix .o,$(basename ${src})) + +lib = so +ifeq ($(shell uname),Darwin) + lib = dylib +endif + +all: $(name).a $(name).$(lib) + +%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@ + +$(name).a: $(o) + $(AR) q $(name).a $(o) + $(RANLIB) $(name).a + +%.lo: %.cpp + $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -fPIC $< -o $@ + +$(name).so: $(lo) + $(CXX) $(LDFLAGS) -fPIC -shared $(lo) -Wl,-soname,$(name).so.$(major) -o $(name).so.$(version) + ln -s $(name).so.$(version) $(name).so.$(major) + ln -s $(name).so.$(version) $(name).so + +$(name).dylib: $(lo) + $(CXX) $(LDFLAGS) -fPIC -dynamiclib $(lo) -install_name $(LIBDIR)/$(name).$(major).dylib -o $(name).$(version).dylib + ln -s $(name).$(version).dylib $(name).$(major).dylib + ln -s $(name).$(version).dylib $(name).dylib + +clean: + -rm -f *.o *.lo *.so* *.a diff --git a/net-libs/libutp/libutp-0_pre20130213-r1.ebuild b/net-libs/libutp/libutp-0_pre20130213-r1.ebuild new file mode 100644 index 000000000000..fd04183fe305 --- /dev/null +++ b/net-libs/libutp/libutp-0_pre20130213-r1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-libs/libutp/libutp-0_pre20130213-r1.ebuild,v 1.1 2013/02/27 15:17:27 ssuominen Exp $ + +EAPI=5 +inherit toolchain-funcs + +DESCRIPTION="uTorrent Transport Protocol library" +HOMEPAGE="http://github.com/bittorrent/libutp" +SRC_URI="http://dev.gentoo.org/~ssuominen/${P}.tar.xz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +src_prepare() { + sed -i \ + -e 's:g++:$(CXX):' \ + -e 's:-Wall:$(LDFLAGS) $(CXXFLAGS) &:' \ + utp_{file,test}/Makefile || die + + cp -f "${FILESDIR}"/Makefile . +} + +src_compile() { + tc-export AR CXX + local d + for d in . utp_file utp_test; do + emake -C ${d} + done +} + +src_install() { + dolib.a ${PN}.a + dolib.so ${PN}.so* + insinto /usr/include/${PN} + doins *.h + + dobin utp_file/utp_{recv,send} utp_test/utp_test + + dodoc README.md +} |