package init

This commit is contained in:
yanzh_h 2019-11-27 20:04:12 +08:00
commit 9eedd3006a
9 changed files with 2351 additions and 0 deletions

11
uuid-1.6.1-mkdir.patch Normal file
View File

@ -0,0 +1,11 @@
diff -up uuid-1.6.2/pgsql/Makefile.mkdir uuid-1.6.2/pgsql/Makefile
--- uuid-1.6.2/pgsql/Makefile.mkdir 2011-03-03 15:12:12.000000000 +0000
+++ uuid-1.6.2/pgsql/Makefile 2011-03-03 16:15:45.000000000 +0000
@@ -16,6 +16,7 @@ PG_CONFIG ?= pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
POSTGRES := $(shell $(PG_CONFIG) --bindir)/postgres
top_builddir := $(dir $(PGXS))../..
+mkinstalldirs = ../shtool mkdir -p
include $(top_builddir)/src/Makefile.global
NAME = ossp-uuid

207
uuid-1.6.1-ossp.patch Normal file
View File

@ -0,0 +1,207 @@
diff -up uuid-1.6.1/uuid-config.in.BAD uuid-1.6.1/uuid-config.in
--- uuid-1.6.1/uuid-config.in.BAD 2008-03-06 11:56:13.000000000 -0500
+++ uuid-1.6.1/uuid-config.in 2008-03-06 11:56:25.000000000 -0500
@@ -121,7 +121,7 @@ do
output_extra="$output_extra $uuid_ldflags"
;;
--libs)
- output="$output -luuid"
+ output="$output -lossp-uuid"
output_extra="$output_extra $uuid_libs"
;;
* )
diff -up uuid-1.6.1/Makefile.in.BAD uuid-1.6.1/Makefile.in
--- uuid-1.6.1/Makefile.in.BAD 2008-03-06 11:10:13.000000000 -0500
+++ uuid-1.6.1/Makefile.in 2008-03-06 11:11:39.000000000 -0500
@@ -62,13 +62,13 @@ PERL = @PERL@
PHP = @PHP@
PG_CONFIG = @PG_CONFIG@
-LIB_NAME = libuuid.la
+LIB_NAME = libossp-uuid.la
LIB_OBJS = uuid.lo uuid_md5.lo uuid_sha1.lo uuid_prng.lo uuid_mac.lo uuid_time.lo uuid_ui64.lo uuid_ui128.lo uuid_str.lo
-DCE_NAME = libuuid_dce.la
+DCE_NAME = libossp-uuid_dce.la
DCE_OBJS = uuid_dce.lo $(LIB_OBJS)
-CXX_NAME = libuuid++.la
+CXX_NAME = libossp-uuid++.la
CXX_OBJS = uuid++.lo $(LIB_OBJS)
PRG_NAME = uuid
@@ -79,10 +79,10 @@ MAN_NAME = uuid.3 uuid++.3 uuid.1
PERL_NAME = $(S)/perl/blib/lib/OSSP/uuid.pm
PERL_OBJS = $(S)/perl/uuid.pm
-PHP_NAME = $(S)/php/modules/uuid.so
+PHP_NAME = $(S)/php/modules/ossp-uuid.so
PHP_OBJS = $(S)/php/uuid.c
-PGSQL_NAME = $(S)/pgsql/libuuid.so
+PGSQL_NAME = $(S)/pgsql/libossp-uuid.so
PGSQL_OBJS = $(S)/pgsql/uuid.c
TARGETS = $(LIB_NAME) @DCE_NAME@ @CXX_NAME@ $(PRG_NAME) @PERL_NAME@ @PHP_NAME@ @PGSQL_NAME@
@@ -231,7 +231,7 @@ install:
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
$(SHTOOL) install -c -m 755 uuid-config $(DESTDIR)$(bindir)/
$(SHTOOL) install -c -m 644 $(S)/uuid-config.1 $(DESTDIR)$(mandir)/man1/
- $(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
+ $(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/ossp-uuid.pc
$(SHTOOL) install -c -m 644 uuid.h $(DESTDIR)$(includedir)/
-@if [ ".$(WITH_DCE)" = .yes ]; then \
echo "$(SHTOOL) install -c -m 644 $(S)/uuid_dce.h $(DESTDIR)$(includedir)/"; \
@@ -241,7 +241,7 @@ install:
echo "$(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/"; \
$(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/; \
fi
- $(SHTOOL) install -c -m 644 $(S)/uuid.3 $(DESTDIR)$(mandir)/man3/
+ $(SHTOOL) install -c -m 644 $(S)/uuid.3 $(DESTDIR)$(mandir)/man3/ossp-uuid.3
-@if [ ".$(WITH_CXX)" = .yes ]; then \
echo "$(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/"; \
$(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/; \
@@ -276,7 +276,7 @@ uninstall:
-@if [ ".$(WITH_CXX)" = .yes ]; then \
$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(CXX_NAME); \
fi
- -$(RM) $(DESTDIR)$(mandir)/man3/uuid.3
+ -$(RM) $(DESTDIR)$(mandir)/man3/ossp-uuid.3
-@if [ ".$(WITH_CXX)" = .yes ]; then \
echo "$(RM) $(DESTDIR)$(mandir)/man3/uuid++.3"; \
$(RM) $(DESTDIR)$(mandir)/man3/uuid++.3; \
@@ -290,7 +290,7 @@ uninstall:
echo "$(RM) $(DESTDIR)$(includedir)/uuid++.hh"; \
$(RM) $(DESTDIR)$(includedir)/uuid++.hh; \
fi
- -$(RM) $(DESTDIR)$(libdir)/pkgconfig/uuid.pc
+ -$(RM) $(DESTDIR)$(libdir)/pkgconfig/ossp-uuid.pc
-$(RM) $(DESTDIR)$(mandir)/man1/uuid-config.1
-$(RM) $(DESTDIR)$(bindir)/uuid-config
-$(RMDIR) $(DESTDIR)$(mandir)/man1 >/dev/null 2>&1 || $(TRUE)
diff -up uuid-1.6.1/pgsql/Makefile.BAD uuid-1.6.1/pgsql/Makefile
--- uuid-1.6.1/pgsql/Makefile.BAD 2008-03-06 11:53:26.000000000 -0500
+++ uuid-1.6.1/pgsql/Makefile 2008-03-06 11:54:14.000000000 -0500
@@ -18,13 +18,13 @@ POSTGRES := $(shell $(PG_CONFIG
top_builddir := $(dir $(PGXS))../..
include $(top_builddir)/src/Makefile.global
-NAME = uuid
+NAME = ossp-uuid
OBJS = uuid.o
SO_MAJOR_VERSION = 1
SO_MINOR_VERSION = 0
override CPPFLAGS := -I.. $(CPPFLAGS)
-SHLIB_LINK := -L../.libs -luuid
+SHLIB_LINK := -L../.libs -lossp-uuid
SHLIB_LINK += $(shell test $(shell uname -s) = FreeBSD && echo "-Wl,-Bsymbolic")
SHLIB_LINK += $(shell test $(shell uname -s) = Darwin && echo "-bundle_loader $(POSTGRES)")
rpath :=
@@ -35,16 +35,16 @@ enable_shared = yes
include $(top_builddir)/src/Makefile.shlib
uuid.sql: uuid.sql.in
- sed -e 's;MODULE_PATHNAME;$(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX);g' <uuid.sql.in >uuid.sql
+ sed -e 's;MODULE_PATHNAME;$(DESTDIR)$(pkglibdir)/ossp-uuid$(DLSUFFIX);g' <uuid.sql.in >uuid.sql
install: all
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
$(mkinstalldirs) $(DESTDIR)$(datadir)
- $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX)
+ $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/ossp-uuid$(DLSUFFIX)
$(INSTALL_DATA) uuid.sql $(DESTDIR)$(datadir)/uuid.sql
uninstall:
- -rm -f $(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX)
+ -rm -f $(DESTDIR)$(pkglibdir)/ossp-uuid$(DLSUFFIX)
-rm -f $(DESTDIR)$(datadir)/uuid.sql
clean distclean: clean-lib
diff -up uuid-1.6.1/uuid.pc.in.BAD uuid-1.6.1/uuid.pc.in
--- uuid-1.6.1/uuid.pc.in.BAD 2008-03-06 11:57:29.000000000 -0500
+++ uuid-1.6.1/uuid.pc.in 2008-03-06 11:57:36.000000000 -0500
@@ -37,6 +37,6 @@ Description: Universally Unique Identifi
Version: @UUID_VERSION_RAW@
URL: http://www.ossp.org/pkg/lib/uuid/
Cflags: -I${includedir}
-Libs: -L${libdir} -luuid
+Libs: -L${libdir} -lossp-uuid
Libs.private: @LIBS@
diff -up uuid-1.6.1/perl/Makefile.PL.BAD uuid-1.6.1/perl/Makefile.PL
--- uuid-1.6.1/perl/Makefile.PL.BAD 2008-03-06 11:12:05.000000000 -0500
+++ uuid-1.6.1/perl/Makefile.PL 2008-03-06 11:49:25.000000000 -0500
@@ -33,9 +33,9 @@ use Config;
use ExtUtils::MakeMaker;
# determine source directory
-my ($srcdir) = map { my $d = $_; $d =~ s/\/libuuid\.la$//; $d }
- grep { -f $_ } ("../libuuid.la", glob("../*/libuuid.la"))
- or die "no source directory found (where libuuid.la is located)";
+my ($srcdir) = map { my $d = $_; $d =~ s/\/libossp-uuid\.la$//; $d }
+ grep { -f $_ } ("../libossp-uuid.la", glob("../*/libossp-uuid.la"))
+ or die "no source directory found (where libossp-uuid.la is located)";
# determine extra build options
my $compat = 0;
@@ -47,7 +47,7 @@ WriteMakefile(
VERSION_FROM => 'uuid.pm',
ABSTRACT_FROM => 'uuid.pod',
PREREQ_PM => {},
- LIBS => [ "-L$srcdir/.libs -L$srcdir -luuid" ],
+ LIBS => [ "-L$srcdir/.libs -L$srcdir -lossp-uuid" ],
DEFINE => '',
INC => "-I. -I$srcdir",
PM => { 'uuid.pm' => '$(INST_LIBDIR)/uuid.pm',
diff -up uuid-1.6.1/Makefile.PL.BAD uuid-1.6.1/Makefile.PL
--- uuid-1.6.1/Makefile.PL.BAD 2008-03-06 11:09:49.000000000 -0500
+++ uuid-1.6.1/Makefile.PL 2008-03-06 11:10:01.000000000 -0500
@@ -44,7 +44,7 @@ ARGS = $ARGS
all pure_all:
\@if [ ! -d build ]; then mkdir build; fi
\@if [ ! -f build/Makefile ]; then (cd build && ../configure --disable-shared); fi
- \@if [ ! -f build/libuuid.la ]; then (cd build && \$(MAKE) \$(MFLAGS) libuuid.la); fi
+ \@if [ ! -f build/libossp-uuid.la ]; then (cd build && \$(MAKE) \$(MFLAGS) libossp-uuid.la); fi
\@if [ ! -f perl/Makefile ]; then (cd perl && \$(PERL) Makefile.PL \$(ARGS)); fi
\@cd perl && \$(MAKE) \$(MFLAGS) \$\@
diff -up uuid-1.6.1/php/config.m4.BAD uuid-1.6.1/php/config.m4
--- uuid-1.6.1/php/config.m4.BAD 2008-03-06 11:54:55.000000000 -0500
+++ uuid-1.6.1/php/config.m4 2008-03-06 11:55:07.000000000 -0500
@@ -34,7 +34,7 @@ if test "$PHP_UUID" != "no"; then
PHP_NEW_EXTENSION(uuid, uuid.c, $ext_shared)
AC_DEFINE(HAVE_UUID, 1, [Have OSSP uuid library])
PHP_ADD_LIBPATH([..], )
- PHP_ADD_LIBRARY([uuid],, UUID_SHARED_LIBADD)
+ PHP_ADD_LIBRARY([ossp-uuid],, UUID_SHARED_LIBADD)
PHP_ADD_INCLUDE([..])
PHP_SUBST(UUID_SHARED_LIBADD)
diff -up uuid-1.6.1/php/Makefile.local.BAD uuid-1.6.1/php/Makefile.local
--- uuid-1.6.1/php/Makefile.local.BAD 2008-03-06 11:54:39.000000000 -0500
+++ uuid-1.6.1/php/Makefile.local 2008-03-06 11:54:49.000000000 -0500
@@ -48,7 +48,7 @@ install: build
@version=`$(PHP)-config --version | sed -e 's;^\([0-9]\).*$$;\1;'`; extdir="$(EXTDIR)"; \
echo "installing PHP$$version API into $$extdir"; \
./build/shtool mkdir -f -p -m 755 $(DESTDIR)$$extdir; \
- ./build/shtool install -c -m 755 modules/uuid.so $(DESTDIR)$$extdir/uuid.so; \
+ ./build/shtool install -c -m 755 modules/uuid.so $(DESTDIR)$$extdir/ossp-uuid.so; \
./build/shtool install -c -m 644 uuid.php$$version $(DESTDIR)$$extdir/uuid.php
clean:
diff -up uuid-1.6.1/php/uuid.ts.BAD uuid-1.6.1/php/uuid.ts
--- uuid-1.6.1/php/uuid.ts.BAD 2008-03-06 11:55:38.000000000 -0500
+++ uuid-1.6.1/php/uuid.ts 2008-03-06 11:56:03.000000000 -0500
@@ -34,9 +34,9 @@
$php_version = $argv[1];
-print "++ loading DSO uuid.so (low-level API)\n";
+print "++ loading DSO ossp-uuid.so (low-level API)\n";
if (!extension_loaded('uuid')) {
- dl('modules/uuid.so');
+ dl('modules/ossp-uuid.so');
}
print "++ loading PHP uuid.php${php_version} (high-level API)\n";

116
uuid-1.6.2-hwaddr.patch Normal file
View File

@ -0,0 +1,116 @@
diff -urN uuid-1.6.2/configure uuid-1.6.2/configure
--- uuid-1.6.2/configure 2008-07-04 15:43:09.000000000 -0600
+++ uuid-1.6.2/configure 2012-06-06 19:19:41.659880386 -0600
@@ -14208,7 +14208,7 @@
-for ac_header in netdb.h ifaddrs.h net/if.h net/if_dl.h net/if_arp.h netinet/in.h arpa/inet.h
+for ac_header in netdb.h ifaddrs.h net/if.h net/if_dl.h net/if_arp.h netinet/in.h arpa/inet.h netpacket/packet.h
do
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
diff -urN uuid-1.6.2/uuid.c uuid-1.6.2/uuid.c
--- uuid-1.6.2/uuid.c 2008-03-07 03:49:59.000000000 -0700
+++ uuid-1.6.2/uuid.c 2012-06-06 15:50:30.060881473 -0600
@@ -72,6 +72,8 @@
/* IEEE 802 MAC address octet length */
#define IEEE_MAC_OCTETS 6
+static unsigned char mac_unset[IEEE_MAC_OCTETS] = {BM_OCTET(1,0,0,0,0,0,0,0), 0x00, 0x00, 0x00, 0x00, 0x00};
+
/* UUID binary representation according to UUID standards */
typedef struct {
uuid_uint32_t time_low; /* bits 0-31 of time field */
@@ -967,7 +969,7 @@
* GENERATE NODE
*/
- if ((mode & UUID_MAKE_MC) || (uuid->mac[0] & BM_OCTET(1,0,0,0,0,0,0,0))) {
+ if ((mode & UUID_MAKE_MC) || !memcmp(uuid->mac, mac_unset, IEEE_MAC_OCTETS)) {
/* generate random IEEE 802 local multicast MAC address */
if (prng_data(uuid->prng, (void *)&(uuid->obj.node), sizeof(uuid->obj.node)) != PRNG_RC_OK)
return UUID_RC_INT;
diff -urN uuid-1.6.2/uuid_mac.c uuid-1.6.2/uuid_mac.c
--- uuid-1.6.2/uuid_mac.c 2008-03-07 03:49:59.000000000 -0700
+++ uuid-1.6.2/uuid_mac.c 2012-06-06 19:30:49.050879930 -0600
@@ -76,6 +76,9 @@
#ifdef HAVE_IFADDRS_H
#include <ifaddrs.h>
#endif
+#ifdef HAVE_NETPACKET_PACKET_H
+#include <netpacket/packet.h>
+#endif
/* own headers (part (1/2) */
#include "uuid_mac.h"
@@ -87,6 +90,10 @@
#define TRUE (/*lint -save -e506*/ !FALSE /*lint -restore*/)
#endif
+#if !defined(min)
+#define min(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
/* return the Media Access Control (MAC) address of
the FIRST network interface card (NIC) */
int mac_address(unsigned char *data_ptr, size_t data_len)
@@ -95,28 +102,41 @@
if (data_ptr == NULL || data_len < MAC_LEN)
return FALSE;
-#if defined(HAVE_IFADDRS_H) && defined(HAVE_NET_IF_DL_H) && defined(HAVE_GETIFADDRS)
+#if defined(HAVE_IFADDRS_H) && (defined(HAVE_NET_IF_DL_H) || defined(HAVE_NETPACKET_PACKET_H)) && defined(HAVE_GETIFADDRS)
/* use getifaddrs(3) on BSD class platforms (xxxBSD, MacOS X, etc) */
{
struct ifaddrs *ifap;
struct ifaddrs *ifap_head;
+#if defined(HAVE_NET_IF_DL_H)
const struct sockaddr_dl *sdl;
unsigned char *ucp;
- int i;
+#else
+ const struct sockaddr_ll *sll;
+#endif
if (getifaddrs(&ifap_head) < 0)
return FALSE;
for (ifap = ifap_head; ifap != NULL; ifap = ifap->ifa_next) {
+#if defined(HAVE_NET_IF_DL_H)
if (ifap->ifa_addr != NULL && ifap->ifa_addr->sa_family == AF_LINK) {
sdl = (const struct sockaddr_dl *)(void *)ifap->ifa_addr;
ucp = (unsigned char *)(sdl->sdl_data + sdl->sdl_nlen);
if (sdl->sdl_alen > 0) {
- for (i = 0; i < MAC_LEN && i < sdl->sdl_alen; i++, ucp++)
- data_ptr[i] = (unsigned char)(*ucp & 0xff);
+ memcpy(data_ptr, ucp, min(sdl->sdl_alen, MAC_LEN));
freeifaddrs(ifap_head);
return TRUE;
}
}
+#else
+ if (ifap->ifa_addr != NULL && ifap->ifa_addr->sa_family == AF_PACKET) {
+ sll = (const struct sockaddr_ll *)(void *)ifap->ifa_addr;
+ if (sll->sll_hatype == ARPHRD_ETHER) {
+ memcpy(data_ptr, sll->sll_addr, min(sll->sll_halen, MAC_LEN));
+ freeifaddrs(ifap_head);
+ return TRUE;
+ }
+ }
+#endif
}
freeifaddrs(ifap_head);
}
diff -urN uuid-1.6.2/config.h.in uuid-1.6.2/config.h.in
--- uuid-1.6.2/config.h.in 2008-07-04 15:43:10.000000000 -0600
+++ uuid-1.6.2/config.h.in 2012-06-06 21:59:03.370227352 -0600
@@ -75,6 +75,9 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
+/* Define to 1 if you have the <netpacket/packet.h> header file. */
+#undef HAVE_NETPACKET_PACKET_H
+
/* Define to 1 if you have the <net/if_arp.h> header file. */
#undef HAVE_NET_IF_ARP_H

13
uuid-1.6.2-manfix.patch Normal file
View File

@ -0,0 +1,13 @@
diff -up uuid-1.6.2/uuid.1.manfix uuid-1.6.2/uuid.1
--- uuid-1.6.2/uuid.1.manfix 2013-05-30 15:56:38.630003125 +0200
+++ uuid-1.6.2/uuid.1 2013-05-30 16:00:57.145127756 +0200
@@ -238,6 +238,9 @@ value representation of a \s-1UUID\s0. E
.IP "\fB\-o\fR \fIfilename\fR" 3
.IX Item "-o filename"
Write output to \fIfilename\fR instead of to \fIstdout\fR.
+.IP "\fB\-r\fR" 3
+.IX Item "-r"
+This is equivalent to \fB-F BIN\fR.
.IP "\fB\-d\fR" 3
.IX Item "-d"
Decode a given \s-1UUID\s0 (given as a command line argument or if the command

12
uuid-1.6.2-nostrip.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up uuid-1.6.2/Makefile.in.nostrip uuid-1.6.2/Makefile.in
--- uuid-1.6.2/Makefile.in.nostrip 2012-06-19 12:53:47.888028956 +0200
+++ uuid-1.6.2/Makefile.in 2012-06-19 12:53:47.913029142 +0200
@@ -253,7 +253,7 @@ install:
-@if [ ".$(WITH_CXX)" = .yes ]; then \
$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(CXX_NAME) $(DESTDIR)$(libdir)/; \
fi
- @$(LIBTOOL) --mode=install $(SHTOOL) install -c -s -m 755 uuid $(DESTDIR)$(bindir)/
+ @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 755 uuid $(DESTDIR)$(bindir)/
$(SHTOOL) install -c -m 644 $(S)/uuid.1 $(DESTDIR)$(mandir)/man1/
-@if [ ".$(WITH_PERL)" = .yes ]; then \
(cd $(S)/perl && $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR)); \

226
uuid-1.6.2-php54.patch Normal file
View File

@ -0,0 +1,226 @@
diff -up uuid-1.6.2/php/uuid.c.php54 uuid-1.6.2/php/uuid.c
--- uuid-1.6.2/php/uuid.c.php54 2007-01-01 19:35:57.000000000 +0100
+++ uuid-1.6.2/php/uuid.c 2012-11-06 16:05:03.354913764 +0100
@@ -60,7 +60,7 @@ static int ctx_id; /* inte
#define ctx_name "UUID context" /* external name */
/* module initialization */
-PHP_MINIT_FUNCTION(uuid)
+ZEND_MINIT_FUNCTION(uuid)
{
/* register resource identifier */
ctx_id = zend_register_list_destructors_ex(
@@ -91,13 +91,13 @@ PHP_MINIT_FUNCTION(uuid)
}
/* module shutdown */
-PHP_MSHUTDOWN_FUNCTION(uuid)
+ZEND_MSHUTDOWN_FUNCTION(uuid)
{
return SUCCESS;
}
/* module information */
-PHP_MINFO_FUNCTION(uuid)
+ZEND_MINFO_FUNCTION(uuid)
{
char version[32];
@@ -115,7 +115,7 @@ PHP_MINFO_FUNCTION(uuid)
proto rc uuid_create(ctx)
$rc = uuid_create(&$uuid);
create UUID context */
-PHP_FUNCTION(uuid_create)
+ZEND_FUNCTION(uuid_create)
{
zval *z_ctx;
ctx_t *ctx;
@@ -147,7 +147,7 @@ PHP_FUNCTION(uuid_create)
proto rc uuid_destroy(ctx)
$rc = uuid_destroy($uuid);
destroy UUID context */
-PHP_FUNCTION(uuid_destroy)
+ZEND_FUNCTION(uuid_destroy)
{
zval *z_ctx;
ctx_t *ctx;
@@ -178,7 +178,7 @@ PHP_FUNCTION(uuid_destroy)
proto rc uuid_clone(ctx, &ctx2)
$rc = uuid_clone($uuid, &$uuid);
clone UUID context */
-PHP_FUNCTION(uuid_clone)
+ZEND_FUNCTION(uuid_clone)
{
zval *z_ctx;
ctx_t *ctx;
@@ -217,7 +217,7 @@ PHP_FUNCTION(uuid_clone)
proto rc uuid_load(ctx, name)
$rc = uuid_name($uuid, $name);
load an existing UUID */
-PHP_FUNCTION(uuid_load)
+ZEND_FUNCTION(uuid_load)
{
zval *z_ctx;
ctx_t *ctx;
@@ -249,7 +249,7 @@ PHP_FUNCTION(uuid_load)
proto rc uuid_make(ctx, mode[, ..., ...])
$rc = uuid_make($uuid, $mode[, ..., ...]);
make a new UUID */
-PHP_FUNCTION(uuid_make)
+ZEND_FUNCTION(uuid_make)
{
zval *z_ctx;
ctx_t *ctx;
@@ -307,7 +307,7 @@ PHP_FUNCTION(uuid_make)
proto rc uuid_isnil(ctx, result)
$rc = uuid_isnil($uuid, &$result);
compare UUID for being Nil UUID */
-PHP_FUNCTION(uuid_isnil)
+ZEND_FUNCTION(uuid_isnil)
{
zval *z_ctx;
ctx_t *ctx;
@@ -344,7 +344,7 @@ PHP_FUNCTION(uuid_isnil)
proto rc uuid_compare(ctx, ctx2, result)
$rc = uuid_compare($uuid, $uuid2, &$result);
compare two UUIDs */
-PHP_FUNCTION(uuid_compare)
+ZEND_FUNCTION(uuid_compare)
{
zval *z_ctx;
ctx_t *ctx;
@@ -388,7 +388,7 @@ PHP_FUNCTION(uuid_compare)
proto rc uuid_import(ctx, fmt, data)
$rc = uuid_import($ctx, $fmt, $data);
import UUID from variable */
-PHP_FUNCTION(uuid_import)
+ZEND_FUNCTION(uuid_import)
{
zval *z_ctx;
ctx_t *ctx;
@@ -424,7 +424,7 @@ PHP_FUNCTION(uuid_import)
proto rc uuid_export(ctx, fmt, data)
$rc = uuid_error($ctx, $fmt, &$data);
export UUID into variable */
-PHP_FUNCTION(uuid_export)
+ZEND_FUNCTION(uuid_export)
{
zval *z_ctx;
ctx_t *ctx;
@@ -472,7 +472,7 @@ PHP_FUNCTION(uuid_export)
proto rc uuid_error(ctx)
$error = uuid_error($rc);
return error string corresponding to error return code */
-PHP_FUNCTION(uuid_error)
+ZEND_FUNCTION(uuid_error)
{
int z_rc;
uuid_rc_t rc;
@@ -490,24 +490,79 @@ PHP_FUNCTION(uuid_error)
proto int uuid_version()
$version = uuid_version();
return library version number */
-PHP_FUNCTION(uuid_version)
+ZEND_FUNCTION(uuid_version)
{
RETURN_LONG((long)uuid_version());
}
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_create, 0)
+ ZEND_ARG_INFO(1, ctx)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_destroy, 0)
+ ZEND_ARG_INFO(0, ctx)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_clone, 0)
+ ZEND_ARG_INFO(0, ctx)
+ ZEND_ARG_INFO(1, ctx2)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_load, 0)
+ ZEND_ARG_INFO(0, ctx)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_uuid_make, 0, 0, 2)
+ ZEND_ARG_INFO(0, ctx)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, ctxns)
+ ZEND_ARG_INFO(0, url)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_isnil, 0)
+ ZEND_ARG_INFO(0, ctx)
+ ZEND_ARG_INFO(1, result)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_compare, 0)
+ ZEND_ARG_INFO(0, ctx)
+ ZEND_ARG_INFO(0, ctx2)
+ ZEND_ARG_INFO(1, result)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_import, 0)
+ ZEND_ARG_INFO(0, ctx)
+ ZEND_ARG_INFO(0, fmt)
+ ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_export, 0)
+ ZEND_ARG_INFO(0, ctx)
+ ZEND_ARG_INFO(0, fmt)
+ ZEND_ARG_INFO(1, data)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_error, 0)
+ ZEND_ARG_INFO(0, ctx)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_uuid_version, 0)
+ZEND_END_ARG_INFO()
+
/* module function table */
-static function_entry uuid_functions[] = {
- PHP_FE(uuid_create, NULL)
- PHP_FE(uuid_destroy, NULL)
- PHP_FE(uuid_clone, NULL)
- PHP_FE(uuid_load, NULL)
- PHP_FE(uuid_make, NULL)
- PHP_FE(uuid_isnil, NULL)
- PHP_FE(uuid_compare, NULL)
- PHP_FE(uuid_import, NULL)
- PHP_FE(uuid_export, NULL)
- PHP_FE(uuid_error, NULL)
- PHP_FE(uuid_version, NULL)
+static zend_function_entry uuid_functions[] = {
+ ZEND_FE(uuid_create, arginfo_uuid_create)
+ ZEND_FE(uuid_destroy, NULL)
+ ZEND_FE(uuid_clone, arginfo_uuid_clone)
+ ZEND_FE(uuid_load, NULL)
+ ZEND_FE(uuid_make, NULL)
+ ZEND_FE(uuid_isnil, arginfo_uuid_isnil)
+ ZEND_FE(uuid_compare, arginfo_uuid_compare)
+ ZEND_FE(uuid_import, NULL)
+ ZEND_FE(uuid_export, arginfo_uuid_export)
+ ZEND_FE(uuid_error, NULL)
+ ZEND_FE(uuid_version, NULL)
{ NULL, NULL, NULL }
};
@@ -516,11 +571,11 @@ zend_module_entry uuid_module_entry = {
STANDARD_MODULE_HEADER,
"uuid",
uuid_functions,
- PHP_MINIT(uuid),
- PHP_MSHUTDOWN(uuid),
+ ZEND_MINIT(uuid),
+ ZEND_MSHUTDOWN(uuid),
NULL,
NULL,
- PHP_MINFO(uuid),
+ ZEND_MINFO(uuid),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};

BIN
uuid-1.6.2.tar.gz Normal file

Binary file not shown.

1588
uuid-aarch64.patch Normal file

File diff suppressed because it is too large Load Diff

178
uuid.spec Normal file
View File

@ -0,0 +1,178 @@
Name: uuid
Version: 1.6.2
Release: 42
Summary: Universally Unique Identifier library
License: MIT
URL: http://www.ossp.org/pkg/lib/uuid/
Source0: ftp://ftp.ossp.org/pkg/lib/uuid/uuid-%{version}.tar.gz
Patch0001: uuid-1.6.1-ossp.patch
Patch0002: uuid-1.6.1-mkdir.patch
Patch0003: uuid-1.6.2-php54.patch
Patch0004: uuid-1.6.2-hwaddr.patch
Patch0005: uuid-1.6.2-nostrip.patch
Patch0006: uuid-1.6.2-manfix.patch
Patch0007: uuid-aarch64.patch
BuildRequires: libtool
Obsoletes: %{name}-pgsql < 1.6.2-24
%description
OSSP uuid is a ISO-C:1999 application programming interface (API) and corresponding
command line interface (CLI) for the generation of DCE 1.1, ISO/IEC 11578:1996 and
RFC 4122 compliant Universally Unique Identifier (UUID).
It supports DCE 1.1 variant UUIDs of version 1 (time and node based), version 3
(name based, MD5), version 4 (random number based) and version 5 (name based, SHA-1).
Additional API bindings are provided for the languages ISO-C++:1998 and Perl:5 Optional
backward compatibility exists for the ISO-C DCE-1.1 and Perl Data::UUiID APIs.
UUIDs are 128-bit numbers which are intended to have a high likelihood of uniqueness
over space,they can be locally generated without contacting a global registration authority.
%package devel
Summary: Development files for UUID library
Requires: pkgconfig %{name} = %{version}-%{release}
%description devel
This package provides libraries and header files for UUID library.
%package c++
Summary: C++ support for UUID library
Requires: %{name} = %{version}-%{release}
%description c++
This package includes C++ libraries for UUID.
%package c++-devel
Summary: C++ development files for UUID library
Requires: %{name}-c++ = %{version}-%{release} %{name}-devel = %{version}-%{release}
%description c++-devel
This package provides c++ development files for UUID library.
%package perl
Summary: Perl support for UUID library
BuildRequires: perl-devel perl-generators perl(Data::UUID) perl(ExtUtils::MakeMaker) perl(Test::More)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: %{name} = %{version}-%{release} perl(Data::UUID)
%description perl
This package includes perl UUID module.
%package dce
Summary: DCE support for UUID library
Requires: %{name} = %{version}-%{release}
%description dce
This package includes DCE UUID module.
%package dce-devel
Summary: DCE development support for UUID library
Requires: %{name}-dce = %{version}-%{release} %{name}-devel = %{version}-%{release}
%description dce-devel
This package provides DCE development files for UUID library.
%package help
Summary: Help documentation for UUID
Requires: %{name} = %{version}-%{release}
%description help
Man pages and other related help documents for UUID library.
%prep
%autosetup -n %{name}-%{version} -p1
%build
export LIB_NAME=libossp-uuid.la DCE_NAME=libossp-uuid_dce.la CXX_NAME=libossp-uuid++.la
export PHP_NAME=$(pwd)/php/modules/ossp-uuid.so PGSQL_NAME=$(pwd)/pgsql/libossp-uuid.so
export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
%configure --disable-static --without-perl --without-php \
--with-dce --with-cxx --without-pgsql
%make_build LIBTOOL=/usr/bin/libtool CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"
pushd perl
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" COMPAT=0
%{__perl} -pi -e 's/^\tLD_RUN_PATH=[^\s]+\s*/\t/' Makefile
%make_build
popd
%install
%make_install
%delete_la_and_a
chmod 755 $RPM_BUILD_ROOT%{_libdir}/*.so.*.*.*
pushd perl
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 | xargs rm -f
find $RPM_BUILD_ROOT -type f -name .packlist | xargs rm -f
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
%{_fixperms} $RPM_BUILD_ROOT/*
popd
%check
make check
pushd perl
LD_LIBRARY_PATH=../.libs make test
perl -MData::UUID -e 'print "Testing compatibility of Data::UUID version $Data::UUID::VERSION\n";'
LD_LIBRARY_PATH=../.libs make test TEST_FILES=uuid_compat.ts
popd
%post -p /sbin/ldconfig
%post c++ -p /sbin/ldconfig
%post dce -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%postun c++ -p /sbin/ldconfig
%postun dce -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS README
%{_bindir}/uuid
%{_libdir}/libossp-uuid.so.*
%exclude %{_mandir}/man1/uuid-config.*
%files devel
%defattr(-,root,root,-)
%{_bindir}/uuid-config
%{_includedir}/uuid.h
%{_libdir}/{libossp-uuid.so,pkgconfig/ossp-uuid.pc}
%files c++
%defattr(-,root,root,-)
%{_libdir}/libossp-uuid++.so.*
%files c++-devel
%defattr(-,root,root,-)
%{_includedir}/uuid++.hh
%{_libdir}/libossp-uuid++.so
%files perl
%defattr(-,root,root,-)
%{perl_vendorarch}/{auto/*,OSSP*}
%files dce
%defattr(-,root,root,-)
%{_libdir}/libossp-uuid_dce.so.*
%files dce-devel
%defattr(-,root,root,-)
%{_includedir}/uuid_dce.h
%{_libdir}/libossp-uuid_dce.so
%files help
%defattr(-,root,root,-)
%doc ChangeLog HISTORY NEWS PORTING SEEALSO THANKS TODO USERS
%{_mandir}/man1/*
%{_mandir}/man3/*
%changelog
* Tue Nov 19 2019 yanzhihua <yanzhihua4@huawei.com> - 1.6.2-42
- Package init