Skip to content
This repository

OC-7187 xdarklaunch #16

Merged
merged 2 commits into from 12 months ago

4 participants

Ho-Sheng Hsiao Seth Falcon Seth Chisamore Stephen Delano
Ho-Sheng Hsiao
Collaborator
hosh commented April 04, 2013
  • Added openresty 1.2.6.6

Requires:

config/software/openresty.rb
((20 lines not shown))
  20
+
  21
+dependencies ["pcre", "openssl", "zlib"]
  22
+
  23
+source :url => "http://agentzh.org/misc/nginx/ngx_openresty-1.2.7.1.tar.gz",
  24
+       :md5 => "87e51a962a9cc911ba85dfc95d671117"
  25
+
  26
+relative_path "ngx_openresty-1.2.7.1"
  27
+
  28
+
  29
+# OpenResty has a finicky build process. Below, we are statically-linking pcre, openssl, and zlib
  30
+# As such, it needs to match those deps
  31
+
  32
+build do
  33
+  # Run make clean against statically linked targets
  34
+
  35
+  %w(pcre-8.31 openssl-1.0.1c zlib-1.2.6).each do |lib|
1
Seth Chisamore Owner
schisamo added a note April 04, 2013

This seems dangerous, we've never needed to do something like that before. You probably don't have your LDFLAGS or CFLAGS set up correctly. For example:
https://github.com/opscode/omnibus-software/blob/master/config/software/postgresql.rb#L31-L35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
config/software/openresty.rb
((36 lines not shown))
  36
+    command 'make clean', :cwd => File.join(source_dir, lib)
  37
+  end
  38
+  # Configure with statically-linked zlib, openssl, and pcre
  39
+  command ["./configure",
  40
+           "--prefix=#{install_dir}/embedded",
  41
+           "--sbin-path=#{install_dir}/embedded/sbin/nginx",
  42
+           "--conf-path=#{install_dir}/embedded/conf/nginx.conf",
  43
+           "--with-http_ssl_module",
  44
+           "--with-debug",
  45
+           "--with-ld-opt=-L#{install_dir}/embedded/lib",
  46
+           "--with-cc-opt=\"-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include\"",
  47
+           # Merged from Openresty Cookbook
  48
+           '--with-md5-asm',
  49
+           '--with-sha1-asm',
  50
+           '--with-pcre-jit',
  51
+           "--with-pcre=#{File.join(source_dir, 'pcre-8.31')}",
2
Seth Chisamore Owner
schisamo added a note April 04, 2013

pretty sure you don't want to do this against the source dir..it should be something like:

--with-pcre=#{install_dir}/embedded
--with-openssl=#{install_dir}/embedded
--with-zlib=#{install_dir}/embedded
Stephen Delano Owner
sdelano added a note April 04, 2013

:thumbsup:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
config/software/nagios-plugins.rb
... ...
@@ -21,7 +21,7 @@
21 21
 dependencies ["zlib", "openssl", "postgresql", "libiconv"]
22 22
 
23 23
 # the url is the location of a redirect from sourceforge
24  
-source :url => "http://voxel.dl.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz",
  24
+source :url => "http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz",
2
Seth Chisamore Owner
schisamo added a note April 04, 2013

Have we ensured no other software definitions are hardcoded to a mirror?

Ho-Sheng Hsiao Collaborator
hosh added a note April 10, 2013

@schisamo Only zlib. I'll update it and rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
config/software/cacerts.rb
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 build do
27 27
   command "mkdir -p #{install_dir}/embedded/ssl/certs"
28  
-  command "cp cacert.pem #{install_dir}/embedded/ssl/certs/cacert.pem"
  28
+  # cp from the omnibus cache instead of where fetcher tries to put it
  29
+  command "cp cacert.pem #{install_dir}/embedded/ssl/certs/cacert.pem", :cwd => '/var/cache/omnibus/cache'
1
Seth Falcon Owner
seth added a note April 11, 2013

this is hard to read with the line break there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
config/software/openresty.rb
((4 lines not shown))
  4
+#
  5
+# Licensed under the Apache License, Version 2.0 (the "License");
  6
+# you may not use this file except in compliance with the License.
  7
+# You may obtain a copy of the License at
  8
+#
  9
+#     http://www.apache.org/licenses/LICENSE-2.0
  10
+#
  11
+# Unless required by applicable law or agreed to in writing, software
  12
+# distributed under the License is distributed on an "AS IS" BASIS,
  13
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14
+# See the License for the specific language governing permissions and
  15
+# limitations under the License.
  16
+#
  17
+
  18
+name "openresty"
  19
+version "1.2.7.1"
1
Seth Falcon Owner
seth added a note April 11, 2013

Looks like we've moved to 1.2.7.3 in OHC. Let's get those in sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
config/software/openresty.rb
((11 lines not shown))
  11
+# Unless required by applicable law or agreed to in writing, software
  12
+# distributed under the License is distributed on an "AS IS" BASIS,
  13
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14
+# See the License for the specific language governing permissions and
  15
+# limitations under the License.
  16
+#
  17
+
  18
+name "openresty"
  19
+version "1.2.7.1"
  20
+
  21
+dependencies ["pcre", "openssl", "zlib"]
  22
+
  23
+source :url => "http://agentzh.org/misc/nginx/ngx_openresty-1.2.7.1.tar.gz",
  24
+       :md5 => "87e51a962a9cc911ba85dfc95d671117"
  25
+
  26
+relative_path "ngx_openresty-1.2.7.1"
2
Seth Falcon Owner
seth added a note April 11, 2013

This should perhaps use the version from above?

Ho-Sheng Hsiao Collaborator
hosh added a note April 11, 2013

Ok, I'll run another one against 1.2.7.3 and update to use version while I am at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
config/software/cacerts.rb
... ...
@@ -25,6 +25,13 @@
25 25
 
26 26
 build do
27 27
   command "mkdir -p #{install_dir}/embedded/ssl/certs"
28  
-  command "cp cacert.pem #{install_dir}/embedded/ssl/certs/cacert.pem"
  28
+
  29
+  # There is a bug in omnibus-ruby that may or may not have been fixed. Since the source url
  30
+  # does not point to an archive, omnibus-ruby tries to copy cacert.pem into the project working
  31
+  # directory. However, it fails and copies to '/var/cache/omnibus/src/cacerts-2012.12.19\' instead
  32
+  # There is supposed to be a fix in omnibus-ruby, but under further testing, it was unsure if the
  33
+  # fix worked. Rather than trying to fix this now, we're filing a bug and copying the cacert.pem
  34
+  # directly from the cache instead.
  35
+  command "cp cacert.pem #{install_dir}/embedded/ssl/certs/cacert.pem", :cwd => '/var/cache/omnibus/cache'
2
Seth Chisamore Owner
schisamo added a note April 16, 2013

probably want to make the cwd: :cwd => Omnibus.config.cache_dir since this path differs based on platform.

Ho-Sheng Hsiao Collaborator
hosh added a note April 16, 2013

Ahh, good call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Seth Falcon
Owner
seth commented April 23, 2013

:+1:

Please to MWR (after your other PR here) Not sure if you'll want to rebase or what, but would be nice to keep the unrelated patches separate in history.

added some commits April 04, 2013
Ho-Sheng Hsiao [openresty] Added openresty build based upon nginx.
Added an openresty build definition. It should be a drop-in replacement
for standard nginx.

 - Since openresty is a metapackage, its configure script descends into
   the source files and calls `configure` for nginx. In order to link to
   the embedded shared libraries, we added linker and cc flags to force a
   lookup in the embedded directories first

 - The sbin and nginx.conf had to be explicitly set to the omnibus
   convensions.

 - Openresty cookbook will automatically detect AIO capabilities and
   automatically enable AIO compile flags. It appears that Ubuntu 10.04
   have the necessary kernel version. However, this requires compiling
   additional AIO libraries. This is a possible improvement for future
   builds.
95f8095
Ho-Sheng Hsiao [openresty] Bumped to Openresty 1.2.6.6 68a2ac0
Ho-Sheng Hsiao hosh merged commit 68a2ac0 into from April 23, 2013
Ho-Sheng Hsiao hosh closed this April 23, 2013
Ho-Sheng Hsiao hosh deleted the branch April 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Apr 23, 2013
Ho-Sheng Hsiao [openresty] Added openresty build based upon nginx.
Added an openresty build definition. It should be a drop-in replacement
for standard nginx.

 - Since openresty is a metapackage, its configure script descends into
   the source files and calls `configure` for nginx. In order to link to
   the embedded shared libraries, we added linker and cc flags to force a
   lookup in the embedded directories first

 - The sbin and nginx.conf had to be explicitly set to the omnibus
   convensions.

 - Openresty cookbook will automatically detect AIO capabilities and
   automatically enable AIO compile flags. It appears that Ubuntu 10.04
   have the necessary kernel version. However, this requires compiling
   additional AIO libraries. This is a possible improvement for future
   builds.
95f8095
Ho-Sheng Hsiao [openresty] Bumped to Openresty 1.2.6.6 68a2ac0
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 66 additions and 0 deletions. Show diff stats Hide diff stats

  1. 66  config/software/openresty.rb
66  config/software/openresty.rb
... ...
@@ -0,0 +1,66 @@
  1
+#
  2
+# Copyright:: Copyright (c) 2012 Opscode, Inc.
  3
+# License:: Apache License, Version 2.0
  4
+#
  5
+# Licensed under the Apache License, Version 2.0 (the "License");
  6
+# you may not use this file except in compliance with the License.
  7
+# You may obtain a copy of the License at
  8
+#
  9
+#     http://www.apache.org/licenses/LICENSE-2.0
  10
+#
  11
+# Unless required by applicable law or agreed to in writing, software
  12
+# distributed under the License is distributed on an "AS IS" BASIS,
  13
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14
+# See the License for the specific language governing permissions and
  15
+# limitations under the License.
  16
+#
  17
+
  18
+name "openresty"
  19
+version "1.2.6.6"
  20
+
  21
+dependency "pcre"
  22
+dependency "openssl"
  23
+dependency "zlib"
  24
+
  25
+source :url => "http://openresty.org/download/ngx_openresty-#{version}.tar.gz",
  26
+       :md5 => "19f04c65e93f8d38e3590db7c7123f6b"
  27
+
  28
+relative_path "ngx_openresty-#{version}"
  29
+
  30
+build do
  31
+  env = {
  32
+    "LDFLAGS" => "-R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",
  33
+    "CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",
  34
+    "LD_RUN_PATH" => "#{install_dir}/embedded/lib"
  35
+  }
  36
+
  37
+  command ["./configure",
  38
+           "--prefix=#{install_dir}/embedded",
  39
+           "--sbin-path=#{install_dir}/embedded/sbin/nginx",
  40
+           "--conf-path=#{install_dir}/embedded/conf/nginx.conf",
  41
+           "--with-http_ssl_module",
  42
+           "--with-debug",
  43
+           # Building Nginx with non-system OpenSSL
  44
+           # http://www.ruby-forum.com/topic/207287#902308
  45
+           "--with-ld-opt=\"-L#{install_dir}/embedded/lib -Wl,-rpath,#{install_dir}/embedded/lib -lssl -lcrypto -ldl -lz\"",
  46
+           "--with-cc-opt=\"-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include\"",
  47
+           # Options inspired by the OpenResty Cookbook
  48
+           '--with-md5-asm',
  49
+           '--with-sha1-asm',
  50
+           '--with-pcre-jit',
  51
+           '--with-luajit', # Necessary?
  52
+           '--without-http_ssi_module',
  53
+           '--without-mail_smtp_module',
  54
+           '--without-mail_imap_module',
  55
+           '--without-mail_pop3_module',
  56
+           '--with-ipv6',
  57
+           # AIO support define in Openresty cookbook. Requires Kernel >= 2.6.22
  58
+           # Ubuntu 10.04 reports: 2.6.32-38-server #83-Ubuntu SMP
  59
+           # However, they require libatomic-ops-dev and libaio
  60
+           #'--with-file-aio',
  61
+           #'--with-libatomic'
  62
+          ].join(" "), :env => env
  63
+  # When building with -j > 1, make emits errors about "Jobserver cannot be reached"
  64
+  command "make", :env => env
  65
+  command "make install"
  66
+end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.