diff options
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/Manifest.gz | bin | 4531 -> 4532 bytes | |||
-rw-r--r-- | www-servers/thin/Manifest | 2 | ||||
-rw-r--r-- | www-servers/thin/files/thin-1.8.1-ruby32.patch | 99 | ||||
-rw-r--r-- | www-servers/thin/thin-1.8.1-r3.ebuild | 99 |
4 files changed, 200 insertions, 0 deletions
diff --git a/www-servers/Manifest.gz b/www-servers/Manifest.gz Binary files differindex 4942edb2fb49..a1aae3e1228d 100644 --- a/www-servers/Manifest.gz +++ b/www-servers/Manifest.gz diff --git a/www-servers/thin/Manifest b/www-servers/thin/Manifest index c268eef871a5..a4ff724449a1 100644 --- a/www-servers/thin/Manifest +++ b/www-servers/thin/Manifest @@ -1,5 +1,7 @@ +AUX thin-1.8.1-ruby32.patch 3151 BLAKE2B 591c0ad4d40ff951c80b8c2c1c957ac32123221549286eefc882737bae117ced32e2fbc7aa47300945108594cf723072a3558c8a41ee068e153ab25f3889e5ed SHA512 2cf789b70f99948d82bd76bc5820d6d29a1b1c4d1b4395a97523a6e633ac4914a357c1e6b721c8e25dc6c4c701d3028539b947688de418172175a2969adbb86a AUX thin.confd-2 1335 BLAKE2B c6821353bbf2dd35d7161394247c4c3d88237c94f976a693ef95d19f7b751256c2f943250737c9f66777df6520feadad853a4ccdcb2fafa779c39d4456d2a78b SHA512 1f6eb02faf7bea7da3be56fd358846c0d5b7fa177d4dbfbb9930cc6496848917a0ae88394d58a7631e78a36c62394b4893d238bee2226568dbc2868627c2105c AUX thin.initd-r4 1841 BLAKE2B 4cdf853cb536011d582c729d3c48d7335cd3fa508c5281139220d624c204fae1460d4d1c0252d42ff3d277eaaaedfe1259e895335fcf9c8b9134d3f288f2ba44 SHA512 08d06627bf61737837af40fc4253afbecf753e3c74edacb038e59e66b95ef6bb56d55065e7d02d393ba2df45b93c9882788debdd4965404a8088c0e52ec98c0a DIST thin-1.8.1.tar.gz 181377 BLAKE2B 883a35d60d5845defa1f20a85b90269838a1b1ebeb4d4f32561af061cdac05b545c254fe65cca828ccfed033ad934ad3b72f1795407734d3b377a6022b57397f SHA512 221ef0c0369c449f2ca121c435ffebed318d6179a3b5d52e24d2bd80212df9cac35db39d156275c915c24550f6d8ded9f29616785d0a38e85cd13a1702e31298 EBUILD thin-1.8.1-r2.ebuild 2696 BLAKE2B dd1c423708dd9bb07c4f10904963d8b24a52ee4ec25f26ebbc5ef3814584ada872641217ff85d740cf67e4ff24ec9ca68bc055b8cc8e01b2bb046f196e22501a SHA512 6ccee535a74e4a52a283d956a91528072e52f63ddd4783162c8401c95839df5e98efa063fd15ae1a6f8930411d3bc08151f5121957e43aee3c485f2a9e1bf7a6 +EBUILD thin-1.8.1-r3.ebuild 2749 BLAKE2B 6502d97049631b6286a416d0068d74c6329e5156b5670d22c82c8fbc76eadaf72a27c0be5e67b4ed2c67e23d2b6a02d5bca1dd9a9e6691624b429d2debc3ff27 SHA512 66b937e191d57687e73c581fac199af5381aef8823fbf2f4165a0c285a3884ce943f2399f0127db95f712966a91cdc18dd4b19671d7389d49910f71d6b48b520 MISC metadata.xml 610 BLAKE2B 8b633db16d80bc055f9e599b176dda37a854c615fcbbd399bf09b9dc26c08d207a170487b429351370b4b7160b1c5a3ba3ed1e582b282d07e05870805866a9e6 SHA512 af5acf36ba40b97581f13ec3fbb6b5519a4be59f3649d665df884847f14fb925bbff2c1480ef5a4c7b771b302927eb8a10350c7cb54e1d0c3e27ce7c7a31041a diff --git a/www-servers/thin/files/thin-1.8.1-ruby32.patch b/www-servers/thin/files/thin-1.8.1-ruby32.patch new file mode 100644 index 000000000000..808ebc2a45db --- /dev/null +++ b/www-servers/thin/files/thin-1.8.1-ruby32.patch @@ -0,0 +1,99 @@ +https://github.com/macournoyer/thin/commit/829c3aaa48efcd0c289d856f068f5d0fb16edaac + +From 829c3aaa48efcd0c289d856f068f5d0fb16edaac Mon Sep 17 00:00:00 2001 +From: Vasily Fedoseyev <github@vasfed.ru> +Date: Wed, 1 Feb 2023 00:03:48 +0300 +Subject: [PATCH] Update code base for Ruby v3.2 (#392) + +* `File.exists?` is removed in ruby 3.2 + +* Fix deprecated rspec expectation syntax + +* Fix `Socket.gethostbyname` deprecation + +* Test on ruby 3.2 and rack 2. +--- a/lib/thin/backends/swiftiply_client.rb ++++ b/lib/thin/backends/swiftiply_client.rb +@@ -50,7 +50,17 @@ def swiftiply_handshake(key) + + # For some reason Swiftiply request the current host + def host_ip +- Socket.gethostbyname(@backend.host)[3].unpack('CCCC') rescue [0, 0, 0, 0] ++ begin ++ if defined?(Addrinfo) ++ # ruby 2.0+ ++ # TODO: ipv6 support here? ++ Addrinfo.getaddrinfo(@backend.host, @backend.port, :PF_INET, :STREAM).first.ip_address.split('.').map(&:to_i) ++ else ++ Socket.gethostbyname(@backend.host)[3].unpack('CCCC') ++ end ++ rescue ++ [0, 0, 0, 0] ++ end + end + end + end +\ No newline at end of file +--- a/lib/thin/daemonizing.rb ++++ b/lib/thin/daemonizing.rb +@@ -78,7 +78,7 @@ def change_privilege(user, group=user) + + if uid != target_uid || gid != target_gid + # Change PID file ownership +- File.chown(target_uid, target_gid, @pid_file) if File.exists?(@pid_file) ++ File.chown(target_uid, target_gid, @pid_file) if File.exist?(@pid_file) + + # Change process ownership + Process.initgroups(user, target_gid) +@@ -174,7 +174,7 @@ def read_pid_file(file) + + protected + def remove_pid_file +- File.delete(@pid_file) if @pid_file && File.exists?(@pid_file) ++ File.delete(@pid_file) if @pid_file && File.exist?(@pid_file) + end + + def write_pid_file +--- a/spec/connection_spec.rb ++++ b/spec/connection_spec.rb +@@ -37,7 +37,7 @@ + end + + it "should process at most once when request is larger than expected" do +- @connection.should_receive(:process).at_most(1) ++ expect(@connection).to receive(:process).at_most(1) + @connection.receive_data("POST / HTTP/1.1\r\nHost: localhost:3000\r\nContent-Length: 300\r\n\r\n") + 10.times { @connection.receive_data('X' * 1_000) } + end +--- a/spec/rails_app/config/boot.rb ++++ b/spec/rails_app/config/boot.rb +@@ -26,7 +26,7 @@ def vendor_rails? + + # FIXME : Ruby 1.9 + def preinitialize +- load(preinitializer_path) if File.exists?(preinitializer_path) ++ load(preinitializer_path) if File.exist?(preinitializer_path) + end + + def preinitializer_path +--- a/spec/request/parser_spec.rb ++++ b/spec/request/parser_spec.rb +@@ -210,7 +210,7 @@ + end + + it "should fail when total request vastly exceeds specified CONTENT_LENGTH" do +- proc do ++ expect do + R(<<-EOS, true) + POST / HTTP/1.1 + Host: localhost:3000 +@@ -218,7 +218,7 @@ + + #{'X' * 300_000} + EOS +- end.should raise_error(InvalidRequest) ++ end.to raise_error(InvalidRequest) + end + + it "should default SERVER_NAME to localhost" do + diff --git a/www-servers/thin/thin-1.8.1-r3.ebuild b/www-servers/thin/thin-1.8.1-r3.ebuild new file mode 100644 index 000000000000..9f3dce90094e --- /dev/null +++ b/www-servers/thin/thin-1.8.1-r3.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby27 ruby30 ruby31 ruby32" + +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" + +inherit ruby-fakegem + +DESCRIPTION="A fast and very simple Ruby web server" +HOMEPAGE="http://code.macournoyer.com/thin/" +SRC_URI="https://github.com/macournoyer/thin/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Ruby" +SLOT="0" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="doc test" + +DEPEND="${DEPEND} + dev-util/ragel" +RDEPEND="${RDEPEND}" + +# The runtime dependencies are used at build-time as well since the +# Rakefile loads thin! +mydeps=">=dev-ruby/daemons-1.0.9 + >=dev-ruby/rack-1.0.0:* <dev-ruby/rack-3:* + >=dev-ruby/eventmachine-1.0.4:0 + virtual/ruby-ssl" + +ruby_add_rdepend "${mydeps}" +ruby_add_bdepend "${mydeps} + dev-ruby/rake-compiler" + +PATCHES=( + "${FILESDIR}"/${P}-ruby32.patch +) + +all_ruby_prepare() { + # Fix Ragel-based parser generation (uses a *very* old syntax that + # is not supported in Gentoo) + sed -i -e 's: | rlgen-cd::' Rakefile || die + + # Fix specs' dependencies so that the extension is not rebuilt + # when running tests + rm tasks/spec.rake || die + + # Fix rspec version to allow newer 2.x versions + sed -i -e '/gem "rspec"/ s/1.2.9/3.0/ ; 2igem "rack", "<3"' spec/spec_helper.rb || die + + # Avoid CLEAN since it may not be available and we don't need it. + sed -i -e '/CLEAN/ s:^:#:' tasks/*.rake || die + + # Disable a test that is known for freezing the testsuite, + # reported upstream. In thin 1.5.1 this just fails. + sed -i \ + -e '/should force kill process in pid file/,/^ end/ s:^:#:' \ + spec/daemonizing_spec.rb || die + + sed -i \ + -e '/tracing routines (with NO custom logger)/,/^ end/ s:^:#:'\ + spec/logging_spec.rb || die + + find spec/perf -name "*_spec.rb" -exec \ + sed -i '/be_faster_then/ i \ skip' {} \; + + sed -i -e "s/Spec::Runner/Rspec/" spec/spec_helper.rb || die + # nasty but too complex to fix up for now :( + use doc || rm tasks/rdoc.rake +} + +each_ruby_compile() { + ${RUBY} -S rake compile || die "rake compile failed" +} + +all_ruby_install() { + all_fakegem_install + + keepdir /etc/thin + newinitd "${FILESDIR}"/${PN}.initd-r4 ${PN} + newconfd "${FILESDIR}"/${PN}.confd-2 ${PN} + + einfo + elog "Thin is now shipped with init scripts." + elog "The default script (/etc/init.d/thin) will start all servers that have" + elog "configuration files in /etc/thin/. You can symlink the init script to" + elog "files of the format 'thin.SERVER' to be able to start individual servers." + elog "See /etc/conf.d/thin for more configuration options." + einfo +} + +each_ruby_install() { + each_fakegem_install + + # Ensure that newer rubygems version see the extention as installed + ruby_fakegem_extensions_installed +} |