/[gentoo-x86]/eclass/ruby.eclass
Gentoo

Diff of /eclass/ruby.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.10 Revision 1.11
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/ruby.eclass,v 1.10 2003/10/20 12:01:18 usata Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/ruby.eclass,v 1.11 2003/11/03 15:55:37 usata Exp $
4# 4#
5# Author: Mamoru KOMACHI <usata@gentoo.org> 5# Author: Mamoru KOMACHI <usata@gentoo.org>
6# 6#
7# The ruby eclass is designed to allow easier installation of ruby 7# The ruby eclass is designed to allow easier installation of ruby
8# softwares, and their incorporation into the Gentoo Linux system. 8# softwares, and their incorporation into the Gentoo Linux system.
26 USE_RUBY_1_8=1 26 USE_RUBY_1_8=1
27fi 27fi
28 28
29ruby_src_unpack() { 29ruby_src_unpack() {
30 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 30 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \
31 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] ; then 31 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
32 [ -n "${RUBY_SLOT}" ] ; then
32 mkdir -p ${S}/{1.6,1.8} 33 mkdir -p ${S}/{1.6,1.8}
34 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
33 cd ${S}/1.6; unpack ${A}; cd - 35 cd ${S}/1.6; unpack ${A}; cd -
36 fi
37 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
34 cd ${S}/1.8; unpack ${A}; cd - 38 cd ${S}/1.8; unpack ${A}; cd -
39 fi
35 else 40 else
36 unpack ${A} 41 unpack ${A}
37 fi 42 fi
38} 43}
39 44
72 fi 77 fi
73} 78}
74 79
75ruby_econf() { 80ruby_econf() {
76 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 81 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \
77 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] ; then 82 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
83 [ -n "${RUBY_SLOT}" ] ; then
84 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
78 einfo "running econf for ruby 1.6 ;)" 85 einfo "running econf for ruby 1.6 ;)"
79 cd 1.6/${S#${WORKDIR}} 86 cd 1.6/${S#${WORKDIR}}
80 erubyconf ruby16 $@ || die 87 erubyconf ruby16 $@ || die
81 cd - 88 cd -
89 fi
90 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
82 einfo "running econf for ruby 1.8 ;)" 91 einfo "running econf for ruby 1.8 ;)"
83 cd 1.8/${S#${WORKDIR}} 92 cd 1.8/${S#${WORKDIR}}
84 erubyconf ruby18 $@ || die 93 erubyconf ruby18 $@ || die
85 cd - 94 cd -
95 fi
86 else 96 else
87 einfo "running econf for ruby ;)" 97 einfo "running econf for ruby ;)"
88 erubyconf ruby $@ || die 98 erubyconf ruby $@ || die
89 fi 99 fi
90} 100}
95 fi 105 fi
96} 106}
97 107
98ruby_emake() { 108ruby_emake() {
99 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 109 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \
100 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] ; then 110 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
111 [ -n "${RUBY_SLOT}" ] ; then
112 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
101 einfo "running emake for ruby 1.6 ;)" 113 einfo "running emake for ruby 1.6 ;)"
102 cd 1.6/${S#${WORKDIR}} 114 cd 1.6/${S#${WORKDIR}}
103 erubymake $@ || die 115 erubymake $@ || die
104 cd - 116 cd -
117 fi
118 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
105 einfo "running emake for ruby 1.8 ;)" 119 einfo "running emake for ruby 1.8 ;)"
106 cd 1.8/${S#${WORKDIR}} 120 cd 1.8/${S#${WORKDIR}}
107 erubymake $@ || die 121 erubymake $@ || die
108 cd - 122 cd -
123 fi
109 else 124 else
110 einfo "running emake for ruby ;)" 125 einfo "running emake for ruby ;)"
111 erubymake $@ || die 126 erubymake $@ || die
112 fi 127 fi
113} 128}
135 ${RUBY} install.rb install $@ \ 150 ${RUBY} install.rb install $@ \
136 || die "install.rb install failed" 151 || die "install.rb install failed"
137 elif [ -f extconf.rb -o -f Makefile ] ; then 152 elif [ -f extconf.rb -o -f Makefile ] ; then
138 make DESTDIR=${D} $@ install || die "make install failed" 153 make DESTDIR=${D} $@ install || die "make install failed"
139 else 154 else
140 if [ "${WANT_RUBY_1_6}" -o "${WANT_RUBY_1_8}" ] ; then 155 if [ "${WANT_RUBY_1_6}" -o "${WANT_RUBY_1_8}" \
156 -o "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "1.8" ] ; then
141 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]') 157 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]')
142 else 158 else
143 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]') 159 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]')
144 fi 160 fi
145 insinto ${siteruby} 161 insinto ${siteruby}
148} 164}
149 165
150ruby_einstall() { 166ruby_einstall() {
151 167
152 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 168 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \
153 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] ; then 169 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
170 [ -n "${RUBY_SLOT}" ] ; then
171 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
154 einfo "running einstall for ruby 1.6 ;)" 172 einfo "running einstall for ruby 1.6 ;)"
155 cd ${S}/1.6/${S#${WORKDIR}} 173 MY_S=${S}/1.6/${S#${WORKDIR}}
174 cd ${MY_S}
156 erubyinstall ruby16 $@ 175 erubyinstall ruby16 $@
157 cd - 176 fi
177 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
158 einfo "running einstall for ruby 1.8 ;)" 178 einfo "running einstall for ruby 1.8 ;)"
159 cd ${S}/1.8/${S#${WORKDIR}} 179 MY_S=${S}/1.8/${S#${WORKDIR}}
180 cd ${MY_S}
160 erubyinstall ruby18 $@ 181 erubyinstall ruby18 $@
161 S=${S}/1.8/${S#${WORKDIR}} 182 fi
183 S=${MY_S}
162 #cd - 184 #cd -
163 else 185 else
164 einfo "running einstall for ruby ;)" 186 einfo "running einstall for ruby ;)"
165 erubyinstall ruby $@ 187 erubyinstall ruby $@
166 fi 188 fi

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20