Welcome! Log In Create A New Profile

Advanced

Re: Help needed with Nginx SRPM script

Andrei Belov
April 16, 2021 02:36AM
> On 16 Apr 2021, at 08:50, Thomas Stephen Lee <lee.iitb@gmail.com> wrote:
>
> Hi,
>
> I have the following script on RHEL 7
>
>
> --------------Script Start---------------------
>
> OPENSSL="openssl-1.1.1k"
> NGINX_VERSION="1.19.10-1"
>
> rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-$NGINX_VERSION.el7.ngx.src.rpm
>
> sed -i "/Source12: .*/a Source100:
> https://www.openssl.org/source/$OPENSSL.tar.gz"
> /home/builder/rpmbuild/SPECS/nginx.spec
> sed -i "s|--with-http_ssl_module|--with-http_ssl_module
> --with-openssl=$OPENSSL |g" /home/builder/rpmbuild/SPECS/nginx.spec
> sed -i '/%setup -q/a tar zxf %{SOURCE100}'
> /home/builder/rpmbuild/SPECS/nginx.spec
> sed -i '/.*Requires: openssl.*/d' /home/builder/rpmbuild/SPECS/nginx.spec
> sed -i 's|%define WITH_LD_OPT .*|%define WITH_LD_OPT ""|g'
> /home/builder/rpmbuild/SPECS/nginx.spec
> sed -i 's| -fPIC||g' /home/builder/rpmbuild/SPECS/nginx.spec
>
> spectool -g -R /home/builder/rpmbuild/SPECS/nginx.spec
>
> rpmbuild -ba /home/builder/rpmbuild/SPECS/nginx.spec
>
> --------------Script End---------------------
>
> This Script worked with
>
> NGINX_VERSION="1.19.9-1"
>
> but does not work with
>
> NGINX_VERSION="1.19.10-1"
>
> Can you please help me with what is wrong?
> I have been using this script which I got from GitHub, for the past two years.

The script itself seems a bit hacky. If you would like to use nginx with openssl 1.1.1,
you should consider switching to e.g. CentOS/RHEL 8 where it's available out of the box.

Alternatively, you can use publicly available packaging sources [1] to do such kind of
modifications - this way you'll be able to add any customizations without using SRPMs
at all.

If none of the above options seem suitable, you can just modify single line of the script
to make it work with 1.19.10 SRPM, but there's no any guarantee it won't break again
in future:

sed -i '/%setup -q/a tar zxf %{SOURCE100}' /home/builder/rpmbuild/SPECS/nginx.spec

should be:

sed -i '/%autosetup -p1/a tar zxf %{SOURCE100}' /home/builder/rpmbuild/SPECS/nginx.spec

A relevant piece was recently changed in our spec [2].

Hope this helps,

-- Andrei


[1] https://hg.nginx.org/pkg-oss
[2] https://hg.nginx.org/pkg-oss/rev/96441fe2b7d9#l9.26

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Help needed with Nginx SRPM script

Thomas Stephen Lee April 16, 2021 01:52AM

Re: Help needed with Nginx SRPM script

Andrei Belov April 16, 2021 02:36AM

Re: Help needed with Nginx SRPM script

Thomas Stephen Lee April 16, 2021 06:02AM

Re: Help needed with Nginx SRPM script

Andrei Belov April 16, 2021 06:12AM

Re: Help needed with Nginx SRPM script

Thomas Stephen Lee April 16, 2021 08:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready