[packages/ruby-shadow] - up to 2.5.0

baggins baggins at pld-linux.org
Tue Mar 24 09:35:40 CET 2020


commit f9bfcdbb0b4dd47255645fc6caaab7fd873458c6
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Mar 24 09:33:23 2020 +0100

    - up to 2.5.0

 cflags.patch           |  12 +--
 ruby-1.9-support.patch | 236 -------------------------------------------------
 ruby-2.0.patch         |  29 ------
 ruby-shadow.spec       |  16 ++--
 4 files changed, 12 insertions(+), 281 deletions(-)
---
diff --git a/ruby-shadow.spec b/ruby-shadow.spec
index 163aa18..6b8186d 100644
--- a/ruby-shadow.spec
+++ b/ruby-shadow.spec
@@ -1,16 +1,14 @@
 %define pkgname shadow
 Summary:	Ruby bindings for shadow password access
 Name:		ruby-%{pkgname}
-Version:	1.4.1
-Release:	6
+Version:	2.5.0
+Release:	1
 License:	Public Domain
 Group:		Development/Languages
-Source0:	http://ttsky.net/src/%{name}-%{version}.tar.gz
-# Source0-md5:	425b742ac43bff359c1717360f761790
-Patch0:		ruby-1.9-support.patch
+Source0:	https://github.com/apalmblad/ruby-shadow/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	e9c35620f6c25233b7b54dcab8ee955e
 Patch1:		cflags.patch
-Patch2:		ruby-2.0.patch
-URL:		http://ttsky.net/
+URL:		https://github.com/apalmblad/ruby-shadow
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.665
 BuildRequires:	ruby >= 1:1.8.6
@@ -23,10 +21,8 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 Ruby bindings for shadow password access.
 
 %prep
-%setup -q -n shadow-%{version}
-%patch0 -p1
+%setup -q
 %patch1 -p1
-%patch2 -p1
 iconv -f EUCJP -t utf8 -o README.ja README.euc
 
 %build
diff --git a/cflags.patch b/cflags.patch
index 02524e3..6628233 100644
--- a/cflags.patch
+++ b/cflags.patch
@@ -2,12 +2,12 @@ diff -up shadow-1.4.1/extconf.rb~ shadow-1.4.1/extconf.rb
 --- shadow-1.4.1/extconf.rb~	2012-04-20 10:48:06.724264584 -0400
 +++ shadow-1.4.1/extconf.rb	2012-04-20 10:40:45.517013943 -0400
 @@ -6,7 +6,8 @@
- 
  require 'mkmf'
+ require 'rbconfig'
  
--$CFLAGS = RUBY_VERSION =~ /1\.9/ ? '-DRUBY19' : ''
+-$CFLAGS = case RUBY_VERSION
 +$CFLAGS = "#{$CFLAGS}"
-+$CFLAGS += RUBY_VERSION =~ /1\.9/ ? ' -DRUBY19' : ''
- 
- #$LDFLAGS = "-lshadow"
- 
++$CFLAGS += case RUBY_VERSION
+           when /^1\.9/; '-DRUBY19'
+           when /^2\./; '-DRUBY19'
+           else; ''
diff --git a/ruby-1.9-support.patch b/ruby-1.9-support.patch
deleted file mode 100644
index 62685b8..0000000
--- a/ruby-1.9-support.patch
+++ /dev/null
@@ -1,236 +0,0 @@
-From bdca56125853d11f1edb367fdbaf4d5216c88f4f Mon Sep 17 00:00:00 2001
-From: Todd Zullinger <tmz at pobox.com>
-Date: Fri, 20 Apr 2012 10:17:39 -0400
-Subject: [PATCH] Add ruby-1.9 support
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This comes from the rubygem-ruby-shadow fork of this project on github¹.
-
-¹ https://github.com/apalmblad/ruby-shadow
----
- HISTORY    |   24 ++++++++++++++++++++++++
- depend     |   10 +++++++++-
- extconf.rb |    9 ++++++---
- shadow.c   |   40 +++++++++++++++++++++++++++-------------
- 4 files changed, 66 insertions(+), 17 deletions(-)
-
-diff --git a/HISTORY b/HISTORY
-index cd7d87e..e317c8e 100644
---- a/HISTORY
-+++ b/HISTORY
-@@ -1,3 +1,27 @@
-+[2012/03/15]
-+* Version 2.1.3
-+ - MATSUU Takuto <matsuu at gentoo.org>
-+ Fix a typo in the C code for rb_shadow_putspent.  Typo has been present since
-+ ruby 1.9 code was added.
-+[2011/02/08]
-+* Version 2.1.2
-+ -  Jeff Blaine <>, Adam Palmblad <adam.palmblad at teampages.com>:
-+   Fix issues with compiling against Solaris.  Apparently solaris does not offer sgetspent
-+ compiling against ruby 1.8; fixes were made to the ruby header path.
-+[2011/02/08]
-+* Version 2.1.1
-+ -  Eric Hankins <ssilver at stormsilver.net>: Looks like there was a minor bug in
-+ compiling against ruby 1.8; fixes were made to the ruby header path.
-+[2011/01/27]
-+* Version 2.1
-+    - Ian Marlier <imarlier at brightcove.com>: Make ruby-shadow compile under Ruby 1.9.2
-+        * STR2CSTR macro was removed in Ruby 1.9.2, after being deprecated in Ruby 1.8.  Change
-+          to StringValuePtr() in its place.
-+
-+[2010/07/27]
-+* Version 2.0
-+    - Adam Palmblad <adam.palmblad at teampages.com>: Make ruby-shadow compile under Ruby 1.9
-+
- [1999/08/18]
- * version 1.4.1
-   - extconf.rb supports glibc2(libc6).
-diff --git a/depend b/depend
-index f5811a2..33ed740 100644
---- a/depend
-+++ b/depend
-@@ -1 +1,9 @@
--shadow.o : shadow.c $(hdrdir)/ruby.h $(hdrdir)/rubyio.h
-+ifneq (,$(findstring 1.9,$(ruby_version)))
-+	io_lib=$(hdrdir)/ruby/ruby/io.h
-+	hdr=$(hdrdir)/ruby/ruby.h
-+else
-+	io_lib=$(hdrdir)/ruby/rubyio.h
-+	hdr=$(hdrdir)/ruby.h
-+endif
-+
-+shadow.o: shadow.c $(hdr) $(io_lib)
-diff --git a/extconf.rb b/extconf.rb
-index 6f300e5..d2baadd 100644
---- a/extconf.rb
-+++ b/extconf.rb
-@@ -6,15 +6,15 @@
- 
- require 'mkmf'
- 
--$CFLAGS = ""
--$LDFLAGS = "-lshadow"
-+$CFLAGS = RUBY_VERSION =~ /1\.9/ ? '-DRUBY19' : ''
-+
-+#$LDFLAGS = "-lshadow"
- 
- if( ! (ok = have_library("shadow","getspent")) )
-   $LDFLAGS = ""
-   ok = have_func("getspent")
- end
- 
--ok &= have_func("sgetspent")
- ok &= have_func("fgetspent")
- ok &= have_func("setspent")
- ok &= have_func("endspent")
-@@ -22,5 +22,8 @@ ok &= have_func("lckpwdf")
- ok &= have_func("ulckpwdf")
- 
- if ok
-+  if !have_func("sgetspent")
-+    $CFLAGS += ' -DSOLARIS'
-+  end
-   create_makefile("shadow")
- end
-diff --git a/shadow.c b/shadow.c
-index 8a52c83..41ff003 100644
---- a/shadow.c
-+++ b/shadow.c
-@@ -10,7 +10,17 @@
- 
- #include <shadow.h>
- #include "ruby.h"
-+#ifdef RUBY19
-+#include <ruby/io.h>
-+#else
- #include "rubyio.h"
-+#endif
-+
-+#ifdef RUBY19
-+#define file_ptr(x) (x)->stdio_file
-+#else
-+#define file_ptr(x) (x)->f
-+#endif
- 
- static VALUE rb_mShadow;
- static VALUE rb_mPasswd;
-@@ -36,6 +46,7 @@ rb_shadow_endspent(VALUE self)
- };
- 
- 
-+#ifndef SOLARIS
- static VALUE
- rb_shadow_sgetspent(VALUE self, VALUE str)
- {
-@@ -45,7 +56,7 @@ rb_shadow_sgetspent(VALUE self, VALUE str)
-   if( TYPE(str) != T_STRING )
-     rb_raise(rb_eException,"argument must be a string.");
- 
--  entry = sgetspent(STR2CSTR(str));
-+  entry = sgetspent(StringValuePtr(str));
- 
-   if( entry == NULL )
-     return Qnil;
-@@ -60,10 +71,11 @@ rb_shadow_sgetspent(VALUE self, VALUE str)
- 		      INT2FIX(entry->sp_inact),
- 		      INT2FIX(entry->sp_expire),
- 		      INT2FIX(entry->sp_flag),
--		      0);
-+		      NULL);
-   free(entry);
-   return result;
- };
-+#endif
- 
- static VALUE
- rb_shadow_fgetspent(VALUE self, VALUE file)
-@@ -74,7 +86,7 @@ rb_shadow_fgetspent(VALUE self, VALUE file)
-   if( TYPE(file) != T_FILE )
-     rb_raise(rb_eTypeError,"argument must be a File.");
- 
--  entry = fgetspent((RFILE(file)->fptr)->f);
-+  entry = fgetspent( file_ptr( (RFILE(file)->fptr) ) );
- 
-   if( entry == NULL )
-     return Qnil;
-@@ -89,7 +101,7 @@ rb_shadow_fgetspent(VALUE self, VALUE file)
- 		      INT2FIX(entry->sp_inact),
- 		      INT2FIX(entry->sp_expire),
- 		      INT2FIX(entry->sp_flag),
--		      0);
-+		      NULL);
-   return result;
- };
- 
-@@ -114,7 +126,7 @@ rb_shadow_getspent(VALUE self)
- 		      INT2FIX(entry->sp_inact),
- 		      INT2FIX(entry->sp_expire),
- 		      INT2FIX(entry->sp_flag),
--		      0);
-+		      NULL);
-   return result;
- };
- 
-@@ -127,7 +139,7 @@ rb_shadow_getspnam(VALUE self, VALUE name)
-   if( TYPE(name) != T_STRING )
-     rb_raise(rb_eException,"argument must be a string.");
- 
--  entry = getspnam(STR2CSTR(name));
-+  entry = getspnam(StringValuePtr(name));
- 
-   if( entry == NULL )
-     return Qnil;
-@@ -142,7 +154,7 @@ rb_shadow_getspnam(VALUE self, VALUE name)
- 		      INT2FIX(entry->sp_inact),
- 		      INT2FIX(entry->sp_expire),
- 		      INT2FIX(entry->sp_flag),
--		      0);
-+		      NULL);
-   return result;
- };
- 
-@@ -157,11 +169,11 @@ rb_shadow_putspent(VALUE self, VALUE entry, VALUE file)
-   int result;
- 
-   for(i=0; i<=8; i++)
--    val[i] = RSTRUCT(entry)->ptr[i];
--  cfile = RFILE(file)->fptr->f;
-+    val[i] = RSTRUCT_PTR( entry )[i]; //val[i] = RSTRUCT(entry)->ptr[i];
-+  cfile = file_ptr( RFILE(file)->fptr );
- 
--  centry.sp_namp = STR2CSTR(val[0]);
--  centry.sp_pwdp = STR2CSTR(val[1]);
-+  centry.sp_namp = StringValuePtr(val[0]);
-+  centry.sp_pwdp = StringValuePtr(val[1]);
-   centry.sp_lstchg = FIX2INT(val[2]);
-   centry.sp_min = FIX2INT(val[3]);
-   centry.sp_max = FIX2INT(val[4]);
-@@ -254,10 +266,10 @@ Init_shadow()
-   rb_sPasswdEntry = rb_struct_define("PasswdEntry",
- 				     "sp_namp","sp_pwdp","sp_lstchg",
- 				     "sp_min","sp_max","sp_warn",
--				     "sp_inact","sp_expire","sp_flag",0);
-+				     "sp_inact","sp_expire","sp_flag", NULL);
-   rb_sGroupEntry = rb_struct_define("GroupEntry",
- 				    "sg_name","sg_passwd",
--				    "sg_adm","sg_mem",0);
-+				    "sg_adm","sg_mem",NULL);
- 
-   rb_mShadow = rb_define_module("Shadow");
-   rb_eFileLock = rb_define_class_under(rb_mShadow,"FileLock",rb_eException);
-@@ -268,7 +280,9 @@ Init_shadow()
- 
-   rb_define_module_function(rb_mPasswd,"setspent",rb_shadow_setspent,0);
-   rb_define_module_function(rb_mPasswd,"endspent",rb_shadow_endspent,0);
-+  #ifndef SOLARIS
-   rb_define_module_function(rb_mPasswd,"sgetspent",rb_shadow_sgetspent,1);
-+  #endif
-   rb_define_module_function(rb_mPasswd,"fgetspent",rb_shadow_fgetspent,1);
-   rb_define_module_function(rb_mPasswd,"getspent",rb_shadow_getspent,0);
-   rb_define_module_function(rb_mPasswd,"getspnam",rb_shadow_getspnam,1);
--- 
-1.7.6
-
diff --git a/ruby-2.0.patch b/ruby-2.0.patch
deleted file mode 100644
index 8a46015..0000000
--- a/ruby-2.0.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From fa317a925f6880d62ce5157792d9901be33ea57f Mon Sep 17 00:00:00 2001
-From: Adam Palmblad <adam.palmblad at teampages.com>
-Date: Mon, 25 Feb 2013 12:49:39 -0800
-Subject: [PATCH] Add support for ruby 2.0.
-
----
- extconf.rb          | 6 +++++-
- 1 files changed, 5 insertions(+), 1 deletions(-)
-
-diff --git a/extconf.rb b/extconf.rb
-index 9453b27..7dcbba7 100644
---- a/extconf.rb
-+++ b/extconf.rb
-@@ -7,7 +7,11 @@
- require 'mkmf'
- 
- $CFLAGS = "#{$CFLAGS}"
--$CFLAGS += RUBY_VERSION =~ /1\.9/ ? ' -DRUBY19' : ''
-+$CFLAGS += case RUBY_VERSION
-+          when /^1\.9/; ' -DRUBY19'
-+          when /^2\./; ' -DRUBY19'
-+          else; ''
-+          end
- 
- #$LDFLAGS = "-lshadow"
- 
--- 
-1.8.1.5
-
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-shadow.git/commitdiff/f9bfcdbb0b4dd47255645fc6caaab7fd873458c6



More information about the pld-cvs-commit mailing list