目次
※ RPM も参照の事。
# su - rpmdevel $ cd rpm/SOURCES $ wget http://cache.ruby-lang.org/pub/ruby/ruby-2.0.0-p451.tar.bz2
$ cd /home/rpmdevel/rpm/SPECS $ vi ruby200p451.spec
%define rubyver 2.0.0 %define rubyminorver p451 Name: ruby Version: %{rubyver}%{rubyminorver} Release: 2%{?dist} License: Ruby License/GPL - see COPYING URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: readline libyaml libyaml-devel readline-devel ncurses ncurses-devel gdbm gdbm-devel glibc-devel tcl-devel gcc unzip openssl-devel db4-devel byacc make libffi-devel Requires: libyaml Source0: ftp://ftp.ruby-lang.org/pub/ruby/ruby-%{rubyver}-%{rubyminorver}.tar.bz2 Summary: An interpreter of object-oriented scripting language Group: Development/Languages Provides: ruby(abi) = 2.0 Provides: ruby-irb Provides: ruby-rdoc Provides: ruby-libs Provides: ruby-devel Provides: rubygems Obsoletes: ruby Obsoletes: ruby-libs Obsoletes: ruby-irb Obsoletes: ruby-rdoc Obsoletes: ruby-devel Obsoletes: rubygems %description Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. %prep %setup -n ruby-%{rubyver}-%{rubyminorver} %build export CFLAGS="$RPM_OPT_FLAGS -Wall -fno-strict-aliasing" %configure \ --enable-shared \ --disable-rpath \ --without-X11 \ --without-tk \ --includedir=%{_includedir}/ruby \ --libdir=%{_libdir} make %{?_smp_mflags} %install # installing binaries ... make install DESTDIR=$RPM_BUILD_ROOT #we don't want to keep the src directory rm -rf $RPM_BUILD_ROOT/usr/src %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %{_bindir} %{_includedir} %{_datadir} %{_libdir}
$ rpmbuild -bb ruby200p451.spec依存性についてエラーが表示される。
エラー: ビルド依存性の失敗: libyaml は ruby-2.1.1-1.el6.i686 に必要とされています libyaml-devel は ruby-2.1.1-1.el6.i686 に必要とされています readline-devel は ruby-2.1.1-1.el6.i686 に必要とされています ncurses-devel は ruby-2.1.1-1.el6.i686 に必要とされています gdbm-devel は ruby-2.1.1-1.el6.i686 に必要とされています tcl-devel は ruby-2.1.1-1.el6.i686 に必要とされています libffi-devel は ruby-2.1.1-1.el6.i686 に必要とされています
$ exit # yum -y install readline-devel ncurses-devel gdbm-devel tcl-devel libffi-devel
# yum --enablerepo=epel install libyaml libyaml-devel
$ rpmbuild -bb ruby200p451.spec
$ sudo rpm -Uvh /home/rpmdevel/rpm/RPMS/i686/ruby-2.0.0p451-2.el6.i686.rpm
$ ruby -v ruby 2.0.0p451 (2014-02-24 revision 45167) [i686-linux]
# gem install bundler --no-rdoc --no-ri Fetching: bundler-1.5.3.gem (100%) Successfully installed bundler-1.5.3 1 gem installed
# yum install libcurl-devel
# yum install ImageMagick ImageMagick-devel # yum install ipa-pgothic-fontsImageMagickと日本語フォントはガントチャートをPNG形式の画像にエクスポートするのに使われる。
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... no Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby Gem files will remain installed in /usr/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2 for inspection. Results logged to /usr/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/ext/RMagick/gem_make.out An error occurred while installing rmagick (2.13.2), and Bundler cannot continue. Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.