Permalink
Browse files

install all libdirs specified by gemspec require_paths

This fixes packages like ruby-debug that have a lib directory named
something other than "lib" but specify the names in the gemspec
require_paths value.
  • Loading branch information...
1 parent d1d08c2 commit 5b244c39e7e445ba737106c371158406053e6b62 @rtomayko committed Apr 26, 2010
Showing with 22 additions and 4 deletions.
  1. +22 −4 rpg-package-install.sh
View
@@ -158,10 +158,28 @@ manifest="$packagedir/$version/manifest"
# ------------------
# Recursively install all library files into `RPGLIB`.
- test -d "$pack/lib" && {
- mkdir -p "$RPGLIB"
- installdir "$pack/lib" "$RPGLIB"
- }
+ #
+ # A big majority of packages have a single lib directory but some use an
+ # alternative libdir (ruby-debug) and it's also possible to have multiple
+ # lib directories. Use the `require_paths` gemspec value to determine lib
+ # sub-directories, ignoring certain incorrect values (`test`, `ext`, `spec`,
+ # etc.).
+
+ libdirs=$(cat "$packagedir/$version/require_paths" 2>&1)
+ : ${libdirs:=lib}
+
+ for libdir in $libdirs
+ do
+ test "$libdir" = "ext" && continue
+ test "$libdir" = "test" && continue
+ test "$libdir" = "spec" && continue
+
+ if test -d "$pack/$libdir"
+ then mkdir -p "$RPGLIB"
+ installdir "$pack/$libdir" "$RPGLIB"
+ else notice "warning: $package libdir '$libdir' does not exist"
+ fi
+ done
# Ruby Executables
# ----------------

0 comments on commit 5b244c3

Please sign in to comment.