diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2024-10-11 19:48:17 +0000 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2024-10-11 20:14:43 +0000 |
commit | d32416d4d8df71f219318084f78cdb37d2926f62 (patch) | |
tree | 376d79fbab4ae57229ce2c86d7261dfc700bb13b | |
parent | dc37ea052ed74321c5244938f8d702372f663776 (diff) | |
download | meta-cloud-services-d32416d4d8df71f219318084f78cdb37d2926f62.tar.gz |
ruby-shadow: update and supply extconf.rb
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
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 @@ | |||
1 | From 781c51f6bc5da29ca879de42efa55128b04d5772 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Fri, 11 Oct 2024 03:34:40 +0000 | ||
4 | Subject: [PATCH] shadow: update to ruby 3.x str routines | ||
5 | |||
6 | Upstream-Status: Inappropriate [embedded specific] | ||
7 | |||
8 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
9 | --- | ||
10 | shadow/shadow.c | 4 ++-- | ||
11 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/shadow/shadow.c b/shadow/shadow.c | ||
14 | index 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 | -- | ||
29 | 2.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 | |||
7 | require 'mkmf' | ||
8 | require '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 | |||
17 | implementation = 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 | ||
27 | implementation = 'shadow' | ||
28 | |||
29 | # puts "Selected implementation: #{implementation}" | ||
30 | # puts "Host OS: #{CONFIG['host_os']}" | ||
31 | |||
32 | ok = true | ||
33 | |||
34 | case implementation | ||
35 | when '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 | ||
54 | when '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") | ||
64 | else | ||
65 | ok = false | ||
66 | end | ||
67 | |||
68 | have_header( "ruby/io.h") | ||
69 | |||
70 | if ok | ||
71 | |||
72 | create_makefile("shadow", implementation) | ||
73 | else | ||
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." | ||
75 | end | ||
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 @@ | |||
1 | SUMMARY = "Shadow Password Module" | 1 | SUMMARY = "Shadow Password Module" |
2 | HOMEPAGE = "https://github.com/apalmblad/ruby-shadow" | 2 | HOMEPAGE = "https://github.com/apalmblad/ruby-shadow" |
3 | LICENSE = "PD" | 3 | LICENSE = "PD" |
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=137882914e5269b7268f0fe8e28a3f89" | 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=eee512aef6667f19c00b841db708cfeb" |
5 | 5 | ||
6 | PV = "2.5.0" | 6 | PV = "2.5.1" |
7 | 7 | ||
8 | SRC_URI = "git://github.com/apalmblad/ruby-shadow.git;branch=master;protocol=https" | 8 | SRC_URI = "git://github.com/apalmblad/ruby-shadow.git;branch=master;protocol=https \ |
9 | SRCREV = "d2e822d8a8bda61f0774debbfce363a7347ed893" | 9 | file://0001-shadow-update-to-ruby-3.x-str-routines.patch \ |
10 | file://extconf.rb" | ||
11 | |||
12 | SRCREV = "f135b3fd52d0a638f2eb9b17a8952a7f0f317688" | ||
10 | S = "${WORKDIR}/git" | 13 | S = "${WORKDIR}/git" |
11 | 14 | ||
12 | inherit ruby | 15 | inherit ruby |
13 | 16 | ||
17 | GEM_NAME = "ruby-shadow" | ||
18 | GEM_SPEC_FILE = "ruby-shadow.gemspec" | ||
19 | |||
14 | DEPENDS += " \ | 20 | DEPENDS += " \ |
15 | ruby \ | 21 | ruby \ |
22 | shadow \ | ||
16 | " | 23 | " |
17 | 24 | ||
18 | RDEPENDS:${PN} += " \ | 25 | RDEPENDS:${PN} += " \ |
@@ -21,3 +28,5 @@ RDEPENDS:${PN} += " \ | |||
21 | 28 | ||
22 | RUBY_INSTALL_GEMS = "ruby-shadow-${PV}.gem" | 29 | RUBY_INSTALL_GEMS = "ruby-shadow-${PV}.gem" |
23 | FILES:${PN}-dbg += "/usr/lib*/ruby/gems/*/gems/ruby-shadow-${PV}/.debug/shadow.so" | 30 | FILES:${PN}-dbg += "/usr/lib*/ruby/gems/*/gems/ruby-shadow-${PV}/.debug/shadow.so" |
31 | |||
32 | INSANE_SKIP:${PN} += "ldflags textrel" | ||