1

I'm trying to build an rpm with nginx, and the nginx rtmp module.

I got my nginx source tar.gz, and my rtmp tar.gz, and placed them in the SOURCES dir.

I then made this spec file:

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

This is my first attempt at making an RPM with rpmbuild, or creating a specfile. The 2 packages appear to be extracted to the BUILD dir properly, but the output of rpmbuild -ba SPECS/nginx-with-rtmp.spec shows this error:

./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-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_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

./configure: error: invalid option "--host=x86_64-redhat-linux-gnu"

error: Bad exit status from /var/tmp/rpm-tmp.h4kaTW (%build)

rpmbuild appears to be adding args to ./configure that I didn't ask for (everything in bold), which are breaking the build. It's also overriding some of my args, like prefix.

How can I tell rpmbuild to stop adding args to ./configure? My build works fine when I run that ./configure command manually without rpmbuild.

2

If you don’t want (or need) the standard arguments provided by the %configure macro, you don’t need to use it:

%build
./configure ...
make

(./ instead of %.)

You should still use the appropriate macros for path components in the ./configure arguments.

| improve this answer | |
  • Holy crap - it worked! I could have sworn I tried that multiple times. Maybe something got cached somewhere, so when I tried ./configure after having already used %configure, it was using cache or something. It works on a fresh system. Thanks! – Tal Oct 21 '19 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.