%define software tengine %define nginx_user nobody %define nginx_group nobody %define nginx_home /usr/local/nginx %define nginx_home_tmp /usr/local/nginx/tmp %define mywebroot /usr/share/nginx/html/ %global debug_package %{nil} Name: %{software} Version: 3.1.0 Release: 1 URL: http://tengine.taobao.org/ Summary: A distribution of Nginx with some advanced features License: BSD Group: System Environment/Daemons Source0: https://github.com/alibaba/tengine/archive/refs/tags/3.1.0.tar.gz BuildRequires: zlib-devel BuildRequires: openssl-devel BuildRequires: pcre-devel BuildRequires: libxslt-devel BuildRequires: perl BuildRequires: gd-devel Requires: initscripts >= 8.36 Requires(pre): shadow-utils Requires(post): chkconfig Requires: libxslt Requires: gd-devel Provides: webserver %description Tengine is a web server originated by Taobao, the largest e-commerce website in Asia. It is based on Nginx HTTP server and has many advanced features. Tengine has been proven very stable and efficient on the top 100 global websites, including taobao.com and tmall.com. Tengine has been an open source project since December 2011. It is now developed and maintained by the Tengine team, whose core members are from Taobao, Sogou and other Internet companies. %prep %setup -q -n %{software}-%{version} %build ./configure \ --prefix=%{nginx_home} \ --conf-path=%{nginx_home}/conf/nginx.conf \ --user=%{nginx_user} \ --group=%{nginx_group} \ --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 \ --with-cc-opt="%{optflags} $(pcre-config --cflags)" \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-http_addition_module \ --with-http_image_filter_module \ --with-http_sub_module \ --with-http_flv_module \ --with-http_slice_module \ --with-http_mp4_module \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_xslt_module \ $* make %{?_smp_mflags} %install # remove default stripping %define __spec_install_port /usr/lib/rpm/brp-compress %{__rm} -rf $RPM_BUILD_ROOT %{__make} DESTDIR=$RPM_BUILD_ROOT install %{__mkdir} -p $RPM_BUILD_ROOT%{nginx_home}/var %{__mkdir} -p $RPM_BUILD_ROOT%{nginx_home_tmp} %{__rm} -f $RPM_BUILD_ROOT%{nginx_home}/conf/*.default %{__rm} -f $RPM_BUILD_ROOT%{nginx_home}/conf/fastcgi.conf %{__rm} -f $RPM_BUILD_ROOT%{nginx_home}/conf/scgi_params %{__rm} -f $RPM_BUILD_ROOT%{nginx_home}/conf/uwsgi_params # install SYSV init stuff %{__mkdir} -p $RPM_BUILD_ROOT%{_initrddir} %{__cat} > $RPM_BUILD_ROOT%{_initrddir}/nginx <&/dev/null; then stop start fi ;; force-reload|reload) reload ;; configtest) configtest ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|upgrade|reload|status|help|configtest}" RETVAL=2 esac exit $RETVAL EOF %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig %{__cat} > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} </dev/null || groupadd -r %{nginx_group} getent passwd %{nginx_user} >/dev/null || \ useradd -r -g %{nginx_group} -s /sbin/nologin \ -d %{nginx_home} -c "web user" %{nginx_user} exit 0 %post # Register the nginx service if [ $1 -eq 1 ]; then /sbin/chkconfig --add nginx fi %preun if [ $1 -eq 0 ]; then /sbin/service nginx stop > /dev/null 2>&1 /sbin/chkconfig --del nginx fi %postun if [ $1 -ge 1 ]; then /sbin/service nginx upgrade &>/dev/null || : fi %changelog * Tue Sep 03 2024 zhangxingrong - 3.1.0-1 - update to 3.1.0 * Wed Dec 1 2021 bzhaoop - 2.3.3-1 - initial package