%define perl_vendorarch %(eval "`%{_bindir}/perl -V:installvendorarch`"; echo $installvendorarch) %define perl_vendorarch64 %(eval "`%{_bindir}/perl_64bit -V:installvendorarch`"; echo $installvendorarch) %define nginx_uid 64600 %define nginx_gid 64600 %global with_perl 0 %global nginx_user nginx %global nginx_group %{nginx_user} %global nginx_home /var/lib/%{name} %global nginx_home_tmp %{nginx_home}/tmp %global nginx_confdir /etc/%{name} %global nginx_datadir %{_datadir}/%{name} %global nginx_logdir /var/log/%{name} %global nginx_webroot /var/%{name}/html Name: nginx Version: 1.9.3 Release: 1 Summary: A high performance web server and reverse proxy server Group: System Environment/Daemons # BSD License (two clause) # http://www.freebsd.org/copyright/freebsd-license.html License: BSD URL: http://nginx.org/ Source0: http://nginx.org/download/%{name}-%{version}.tar.gz Source1: http://nginx.org/download/%{name}-%{version}.tar.gz.asc Source2: %{name}.logrotate Source3: %{name}.conf Source4: %{name}-default.conf Source5: %{name}-ssl.conf Source6: %{name}-virtual.conf Source7: %{name}.aix.init Source100: %{name}-index.html Source102: %{name}-logo.png Source103: %{name}-404.html Source104: %{name}-50x.html Patch0: %{name}-%{version}-aix51-52.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gcc >= 4.5.4-1 BuildRequires: GeoIP-devel >= 1.5.1-1 BuildRequires: gd-devel >= 2.0.35-5 BuildRequires: libxslt-devel >= 1.1.28-2 BuildRequires: libxml2-devel >= 2.9.2-1 BuildRequires: openssl-devel >= 1.0.1m-1 BuildRequires: pcre-devel >= 8.36-1 BuildRequires: perl >= 5.8.8-2 BuildRequires: zlib-devel >= 1.2.3-7 Requires: libgcc >= 4.5.4-1 Requires: GeoIP >= 1.5.1-1 Requires: gd >= 2.0.35-5 Requires: libxslt >= 1.1.28-2 Requires: libxml2 >= 2.9.2-1 Requires: openssl >= 1.0.1m-1 Requires: pcre >= 8.36-1 Requires: zlib >= 1.2.3-7 # on AIX 5.1 and 5.2 it keeps core dumping... BuildRequires: AIX-rpm >= 5.3.0.0 Requires: AIX-rpm >= 5.3.0.0 Provides: webserver %description Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high concurrency, performance and low memory usage. %prep %setup -q %ifos aix5.1 || %ifos aix5.2 %patch0 %endif %build # we must find our perl first export PATH=/opt/freeware/bin:$PATH export CC=gcc export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" # nginx does not utilize a standard configure script. It has its own # and the standard configure options cause the nginx configure script # to error out. This is is also the reason for the DESTDIR environment # variable. export DESTDIR=${RPM_BUILD_ROOT} ./configure \ --prefix=%{nginx_datadir} \ --sbin-path=%{_sbindir}/%{name} \ --conf-path=%{nginx_confdir}/%{name}.conf \ --error-log-path=%{nginx_logdir}/error.log \ --http-log-path=%{nginx_logdir}/access.log \ --http-client-body-temp-path=%{nginx_home_tmp}/client_body \ --http-proxy-temp-path=%{nginx_home_tmp}/proxy \ --http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \ --http-uwsgi-temp-path=%{nginx_home_tmp}/uwsgi \ --http-scgi-temp-path=%{nginx_home_tmp}/scgi \ --pid-path=/var/run/%{name}.pid \ --lock-path=/var/locks/%{name} \ --user=%{nginx_user} \ --group=%{nginx_group} \ --with-ipv6 \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_addition_module \ --with-http_xslt_module \ --with-http_image_filter_module \ --with-http_geoip_module \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gzip_static_module \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_degradation_module \ --with-http_stub_status_module \ %if %{with_perl} --with-http_perl_module \ %endif --with-mail \ --with-mail_ssl_module \ --with-cc-opt="${CFLAGS} $(pcre-config --cflags)" \ --with-ld-opt="${LDFLAGS}" make %{?_smp_mflags} %install make install DESTDIR=${RPM_BUILD_ROOT} INSTALLDIRS=vendor /usr/bin/strip ${RPM_BUILD_ROOT}%{_sbindir}/* || : find ${RPM_BUILD_ROOT} -type f -name .packlist -exec rm -f '{}' \; find ${RPM_BUILD_ROOT} -type f -name perllocal.pod -exec rm -f '{}' \; find ${RPM_BUILD_ROOT} -type f -name '*.so' -exec chmod 0755 '{}' \; # the manpage does not get installed anymore mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8 cp objs/%{name}.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/%{name}.8 chmod 0644 ${RPM_BUILD_ROOT}%{_mandir}/man8/%{name}.8 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name} chmod 0644 ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name} mkdir -p ${RPM_BUILD_ROOT}%{nginx_confdir}/conf.d cp %{SOURCE3} ${RPM_BUILD_ROOT}%{nginx_confdir}/%{name}.conf chmod 0644 ${RPM_BUILD_ROOT}%{nginx_confdir}/%{name}.conf cp %{SOURCE4} ${RPM_BUILD_ROOT}%{nginx_confdir}/conf.d/default.conf cp %{SOURCE5} ${RPM_BUILD_ROOT}%{nginx_confdir}/conf.d/ssl.conf cp %{SOURCE6} ${RPM_BUILD_ROOT}%{nginx_confdir}/conf.d/virtual.conf chmod 0644 ${RPM_BUILD_ROOT}%{nginx_confdir}/conf.d/*.conf mkdir -p ${RPM_BUILD_ROOT}%{nginx_home_tmp} mkdir -p ${RPM_BUILD_ROOT}%{nginx_logdir} mkdir -p ${RPM_BUILD_ROOT}%{nginx_webroot} cp %{SOURCE100} ${RPM_BUILD_ROOT}%{nginx_webroot}/index.html cp %{SOURCE102} ${RPM_BUILD_ROOT}%{nginx_webroot} cp %{SOURCE103} ${RPM_BUILD_ROOT}%{nginx_webroot}/404.html cp %{SOURCE104} ${RPM_BUILD_ROOT}%{nginx_webroot}/50x.html chmod 0644 ${RPM_BUILD_ROOT}%{nginx_webroot}/* mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d cp %{SOURCE7} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/%{name} mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d ln -sf '../init.d/nginx' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/S%{name} ln -sf '../init.d/nginx' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/K%{name} ln -sf '../init.d/nginx' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/S%{name} ln -sf '../init.d/nginx' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/K%{name} %preun if [ $1 = 0 ]; then /etc/rc.d/init.d/%{name} stop > /dev/null 2>&1 fi # remove "nginx" user and group /usr/sbin/rmuser -p nginx || : /usr/sbin/rmgroup nginx || : %pre # add the "nginx" group only if it does not yet exist result=`/usr/sbin/lsgroup nginx | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "nginx" ]] ; then /usr/bin/mkgroup -A id=%{nginx_gid} nginx 2> /dev/null || : fi # add the "nginx" user only if it does not yet exist result=`/usr/sbin/lsuser nginx | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "nginx" ]] ; then /usr/bin/mkuser id=%{nginx_uid} pgrp='nginx' gecos='NGINX User' \ login='false' rlogin='false' nginx 2> /dev/null || : fi %postun if [ $1 -gt 1 ]; then /etc/rc.d/init.d/%{name} conrestart >/dev/null 2>&1 || : fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %doc LICENSE CHANGES README %{_sbindir}/nginx %{_mandir}/man8/nginx.8 %{nginx_datadir}/ %dir %{nginx_confdir} %dir %{nginx_confdir}/conf.d %dir %{nginx_logdir} %config(noreplace) %{nginx_confdir}/fastcgi.conf %config(noreplace) %{nginx_confdir}/fastcgi.conf.default %config(noreplace) %{nginx_confdir}/fastcgi_params %config(noreplace) %{nginx_confdir}/fastcgi_params.default %config(noreplace) %{nginx_confdir}/koi-utf %config(noreplace) %{nginx_confdir}/koi-win %config(noreplace) %{nginx_confdir}/mime.types %config(noreplace) %{nginx_confdir}/mime.types.default %config(noreplace) %{nginx_confdir}/nginx.conf %config(noreplace) %{nginx_confdir}/nginx.conf.default %config(noreplace) %{nginx_confdir}/scgi_params %config(noreplace) %{nginx_confdir}/scgi_params.default %config(noreplace) %{nginx_confdir}/uwsgi_params %config(noreplace) %{nginx_confdir}/uwsgi_params.default %config(noreplace) %{nginx_confdir}/win-utf %config(noreplace) %{nginx_confdir}/conf.d/*.conf %config(noreplace) %{_sysconfdir}/logrotate.d/nginx %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home} %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp} /etc/rc.d/init.d/%{name} /etc/rc.d/rc2.d/S%{name} /etc/rc.d/rc2.d/K%{name} /etc/rc.d/rc3.d/S%{name} /etc/rc.d/rc3.d/K%{name} %if %{with_perl} %dir %{perl_vendorarch}/auto/nginx %{perl_vendorarch}/nginx.pm %{perl_vendorarch}/auto/nginx/nginx.so %endif %dir %{nginx_webroot} %{nginx_webroot}/* %changelog * Thu Jul 16 2015 Michael Perzl - 1.9.3-1 - updated to version 1.9.3 * Mon Jun 22 2015 Michael Perzl - 1.9.2-1 - updated to version 1.9.2 * Tue Jun 09 2015 Michael Perzl - 1.9.1-1 - updated to version 1.9.1 * Wed May 13 2015 Michael Perzl - 1.9.0-1 - updated to version 1.9.0 * Mon Apr 13 2015 Michael Perzl - 1.7.12-1 - updated to version 1.7.12 * Thu Apr 02 2015 Michael Perzl - 1.7.11-1 - updated to version 1.7.11 * Wed Feb 18 2015 Michael Perzl - 1.7.10-1 - updated to version 1.7.10 * Wed Feb 18 2015 Michael Perzl - 1.7.9-1 - updated to version 1.7.9 * Mon Dec 08 2014 Michael Perzl - 1.7.8-1 - updated to version 1.7.8 * Wed Oct 29 2014 Michael Perzl - 1.7.7-1 - updated to version 1.7.7 * Wed Oct 01 2014 Michael Perzl - 1.7.6-1 - updated to version 1.7.6 * Thu Sep 18 2014 Michael Perzl - 1.7.5-1 - updated to version 1.7.5 * Tue Aug 12 2014 Michael Perzl - 1.7.4-1 - updated to version 1.7.4 * Tue Aug 12 2014 Michael Perzl - 1.7.3-1 - updated to version 1.7.3 * Mon Jun 23 2014 Michael Perzl - 1.7.2-1 - updated to version 1.7.2 * Wed May 28 2014 Michael Perzl - 1.7.1-1 - updated to version 1.7.1 * Sun Apr 27 2014 Michael Perzl - 1.7.0-1 - updated to version 1.7.0 * Sun Apr 27 2014 Michael Perzl - 1.5.13-1 - updated to version 1.5.13 * Thu Mar 27 2014 Michael Perzl - 1.5.12-1 - updated to version 1.5.12 * Fri Mar 14 2014 Michael Perzl - 1.5.11-1 - updated to version 1.5.11 * Wed Feb 05 2014 Michael Perzl - 1.5.10-1 - updated to version 1.5.10 * Wed Feb 05 2014 Michael Perzl - 1.5.9-1 - updated to version 1.5.9 * Mon Jan 20 2014 Michael Perzl - 1.5.8-1 - updated to version 1.5.8 * Wed Nov 20 2013 Michael Perzl - 1.5.7-1 - updated to version 1.5.7 * Fri Oct 11 2013 Michael Perzl - 1.5.6-1 - updated to version 1.5.6 * Fri Oct 11 2013 Michael Perzl - 1.5.5-1 - updated to version 1.5.5 * Fri Oct 11 2013 Michael Perzl - 1.5.4-1 - updated to version 1.5.4 * Fri Aug 23 2013 Michael Perzl - 1.5.3-1 - updated to version 1.5.3 * Mon Jul 08 2013 Michael Perzl - 1.5.2-1 - updated to version 1.5.2 * Mon Jun 24 2013 Michael Perzl - 1.5.1-1 - updated to version 1.5.1 * Wed May 08 2013 Michael Perzl - 1.5.0-1 - updated to version 1.5.0 * Wed May 08 2013 Michael Perzl - 1.4.1-1 - updated to version 1.4.1 * Fri May 03 2013 Michael Perzl - 1.4.0-1 - updated to version 1.4.0 * Fri May 03 2013 Michael Perzl - 1.3.16-1 - updated to version 1.3.16 * Thu Apr 04 2013 Michael Perzl - 1.3.15-1 - updated to version 1.3.15 * Tue Mar 26 2013 Michael Perzl - 1.3.14-1 - updated to version 1.3.14 * Wed Feb 20 2013 Michael Perzl - 1.3.13-1 - updated to version 1.3.13 * Mon Jan 28 2013 Michael Perzl - 1.3.11-1 - updated to version 1.3.11 * Tue Jan 08 2013 Michael Perzl - 1.3.10-1 - updated to version 1.3.10 * Tue Oct 31 2012 Michael Perzl - 1.3.8-1 - updated to version 1.3.8 * Tue Oct 31 2012 Michael Perzl - 1.3.7-1 - updated to version 1.3.7 * Sun Oct 28 2012 Michael Perzl - 1.2.4-1 - first version for AIX5L v5.1 and higher