summaryrefslogtreecommitdiff
path: root/libshare/debian/patches/libshare-plugin-path.patch
blob: bdea1d9880b5adc01bb341605c64780ec323c052 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Index: libshare/usr/src/lib/libshare/common/libshare_impl.h
===================================================================
--- libshare.orig/usr/src/lib/libshare/common/libshare_impl.h	2012-10-08 04:25:42.000000000 +0400
+++ libshare/usr/src/lib/libshare/common/libshare_impl.h	2013-09-27 12:30:54.525002798 +0400
@@ -43,9 +43,6 @@
 extern "C" {
 #endif
 
-/* directory to find plugin modules in */
-#define	SA_LIB_DIR	"/usr/lib/fs"
-
 /* default group name for dfstab file */
 #define	SA_DEFAULT_FILE_GRP	"sys"
 
Index: libshare/usr/src/lib/libshare/common/plugin.c
===================================================================
--- libshare.orig/usr/src/lib/libshare/common/plugin.c	2012-10-08 04:25:42.000000000 +0400
+++ libshare/usr/src/lib/libshare/common/plugin.c	2013-09-27 12:31:32.600779970 +0400
@@ -39,6 +39,14 @@
 #include <sys/systeminfo.h>
 #include <thread.h>
 #include <synch.h>
+#include <fnmatch.h>
+
+/* directory to find plugin modules in */
+#ifdef DEB_HOST_MULTIARCH
+#define SA_LIB_DIR      "/usr/lib/" DEB_HOST_MULTIARCH "/libshare"
+#else
+#define SA_LIB_DIR      "/usr/lib/fs"
+#endif
 
 #define	MAXISALEN	257	/* based on sysinfo(2) man page */
 
@@ -93,14 +101,16 @@
 	struct dirent *dent;
 	int ret = SA_OK;
 	struct stat st;
-	char isa[MAXISALEN];
 
+#ifndef DEB_HOST_MULTIARCH
+	char isa[MAXISALEN];
 #if defined(_LP64)
 	if (sysinfo(SI_ARCHITECTURE_64, isa, MAXISALEN) == -1)
 		isa[0] = '\0';
 #else
 	isa[0] = '\0';
 #endif
+#endif
 
 	if ((dir = opendir(SA_LIB_DIR)) == NULL)
 		return (SA_OK);
@@ -111,9 +121,18 @@
 		if (proto_is_dot_or_dotdot(dent->d_name))
 			continue;
 
+#ifndef DEB_HOST_MULTIARCH
 		(void) snprintf(path, MAXPATHLEN,
 		    "%s/%s/%s/libshare_%s.so.1", SA_LIB_DIR,
 		    dent->d_name, isa, dent->d_name);
+#else
+		if (fnmatch("libshare_*.so.1", dent->d_name, 0))
+			continue;
+
+		(void) snprintf(path, MAXPATHLEN,
+		    "%s/%s", SA_LIB_DIR, /* SA_LIB_DIR includes DEB_HOST_MULTIARCH */
+		    dent->d_name);
+#endif
 
 		/*
 		 * If file doesn't exist, don't try to map it
Index: libshare/usr/src/lib/libshare/Makefile.com
===================================================================
--- libshare.orig/usr/src/lib/libshare/Makefile.com	2012-10-08 04:25:42.000000000 +0400
+++ libshare/usr/src/lib/libshare/Makefile.com	2013-09-27 12:25:45.936723597 +0400
@@ -46,6 +46,7 @@
 CERRWARN +=	-_gcc=-Wno-uninitialized
 CERRWARN +=	-_gcc=-Wno-switch
 CPPFLAGS +=	-D_REENTRANT -I$(NFSLIB_DIR) -I/usr/include/libxml2
+CPPFLAGS += -DDEB_HOST_MULTIARCH=\"$(DEB_HOST_MULTIARCH)\"
 
 .KEEP_STATE:
 
Index: libshare/usr/src/lib/libshare/autofs/Makefile.com
===================================================================
--- libshare.orig/usr/src/lib/libshare/autofs/Makefile.com	2012-10-08 04:25:42.000000000 +0400
+++ libshare/usr/src/lib/libshare/autofs/Makefile.com	2013-09-27 12:25:45.938830331 +0400
@@ -33,8 +33,8 @@
 
 include ../../../Makefile.lib
 
-ROOTLIBDIR =	$(ROOT)/usr/lib/fs/autofs
-ROOTLIBDIR64 =	$(ROOT)/usr/lib/fs/autofs/$(MACH64)
+ROOTLIBDIR =    $(ROOT)/usr/lib/$(DEB_HOST_MULTIARCH)/libshare
+ROOTLIBDIR64 =  $(ROOTLIBDIR)
 
 LIBSRCS = $(LIBOBJS:%.o=$(SRCDIR)/%.c)
 # we don't want to lint the sources for OTHOBJS since they are pre-existing files
Index: libshare/usr/src/lib/libshare/nfs/Makefile.com
===================================================================
--- libshare.orig/usr/src/lib/libshare/nfs/Makefile.com	2012-10-08 04:25:42.000000000 +0400
+++ libshare/usr/src/lib/libshare/nfs/Makefile.com	2013-09-27 12:25:45.941127600 +0400
@@ -33,8 +33,8 @@
 
 include ../../../Makefile.lib
 
-ROOTLIBDIR =	$(ROOT)/usr/lib/fs/nfs
-ROOTLIBDIR64 =	$(ROOT)/usr/lib/fs/nfs/$(MACH64)
+ROOTLIBDIR =	$(ROOT)/usr/lib/$(DEB_HOST_MULTIARCH)/libshare
+ROOTLIBDIR64 =	$(ROOTLIBDIR)
 
 LIBSRCS = $(LIBOBJS:%.o=$(SRCDIR)/%.c)
 # we don't want to lint the sources for OTHOBJS since they are pre-existing files
Index: libshare/usr/src/lib/libshare/smb/Makefile.com
===================================================================
--- libshare.orig/usr/src/lib/libshare/smb/Makefile.com	2013-09-27 12:25:45.343870095 +0400
+++ libshare/usr/src/lib/libshare/smb/Makefile.com	2013-09-27 12:25:45.943038480 +0400
@@ -38,8 +38,8 @@
 
 include ../../../Makefile.lib
 
-ROOTLIBDIR =	$(ROOT)/usr/lib/fs/smb
-ROOTLIBDIR64 =	$(ROOT)/usr/lib/fs/smb/$(MACH64)
+ROOTLIBDIR =    $(ROOT)/usr/lib/$(DEB_HOST_MULTIARCH)/libshare
+ROOTLIBDIR64 =  $(ROOTLIBDIR)
 
 LIBSRCS = $(LIBOBJS:%.o=$(SRCDIR)/%.c)
 lintcheck := SRCS = $(LIBSRCS)
Index: libshare/usr/src/lib/libshare/smbfs/Makefile.com
===================================================================
--- libshare.orig/usr/src/lib/libshare/smbfs/Makefile.com	2012-10-08 04:25:42.000000000 +0400
+++ libshare/usr/src/lib/libshare/smbfs/Makefile.com	2013-09-27 12:25:45.944931050 +0400
@@ -32,8 +32,8 @@
 
 include ../../../Makefile.lib
 
-ROOTLIBDIR =	$(ROOT)/usr/lib/fs/smbfs
-ROOTLIBDIR64 =	$(ROOT)/usr/lib/fs/smbfs/$(MACH64)
+ROOTLIBDIR =    $(ROOT)/usr/lib/$(DEB_HOST_MULTIARCH)/libshare
+ROOTLIBDIR64 =  $(ROOTLIBDIR)
 
 LIBSRCS = $(LIBOBJS:%.o=$(SRCDIR)/%.c)