LoginSignup
1
1

More than 3 years have passed since last update.

CentOS7でrpmを作るためにfpm使ってみた

Last updated at Posted at 2017-02-15

fpm

インストール
RUN yum -y install ruby ruby-devel ruby-libs rubygems rpm-build \
 && gem install fpm --no-rdoc --no-ri
使い方
RUN fpm -s dir \
  -v 4.0.30 \
  -t rpm \
  -n opt-mysql-client \
  -p opt-mysql-client-4.0.30.el7.x86_64.rpm \
  -C /opt/mysql \
  -a x86_64

version指定

  • -v指定する。version一覧
  • ubuntu 14.04 の ruby に対応しているのは 0.4.32 まで。
gem install fpm --no-rdoc --no-ri -v "1.10.2"

checkinstall

checkinstallも動くがrpm作成に失敗することがあった。fpmだと作れた。

インストール
RUN yum install -y -q git gettext which && yum clean all
WORKDIR /usr/local/src/
RUN git clone http://checkinstall.izto.org/checkinstall.git
WORKDIR /usr/local/src/checkinstall
RUN sed -i 's@CONFDIR=$(PREFIX)/lib/checkinstall@CONFDIR=$(PREFIX)@g' Makefile \
 && sed -i 's@EXCLUDE=""@EXCLUDE="/selinux"@g' checkinstallrc-dist \
 && sed -i 's@LIBDIR=$(PREFIX)/lib@LIBDIR=$(PREFIX)/lib64@g' installwatch/Makefile \
 && make -s \
 && make install \
 && mkdir -p /root/rpmbuild/SOURCES
RUN checkinstall -y -R --pkgname=checkinstall
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