LoginSignup
1
1

More than 5 years have passed since last update.

bashのSRPMからのビルド

Posted at

・shellshock対応でRHEE5のi686環境用のrpmがなかったのでSRPMから作成する手順
・実行環境は64bit centos5のdockerコンテナ

ビルド環境構築

1. rpm-buildのインストール

# yum install rpm-build

依存するパッケージも一緒にインストールされます。

2.mockのインストール

# yum install mock
# useradd -s /sbin/nologin mockbuild

3.buildに必要そうなパッケージ一式インストール

# yum groupinstall "Development Tools"  
# yum install libtermcap-devel

4.32bit用のglibc-develインストール

# yum install glibc-devel.i386

ビルド

1. srpmをダウンロード

# cd /usr/src/redhat/SRPMS
# wget ftp://ftp.pbone.net/mirror/ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/bash-3.2-33.el5_11.4.src.rpm

2.アーキテクチャ指定でビルド

# CC='gcc -m32' CXX='g++ -m32' linux32 rpmbuild --rebuild --target=i686 bash-3.2-33.el5_11.4.src.rpm 

3.成果物確認

# ls -l /usr/src/redhat/RPMS
total 3164
-rw-r--r-- 1 root root 1887161 Nov 19 11:38 bash-3.2-33.4.i686.rpm
-rw-r--r-- 1 root root 1350536 Nov 19 11:38 bash-debuginfo-3.2-33.4.i686.rpm

おわり

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1