Gentoo Archives: gentoo-commits

From: Martin Mokrejs <mmokrejs@×××××××××××××××.cz>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/gbrowse/files/, sci-biology/gbrowse/
Date: Sat, 30 Jul 2011 14:45:47
Message-Id: fa7a65b1a985d0cd4c830b8cac8e63ce2e576c28.mmokrejs@gentoo
1 commit: fa7a65b1a985d0cd4c830b8cac8e63ce2e576c28
2 Author: Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
3 AuthorDate: Sat Jul 30 14:45:25 2011 +0000
4 Commit: Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
5 CommitDate: Sat Jul 30 14:45:25 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=fa7a65b1
7
8 sci-biology/gbrowse: added support for --destdir, patch sent to upstream
9
10 (Portage version: 2.1.10.7/git/Linux i686, unsigned Manifest commit)
11
12 ---
13 sci-biology/gbrowse/ChangeLog | 8 +++
14 sci-biology/gbrowse/files/destdir.patch | 92 +++++++++++++++++++++++++++++++
15 sci-biology/gbrowse/gbrowse-2.39.ebuild | 3 +-
16 3 files changed, 102 insertions(+), 1 deletions(-)
17
18 diff --git a/sci-biology/gbrowse/ChangeLog b/sci-biology/gbrowse/ChangeLog
19 index b8780b1..5c2bd3e 100644
20 --- a/sci-biology/gbrowse/ChangeLog
21 +++ b/sci-biology/gbrowse/ChangeLog
22 @@ -3,6 +3,14 @@
23 # $Header: /var/cvsroot/gentoo-x86/sci-biology/generic-genome-browser/ChangeLog,v 1.10 2007/07/29 17:07:38 phreak Exp $
24
25 30 Jul 2011; Martin Mokrejs <mmokrejs@×××××××××××××××.cz>
26 + gbrowse-2.39.ebuild, +files/destdir.patch:
27 + added support for --destdir, patch sent to upstream gbrowse-2.39.ebuild
28 +
29 + 30 Jul 2011; Martin Mokrejs <mmokrejs@×××××××××××××××.cz>
30 + gbrowse-2.39.ebuild, +files/destdir.patch:
31 + added support for --destdir, patch sent to upstream
32 +
33 + 30 Jul 2011; Martin Mokrejs <mmokrejs@×××××××××××××××.cz>
34 -gbrowse-2.38.ebuild, -files/GBrowseInstall.pm-2.38.patch,
35 +gbrowse-2.39.ebuild, +files/GBrowseInstall.pm-2.39.patch:
36 version bump but still need to rewrite upstream's install procedure to
37
38 diff --git a/sci-biology/gbrowse/files/destdir.patch b/sci-biology/gbrowse/files/destdir.patch
39 new file mode 100644
40 index 0000000..655158c
41 --- /dev/null
42 +++ b/sci-biology/gbrowse/files/destdir.patch
43 @@ -0,0 +1,92 @@
44 +--- install_util/GBrowseInstall.pm.ori 2011-07-30 16:06:18.000000000 +0200
45 ++++ install_util/GBrowseInstall.pm 2011-07-30 16:06:28.000000000 +0200
46 +@@ -419,6 +419,7 @@
47 + sub ACTION_install {
48 + my $self = shift;
49 + my $prefix = $self->install_base || $self->prefix || '';
50 ++ my $destdir = $self->destdir || '';
51 + GBrowseGuessDirectories->prefix($prefix);
52 +
53 + $self->depends_on('config_data');
54 +@@ -445,7 +446,7 @@
55 +
56 + # fix some directories so that www user can write into them
57 + my $tmp = $self->config_data('tmp') || GBrowseGuessDirectories->tmp;
58 +- mkpath($tmp);
59 ++ mkpath($destdir.$tmp);
60 + my ($uid,$gid) = (getpwnam($user))[2,3];
61 +
62 + # taint check issues
63 +@@ -454,29 +455,29 @@
64 + $gid =~ /^(\d+)$/;
65 + $gid = $1;
66 +
67 +- unless (chown $uid,$gid,$tmp) {
68 ++ unless (chown $uid,$gid,$destdir.$tmp) {
69 + $self->ownership_warning($tmp,$user);
70 + }
71 +
72 + my $htdocs_i = File::Spec->catfile($self->install_path->{htdocs},'i');
73 + my $images = File::Spec->catfile($tmp,'images');
74 + my $htdocs = $self->install_path->{htdocs};
75 +- chown $uid,-1,$htdocs;
76 ++ chown $uid,-1,$destdir.$htdocs;
77 + {
78 + local $> = $uid;
79 + symlink($images,$htdocs_i); # so symlinkifowner match works!
80 + }
81 +- chown $>,-1,$self->install_path->{htdocs};
82 ++ chown $>,-1,$destdir.$self->install_path->{htdocs};
83 +
84 + my $persistent = $self->install_path->{'persistent'};
85 + my $sessions = File::Spec->catfile($persistent,'sessions');
86 + my $userdata = File::Spec->catfile($persistent,'userdata');
87 +- mkpath([$sessions,$userdata],0711);
88 ++ mkpath([$destdir.$sessions,$destdir.$userdata],0711);
89 +
90 + my $databases = $self->install_path->{'databases'};
91 +
92 +- unless (chown $uid,$gid,glob(File::Spec->catfile($databases,'').'*')) {
93 +- $self->ownership_warning($databases,$user);
94 ++ unless (chown $uid,$gid,glob($destdir.File::Spec->catfile($databases,'').'*')) {
95 ++ $self->ownership_warning($destdir.$databases,$user);
96 + }
97 +
98 + # chmod 0755,File::Spec->catfile($self->install_path->{'etc'},'init.d','gbrowse-slave');
99 +@@ -490,7 +491,7 @@
100 + my $perl = $self->perl;
101 + my @inc = map{"-I$_"} split ':',$self->added_to_INC;
102 + system $perl,@inc,$metadb_script;
103 +- system 'sudo','chown','-R',"$uid.$gid",$sessions,$userdata;
104 ++ system 'sudo','chown','-R',"$uid.$gid",$destdir.$sessions,$destdir.$userdata;
105 +
106 + # if (Module::Build->y_n(
107 + # "It is recommended that you restart Apache. Shall I try this for you?",'y'
108 +@@ -600,6 +601,7 @@
109 + my $self = shift;
110 +
111 + my $prefix = $self->install_base || $self->prefix || '';
112 ++ my $destdir = $self->destdir || '';
113 + GBrowseGuessDirectories->prefix($prefix);
114 + my $install_path = GBrowseGuessDirectories->etc;
115 +
116 +@@ -647,7 +649,7 @@
117 + if ($self->config_data('installconf') =~ /^[yY]/ && !-e "${includes}/$file") {
118 + warn "Creating include file for Apache config: $target\n";
119 + my $dir = dirname($target);
120 +- mkpath([$dir]);
121 ++ mkpath([$destdir.$dir]);
122 + if (my $f = IO::File->new("blib${includes}/$file",'>')) {
123 + $f->print($self->apache_conf);
124 + $f->close;
125 +@@ -935,8 +937,9 @@
126 + sub ownership_warning {
127 + my $self = shift;
128 + my ($path,$owner) = @_;
129 ++ my $destdir = $self->destdir || '';
130 + warn "*** WARNING: Using sudo to change ownership of $path to '$owner'. You may be prompted for your login password ***\n";
131 +- system "sudo chown -R $owner $path";
132 ++ system "sudo chown -R $owner $destdir.$path";
133 + }
134 +
135 + sub cgiurl {
136
137 diff --git a/sci-biology/gbrowse/gbrowse-2.39.ebuild b/sci-biology/gbrowse/gbrowse-2.39.ebuild
138 index 426ee4b..0acd25a 100644
139 --- a/sci-biology/gbrowse/gbrowse-2.39.ebuild
140 +++ b/sci-biology/gbrowse/gbrowse-2.39.ebuild
141 @@ -89,7 +89,8 @@ RDEPEND="${DEPEND}
142 src_prepare() {
143 sed -i 's/return unless -t STDIN/return/' install_util/GBrowseInstall.pm || die
144 sed -i 's/process_/bp_process_/g' INSTALL || die
145 - epatch "${FILESDIR}"/GBrowseInstall.pm-"${PV}".patch || die "Failed to patch"
146 + epatch "${FILESDIR}"/GBrowseInstall.pm-"${PV}".patch || die "Failed to apply GBrowseInstall.pm-"${PV}".patch"
147 + epatch "${FILESDIR}"/destdir.patch || die "Failed to apply destdir.patch "
148 }
149
150 src_configure() {