2 # This helper is for templates using gem files from RubyGems.
9 _GEMDIR
=$
($gem_cmd env gemdir
)
10 _INSTDIR
=${DESTDIR}/${_GEMDIR}/gems/${pkgname#ruby-}-${version}
14 --install-dir ${DESTDIR}/${_GEMDIR} \
15 --bindir ${DESTDIR}/usr
/bin \
16 --ignore-dependencies \
19 ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${pkgname#ruby-}-${version}.gem
22 rm -rf ${DESTDIR}/${_GEMDIR}/cache
24 # Remove ext directory. they are only source code and configuration
25 # The actual extensions are guarded in an arch path
26 rm -rf ${_INSTDIR}/ext
28 # Remove installed tests and benchmarks
29 rm -rf ${_INSTDIR}/{test,tests
,autotest
,benchmark
,benchmarks
,script,examples
,demo
}
31 # Remove files shipped on the root of the gem, most of the time they are useless
32 find ${_INSTDIR} -maxdepth 1 -type f
-delete
34 # Remove unnecessary files
35 find ${DESTDIR}/${_GEMDIR}/extensions \
( -name mkmf.log
-o -name gem_make.out \
) -delete
37 # Place manpages in usr/share/man/man[0-9]
38 if [ -d ${_INSTDIR}/man
]; then
39 find ${_INSTDIR}/man
-type f
-name '*.[0-8n]' |
while read -r m
; do
44 rm -rf "${_INSTDIR}/man"
46 # Place executables in /usr/bin
47 if [ -d "${_INSTDIR}/bin" ]; then
48 for f
in "${_INSTDIR}"/bin
/*; do
53 rm -rf ${_INSTDIR}/bin
55 # Place conf files in their places
56 if [ -d ${_INSTDIR}/etc
]; then
57 find ${_INSTDIR}/etc
-type f |
while read -r c
; do
59 mv ${c} "${DESTDIR}/${c##*${_INSTDIR}/etc/}/"
63 rm -rf ${_INSTDIR}/etc
65 # Ignore the ~> operator, replace it with >=
67 -i ${DESTDIR}/${_GEMDIR}/specifications/${pkgname#ruby-}-${version}.gemspec