## page was renamed from CentOS/YUMリポジトリ/Software Collections <> = Software Collections(SCLs) = * SCLs(Software Collections)はRHEL(CentOS) 上で最新のソフトウェアを利用するためのソフトウェアパッケージ集です。 * Ruby, Python, Perl, PHP, Node.js といった言語の比較的新しいバージョンをサポートするYUMリポジトリとなります。 * 他にも PostgreSQL, MySQL といったミドルウェアの提供もありますが、こちらは別途本家からのものを利用した方がいいと思います。 == SCLsセットアップ == ||<#ffff00> '''リポジトリ名''' ||<#ffff00> '''デフォルト''' ||<#ffff00> '''GPGパス''' ||<#ffff00> '''所属パッケージ''' || || centos-sclo-rh || 有効 || /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo || centos-release-scl-rh || || centos-sclo-rh-testing || 無効 || 署名無し || centos-release-scl-rh || || centos-sclo-rh-source || 無効 || /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo || centos-release-scl-rh || || centos-sclo-rh-debuginfo || 無効 || /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo || centos-release-scl-rh || || centos-sclo-sclo || 有効 || /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo || centos-release-scl || || centos-sclo-sclo-testing || 無効 || 署名無し || centos-release-scl || || centos-sclo-sclo-source || 無効 || /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo || centos-release-scl || || centos-sclo-sclo-debuginfo || 無効 || /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo || centos-release-scl || * 通常の利用において、上記リポジトリが有効で問題無い。 * GDBでデバッグしたい向けは、debuginfo リポジトリを有効にして当該パッケージに該当するパッケージを追加インストールすること。 * ソースについては言うまでも無く。 === 全CentOS共通(CentOS6以降) === {{{ yum -y install centos-release-scl }}} ※centos-release-scl パッケージは centos-release-scl-rh パッケージを含んで(依存)います。 === CentOS5環境 === 未サポート。提供予定無し。 === CentOS4環境 === 未サポート。提供はありえない。 == SCLsインストール例 == * インストールできる「パッケージ集」については [[https://www.softwarecollections.org/en/scls/|Browse All Software Collections]] を参照してください。 * また、インストール方法についても記載がありますが、注意深く読んでください。 * というのもRHELとCentOSでは手順が違います。 === Perl 5.20 === {{{ yum -y install rh-perl520 }}} == SCLs運用メモ == * 混ぜても大丈夫を実現するため、インストール先が特殊です。 * /opt/rh/パッケージ集名/root がインストールの起点(トップディレクトリ)となります。 * 例えば Perl 5.20 であるところの rh-perl520 の場合、「/opt/rh/rh-perl520/root」となります。 * よって PATH 等の調整の必要がありますが、他にも調整しないといけないものがあるので、「scl enable」コマンドを使用して実行します。 {{{ scl enable <パッケージ集名> [<パッケージ集名>...] "コマンド" }}} * 「パッケージ集名」を複数指定することが可能。その場合「パッケージ集名」分の PATH が追加された、とイメージすると良いです。 * 「"コマンド"」はシェル的に単一引数となるように指定します(二個以上の指定はできない)。 * 例えば Perl 5.20 であるところの rh-perl520 の場合、下記のような感じで実行します。 {{{ $ scl enable rh-perl520 "perl -v" This is perl 5, version 20, subversion 1 (v5.20.1) built for x86_64-linux-thread-multi (with 16 registered patches, see perl -V for more detail) Copyright 1987-2014, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. }}} {{{ $ scl enable rh-perl520 bash ※perl 5.20 への PATH が通った bash(子プロセス)が立ち上がる。 }}} * シェルスクリプト上での使用を前提に PATH に含めたい場合、以下のような設定を実施します(イディオム)。 {{{ #!/bin/sh : source /opt/rh/パッケージ集名/enable export X_SCLS="$(scl enable パッケージ集名 'echo $X_SCLS')" : }}} * 当然ですが /usr/local/bin/perl として単純にシンボリックリンクを張るみたいな呼び出し方はできないです。 * 少なくとも上記イディオムを含んだ /usr/local/bin/perl スクリプトを用意する必要があります。 * 常用しようと思って、PATH に入れる(上記イディオムで)など試して見た限りは、かなり煩わしいです。 == SCLs参考文献 == * [[https://wiki.centos.org/SpecialInterestGroup/SCLo|SpecialInterestGroup/SCLo - CentOS Wiki]] * [[https://www.softwarecollections.org/en/scls/|All Sotware Collections]] * [[http://blog.idcf.jp/entry/cloud/software-collections-for-centos-6/|Software Collections for CentOS 6を使おう!]] * [[http://qiita.com/murachi1208/items/741034381893a271ffb9|PHPフレームワーク「Laravel5」の環境を Vagrant, CentOS 6.6, SCLの PHP 5.4, Apache2.4, MariaDB 5.5 で作ってみた、その1]] * [[http://hideharaaws.hatenablog.com/entry/2014/11/29/223040|Redhat6.x + SCL 使う時に気をつけたい3つのポイント]]