Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 435434

Summary: dev-vcs/colorsvn-0.3.2-r2 : add prefix support
Product: Gentoo/Alt Reporter: Myk Taylor <myk002>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED FIXED    
Severity: normal CC: idl0r
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 315803    
Attachments: patched ebuild
patch for Makefile.in

Description Myk Taylor 2012-09-18 17:06:40 UTC
Created attachment 324220 [details]
patched ebuild

I got colorsvn working on my OSX 10.8 (Mountain Lion) system.  The ebuild needed some manual updating.  The package's Makefile.in had hard-coded /etc instead of using %sysconfdir%, and the ebuild had been working around that.  I patched Makefile.in and removed the hack in the ebuild.


--- usr/portage/dev-vcs/colorsvn/colorsvn-0.3.2-r2.ebuild	2010-12-29 08:20:06.000000000 -0800
+++ usr/local/portage/dev-vcs/colorsvn/colorsvn-0.3.2-r2.ebuild	2012-09-18 09:54:31.000000000 -0700
@@ -24,6 +24,7 @@
 	sed -i -e 's:rxvt:rxvt rxvt-unicode:' colorsvnrc-original || die
 
 	epatch "${FILESDIR}/0001-Don-t-colorize-svn-mkdir-bug-321451.-Use-IPC-open2-i.patch"
+	epatch "${FILESDIR}/0002-Makefile_in_respect_sysconfdir.patch"
 }
 
 src_compile() {
@@ -32,7 +33,7 @@
 }
 
 src_install() {
-	emake DESTDIR="${D}" install || die "emake install failed"
+	emake install || die "emake install failed"
 	dodoc CREDITS || die "dodoc failed"
 }


patched ebuild and patch for Makefile.in attached
Comment 1 Myk Taylor 2012-09-18 17:07:00 UTC
Created attachment 324222 [details, diff]
patch for Makefile.in
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-09-18 17:26:51 UTC
stabilize? Changed Summary.

I feel like your patch to Makefile.in is faulty, since ebuilds must install to DESTDIR and not the live fs directly. This isn't a "hack" in the ebuild, as you say.
Comment 3 Myk Taylor 2012-09-18 21:15:59 UTC
Ah, sorry if I misread this.  I'm quite new to prefix.  This is what I'm seeing:

In the Makefile (generated from Makefile.in), DESTDIR is respected.  Config files are installed to DESTDIR/confdir.  It's just that confdir ignores the values passed in to ./configure and is hard-coded to /etc.  sysconfdir, defined in the line previous to confdir, correctly derives its value from the parameters to ./configure.  Removing the DESTDIR definition from the ebuild prevents $EPREFIX from being prepended twice to all other paths (i.e. when DESTDIR is defined in the ebuild, lcov gets installed into $EPREFIX/$EPREFIX/usr/bin/lcov).  Of course, when DESTDIR is defined in the original ebuild, config files go the right place, but for the wrong reason.
Comment 4 Myk Taylor 2012-09-18 21:18:26 UTC
looking in other ebuilds, perhaps this would be more appropriate:

-	emake PREFIX="${D}" install || die "emake install failed"
+	emake PREFIX="${ED}" install || die "emake install failed"

i.e. using PREFIX instead of DESTDIR?
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-09-18 21:43:01 UTC
The problem is that the Makefile hardcodes confdir. It is a broken build system, this fixes it and obsoletes your patch:

+       sed -i -e '/^confdir/d' Makefile.in || die
+       sed -i -e 's/$(confdir)/$(sysconfdir)/g' Makefile.in || die

Please test.
Comment 6 Myk Taylor 2012-09-19 17:14:48 UTC
confirmed: your code (added to prepare()) works without any additional patches.  Thanks!
Comment 7 Fabian Groffen gentoo-dev 2012-09-29 12:47:12 UTC
(In reply to comment #5)
> The problem is that the Makefile hardcodes confdir. It is a broken build
> system, this fixes it and obsoletes your patch:
> 
> +       sed -i -e '/^confdir/d' Makefile.in || die
> +       sed -i -e 's/$(confdir)/$(sysconfdir)/g' Makefile.in || die

@idl0r: are you ok with adding this to src_prepare?
Comment 8 Christian Ruppert (idl0r) gentoo-dev 2012-09-29 14:56:27 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > The problem is that the Makefile hardcodes confdir. It is a broken build
> > system, this fixes it and obsoletes your patch:
> > 
> > +       sed -i -e '/^confdir/d' Makefile.in || die
> > +       sed -i -e 's/$(confdir)/$(sysconfdir)/g' Makefile.in || die
> 
> @idl0r: are you ok with adding this to src_prepare?

+1
Just add a comment / bug id there as well please.
Comment 9 Fabian Groffen gentoo-dev 2012-09-29 15:06:48 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #5)
> > > The problem is that the Makefile hardcodes confdir. It is a broken build
> > > system, this fixes it and obsoletes your patch:
> > > 
> > > +       sed -i -e '/^confdir/d' Makefile.in || die
> > > +       sed -i -e 's/$(confdir)/$(sysconfdir)/g' Makefile.in || die
> > 
> > @idl0r: are you ok with adding this to src_prepare?
> 
> +1
> Just add a comment / bug id there as well please.

thanks, committed and done.