summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2024-10-11 19:48:17 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2024-10-11 20:14:43 +0000
commitd32416d4d8df71f219318084f78cdb37d2926f62 (patch)
tree376d79fbab4ae57229ce2c86d7261dfc700bb13b
parentdc37ea052ed74321c5244938f8d702372f663776 (diff)
downloadmeta-cloud-services-d32416d4d8df71f219318084f78cdb37d2926f62.tar.gz
ruby-shadow: update and supply extconf.rb
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-support/ruby-shadow/files/0001-shadow-update-to-ruby-3.x-str-routines.patch30
-rw-r--r--recipes-support/ruby-shadow/files/extconf.rb75
-rw-r--r--recipes-support/ruby-shadow/ruby-shadow_git.bb17
3 files changed, 118 insertions, 4 deletions
diff --git a/recipes-support/ruby-shadow/files/0001-shadow-update-to-ruby-3.x-str-routines.patch b/recipes-support/ruby-shadow/files/0001-shadow-update-to-ruby-3.x-str-routines.patch
new file mode 100644
index 0000000..4c5591d
--- /dev/null
+++ b/recipes-support/ruby-shadow/files/0001-shadow-update-to-ruby-3.x-str-routines.patch
@@ -0,0 +1,30 @@
1From 781c51f6bc5da29ca879de42efa55128b04d5772 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Fri, 11 Oct 2024 03:34:40 +0000
4Subject: [PATCH] shadow: update to ruby 3.x str routines
5
6Upstream-Status: Inappropriate [embedded specific]
7
8Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
9---
10 shadow/shadow.c | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/shadow/shadow.c b/shadow/shadow.c
14index 35a77a1..314c280 100644
15--- a/shadow/shadow.c
16+++ b/shadow/shadow.c
17@@ -34,8 +34,8 @@ static VALUE rb_eFileLock;
18 static VALUE convert_pw_struct( struct spwd *entry )
19 {
20 return rb_struct_new(rb_sPasswdEntry,
21- rb_tainted_str_new2(entry->sp_namp),
22- rb_tainted_str_new2(entry->sp_pwdp),
23+ rb_str_new_cstr(entry->sp_namp),
24+ rb_str_new_cstr(entry->sp_pwdp),
25 INT2FIX(entry->sp_lstchg),
26 INT2FIX(entry->sp_min),
27 INT2FIX(entry->sp_max),
28--
292.39.2
30
diff --git a/recipes-support/ruby-shadow/files/extconf.rb b/recipes-support/ruby-shadow/files/extconf.rb
new file mode 100644
index 0000000..570a6ee
--- /dev/null
+++ b/recipes-support/ruby-shadow/files/extconf.rb
@@ -0,0 +1,75 @@
1# -*- ruby -*-
2# extconf.rb
3#
4# Modified at: <1999/8/19 06:38:55 by ttate>
5#
6
7require 'mkmf'
8require 'rbconfig'
9
10$CFLAGS = case RUBY_VERSION
11 when /^1\.9/; '-DRUBY19'
12 when /^2\./; '-DRUBY19'
13 when /^3\./; '-DRUBY19'
14 else; ''
15 end
16
17implementation = case CONFIG['host_os']
18 when /linux/i; 'shadow'
19 when /sunos|solaris/i; 'shadow'
20 when /freebsd|mirbsd|netbsd|openbsd/i; 'pwd'
21 when /darwin/i; 'pwd'
22 else; nil
23 "This library works on OS X, FreeBSD, MirBSD, NetBSD, OpenBSD, Solaris and Linux."
24 end
25
26# force this, we know we are building for linux
27implementation = 'shadow'
28
29# puts "Selected implementation: #{implementation}"
30# puts "Host OS: #{CONFIG['host_os']}"
31
32ok = true
33
34case implementation
35when 'shadow'
36 #$LDFLAGS = "-lshadow"
37
38 if( ! (ok &= have_library("shadow","getspent")) )
39 $LDFLAGS = ""
40 ok = have_func("getspent")
41 end
42
43 ok &= have_func("fgetspent")
44 ok &= have_func("setspent")
45 ok &= have_func("endspent")
46 ok &= have_func("lckpwdf")
47 ok &= have_func("ulckpwdf")
48
49 if ok
50 if !have_func("sgetspent")
51 $CFLAGS += ' -DSOLARIS'
52 end
53 end
54when 'pwd'
55 ok &= have_func("endpwent")
56 ok &= have_func("getpwent")
57 ok &= have_func("getpwnam")
58 ok &= have_func("getpwuid")
59 ok &= have_func("setpassent")
60 ok &= have_func("setpwent")
61
62 have_header("uuid/uuid.h")
63 have_header("uuid.h")
64else
65 ok = false
66end
67
68have_header( "ruby/io.h")
69
70if ok
71
72 create_makefile("shadow", implementation)
73else
74 raise "You are missing some of the required functions from either shadow.h on Linux/Solaris, or pwd.h on FreeBSD/MirBSD/NetBSD/OpenBSD/OS X."
75end
diff --git a/recipes-support/ruby-shadow/ruby-shadow_git.bb b/recipes-support/ruby-shadow/ruby-shadow_git.bb
index 0c6fc60..9a82a5b 100644
--- a/recipes-support/ruby-shadow/ruby-shadow_git.bb
+++ b/recipes-support/ruby-shadow/ruby-shadow_git.bb
@@ -1,18 +1,25 @@
1SUMMARY = "Shadow Password Module" 1SUMMARY = "Shadow Password Module"
2HOMEPAGE = "https://github.com/apalmblad/ruby-shadow" 2HOMEPAGE = "https://github.com/apalmblad/ruby-shadow"
3LICENSE = "PD" 3LICENSE = "PD"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=137882914e5269b7268f0fe8e28a3f89" 4LIC_FILES_CHKSUM = "file://LICENSE;md5=eee512aef6667f19c00b841db708cfeb"
5 5
6PV = "2.5.0" 6PV = "2.5.1"
7 7
8SRC_URI = "git://github.com/apalmblad/ruby-shadow.git;branch=master;protocol=https" 8SRC_URI = "git://github.com/apalmblad/ruby-shadow.git;branch=master;protocol=https \
9SRCREV = "d2e822d8a8bda61f0774debbfce363a7347ed893" 9 file://0001-shadow-update-to-ruby-3.x-str-routines.patch \
10 file://extconf.rb"
11
12SRCREV = "f135b3fd52d0a638f2eb9b17a8952a7f0f317688"
10S = "${WORKDIR}/git" 13S = "${WORKDIR}/git"
11 14
12inherit ruby 15inherit ruby
13 16
17GEM_NAME = "ruby-shadow"
18GEM_SPEC_FILE = "ruby-shadow.gemspec"
19
14DEPENDS += " \ 20DEPENDS += " \
15 ruby \ 21 ruby \
22 shadow \
16" 23"
17 24
18RDEPENDS:${PN} += " \ 25RDEPENDS:${PN} += " \
@@ -21,3 +28,5 @@ RDEPENDS:${PN} += " \
21 28
22RUBY_INSTALL_GEMS = "ruby-shadow-${PV}.gem" 29RUBY_INSTALL_GEMS = "ruby-shadow-${PV}.gem"
23FILES:${PN}-dbg += "/usr/lib*/ruby/gems/*/gems/ruby-shadow-${PV}/.debug/shadow.so" 30FILES:${PN}-dbg += "/usr/lib*/ruby/gems/*/gems/ruby-shadow-${PV}/.debug/shadow.so"
31
32INSANE_SKIP:${PN} += "ldflags textrel"