Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 388193 - Please review Prefix changes for sys-apps/groff-1.21
Summary: Please review Prefix changes for sys-apps/groff-1.21
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-23 09:19 UTC by Fabian Groffen
Modified: 2011-10-23 19:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2011-10-23 09:19:49 UTC
To make groff-1.21 offset-aware, we need the variables EPREFIX and ED, therefore, the ebuild needs to be EAPI-bumped to EAPI3.
We want to identify as "Gentoo Prefix" instead of "Gentoo", which is reflected in the mdoc.local file.
We need a couple of patches from upstream to compile, and a little mod to force groff installing without g-nameprefix on traditional UNIX platforms.  Upstreamed patches can be found at bug #353287 and bug #353377.


Complete changes involved that should go to groff-1.21-r1:

@@ -2,6 +2,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/sys-apps/groff/groff-1.21.ebuild,v 1.8 2011/05/07 18:02:54 armin76 Exp $
 
+EAPI="3"
+
 inherit autotools eutils toolchain-funcs
 
 DESCRIPTION="Text formatter used for man pages"
@@ -24,17 +26,14 @@
                x11-libs/libICE
        )"
 
-src_unpack() {
-       unpack ${A}
-       cd "${S}"
-
+src_prepare() {
        epatch "${FILESDIR}"/${PN}-1.19.2-man-unicode-dashes.patch #16108 #17580 #121502
 
        # Make sure we can cross-compile this puppy
        if tc-is-cross-compiler ; then
                sed -i \
-                       -e '/^GROFFBIN=/s:=.*:=/usr/bin/groff:' \
-                       -e '/^TROFFBIN=/s:=.*:=/usr/bin/troff:' \
+                       -e '/^GROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/groff:' \
+                       -e '/^TROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/troff:' \
                        -e '/^GROFF_BIN_PATH=/s:=.*:=:' \
                        -e '/^GROFF_BIN_DIR=/s:=.*:=:' \
                        contrib/*/Makefile.sub \
@@ -42,10 +41,12 @@
                        doc/Makefile.sub || die "cross-compile sed failed"
        fi
 
+       local pfx=
+       use prefix && pfx=" Prefix"
        cat <<-EOF >> tmac/mdoc.local
-       .ds volume-operating-system Gentoo
-       .ds operating-system Gentoo/${KERNEL}
-       .ds default-operating-system Gentoo/${KERNEL}
+       .ds volume-operating-system Gentoo${pfx}
+       .ds operating-system Gentoo${pfx}/${KERNEL}
+       .ds default-operating-system Gentoo${pfx}/${KERNEL}
        EOF
 
        if use linguas_ja ; then
@@ -53,15 +54,21 @@
                eautoconf
                eautoheader
        fi
+
+       # from upstream, #353287, #353377
+       epatch "${FILESDIR}"/groff-1.21-makefile.patch
+       epatch "${FILESDIR}"/groff-1.21-gnulib.patch
+       # make sure we don't get a crappy `g' nameprefix on UNIX systems with real
+       # troff (GROFF_G macro runs some test to see, its own troff doesn't satisfy)
+       sed -i -e 's/^[ \t]\+g=g$/g=/' configure || die
 }
 
-src_compile() {
+src_configure() {
        econf \
-               --with-appresdir=/usr/share/X11/app-defaults \
-               --docdir=/usr/share/doc/${PF} \
+               --with-appresdir="${EPREFIX}"/usr/share/X11/app-defaults \
+               --docdir="${EPREFIX}"/usr/share/doc/${PF} \
                $(use_with X x) \
                $(use linguas_ja && echo --enable-japanese)
-       emake || die
 }
 
 src_install() {
@@ -74,5 +81,5 @@
        dodoc BUG-REPORT ChangeLog MORE.STUFF NEWS \
                PROBLEMS PROJECTS README REVISION TODO VERSION
 
-       use examples || rm -rf "${D}"/usr/share/doc/${PF}/examples
+       use examples || rm -rf "${ED}"/usr/share/doc/${PF}/examples
 }
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-10-23 19:15:34 UTC
+1, in a revbump.
Comment 2 Fabian Groffen gentoo-dev 2011-10-23 19:43:49 UTC
committed, thanks