Skip to content

Commit

Permalink
Port libzfsacl and libsunacl from samba
Browse files Browse the repository at this point in the history
- Add python packaging bits to build and install the extension
- Package libzfsacl in python3-libzfsacl-VER-ARCH.deb for ALIEN
  converted Debian packaging
- Package libzfsacl in openzfs-zfs-libzfsacl_VER_ARCH.deb for
  native Debian packaging
- Fix all checkstyle warnings and errors
- Builds on both FreeBSD and Linux

Signed-off-by: Umer Saleem <[email protected]>
  • Loading branch information
usaleem-ix committed Aug 3, 2023
1 parent 8275c98 commit 57292a3
Show file tree
Hide file tree
Showing 17 changed files with 3,921 additions and 4 deletions.
5 changes: 3 additions & 2 deletions config/deb.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ deb-utils: deb-local rpm-utils-initramfs
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
pkg10=`ls python3-pyzfs-$${version}.noarch.rpm 2>/dev/null`; \
pkg11=`ls pam_zfs_key-$${version}.$${arch}.rpm 2>/dev/null`; \
pkg12=`ls python3-libzfsacl-$${version}.$${arch}.rpm 2>/dev/null`; \
## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
## to do this, so we install a shim onto the path which calls the real
## dh_shlibdeps with the required arguments.
Expand All @@ -81,11 +82,11 @@ deb-utils: deb-local rpm-utils-initramfs
env "PATH=$${path_prepend}:$${PATH}" \
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
$$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
$$pkg8 $$pkg9 $$pkg10 $$pkg11 || exit 1; \
$$pkg8 $$pkg9 $$pkg10 $$pkg11 $$pkg12 || exit 1; \
$(RM) $${path_prepend}/dh_shlibdeps; \
rmdir $${path_prepend}; \
$(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
$$pkg8 $$pkg9 $$pkg10 $$pkg11;
$$pkg8 $$pkg9 $$pkg10 $$pkg11 $$pkg12;

deb: deb-kmod deb-dkms deb-utils

Expand Down
12 changes: 12 additions & 0 deletions contrib/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ Description: wrapper for libzfs_core C library (documentation)
.
This package contains the documentation.

Package: openzfs-python3-libzfsacl
Section: contrib/python
Architecture: linux-any
Depends: openzfs-zfsutils (= ${binary:Version}),
${misc:Depends},
${python3:Depends}
Replaces: python3-libzfsacl
Conflicts: python3-libzfsacl
Description: Python module for accessing NFSV41 style ACLs
libzfsacl is cross platform python library for accessing NFSv41 style
ACLs.

Package: openzfs-zfs-dkms
Architecture: all
Depends: dkms (>> 2.1.1.2-5),
Expand Down
2 changes: 2 additions & 0 deletions contrib/debian/openzfs-python3-libzfsacl.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/lib/python3/dist-packages/libzfsacl-*.egg-info
usr/lib/python3/dist-packages/libzfsacl.cpython-*.so
3 changes: 2 additions & 1 deletion contrib/debian/openzfs-python3-pyzfs.install
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
usr/lib/python3*
usr/lib/python3/dist-packages/libzfs_core
usr/lib/python3/dist-packages/pyzfs-*.egg-info
1 change: 1 addition & 0 deletions contrib/debian/rules.in
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ override_dh_auto_install:

override_dh_python3:
dh_python3 -p openzfs-python3-pyzfs
dh_python3 -p openzfs-python3-libzfsacl

override_dh_dkms:
'$(CURDIR)/scripts/dkms.mkconf' -n $(NAME) -v $(DEB_VERSION_UPSTREAM) -f '$(CURDIR)/scripts/zfs-dkms.dkms'
Expand Down
1 change: 1 addition & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ include $(srcdir)/%D%/libunicode/Makefile.am
include $(srcdir)/%D%/libuutil/Makefile.am
include $(srcdir)/%D%/libzfs_core/Makefile.am
include $(srcdir)/%D%/libzfs/Makefile.am
include $(srcdir)/%D%/libzfsacl/Makefile.am
include $(srcdir)/%D%/libzfsbootenv/Makefile.am
include $(srcdir)/%D%/libzpool/Makefile.am
include $(srcdir)/%D%/libzstd/Makefile.am
Expand Down
3 changes: 3 additions & 0 deletions lib/libzfsacl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
libzfsacl.egg-info
setup.py
25 changes: 25 additions & 0 deletions lib/libzfsacl/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
dist_noinst_DATA += \
%D%/sunacl.h \
%D%/libzfsacl.h \
%D%/libpyzfsacl.c \
%D%/libsunacl.c \
%D%/libzfsacl_impl_freebsd.c \
%D%/libzfsacl_impl_linux.c

SUBSTFILES += %D%/setup.py

ALL_LOCAL += libzfsacl-all-local
libzfsacl-all-local: %D%/setup.py
cd %D% && $(PYTHON) setup.py egg_info -e . build

INSTALL_DATA_HOOKS += libzfsacl-install-data-hook
libzfsacl-install-data-hook:
cd %D% && $(PYTHON) setup.py egg_info -e . install \
--prefix $(prefix) \
--root $(DESTDIR)/ \
--install-lib $(pythonsitedir) \
--verbose

CLEAN_LOCAL += libzfsacl-clean-local
libzfsacl-clean-local:
-$(RM) -r %D%/build/
Loading

0 comments on commit 57292a3

Please sign in to comment.