summaryrefslogtreecommitdiff
path: root/libshare
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-09-27 13:03:15 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-09-27 13:03:15 +0400
commitf65c0617ebdda4997607ad9b3b837b6e57fbfff9 (patch)
treed881748b7b7eba250de791b831e5e9d3a7c02d0b /libshare
parentca5746a89aeafdaff9f69cc39c9b94764102382c (diff)
downloadillumos-packaging-f65c0617ebdda4997607ad9b3b837b6e57fbfff9.tar.gz
libshare
Diffstat (limited to 'libshare')
-rw-r--r--libshare/debian/README.source10
-rw-r--r--libshare/debian/changelog5
-rw-r--r--libshare/debian/compat1
-rw-r--r--libshare/debian/control67
-rw-r--r--libshare/debian/copyright62
-rw-r--r--libshare/debian/libshare-autofs1.install1
-rw-r--r--libshare/debian/libshare-nfs1.install1
-rw-r--r--libshare/debian/libshare-smbfs1.install1
-rw-r--r--libshare/debian/libshare1-dev.install2
-rw-r--r--libshare/debian/libshare1.install1
-rw-r--r--libshare/debian/libshare1.symbols112
-rw-r--r--libshare/debian/patches/libshare-no-multilib.patch89
-rw-r--r--libshare/debian/patches/libshare-no-smb.patch14
-rw-r--r--libshare/debian/patches/libshare-plugin-path.patch142
-rw-r--r--libshare/debian/patches/libshare-smb-makefile.patch13
-rw-r--r--libshare/debian/patches/libshare_autofs.c.patch15
-rw-r--r--libshare/debian/patches/libshare_nfs.c-NULL.patch31
-rw-r--r--libshare/debian/patches/libshare_nfs.c-ppriv.patch12
-rw-r--r--libshare/debian/patches/libshare_smb.c.patch30
-rw-r--r--libshare/debian/patches/series8
-rwxr-xr-xlibshare/debian/rules92
-rw-r--r--libshare/debian/source/format1
22 files changed, 710 insertions, 0 deletions
diff --git a/libshare/debian/README.source b/libshare/debian/README.source
new file mode 100644
index 0000000..9988910
--- /dev/null
+++ b/libshare/debian/README.source
@@ -0,0 +1,10 @@
+Real sources are in the package illumos-source-X.Y,
+where X and Y are numbers. Exact values of X and Y
+are set in Build-Depends field of debian/control as
+well as in the version string in debian/changelog,
+in a form of X.Y-1.
+
+To add a patch you need first to unpack files from
+illumos-source-X.Y using ./debian/rules unpack
+and, desirably, ./debian/rules patch
+
diff --git a/libshare/debian/changelog b/libshare/debian/changelog
new file mode 100644
index 0000000..ecf7230
--- /dev/null
+++ b/libshare/debian/changelog
@@ -0,0 +1,5 @@
+libshare (2.10+1) unstable; urgency=low
+
+ * Initial release.
+
+ -- Igor Pashev <pashev.igor@gmail.com> Fri, 27 Sep 2013 13:03:02 +0400
diff --git a/libshare/debian/compat b/libshare/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/libshare/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/libshare/debian/control b/libshare/debian/control
new file mode 100644
index 0000000..0f16abb
--- /dev/null
+++ b/libshare/debian/control
@@ -0,0 +1,67 @@
+Source: libshare
+Section: admin
+Priority: standard
+Maintainer: Igor Pashev <pashev.igor@gmail.com>
+Build-Depends:
+ illumos-source-2.10,
+ dh-illumos,
+ libnvpair-dev,
+ libscf1-dev,
+ libsmbfs1-dev,
+ libsunuuid1-dev | uuid-dev,
+ libumem-dev,
+ libxml2-dev,
+ libzfs1-dev,
+ quilt,
+ symlinks,
+Standards-Version: 3.9.3
+Homepage: https://www.illumos.org
+
+Package: libshare1
+Section: libs
+Priority: standard
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Recommends: libshare-nfs1, libshare-smbfs1, libshare-autofs1
+Architecture: illumos-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: share management library
+ This package contains libshare1 shared library.
+
+Package: libshare1-dev
+Section: libdevel
+Priority: optional
+Architecture: illumos-any
+Provides: libshare-dev
+Depends: libshare1 (= ${binary:Version}), ${misc:Depends},
+ libscf1-dev, libxml2-dev, libzfs1-dev,
+Description: share management library (development files)
+ This package contains the header files and symlinks needed
+ to compile applications that use libshare1.
+
+Package: libshare-nfs1
+Section: libs
+Priority: standard
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Architecture: illumos-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: NFS plugin for share management library
+
+Package: libshare-autofs1
+Section: libs
+Priority: standard
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Architecture: illumos-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: AUTOFS plugin for share management library
+
+Package: libshare-smbfs1
+Section: libs
+Priority: standard
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Architecture: illumos-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: SMBFS plugin for share management library
diff --git a/libshare/debian/copyright b/libshare/debian/copyright
new file mode 100644
index 0000000..2b18913
--- /dev/null
+++ b/libshare/debian/copyright
@@ -0,0 +1,62 @@
+Files: debian/*
+Copyright: 2012, Igor Pashev <pashev.igor@gmail.com>
+License: WTFPL-2
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+ .
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+ .
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+ .
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+ .
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
+
+
+Files: usr/src/lib/libinetutil/common/ifaddrlist.c
+Copyright: 1997, The Regents of the University of California.
+ 2009 Sun Microsystems, Inc.
+License: 4-clause BSD
+ Copyright (c) 1997
+ The Regents of the University of California. All rights reserved.
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by the Computer Systems
+ Engineering Group at Lawrence Berkeley Laboratory.
+ 4. Neither the name of the University nor of the Laboratory may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+Files: *
+License: CDDL
+ Note that sources are not in this package but in the package
+ illumos-source-X.Y. Those sources are covered by Common Development
+ and Distribution License (CDDL).
+ .
+ On Dyson system, the full text of the CDDL license
+ can be found in the file `/usr/share/common-licenses/CDDL-1.0'.
+
diff --git a/libshare/debian/libshare-autofs1.install b/libshare/debian/libshare-autofs1.install
new file mode 100644
index 0000000..48263bb
--- /dev/null
+++ b/libshare/debian/libshare-autofs1.install
@@ -0,0 +1 @@
+usr/lib/*/libshare/libshare_autofs.so.1
diff --git a/libshare/debian/libshare-nfs1.install b/libshare/debian/libshare-nfs1.install
new file mode 100644
index 0000000..e3d7f5a
--- /dev/null
+++ b/libshare/debian/libshare-nfs1.install
@@ -0,0 +1 @@
+usr/lib/*/libshare/libshare_nfs.so.1
diff --git a/libshare/debian/libshare-smbfs1.install b/libshare/debian/libshare-smbfs1.install
new file mode 100644
index 0000000..85f197d
--- /dev/null
+++ b/libshare/debian/libshare-smbfs1.install
@@ -0,0 +1 @@
+usr/lib/*/libshare/libshare_smbfs.so.1
diff --git a/libshare/debian/libshare1-dev.install b/libshare/debian/libshare1-dev.install
new file mode 100644
index 0000000..3b71333
--- /dev/null
+++ b/libshare/debian/libshare1-dev.install
@@ -0,0 +1,2 @@
+usr/lib/*/libshare.so
+usr/include/*.h
diff --git a/libshare/debian/libshare1.install b/libshare/debian/libshare1.install
new file mode 100644
index 0000000..2839706
--- /dev/null
+++ b/libshare/debian/libshare1.install
@@ -0,0 +1 @@
+usr/lib/*/libshare.so.1
diff --git a/libshare/debian/libshare1.symbols b/libshare/debian/libshare1.symbols
new file mode 100644
index 0000000..55ef9b1
--- /dev/null
+++ b/libshare/debian/libshare1.symbols
@@ -0,0 +1,112 @@
+libshare.so.1 libshare1 #MINVER#
+ SUNWprivate@SUNWprivate 2.10
+ sa_add_property@SUNWprivate 2.10
+ sa_add_protocol_property@SUNWprivate 2.10
+ sa_add_resource@SUNWprivate 2.10
+ sa_add_share@SUNWprivate 2.10
+ sa_check_path@SUNWprivate 2.10
+ sa_commit_properties@SUNWprivate 2.10
+ sa_create_group@SUNWprivate 2.10
+ sa_create_optionset@SUNWprivate 2.10
+ sa_create_property@SUNWprivate 2.10
+ sa_create_protocol_properties@SUNWprivate 2.10
+ sa_create_section@SUNWprivate 2.10
+ sa_create_security@SUNWprivate 2.10
+ sa_delete_legacy@SUNWprivate 2.10
+ sa_delete_sharetab@SUNWprivate 2.10
+ sa_destroy_optionset@SUNWprivate 2.10
+ sa_destroy_security@SUNWprivate 2.10
+ sa_disable_resource@SUNWprivate 2.10
+ sa_disable_share@SUNWprivate 2.10
+ sa_emptyshare@SUNWprivate 2.10
+ sa_enable_resource@SUNWprivate 2.10
+ sa_enable_share@SUNWprivate 2.10
+ sa_errorstr@SUNWprivate 2.10
+ sa_find_group_handle@SUNWprivate 2.10
+ sa_find_resource@SUNWprivate 2.10
+ sa_find_share@SUNWprivate 2.10
+ sa_fini@SUNWprivate 2.10
+ sa_fix_resource_name@SUNWprivate 2.10
+ sa_format_free@SUNWprivate 2.10
+ sa_free_attr_string@SUNWprivate 2.10
+ sa_free_derived_optionset@SUNWprivate 2.10
+ sa_free_derived_security@SUNWprivate 2.10
+ sa_free_share_description@SUNWprivate 2.10
+ sa_get_all_security_types@SUNWprivate 2.10
+ sa_get_derived_optionset@SUNWprivate 2.10
+ sa_get_derived_security@SUNWprivate 2.10
+ sa_get_group@SUNWprivate 2.10
+ sa_get_group_attr@SUNWprivate 2.10
+ sa_get_next_group@SUNWprivate 2.10
+ sa_get_next_optionset@SUNWprivate 2.10
+ sa_get_next_property@SUNWprivate 2.10
+ sa_get_next_protocol_property@SUNWprivate 2.10
+ sa_get_next_protocol_section@SUNWprivate 2.10
+ sa_get_next_resource@SUNWprivate 2.10
+ sa_get_next_security@SUNWprivate 2.10
+ sa_get_next_share@SUNWprivate 2.10
+ sa_get_optionset@SUNWprivate 2.10
+ sa_get_optionset_attr@SUNWprivate 2.10
+ sa_get_parent_group@SUNWprivate 2.10
+ sa_get_property@SUNWprivate 2.10
+ sa_get_property_attr@SUNWprivate 2.10
+ sa_get_protocol_property@SUNWprivate 2.10
+ sa_get_protocol_section@SUNWprivate 2.10
+ sa_get_protocol_status@SUNWprivate 2.10
+ sa_get_protocols@SUNWprivate 2.10
+ sa_get_resource@SUNWprivate 2.10
+ sa_get_resource_attr@SUNWprivate 2.10
+ sa_get_resource_description@SUNWprivate 2.10
+ sa_get_resource_parent@SUNWprivate 2.10
+ sa_get_security@SUNWprivate 2.10
+ sa_get_security_attr@SUNWprivate 2.10
+ sa_get_share@SUNWprivate 2.10
+ sa_get_share_attr@SUNWprivate 2.10
+ sa_get_share_description@SUNWprivate 2.10
+ sa_get_share_resource@SUNWprivate 2.10
+ sa_get_sub_group@SUNWprivate 2.10
+ sa_get_zfs_handle@SUNWprivate 2.10
+ sa_group_is_zfs@SUNWprivate 2.10
+ sa_init@SUNWprivate 2.10
+ sa_is_persistent@SUNWprivate 2.10
+ sa_is_security@SUNWprivate 2.10
+ sa_is_share@SUNWprivate 2.10
+ sa_move_share@SUNWprivate 2.10
+ sa_needs_refresh@SUNWprivate 2.10
+ sa_parse_legacy_options@SUNWprivate 2.10
+ sa_path_is_zfs@SUNWprivate 2.10
+ sa_proto_change_notify@SUNWprivate 2.10
+ sa_proto_delete_section@SUNWprivate 2.10
+ sa_proto_get_featureset@SUNWprivate 2.10
+ sa_proto_get_properties@SUNWprivate 2.10
+ sa_proto_legacy_format@SUNWprivate 2.10
+ sa_proto_notify_resource@SUNWprivate 2.10
+ sa_proto_space_alias@SUNWprivate 2.10
+ sa_proto_valid_space@SUNWprivate 2.10
+ sa_remove_group@SUNWprivate 2.10
+ sa_remove_property@SUNWprivate 2.10
+ sa_remove_resource@SUNWprivate 2.10
+ sa_remove_share@SUNWprivate 2.10
+ sa_rename_resource@SUNWprivate 2.10
+ sa_set_group_attr@SUNWprivate 2.10
+ sa_set_optionset_attr@SUNWprivate 2.10
+ sa_set_protocol_property@SUNWprivate 2.10
+ sa_set_resource_attr@SUNWprivate 2.10
+ sa_set_resource_description@SUNWprivate 2.10
+ sa_set_section_attr@SUNWprivate 2.10
+ sa_set_security_attr@SUNWprivate 2.10
+ sa_set_share_attr@SUNWprivate 2.10
+ sa_set_share_description@SUNWprivate 2.10
+ sa_share_zfs@SUNWprivate 2.10
+ sa_sharetab_fill_zfs@SUNWprivate 2.10
+ sa_update_config@SUNWprivate 2.10
+ sa_update_legacy@SUNWprivate 2.10
+ sa_update_property@SUNWprivate 2.10
+ sa_update_sharetab@SUNWprivate 2.10
+ sa_update_sharetab_ts@SUNWprivate 2.10
+ sa_valid_group_name@SUNWprivate 2.10
+ sa_valid_property@SUNWprivate 2.10
+ sa_valid_protocol@SUNWprivate 2.10
+ sa_zfs_is_shared@SUNWprivate 2.10
+ sa_zfs_process_share@SUNWprivate 2.10
+ sa_zfs_setprop@SUNWprivate 2.10
diff --git a/libshare/debian/patches/libshare-no-multilib.patch b/libshare/debian/patches/libshare-no-multilib.patch
new file mode 100644
index 0000000..16c2411
--- /dev/null
+++ b/libshare/debian/patches/libshare-no-multilib.patch
@@ -0,0 +1,89 @@
+Index: sharemgr/usr/src/lib/libshare/Makefile
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/Makefile 2012-10-08 04:25:42.000000000 +0400
++++ sharemgr/usr/src/lib/libshare/Makefile 2013-09-27 00:31:10.504880652 +0400
+@@ -28,8 +28,11 @@
+ HDRS = libshare.h libshare_impl.h scfutil.h
+ HDRDIR = common
+
++ifeq ($(DEB_BUILD_ARCH_BITS),32)
+ MACHS = $(MACH)
+-$(BUILD64)MACHS += $(MACH64)
++else
++MACHS = $(MACH64)
++endif
+
+ # Add plugin module directories here. They need to build after the libshare
+ # objects are built.
+Index: sharemgr/usr/src/lib/libshare/autofs/Makefile
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/autofs/Makefile 2012-10-08 04:25:42.000000000 +0400
++++ sharemgr/usr/src/lib/libshare/autofs/Makefile 2013-09-27 00:26:32.690716545 +0400
+@@ -24,8 +24,11 @@
+
+ include ../../Makefile.lib
+
+-SUBDIRS = $(MACH)
+-$(BUILD64)SUBDIRS += $(MACH64)
++ifeq ($(DEB_BUILD_ARCH_BITS),32)
++SUBDIRS = $(MACH)
++else
++SUBDIRS = $(MACH64)
++endif
+
+ MSGFILES = libshare_autofs.c
+ POFILE = libshare_autofs.po
+Index: sharemgr/usr/src/lib/libshare/nfs/Makefile
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/nfs/Makefile 2012-10-08 04:25:42.000000000 +0400
++++ sharemgr/usr/src/lib/libshare/nfs/Makefile 2013-09-27 00:26:32.693023430 +0400
+@@ -27,8 +27,11 @@
+
+ include ../../Makefile.lib
+
+-SUBDIRS = $(MACH)
+-$(BUILD64)SUBDIRS += $(MACH64)
++ifeq ($(DEB_BUILD_ARCH_BITS),32)
++SUBDIRS = $(MACH)
++else
++SUBDIRS = $(MACH64)
++endif
+
+ MSGFILES = libshare_nfs.c
+ POFILE = libshare_nfs.po
+Index: sharemgr/usr/src/lib/libshare/smb/Makefile
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/smb/Makefile 2012-10-08 04:25:42.000000000 +0400
++++ sharemgr/usr/src/lib/libshare/smb/Makefile 2013-09-27 00:26:32.695001814 +0400
+@@ -27,8 +27,11 @@
+
+ include ../../Makefile.lib
+
+-SUBDIRS = $(MACH)
+-$(BUILD64)SUBDIRS += $(MACH64)
++ifeq ($(DEB_BUILD_ARCH_BITS),32)
++SUBDIRS = $(MACH)
++else
++SUBDIRS = $(MACH64)
++endif
+
+ MSGFILES = libshare_smb.c
+
+Index: sharemgr/usr/src/lib/libshare/smbfs/Makefile
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/smbfs/Makefile 2012-10-08 04:25:42.000000000 +0400
++++ sharemgr/usr/src/lib/libshare/smbfs/Makefile 2013-09-27 00:26:32.696859730 +0400
+@@ -27,8 +27,11 @@
+
+ include ../../Makefile.lib
+
+-SUBDIRS = $(MACH)
+-$(BUILD64)SUBDIRS += $(MACH64)
++ifeq ($(DEB_BUILD_ARCH_BITS),32)
++SUBDIRS = $(MACH)
++else
++SUBDIRS = $(MACH64)
++endif
+
+ MSGFILES = libshare_smbfs.c
+ POFILE = libshare_smbfs.po
diff --git a/libshare/debian/patches/libshare-no-smb.patch b/libshare/debian/patches/libshare-no-smb.patch
new file mode 100644
index 0000000..071eea8
--- /dev/null
+++ b/libshare/debian/patches/libshare-no-smb.patch
@@ -0,0 +1,14 @@
+Description: libshare_smb requires libsmb which require libshare
+Index: sharemgr/usr/src/lib/libshare/Makefile
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/Makefile 2013-09-27 00:31:10.504880652 +0400
++++ sharemgr/usr/src/lib/libshare/Makefile 2013-09-27 11:57:23.927057214 +0400
+@@ -36,7 +36,7 @@
+
+ # Add plugin module directories here. They need to build after the libshare
+ # objects are built.
+-PLUGINS = nfs smb smbfs autofs
++PLUGINS = nfs smbfs autofs
+ $(PLUGINS): $(MACHS)
+
+ SUBDIRS = $(MACHS) $(PLUGINS)
diff --git a/libshare/debian/patches/libshare-plugin-path.patch b/libshare/debian/patches/libshare-plugin-path.patch
new file mode 100644
index 0000000..bdea1d9
--- /dev/null
+++ b/libshare/debian/patches/libshare-plugin-path.patch
@@ -0,0 +1,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)
+
diff --git a/libshare/debian/patches/libshare-smb-makefile.patch b/libshare/debian/patches/libshare-smb-makefile.patch
new file mode 100644
index 0000000..5a62c51
--- /dev/null
+++ b/libshare/debian/patches/libshare-smb-makefile.patch
@@ -0,0 +1,13 @@
+Index: sharemgr/usr/src/lib/libshare/smb/Makefile.com
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/smb/Makefile.com 2012-10-08 04:25:42.000000000 +0400
++++ sharemgr/usr/src/lib/libshare/smb/Makefile.com 2013-09-25 12:42:41.231111708 +0400
+@@ -53,7 +53,7 @@
+ CERRWARN += -_gcc=-Wno-switch
+ CPPFLAGS += -D_REENTRANT -I/usr/include/libxml2 \
+ -I$(SRCDIR)/../common
+-$(ENABLE_SMB_PRINTING) CPPFLAGS += -DHAVE_CUPS
++$(ENABLE_SMB_PRINTING)CPPFLAGS += -DHAVE_CUPS
+
+ .KEEP_STATE:
+
diff --git a/libshare/debian/patches/libshare_autofs.c.patch b/libshare/debian/patches/libshare_autofs.c.patch
new file mode 100644
index 0000000..c1f0acb
--- /dev/null
+++ b/libshare/debian/patches/libshare_autofs.c.patch
@@ -0,0 +1,15 @@
+Index: sharemgr/usr/src/lib/libshare/autofs/libshare_autofs.c
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/autofs/libshare_autofs.c 2012-10-08 04:25:42.000000000 +0400
++++ sharemgr/usr/src/lib/libshare/autofs/libshare_autofs.c 2013-09-27 12:01:18.293072892 +0400
+@@ -146,8 +146,8 @@
+ #define PROTO_OPT_AUTOMOUNTD_ENV 5
+ { "environment",
+ "environment", PROTO_OPT_AUTOMOUNTD_ENV, SCF_TYPE_ASTRING,
+- NULL, 0, 1024, strlen_validator},
+- {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
++ 0, 0, 1024, strlen_validator},
++ {NULL, NULL, 0, 0, 0, 0, 0, NULL}
+ };
+
+ #define AUTOFS_PROP_MAX (sizeof (proto_options) / sizeof (proto_options[0]))
diff --git a/libshare/debian/patches/libshare_nfs.c-NULL.patch b/libshare/debian/patches/libshare_nfs.c-NULL.patch
new file mode 100644
index 0000000..62b5875
--- /dev/null
+++ b/libshare/debian/patches/libshare_nfs.c-NULL.patch
@@ -0,0 +1,31 @@
+Index: sharemgr/usr/src/lib/libshare/nfs/libshare_nfs.c
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/nfs/libshare_nfs.c 2013-09-25 12:38:03.723163728 +0400
++++ sharemgr/usr/src/lib/libshare/nfs/libshare_nfs.c 2013-09-25 12:39:12.801565698 +0400
+@@ -884,7 +884,7 @@
+
+ err:
+ if (error != 0) {
+- if (exp->ex_flags != NULL)
++ if (exp->ex_flags != 0)
+ free(exp->ex_tag);
+ if (exp->ex_log_buffer != NULL)
+ free(exp->ex_log_buffer);
+@@ -2383,7 +2383,7 @@
+ #define PROTO_OPT_NFSMAPID_DOMAIN 10
+ {"nfsmapid_domain",
+ "nfsmapid_domain", PROTO_OPT_NFSMAPID_DOMAIN, OPT_TYPE_DOMAIN,
+- NULL, SVC_NFSMAPID, 0, 0},
++ 0, SVC_NFSMAPID, 0, 0},
+ #define PROTO_OPT_NFSD_MAX_CONNECTIONS 11
+ {"nfsd_max_connections",
+ "max_connections", PROTO_OPT_NFSD_MAX_CONNECTIONS,
+@@ -2399,7 +2399,7 @@
+ #define PROTO_OPT_NFSD_DEVICE 14
+ {"nfsd_device",
+ "device", PROTO_OPT_NFSD_DEVICE,
+- OPT_TYPE_STRING, NULL, SVC_NFSD, 0, 0},
++ OPT_TYPE_STRING, 0, SVC_NFSD, 0, 0},
+ {NULL}
+ };
+
diff --git a/libshare/debian/patches/libshare_nfs.c-ppriv.patch b/libshare/debian/patches/libshare_nfs.c-ppriv.patch
new file mode 100644
index 0000000..b729aeb
--- /dev/null
+++ b/libshare/debian/patches/libshare_nfs.c-ppriv.patch
@@ -0,0 +1,12 @@
+Index: sharemgr/usr/src/lib/libshare/nfs/libshare_nfs.c
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/nfs/libshare_nfs.c 2013-09-25 12:34:40.598776937 +0400
++++ sharemgr/usr/src/lib/libshare/nfs/libshare_nfs.c 2013-09-25 12:37:33.036920332 +0400
+@@ -35,6 +35,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <zone.h>
++#include <priv.h>
+ #include <errno.h>
+ #include <locale.h>
+ #include <signal.h>
diff --git a/libshare/debian/patches/libshare_smb.c.patch b/libshare/debian/patches/libshare_smb.c.patch
new file mode 100644
index 0000000..48d414a
--- /dev/null
+++ b/libshare/debian/patches/libshare_smb.c.patch
@@ -0,0 +1,30 @@
+Index: sharemgr/usr/src/lib/libshare/smb/libshare_smb.c
+===================================================================
+--- sharemgr.orig/usr/src/lib/libshare/smb/libshare_smb.c 2013-09-25 12:47:00.847314729 +0400
++++ sharemgr/usr/src/lib/libshare/smb/libshare_smb.c 2013-09-25 15:07:52.134715408 +0400
+@@ -33,6 +33,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <zone.h>
++#include <priv.h>
+ #include <errno.h>
+ #include <locale.h>
+ #include <fcntl.h>
+@@ -57,6 +58,8 @@
+
+ #define SMB_VALID_SUB_CHRS "UDhMLmIiSPu" /* substitution characters */
+
++extern int is_system_labeled(void);
++
+ /* internal functions */
+ static int smb_share_init(void);
+ static void smb_share_fini(void);
+@@ -177,7 +180,7 @@
+ { SHOPT_GUEST, OPT_TYPE_BOOLEAN },
+ { SHOPT_DFSROOT, OPT_TYPE_BOOLEAN },
+ { SHOPT_DESCRIPTION, OPT_TYPE_STRING },
+- { NULL, NULL }
++ { NULL, 0 }
+ };
+
+ /*
diff --git a/libshare/debian/patches/series b/libshare/debian/patches/series
new file mode 100644
index 0000000..6ecf3c7
--- /dev/null
+++ b/libshare/debian/patches/series
@@ -0,0 +1,8 @@
+libshare_nfs.c-ppriv.patch
+libshare_nfs.c-NULL.patch
+libshare-smb-makefile.patch
+libshare_smb.c.patch
+libshare-no-multilib.patch
+libshare-plugin-path.patch
+libshare-no-smb.patch
+libshare_autofs.c.patch
diff --git a/libshare/debian/rules b/libshare/debian/rules
new file mode 100755
index 0000000..ff565b4
--- /dev/null
+++ b/libshare/debian/rules
@@ -0,0 +1,92 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpkg/architecture.mk
+export DH_VERBOSE = 1
+
+# libs having "install_h" target to install headers:
+libs_headers := \
+libshare
+
+# All libraries to build and to package.
+# Order is important:
+libs := $(libs_headers) \
+
+
+unpack: unpack-stamp
+unpack-stamp:
+ dh_testdir
+ dh_illumos_gate --build \
+ $(libs:%=usr/src/lib/%) \
+ usr/src/cmd/fs.d/nfs/lib/sharetab.h \
+ usr/src/cmd/fs.d/nfs/lib/sharetab.c \
+ usr/src/cmd/fs.d/nfs/lib/nfs_sec.c \
+ usr/src/cmd/fs.d/nfs/lib/nfslog_config.h \
+ usr/src/cmd/fs.d/nfs/lib/nfslog_config.c \
+ usr/src/cmd/fs.d/nfs/lib/nfslogtab.h \
+ usr/src/cmd/fs.d/nfs/lib/nfslogtab.c \
+ usr/src/cmd/fs.d/nfs/lib/smfcfg.h \
+ usr/src/cmd/fs.d/nfs/lib/smfcfg.c \
+
+ # Not used and buggy:
+ echo > usr/src/Makefile.msg.targ
+ touch $@
+
+patch: patch-stamp
+patch-stamp: unpack-stamp
+ dh_testdir
+ [ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
+ touch $@
+
+unpatch:
+ dh_testdir
+ [ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt pop -a -f || test $$? = 2
+ rm -f patch-stamp
+
+dirs-stamp:
+ . usr/env.sh; mkdir -p \
+ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libshare \
+ debian/tmp/usr/include
+ touch $@
+
+headers-stamp: patch-stamp dirs-stamp
+ dh_illumos_make $(libs_headers:%=usr/src/lib/%) -t install_h
+ touch $@
+
+install install install-arch install-indep: install-stamp
+install-stamp: build-stamp
+ touch $@
+
+build build-arch build-indep: build-stamp
+build-stamp: patch-stamp dirs-stamp headers-stamp
+ dh_illumos_make $(libs:%=usr/src/lib/%)
+ touch $@
+
+binary binary-arch binary-indep: binary-stamp
+binary-stamp: install-stamp
+ dh_testdir
+ dh_testroot
+ dh_installdirs
+ find debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libshare -type l -print -name libshare_\*.so -delete
+ dh_install --fail-missing
+ dh_installman
+ dh_installdocs
+ dh_installexamples
+ dh_installchangelogs
+ dh_link
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs -- -c4
+ dh_installdeb
+ dh_shlibdeps
+ dh_strip
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+ touch $@
+
+clean: unpatch
+ dh_testdir
+ dh_testroot
+ dh_clean
+ rm -rf usr .pc
+
diff --git a/libshare/debian/source/format b/libshare/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/libshare/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)