Help us understand the problem. What is going on with this article?

ProxySQL2.0をbuildしてrpmを作る

More than 1 year has passed since last update.

概要

ProxySQL2.0がリリースされましたが、2018/8/8時点ではrpmがなかったのでbuildしてみました。
make install すれば使えますが

環境

  • CentOS 7.3

手順

事前準備

  • docker, docker-composeをインストールする
  • dockerを起動しておく
  • ここの手順 の通りに make まで進めます。

build手順

以下のコマンドでbuildが開始されます。今回はCentOS7用のrpmを作ります。

$ sudo make centos7

エラー対応

エラーメッセージ

私の環境では、以下のエラーメッセージが出力されbuildがこけました。

centos7_build_1        | error: Bad owner/group: /root/rpmbuild/SPECS/proxysql.spec
centos7_build_1        |     bogus date in %changelog: Sat Mar 11 2016 Rene Cannao <rene.cannao@gmail.com> 1.1.2
centos7_build_1        |     Bad owner/group: /root/rpmbuild/SPECS/proxysql.spec
centos7_build_1        |
centos7_build_1        |
centos7_build_1        | RPM build errors:
proxysql_centos7_build_1 exited with code 1
docker-compose rm -f
Going to remove proxysql_centos7_build_1
Removing proxysql_centos7_build_1 ... done

対応

調査してみると proxysql.spec の権限が root:rootじゃないといけないようだったので修正しました。

# 編集
$ cd /path/to/source_proxysql_directory
$ vim docker/images/proxysql/rhel-compliant/entrypoint/entrypoint.bash

# 編集内容
$ diff -u /tmp/entrypoint.bash docker/images/proxysql/rhel-compliant/entrypoint/entrypoint.bash
--- /tmp/entrypoint.bash    2018-08-08 10:54:27.089378333 +0900
+++ docker/images/proxysql/rhel-compliant/entrypoint/entrypoint.bash    2018-08-08 15:15:25.336411161 +0900
@@ -18,6 +18,7 @@
 tar czvf proxysql-${CURVER}.tar.gz proxysql-${CURVER} && \
 mkdir -p /root/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp} && \
 mv /opt/proxysql/proxysql-${CURVER}.tar.gz /root/rpmbuild/SOURCES && \
+chown root:root /root/rpmbuild/SPECS/proxysql.spec
 cd /root/rpmbuild && rpmbuild -ba SPECS/proxysql.spec --define "version ${CURVER}" && \
 mv /root/rpmbuild/RPMS/x86_64/proxysql-${CURVER}-1.x86_64.rpm /opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.x86_64.rpm && \
 # Cleanup current build
$

参考ページ

https://github.com/sysown/proxysql/wiki/Packaging

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away