From 3c67e80b9017a0bd89d5eec08eb0b03b0202e45e Mon Sep 17 00:00:00 2001 From: David Seifert Date: Tue, 13 Dec 2016 18:54:45 +0100 Subject: 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 --- app-text/crm114/crm114-20100106-r1.ebuild | 81 +++++++++++++++++++++ app-text/crm114/crm114-20100106.ebuild | 82 ---------------------- .../files/crm114-20100106-fix-makefile.patch | 60 ++++++++++++++++ 3 files changed, 141 insertions(+), 82 deletions(-) create mode 100644 app-text/crm114/crm114-20100106-r1.ebuild delete mode 100644 app-text/crm114/crm114-20100106.ebuild create mode 100644 app-text/crm114/files/crm114-20100106-fix-makefile.patch (limited to 'app-text/crm114') diff --git a/app-text/crm114/crm114-20100106-r1.ebuild b/app-text/crm114/crm114-20100106-r1.ebuild new file mode 100644 index 000000000000..4094f9d9fd37 --- /dev/null +++ b/app-text/crm114/crm114-20100106-r1.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit flag-o-matic toolchain-funcs + +MY_P="${P}-BlameMichelson.src" + +DESCRIPTION="A powerful text processing tool, mainly used for spam filtering" +HOMEPAGE="http://crm114.sourceforge.net/" +SRC_URI="http://crm114.sourceforge.net/tarballs/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd" +IUSE="examples mew mimencode nls normalizemime static test" + +RDEPEND=" + static? ( dev-libs/tre[static-libs] ) + !static? ( dev-libs/tre ) + mew? ( app-emacs/mew ) + mimencode? ( net-mail/metamail ) + normalizemime? ( mail-filter/normalizemime )" +DEPEND="${RDEPEND} + test? ( sys-apps/miscfiles )" + +S="${WORKDIR}"/${MY_P} + +PATCHES=( "${FILESDIR}"/${P}-fix-makefile.patch ) + +src_prepare() { + default + + 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 + sed \ + -e 's%#:mime_decoder: /normalizemime/%:mime_decoder: /normalizemime/%' \ + -e 's%:mime_decoder: /mewdecode/%#:mime_decoder: /mewdecode/%' \ + -i mailfilter.cf || die + fi +} + +src_compile() { + # Restore GNU89 inline semantics to + # emit external symbols, bug 571062 + append-cflags -std=gnu89 + + use static && append-ldflags -static -static-libgcc + + emake CC="$(tc-getCC)" +} + +src_test() { + 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 ${EROOT%/}/usr/share/${PN}." +} diff --git a/app-text/crm114/crm114-20100106.ebuild b/app-text/crm114/crm114-20100106.ebuild deleted file mode 100644 index f406281548f1..000000000000 --- a/app-text/crm114/crm114-20100106.ebuild +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=2 - -MY_P="${P}-BlameMichelson.src" - -inherit eutils toolchain-funcs - -DESCRIPTION="A powerful text processing tool, mainly used for spam filtering" -HOMEPAGE="http://crm114.sourceforge.net/" -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" - -RDEPEND=" - static? ( dev-libs/tre[static-libs] ) - !static? ( dev-libs/tre ) - mew? ( app-emacs/mew ) - mimencode? ( net-mail/metamail ) - normalizemime? ( mail-filter/normalizemime )" -DEPEND="${RDEPEND} - test? ( sys-apps/miscfiles )" - -S="${WORKDIR}"/${MY_P} - -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 - - 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 - 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 - - 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 - - insinto /usr/share/${PN} - doins *.crm || die - doins *.cf || die - doins *.mfp || die -} - -src_test() { - emake megatest || die -} - -pkg_postinst() { - elog "The spam-filter CRM files are installed in /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 000000000000..12ad4052002d --- /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 \ -- cgit v1.2.3-65-gdbad