-
Notifications
You must be signed in to change notification settings - Fork 15
/
openresty.spec
91 lines (67 loc) · 2.49 KB
/
openresty.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Name: openresty
Version: 1.13.6.1
Release: 1%{?dist}
Summary: a fast web app server by extending nginx
Group: Productivity/Networking/Web/Servers
License: BSD
URL: openresty.org
Source0: http://openresty.org/download/%{name}-%{version}.tar.gz
Source1: https://github.com/brnt/openresty-rpm-spec/raw/master/openresty.init
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: sed openssl-devel pcre-devel readline-devel
Requires: openssl pcre readline
Requires(pre): shadow-utils
%define user nginx
%define homedir %{_usr}/local/openresty
%description
OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well as most of their external dependencies.
%prep
%setup -q
%build
./configure --with-ipv6 --with-pcre-jit --with-http_geoip_module --with-http_stub_status_module --with-http_realip_module --with-http_v2_module --with-http_slice_module
make %{?_smp_mflags}
%pre
getent group %{user} || groupadd -f -r %{user}
getent passwd %{user} || useradd -M -d %{homedir} -g %{user} -s /bin/nologin %{user}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/etc/init.d
sed -e 's/%NGINX_CONF_DIR%/%{lua: esc,qty=string.gsub(rpm.expand("%{homedir}"), "/", "\\/"); print(esc)}\/nginx\/conf/g' \
-e 's/%NGINX_BIN_DIR%/%{lua: esc,qty=string.gsub(rpm.expand("%{homedir}"), "/", "\\/"); print(esc)}\/nginx\/sbin/g' \
%{SOURCE1} > %{buildroot}/etc/init.d/openresty
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
#%{homedir}/*
%attr(755,root,root) /etc/init.d/openresty
%{homedir}/luajit/*
%{homedir}/lualib/*
%{homedir}/nginx
%{homedir}/pod
%{homedir}/nginx/html/*
%{homedir}/nginx/logs
%{homedir}/nginx/sbin
%{homedir}/nginx/sbin/nginx
%{homedir}/bin
%{homedir}/COPYRIGHT
%{homedir}/resty.index
%{homedir}/nginx/conf
%{homedir}/nginx/conf/fastcgi.conf.default
%{homedir}/nginx/conf/fastcgi_params.default
%{homedir}/nginx/conf/mime.types.default
%{homedir}/nginx/conf/nginx.conf.default
%{homedir}/nginx/conf/scgi_params.default
%{homedir}/nginx/conf/uwsgi_params.default
%config %{homedir}/nginx/conf/fastcgi.conf
%config %{homedir}/nginx/conf/fastcgi_params
%config %{homedir}/nginx/conf/koi-utf
%config %{homedir}/nginx/conf/koi-win
%config %{homedir}/nginx/conf/mime.types
%config %{homedir}/nginx/conf/nginx.conf
%config %{homedir}/nginx/conf/scgi_params
%config %{homedir}/nginx/conf/uwsgi_params
%config %{homedir}/nginx/conf/win-utf
%postun
%changelog