0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

公式 httpd ソースから古いバージョンの rpmbuild

Posted at

el8 環境で特定バージョンの rpm が見つからなかったので、ソースからビルド
あまり情報がなくて少し苦労したのでメモ

  • 公式の httpd ソースには、spec ファイルが含まれているので直接 rpmbuild -bt httpd-2.4.46.tar.bz2 で構築可能
  • systemd 環境に対応する為、ソースを解凍して configure オプション--enable-systemd を追加する
  • el8 互換の docker image rockylinux:8 から作成
  1. docker ファイル
    Dockerfile
    FROM rockylinux:8
    
    RUN dnf install -y epel-release && \
        dnf  config-manager --set-enabled powertools && \
        dnf groupinstall -y 'Development Tools'  && \
        dnf groupinstall -y 'RPM Development Tools'  && \
        dnf install -y apr-devel apr-util-devel autoconf libselinux-devel libuuid-devel libxml2-devel lua-devel openldap-devel openssl-devel pcre-devel perl zlib-devel systemd-devel
    
    # https://archive.apache.org/dist/httpd/httpd-2.4.46.tar.bz2
    COPY httpd-2.4.46.tar.bz2 .
    RUN tar xjf httpd-2.4.46.tar.bz2 && mkdir -p /root/rpmbuild/SOURCES/ && mv httpd-2.4.46.tar.bz2 /root/rpmbuild/SOURCES/
    #
    # mod_systemd 追加
    RUN sed -i "s/%configure/%configure --enable-systemd/;/mod_watchdog/a %{_libdir}/httpd/modules/mod_systemd.so" httpd-2.4.46/httpd.spec
    RUN rpmbuild --clean -bb  httpd-2.4.46/httpd.spec
    RUN rm -rf httpd-2.4.46
    #RUN rpmbuild -tb --clean httpd-2.4.46.tar.bz2
    CMD ["bash"]
    
  2. docker build
    $ docker build . -t  httpd_rpm_build_el8
    
  3. バイナリをホストにコピー
    $ mkdir rpms
    $ docker run -ti --rm -v `pwd`/rpms:/tmp  httpd_rpm_build_el8 bash -c 'cp 
    /root/rpmbuild/RPMS/x86_64/* /tmp/'
    $ ls rpms/
    httpd-2.4.46-1.x86_64.rpm              httpd-devel-debuginfo-2.4.46-1.x86_64.rpm  mod_authnz_ldap-2.4.46-1.x86_64.rpm            mod_proxy_html-2.4.46-1.x86_64.rpm 
    httpd-debuginfo-2.4.46-1.x86_64.rpm    httpd-manual-2.4.46-1.x86_64.rpm           mod_authnz_ldap-debuginfo-2.4.46-1.x86_64.rpm  mod_proxy_html-debuginfo-2.4.46-1.x86_64.rpm
    httpd-debugsource-2.4.46-1.x86_64.rpm  httpd-tools-2.4.46-1.x86_64.rpm            mod_lua-2.4.46-1.x86_64.rpm                    mod_ssl-2.4.46-1.x86_64.rpm
    httpd-devel-2.4.46-1.x86_64.rpm        httpd-tools-debuginfo-2.4.46-1.x86_64.rpm  mod_lua- 
    debuginfo-2.4.46-1.x86_64.rpm          mod_ssl-debuginfo-2.4.46-1.x86_64.rpm
    
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?