rpmbuildを使用して./configure argsを指定するには?

rpmbuildを使用して./configure argsを指定するには?

私はnginxとnginx rtmpモジュールを使ってrpmを構築しようとしています。

nginxソースtar.gzとrtmp tar.gzをインポートし、SOURCESディレクトリに配置しました。

その後、この仕様ファイルを作成しました。

Name:       nginx
Version:    1.16.1
Release:    1%{?dist}
Summary:    Nginx with RTMP module

License:    GPLv3 Probably
URL:        nginx.com
Source0:    nginx-1.16.1.tar.gz
Source1:    nginx-rtmp-module.tar.gz


BuildRequires:  openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed geoip-devel gperftools-devel pcre-devel zlib-devel
Requires: bash glibc glibc glibc openssl-libs openssl-libs openssl-libs glibc glibc pcre gperftools-libs glibc glibc openssl-libs openssl-libs zlib nginx-all-modules nginx-filesystem nginx-filesystem openssl pcre pcre centos-indexhtml glibc glibc centos-logos systemd 

%description
Nginx 1.16.1 with RTMP module

%prep
%setup -q
%setup -q -T -D -a 1


%build
%configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E' --add-module=./nginx-rtmp-module
make 


%install
make install

rpmbuildを使ってRPMを作成したり、仕様ファイルを作成したりするのは今回が初めてです。 2つのパッケージがBUILDディレクトリに正しく抽出されているように見えますが、出力にはrpmbuild -ba SPECS/nginx-with-rtmp.spec次のエラーが表示されます。

。 /構成--build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependent-tracking --prefix=/usr --exec-prefix=/usr - -bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/ usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info--prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var /lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi -- http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with- http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_ -http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_modus_module=動的 --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=動的 --with-stream_ssl_module --with-google_perftools_module --with-debug '--with-cc-opt=- O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fExceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat /redhat-hardened-cc1 -m64 -mtune=generic' '--with-ld-opt=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,- E '--追加モジュール=./nginx-rtmp-モジュール

./configure: エラー: 無効なオプション "--host=x86_64-redhat-linux-gnu"

エラー:/var/tmp/rpm-tmp.h4kaTW(%build)の無効な終了ステータス

./configurerpmbuildは私が要求していないパラメータを追加しているようです(すべての項目は太字で表示されます)。これによりビルドが中断されます。またprefix

パラメータの追加を停止するようにrpmbuildに指示するにはどうすればよいですか./configure? rpmbuildなしで手動でコマンドを実行すると、./configureビルドは正常に機能します。

ベストアンサー1

マクロが提供する標準引数が望ましくない場合、または必要でない場合は、%configureそれを使用する必要はありません。

%build
./configure ...
make

./変更する%。)

あなたはまだ使用する必要があります適切なマクロパラメータのパスコンポーネント用です./configure

おすすめ記事