From dab54d17b836c9560201827a89f493e2b2790f3d Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 11 Apr 2014 01:35:38 +0700 Subject: [PATCH 1/3] Modifi mysql --- lib/autoparts/packages/mysql.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/autoparts/packages/mysql.rb b/lib/autoparts/packages/mysql.rb index e1e3b75..3f9223e 100644 --- a/lib/autoparts/packages/mysql.rb +++ b/lib/autoparts/packages/mysql.rb @@ -55,6 +55,7 @@ def post_install "--datadir=#{mysql_var_path}", "--tmpdir=/tmp", "--user=#{user}", + "--no-defaults", '--verbose' ] execute "scripts/mysql_install_db", *args From db87d8af77a27101eef129acfa74eef2486790de Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 13 Apr 2014 00:35:01 +0700 Subject: [PATCH 2/3] Add php-memcached --- lib/autoparts/packages/libmemcached.rb | 77 +++++++++++++++++++++++++ lib/autoparts/packages/phpmemcached.rb | 79 ++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 lib/autoparts/packages/libmemcached.rb create mode 100644 lib/autoparts/packages/phpmemcached.rb diff --git a/lib/autoparts/packages/libmemcached.rb b/lib/autoparts/packages/libmemcached.rb new file mode 100644 index 0000000..d7bf11b --- /dev/null +++ b/lib/autoparts/packages/libmemcached.rb @@ -0,0 +1,77 @@ +module Autoparts + module Packages + class Libmemcached < Package + name 'libmemcached' # This should be the name of the part in all lowercase letters. + version '1.0.18' # Version of the tool being installed. + + # This description should contain the human readable package name + # (e.g. 'MySQL'), followed by a colon and then description. + description "libmemcached - A C and C++ client library for memcached" + + # Include a category for your part. A list of categories can be found at + # https://github.com/nitrous-io/autoparts/blob/master/lib/autoparts/category.rb. + category Category::LIBRARIES + + # The url of the source archive. + source_url 'https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz' + + # The sha1 hash. If it is not provided by the host, download the + # archive and run `sha1sum filename` to obtain this. + source_sha1 '8be06b5b95adbc0a7cb0f232e237b648caf783e1' + + # source_filetype is used to determine how to extract the package. + # Currently, variations of tar and zip are supported. Other filetypes are + # simply copied over without extraction. + source_filetype 'tar.gz' + + ## Dependencies + # + # Include any dependencies for this part. + # Any dependencies will be installed before proceeding. + # If any dependencies don't already exist as an Autoparts package, you'll + # need to add them as a separate package. + depends_on 'memcached' # Not actually needed for MySQL, but added as an example. + + ## Installation + # + # At this step the archive from the `source_url` is downloaded, and the + # sha1 hash is checked. Autoparts creates a temporary directory where the + # archive is unpacked. + def compile + Dir.chdir('libmemcached-1.0.18') do + args = [ + "--prefix=#{prefix_path}", + "--enable-sasl", + ] + + execute './configure', *args + execute 'make' + end + end + + def install + Dir.chdir('libmemcached-1.0.18') do + execute 'make install' + end + end + + + def purge + lib_path.rmtree if lib_path.exist? + end + + def lib_path + prefix_path + end + + + ## Tips + # If you want to print out any messages after the part has been installed, now is the time. + def tips + <<-STR.unindent +installed +STR + end + end + end +end diff --git a/lib/autoparts/packages/phpmemcached.rb b/lib/autoparts/packages/phpmemcached.rb new file mode 100644 index 0000000..70c5fde --- /dev/null +++ b/lib/autoparts/packages/phpmemcached.rb @@ -0,0 +1,79 @@ +module Autoparts + module Packages + class Phpmemcached < Package + name 'phpmemcached' # This should be the name of the part in all lowercase letters. + version '2.1.0' # Version of the tool being installed. + + # This description should contain the human readable package name + # (e.g. 'MySQL'), followed by a colon and then description. + description "php-memcached extentions" + + # Include a category for your part. A list of categories can be found at + # https://github.com/nitrous-io/autoparts/blob/master/lib/autoparts/category.rb. + category Category::LIBRARIES + + # The url of the source archive. + source_url 'http://pecl.php.net/get/memcached-2.1.0.tgz' + + # The sha1 hash. If it is not provided by the host, download the + # archive and run `sha1sum filename` to obtain this. + source_sha1 '16fac6bfae8ec7e2367fda588b74df88c6f11a8e' + + # source_filetype is used to determine how to extract the package. + # Currently, variations of tar and zip are supported. Other filetypes are + # simply copied over without extraction. + source_filetype 'tar.gz' + + ## Dependencies + # + # Include any dependencies for this part. + # Any dependencies will be installed before proceeding. + # If any dependencies don't already exist as an Autoparts package, you'll + # need to add them as a separate package. + depends_on 'libmemcached' # Not actually needed for MySQL, but added as an example. + + ## Installation + # + # At this step the archive from the `source_url` is downloaded, and the + # sha1 hash is checked. Autoparts creates a temporary directory where the + # archive is unpacked. + def compile + Dir.chdir('phpmemcached-2.1.0') do + args = [ + "--prefix=#{prefix_path}", + "--with-libmemcached-dir=#{get_dependency("libmemcached").prefix_path}", + "--disable-memcached-sasl" + ] + execute 'phpize' + execute './configure', *args + execute 'make' + end + end + + def install + Dir.chdir('phpmemcached-2.1.0') do + execute 'make install' + end + end + + + def purge + lib_path.rmtree if lib_path.exist? + end + + def lib_path + prefix_path + end + + + ## Tips + # If you want to print out any messages after the part has been installed, now is the time. + def tips + <<-STR.unindent +Add this line to the end of file 'php.ini' (Depend on your php version) +extension=/home/action/.parts/packages/php5/5.5.8-nitrous2/lib/extensions/no-debug-zts-20121212/memcached.so +STR + end + end + end +end From 20d75a82ca9e5daa1928d483da3e4dcd3c19c23f Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 13 Apr 2014 00:45:10 +0700 Subject: [PATCH 3/3] Add php-memcached --- lib/autoparts/packages/phpmemcached.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/autoparts/packages/phpmemcached.rb b/lib/autoparts/packages/phpmemcached.rb index 70c5fde..33b010f 100644 --- a/lib/autoparts/packages/phpmemcached.rb +++ b/lib/autoparts/packages/phpmemcached.rb @@ -38,7 +38,7 @@ class Phpmemcached < Package # sha1 hash is checked. Autoparts creates a temporary directory where the # archive is unpacked. def compile - Dir.chdir('phpmemcached-2.1.0') do + Dir.chdir('memcached-2.1.0') do args = [ "--prefix=#{prefix_path}", "--with-libmemcached-dir=#{get_dependency("libmemcached").prefix_path}", @@ -51,7 +51,7 @@ def compile end def install - Dir.chdir('phpmemcached-2.1.0') do + Dir.chdir('memcached-2.1.0') do execute 'make install' end end