Browse code

Add package nginx.

Change-Id: Id71f8a80f8cc3fe1607160d7ded8a7ff0de14426
Reviewed-on: http://photon-jenkins.eng.vmware.com/950
Tested-by: jenkins-photon <wangnan2015@hotmail.com>
Reviewed-by: suezzelur <anishs@vmware.com>

xiaolin-vmware authored on 2016/05/20 09:51:26
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,71 @@
0
+Summary:	High-performance HTTP server and reverse proxy
1
+Name:		nginx
2
+Version:	1.10.0
3
+Release:	1%{?dist}
4
+License:	BSD-2-Clause
5
+URL:		http://nginx.org/download/nginx-1.10.0.tar.gz
6
+Group:		Applications/System
7
+Vendor:		VMware, Inc.
8
+Distribution: Photon
9
+Source0:	%{name}-%{version}.tar.gz
10
+%define sha1 nginx=7a452cfe37e4134481442dbfa3fbdac6f484c5bc
11
+
12
+BuildRequires:	openssl-devel
13
+BuildRequires:  pcre-devel
14
+%description
15
+NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. 
16
+
17
+%prep
18
+%setup -q
19
+%build
20
+./configure \
21
+	--prefix=%{_sysconfdir}//nginx              \
22
+	--sbin-path=/usr/sbin/nginx                 \
23
+	--conf-path=/etc/nginx/nginx.conf           \
24
+	--pid-path=/var/run/nginx/nginx.pid         \
25
+	--lock-path=/var/run/nginx/nginx.lock       \
26
+	--error-log-path=/var/log/nginx/error.log   \
27
+	--http-log-path=/var/log/nginx/access.log   \
28
+    --with-http_ssl_module \
29
+    --with-pcre \
30
+    --with-ipv6 
31
+
32
+make %{?_smp_mflags}
33
+%install
34
+make DESTDIR=%{buildroot} install
35
+install -vdm755 %{buildroot}/usr/lib/systemd/system
36
+install -vdm755 %{buildroot}%{_var}/log/nginx
37
+install -vdm755 %{buildroot}%{_var}/run/nginx
38
+
39
+cat << EOF >> %{buildroot}/usr/lib/systemd/system/nginx.service
40
+[Unit]
41
+Description=Nginx High-performance HTTP server and reverse proxy
42
+After=network.target remote-fs.target nss-lookup.target
43
+
44
+[Service]
45
+Type=forking
46
+PIDFile=/var/run/nginx/nginx.pid
47
+ExecStartPre=/usr/sbin/nginx -t
48
+ExecStart=/usr/sbin/nginx
49
+ExecReload=/bin/kill -s HUP $MAINPID
50
+ExecStop=/bin/kill -s QUIT $MAINPID
51
+PrivateTmp=true
52
+[Install]
53
+WantedBy=multi-user.target
54
+
55
+EOF
56
+
57
+%check
58
+make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
59
+
60
+%files
61
+%defattr(-,root,root)
62
+%{_sysconfdir}/*
63
+%{_sbindir}/*
64
+%{_libdir}/*
65
+%{_var}/log/nginx
66
+%{_var}/run/nginx
67
+
68
+%changelog
69
+*   Mon May 16 2016 Xiaolin Li <xiaolinl@vmware.com> 1.10.0-1
70
+-	Initial build. First version
... ...
@@ -123,6 +123,7 @@
123 123
         "efibootmgr",
124 124
         "efivar",
125 125
         "grub2-efi",
126
-        "pciutils"
126
+        "pciutils",
127
+        "nginx"
127 128
             ]
128 129
 }