commit:     3c67e80b9017a0bd89d5eec08eb0b03b0202e45e
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 13 17:54:45 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Dec 13 19:07:04 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c67e80b

app-text/crm114: Fix building with GCC 5

Gentoo-bug: 571062
* EAPI=6
* Respect user CPPFLAGS
* Introduce USE=examples

Package-Manager: portage-2.3.3

 ...4-20100106.ebuild => crm114-20100106-r1.ebuild} | 71 +++++++++++-----------
 .../files/crm114-20100106-fix-makefile.patch       | 60 ++++++++++++++++++
 2 files changed, 95 insertions(+), 36 deletions(-)

diff --git a/app-text/crm114/crm114-20100106.ebuild 
b/app-text/crm114/crm114-20100106-r1.ebuild
similarity index 52%
rename from app-text/crm114/crm114-20100106.ebuild
rename to app-text/crm114/crm114-20100106-r1.ebuild
index f406281..4094f9d 100644
--- a/app-text/crm114/crm114-20100106.ebuild
+++ b/app-text/crm114/crm114-20100106-r1.ebuild
@@ -1,12 +1,12 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=2
+EAPI=6
 
-MY_P="${P}-BlameMichelson.src"
+inherit flag-o-matic toolchain-funcs
 
-inherit eutils toolchain-funcs
+MY_P="${P}-BlameMichelson.src"
 
 DESCRIPTION="A powerful text processing tool, mainly used for spam filtering"
 HOMEPAGE="http://crm114.sourceforge.net/";
@@ -14,8 +14,8 @@ 
SRC_URI="http://crm114.sourceforge.net/tarballs/${MY_P}.tar.gz";
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="amd64 ppc x86 ~x86-fbsd"
-IUSE="mew mimencode nls normalizemime static test"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+IUSE="examples mew mimencode nls normalizemime static test"
 
 RDEPEND="
        static? ( dev-libs/tre[static-libs] )
@@ -28,55 +28,54 @@ DEPEND="${RDEPEND}
 
 S="${WORKDIR}"/${MY_P}
 
+PATCHES=( "${FILESDIR}"/${P}-fix-makefile.patch )
+
 src_prepare() {
-       sed \
-               -e "s#-O3 -Wall##" \
-               -e "s#^CC=.*#CC=$(tc-getCC)#" \
-               -i Makefile || die
-       # Upstream recommends static linking
-       if ! use static ; then
-               sed -i "s#LDFLAGS += -static -static-libgcc#LDFLAGS += 
${LDFLAGS}#" Makefile || die
-       else
-               sed \
-                       -e "s#LDFLAGS += -static -static-libgcc#LDFLAGS += 
${LDFLAGS} -static -static-libgcc#" \
-                       -i Makefile || die
-       fi
+       default
 
-       if use mimencode ; then
+       if use mimencode; then
                sed \
                        -e 's%#:mime_decoder: /mimencode -u/%:mime_decoder: 
/mimencode -u/%' \
                        -e 's%:mime_decoder: /mewdecode/%#:mime_decoder: 
/mewdecode/%' \
                        -i mailfilter.cf || die
-       elif use normalizemime ; then
+       elif use normalizemime; then
                sed \
                        -e 's%#:mime_decoder: /normalizemime/%:mime_decoder: 
/normalizemime/%' \
                        -e 's%:mime_decoder: /mewdecode/%#:mime_decoder: 
/mewdecode/%' \
                        -i mailfilter.cf || die
        fi
-
 }
 
-src_install() {
-       dobin crm114 cssutil cssdiff cssmerge || die
-       dobin cssutil cssdiff cssmerge || die
-       dobin osbf-util || die
+src_compile() {
+       # Restore GNU89 inline semantics to
+       # emit external symbols, bug 571062
+       append-cflags -std=gnu89
 
-       dodoc COLOPHON.txt CRM114_Mailfilter_HOWTO.txt FAQ.txt INTRO.txt || die
-       dodoc QUICKREF.txt CLASSIFY_DETAILS.txt inoc_passwd.txt || die
-       dodoc KNOWNBUGS.txt THINGS_TO_DO.txt README || die
-       docinto examples
-       dodoc *.example || die
+       use static && append-ldflags -static -static-libgcc
 
-       insinto /usr/share/${PN}
-       doins *.crm || die
-       doins *.cf || die
-       doins *.mfp || die
+       emake CC="$(tc-getCC)"
 }
 
 src_test() {
-       emake megatest || die
+       emake megatest
+}
+
+src_install() {
+       dobin crm114 cssdiff cssmerge cssutil osbf-util
+
+       insinto /usr/share/${PN}
+       doins *.crm *.cf *.mfp
+
+       dodoc COLOPHON.txt CRM114_Mailfilter_HOWTO.txt FAQ.txt INTRO.txt 
QUICKREF.txt \
+               CLASSIFY_DETAILS.txt inoc_passwd.txt KNOWNBUGS.txt 
THINGS_TO_DO.txt README
+
+       if use examples; then
+               docinto examples
+               dodoc *.example
+               docompress -x /usr/share/doc/${PF}/examples
+       fi
 }
 
 pkg_postinst() {
-       elog "The spam-filter CRM files are installed in /usr/share/${PN}."
+       elog "The spam-filter CRM files are installed in 
${EROOT%/}/usr/share/${PN}."
 }

diff --git a/app-text/crm114/files/crm114-20100106-fix-makefile.patch 
b/app-text/crm114/files/crm114-20100106-fix-makefile.patch
new file mode 100644
index 00000000..12ad405
--- /dev/null
+++ b/app-text/crm114/files/crm114-20100106-fix-makefile.patch
@@ -0,0 +1,60 @@
+* Remove hardcoded variable
+* Respect user variables
+
+--- a/Makefile
++++ b/Makefile
+@@ -19,10 +19,6 @@
+ VER_SUFFIX ?=
+ 
+ #
+-#      The following forces the compiler to be GCC.  If you have trouble
+-#      with your default compiler, and you want to force GCC, uncomment it.
+-CC=gcc
+-#
+ #     What version is this software (PLEASE don't change this just
+ #     to mess with my brain. - wsy)
+ #
+@@ -82,7 +78,7 @@
+ #
+ #     Build our basic CFLAGS chunk
+ #
+-CFLAGS += -DVERSION='"$(VERSION)"'
++MY_CPPFLAGS += -DVERSION='"$(VERSION)"'
+ #
+ #  Known Neighbord On, only for debugging
+ # CFLAGS += -DKNN_ON
+@@ -104,7 +100,7 @@
+ #  certain functions to be inline (I added that to force gcc to inline 
functions
+ #  under high optimization but not under low so that debugging is possible - 
+ #  that's why DO_INLINES is defined at O3 but not O0 - JB):
+-CFLAGS += -O3 -Wall -DDO_INLINES
++MY_CPPFLAGS += -DDO_INLINES
+ #     turn this one on for no optimization, but debugging
+ #CFLAGS += -g -O0 -Wall
+ #
+@@ -119,7 +115,6 @@
+ #    BSD users - do NOT use -static-libgcc!!!
+ #    Also note that this keeps valgrind from running correctly so comment
+ #    it out for debugging.
+-LDFLAGS += -static -static-libgcc
+ #    use this one if you want program profiling.
+ #LDFLAGS += -static -static-libgcc -pg
+ #LDFLAGS += -pg
+@@ -306,7 +301,7 @@
+         #                               of with your mods built in.
+ 
+ crm114: $(OFILES)
+-      $(CC) $(LDFLAGS) $(LIBS) $(OFILES) \
++      $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $(OFILES) \
+         -ltre -lm \
+         -o crm114
+       #
+@@ -315,7 +310,7 @@
+ 
+ *.o: $(HFILES)
+ .c.o:
+-      $(CC)  $(CFLAGS) -c $*.c
++      $(CC) $(CFLAGS) $(MY_CPPFLAGS) $(CPPFLAGS) -c $*.c
+ 
+ cssutil: cssutil.o crm_css_maintenance.o crm_util_errorhandlers.o 
crm_str_funcs.o $(HFILES)
+       $(CC)  $(CFLAGS) $(LDFLAGS) cssutil.o \

Reply via email to