1:HL["/_next/static/css/e0b87381b78a72d0.css",{"as":"style"}] 0:["00Nw3V7p6jjR7VBCI9FoH",[[["",{"children":["blog",{"children":[["slug","2013/05/03/create-mesos-rpm-using-fpm","c"],{"children":["__PAGE__?{\"slug\":[\"2013\",\"05\",\"03\",\"create-mesos-rpm-using-fpm\"]}",{}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/e0b87381b78a72d0.css","precedence":"next"}]],"$L3"]]]] 4:I{"id":4896,"chunks":["896:static/chunks/896-da17be67249e7703.js","797:static/chunks/app/blog/[...slug]/page-a20797c105738917.js"],"name":"","async":false} 5:I{"id":3466,"chunks":["272:static/chunks/webpack-a5603073f1184a0b.js","253:static/chunks/bce60fc1-3138fc63e84359d9.js","961:static/chunks/961-177df6473dc74d43.js"],"name":"default","async":false} 6:I{"id":372,"chunks":["272:static/chunks/webpack-a5603073f1184a0b.js","253:static/chunks/bce60fc1-3138fc63e84359d9.js","961:static/chunks/961-177df6473dc74d43.js"],"name":"default","async":false} 2:[["$","html",null,{"lang":"ja","children":["$","body",null,{"children":[["$","header",null,{"children":["$","h1",null,{"id":"site-title","children":["$","$L4",null,{"href":"/","children":"apatheia.info"}]}]}],["$","main",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":["$","div",null,{"children":[["$","h2",null,{"children":"Not Found"}],["$","p",null,{"children":"Could not find requested resource"}],["$","p",null,{"children":["View ",["$","$L4",null,{"href":"/","children":"all posts"}]]}]]}],"notFoundStyles":[],"childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children",["slug","2013/05/03/create-mesos-rpm-using-fpm","c"],"children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$L7",null],"segment":"__PAGE__?{\"slug\":[\"2013\",\"05\",\"03\",\"create-mesos-rpm-using-fpm\"]}"},"styles":[]}],"segment":["slug","2013/05/03/create-mesos-rpm-using-fpm","c"]},"styles":[]}],"segment":"blog"},"styles":[]}]}],["$","footer",null,{"children":["$","ul",null,{"children":[["$","li",null,{"children":"Link:"}],["$","li",null,{"children":["$","a",null,{"href":"https://twitter.com/f440","children":"Twitter"}]}],["$","li",null,{"children":["$","a",null,{"href":"https://github.com/f440","children":"Github"}]}],["$","li",null,{"children":["$","a",null,{"href":"https://pinbaord.in/u:f440","children":"Pinbaord"}]}]]}]}]]}]}],null] 3:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"fpm で Mesos の RPM を作るまで - aptheia.info"}],["$","meta","2",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","3",{"rel":"alternate","type":"application/rss+xml","href":"/atom.xml"}]] 8:Td1b,
Mesos をインストールするとき各マシンでビルドはしんどいので、fpm で Mesos の RPM を作ってインストールしている。ビルドからパッケージ作成までの作業ログを残しておく。
作業環境は CentOS 6.4 x86_64。
Ruby をインストール。
sudo yum install ruby.x86_64 rubygems ruby-devel.x86_64 rpm-build.x86_64
fpm をインストール。
sudo gem install fpm --no-rdoc --no-ri
Mesos のソースをダウンロード、展開。
curl -LO http://ftp.meisei-u.ac.jp/mirror/apache/dist/incubator/mesos/mesos-0.10.0-incubating/mesos-0.10.0-incubating.tar.gz
tar xf mesos-0.10.0-incubating.tar.gz
cd mesos-0.10.0
Mesos のビルドに必要なパッケージをインストール。
sudo yum install gcc-c++.x86_64 patch.x86_64 python-devel.x86_64 \
cppunit-devel.x86_64 java-1.6.0-openjdk-devel.x86_64
ビルド。今回は、configure のオプションで Redhat っぽい配置を指定している。/opt/mesos
とか /usr/local/mesos
に全部まとめたければ --prefix を使うなど、このあたりはお好みで。
make install
時には書き込み可能な場所を DESTDIR で指定。説明中では、/tmp/mesos
を利用している。
JAVA_HOME=/etc/alternatives/java_sdk ./configure \
--bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec \
--localstatedir=/var --libdir=/usr/lib64 --includedir=/usr/include \
--datarootdir=/usr/share
make
make install DESTDIR=/tmp/mesos
fpm でパッケージを作成。詳細は fpm --help を参照。注意点としては、--description
は RPM のメタ情報 description
, summary
で兼用されるので、あまり長い情報を入れると yum search
とかがごちゃごちゃすることになる。適度に切り詰めた方がいい。
fpm -s dir -t rpm \
-v 0.10.0 \
-n mesos \
-C /tmp/mesos \
-a x86_64 \
--license "ASL 2.0" \
--url "http://incubator.apache.org/mesos/" \
--description "Dynamic resource sharing for clusters" \
-d python-devel \
-d java-1.6.0-openjdk-devel \
.
RPM ファイルのメタ情報やファイル一覧をチェック。
rpm -qpi mesos-0.10.0-1.x86_64.rpm
rpm -qpl mesos-0.10.0-1.x86_64.rpm
あとは、できあがった RPM ファイルを他のマシンに持っていってインストール。
sudo yum install ./mesos-0.10.0-1.x86_64.rpm
7:["$","article",null,{"children":[["$","h1",null,{"children":"fpm で Mesos の RPM を作るまで"}],["$","p",null,{"id":"article-info","children":["2013.05.03"," ",[["$","span","packaging",{"children":[["$","$L4",null,{"href":"/blog/categories/packaging","children":"packaging"}]," "]}],["$","span","mesos",{"children":[["$","$L4",null,{"href":"/blog/categories/mesos","children":"mesos"}]," "]}]]]}],["$","div",null,{"dangerouslySetInnerHTML":{"__html":"$8"}}]]}]