Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 62656 - ebuild request: slony (postgresql replication)
Summary: ebuild request: slony (postgresql replication)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-02 14:00 UTC by Jacob Smullyan
Modified: 2007-09-22 23:20 UTC (History)
4 users (show)

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


Attachments
slony-1.0.2.ebuild (slony-1.0.2.ebuild,2.03 KB, text/plain)
2004-09-07 15:24 UTC, MATSUU Takuto (RETIRED)
Details
diff against previously attached slony ebuild (DIFF,988 bytes, patch)
2004-09-13 09:16 UTC, Jacob Smullyan
Details | Diff
Tried to get slony working with pg 8 beta 3 (slony-1.0.2.ebuild,2.05 KB, text/plain)
2004-10-28 07:39 UTC, Calum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Smullyan 2004-09-02 14:00:38 UTC
Slony is a (relatively) new postgresql replication system: http://slony.info/

I don't know how to write the ebuild for this, or I'd contribute it myself.  The problem is that slony requires the src directory of a postgresql build for its own build.  I've been able to build it with a gentoo-ebuild postgresql install by emerging with FEATURES="noclean" and then building against the src directory which is still lying around.  How you would do this in an ebuild I don't know.  

Reproducible: Always
Steps to Reproduce:
Comment 1 MATSUU Takuto (RETIRED) gentoo-dev 2004-09-07 15:24:09 UTC
Created attachment 39152 [details]
slony-1.0.2.ebuild

this ebuild contains hard-coded pgsql version.
Comment 2 Jacob Smullyan 2004-09-08 20:00:51 UTC
Thanks, it seems to install fine.  Hard-coding a postgresql version works, but isn't as flexible as one might like.  Some alternatives:

   1. determine the postgresql version from what happens to be installed (provided that it within the range slony supports, which is pretty broad); recompile everything as you have in the ebuild, with the current USE flags.
DEPEND would be fairly permissive about postgresql version (7.3 or newer).

   2. determine the postgresql version from what happens to be installed, 
as above; additionally, check to see if the source tree exists and use it if 
so.  

   3. ignore the currently installed version and use the ebuild function "best_version" to determine the required postgresql version; dynamically use that function to determine DEPEND.

I don't know the preferred api for determining the currently installed version of a package from within an ebuild; one might have to do something a bit nasty.  I put down 3. for completeness, but I think it is wrong.  1. or 2. seem better to me (2. is perhaps unnecessary); it would be more flexible for users and easier to maintain (you wouldn't have to deal with the power set of slony and postgresql releases!). 

What do you think?  If option 1. isn't too outre, I'll attempt it.
  
Comment 3 Jacob Smullyan 2004-09-13 09:16:37 UTC
Created attachment 39512 [details, diff]
diff against previously attached slony ebuild

It seems that the function defined in /usr/sbin/ebuild.sh, "best_version", will
return the latest *installed* version, which is what we'd want here.  However,
if invoked during the depend phase, it prints a warning to stderr (although it
works).  All it does is call portageq.	

I attach a diff.  However, the fact that best_version produces a warning here
makes me think that someone felt using package introspection during the depend
phase is not nice to do.   I don't see a bad effect directly following from its
use in this case, but perhaps I'm missing something.
Comment 4 Jacob Smullyan 2004-09-13 09:20:20 UTC
Ooops -- I see now that the assumptions this ebuild makes about what sources are needed for postgresql are not correct for all postgresql versions.  This may be correctable by using a >= postgresql depend.
Comment 5 Jacob Smullyan 2004-09-21 12:08:17 UTC
It seems that slony in cvs no longer requires the postgresql source tree! So the problem I was trying to solve will be moot by the next slony release.  I therefore suggest that the original slony ebuild, without my diff, be checked in as dev-db/slony.
Comment 6 Calum 2004-10-28 07:36:31 UTC
I tried to get it working with 8 beta3. (Warning: I have no experience of writing ebuilds)
I used the patch, otherwise it pulled in a load of deps and wanted to downgrade me to 7.x

Problems I found:
The mirrors don't work
--docdir doesn't exist any more
It needs --with-pgsourcetree=/var/tmp/portage/slony-1.0.2/work/postgresql-8.0.0beta3

but it fails with:

checking for cc_r... gcc
configure: error:
    ********************
    * The sourcetree in /var/tmp/portage/slony-1.0.2/work/postgresql-8.0.0beta3
    * does not appear to be built. Please make sure to build
    * and install PostgreSQL from sources first.
    ********************

/usr/lib/portage/bin/ebuild.sh: line 54: --enable-depend: command not found

!!! ERROR: dev-db/slony-1.0.2 failed.
!!! Function src_compile, Line 56, Exitcode 127
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.


I will post my ebuild too.

I would love to see this working so I don't have to compile into /usr/local/*
Comment 7 Calum 2004-10-28 07:39:29 UTC
Created attachment 42776 [details]
Tried to get slony working with pg 8 beta 3

It's not pretty, and it didn't work.
Comment 8 Calum 2004-10-28 07:43:27 UTC
Just visited the slony page and saw that 1.0.5 was out. Wish I'd seen that sooner. Sorry.
Comment 9 Jeffrey Crawford 2004-12-21 09:43:28 UTC
Is this going anywhere? We would like to start using this , but I prefer to use the portage system for package management, Knowing when new releases are out etc.
Comment 10 Ray Russell Reese III (RETIRED) gentoo-dev 2005-01-31 12:59:12 UTC
Any updates on this?

I've taken an interest in it, I'm going to work on updating it for 1.0.5, plus any additional bug fixes along the way. I'll post my progress here. Hopefully revive some interest in this and get it submitted into cvs.
Comment 11 Abdul-Wahid Paterson 2005-02-14 04:05:48 UTC
Ray,

I am also interested in this. I have created my own ebuild for 1.0.5 and have it working on 3 machines ok. I am now adding extra files for an init script and some configuration (examples) for actually running the thing. I am interested in seeing what you have and comparing it. Perhaps we can create a forum post for this where we can hammer out exactly the best way of making it work and we can test it thoroughly. More chance then of getting something submitted to portage. :)
Comment 12 Masatomo Nakano (RETIRED) gentoo-dev 2005-05-11 14:30:25 UTC
I've added slony-1.1.0_beta4.ebuild to the portage tree.

It's working fine in my environment.
But please be careful because it's beta version as it's name.

(Sorry about ignoring 1.0.* versions. 
It's very difficult to handle in portage because it requires postgresql source to compile)