Browse Source

seafile: Remove Python variants, update Python packaging

This removes Python build variants and adds PYTHON3_PKG_BUILD:=0 (where
appropriate) for the Seafile packages.

This also updates the way the Python bindings packages are packaged,
using automake installation instead of manual install recipes.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lilik-openwrt-22.03
Jeffery To 5 years ago
parent
commit
81e99fa7ff
7 changed files with 48 additions and 35 deletions
  1. +6
    -10
      libs/libsearpc/Makefile
  2. +8
    -0
      libs/libsearpc/patches/001-no-python-compile.patch
  3. +5
    -8
      net/seafile-ccnet/Makefile
  4. +6
    -0
      net/seafile-ccnet/patches/011-no-python-compile.patch
  5. +5
    -4
      net/seafile-seahub/Makefile
  6. +4
    -13
      net/seafile-server/Makefile
  7. +14
    -0
      net/seafile-server/patches/012-automake-no-python-compile.patch

+ 6
- 10
libs/libsearpc/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libsearpc
PKG_VERSION:=3.2.0
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/haiwen/libsearpc.git
@ -25,6 +25,7 @@ PKG_FIXUP:=autoreconf
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@ -50,19 +51,21 @@ define Package/python3-searpc
SUBMENU:=Python
TITLE:=Python bindings for Searpc
DEPENDS:=+libsearpc +python3-light +python3-logging
VARIANT:=python3
endef
define Package/python3-searpc/description
$(call Package/libsearpc/description)
This package contains the Python bindings for Searpc.
This package contains Python bindings for Searpc.
endef
CONFIGURE_ARGS += \
--disable-compile-demo \
--disable-server-pkg
CONFIGURE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/{bin,include}
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
@ -77,13 +80,6 @@ define Package/libsearpc/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsearpc.so* $(1)/usr/lib/
endef
define Py3Build/Compile
rm -rf $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc
$(INSTALL_DIR) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc
$(INSTALL_DATA) $(PKG_BUILD_DIR)/pysearpc/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc/
rm -f $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc/{pygencode,test_pysearpc}.py
endef
Py3Package/python3-searpc/install:=:
$(eval $(call BuildPackage,libsearpc))


+ 8
- 0
libs/libsearpc/patches/001-no-python-compile.patch View File

@ -0,0 +1,8 @@
--- a/pysearpc/Makefile.am
+++ b/pysearpc/Makefile.am
@@ -1,4 +1,4 @@
pysearpcdir=${pyexecdir}/pysearpc
-pysearpc_PYTHON = __init__.py client.py common.py errors.py named_pipe.py server.py transport.py utils.py
+pysearpc_DATA = __init__.py client.py common.py errors.py named_pipe.py server.py transport.py utils.py

+ 5
- 8
net/seafile-ccnet/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-ccnet
PKG_VERSION:=7.1.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/ccnet-server/tar.gz/v$(PKG_VERSION)-server?
@ -25,6 +25,7 @@ PKG_BUILD_DEPENDS:=vala/host
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@ -58,7 +59,6 @@ define Package/python3-seafile-ccnet
SUBMENU:=Python
TITLE:=Python bindings for Seafile Ccnet
DEPENDS:=+seafile-ccnet +python3-light +python3-searpc
VARIANT:=python3
endef
define Package/python3-seafile-ccnet/description
@ -73,6 +73,9 @@ CONFIGURE_ARGS += \
--enable-python \
--with-mysql="$(STAGING_DIR)/usr/bin/mysql_config"
CONFIGURE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)"
define Package/seafile-ccnet/install
$(INSTALL_DIR) $(1)/usr/{lib,libexec}
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/libexec/
@ -88,12 +91,6 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libccnet.{a,la,so*} $(1)/usr/lib/
endef
define Py3Build/Compile
rm -rf $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/ccnet
$(INSTALL_DIR) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/ccnet
$(INSTALL_DATA) $(PKG_BUILD_DIR)/python/ccnet/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/ccnet/
endef
Py3Package/python3-seafile-ccnet/install:=:
$(eval $(call BuildPackage,seafile-ccnet))


+ 6
- 0
net/seafile-ccnet/patches/011-no-python-compile.patch View File

@ -0,0 +1,6 @@
--- a/python/ccnet/Makefile.am
+++ b/python/ccnet/Makefile.am
@@ -1,2 +1,2 @@
ccnetdir=${pyexecdir}/ccnet
-ccnet_PYTHON = __init__.py rpc.py
+ccnet_DATA = __init__.py rpc.py

+ 5
- 4
net/seafile-seahub/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-seahub
PKG_VERSION:=7.1.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/seahub/tar.gz/v$(PKG_VERSION)-server?
@ -24,6 +24,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/seahub-$(PKG_VERSION)-server
HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="Django~=1.11"
PKG_BUILD_PARALLEL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
@ -57,7 +58,6 @@ define Package/seafile-seahub
+python3-requests-oauthlib \
+python3-seafile-ccnet \
+python3-searpc
VARIANT:=python3
endef
define Package/seafile-seahub/description
@ -75,10 +75,9 @@ MAKE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)" \
DJANGO_ADMIN_PY="$(STAGING_DIR_HOSTPKG)/bin/django-admin"
define Py3Build/Compile
define Build/Compile
$(call HostPython3/PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS))
$(call Build/Compile/Default,locale)
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
endef
define Py3Package/seafile-seahub/install
@ -90,6 +89,8 @@ define Py3Package/seafile-seahub/install
mv $(1)/usr/share/seafile/seafile-server/seahub/media/avatars $(1)/usr/share/seafile/seafile-server/seahub/media/avatars_default
endef
Py3Package/seafile-seahub/filespec:=
$(eval $(call Py3Package,seafile-seahub))
$(eval $(call BuildPackage,seafile-seahub))
$(eval $(call BuildPackage,seafile-seahub-src))

+ 4
- 13
net/seafile-server/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-server
PKG_VERSION:=7.1.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/seafile-server/tar.gz/v$(PKG_VERSION)-server?
@ -25,6 +25,7 @@ PKG_BUILD_DEPENDS:=vala/host libevhtp
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@ -111,7 +112,6 @@ define Package/python3-seafile-server
SUBMENU:=Python
TITLE:=Python bindings for Seafile server
DEPENDS:=+python3-light +python3-logging +python3-searpc +python3-seafile-ccnet
VARIANT:=python3
endef
define Package/python3-seafile-server/description
@ -126,10 +126,8 @@ CONFIGURE_ARGS += \
--enable-python \
--with-mysql="$(STAGING_DIR)/usr/bin/mysql_config"
# This is required as python3-package.mk overrides the default setting of having interlinking enabled
ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -minterlink-mips16
endif
CONFIGURE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)"
ifdef CONFIG_GCC_LIBSSP
TARGET_LDFLAGS += -lssp
@ -199,13 +197,6 @@ define Build/InstallDev
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
endef
define Py3Build/Compile
rm -rf $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/{seafile,seaserv}
$(INSTALL_DIR) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/{seafile,seaserv}
$(INSTALL_DATA) $(PKG_BUILD_DIR)/python/seafile/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/seafile/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/python/seaserv/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/seaserv/
endef
define Package/seafile-server-fuse/install
$(INSTALL_DIR) $(1)/usr/{bin,libexec}
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/seaf-fuse $(1)/usr/libexec/


+ 14
- 0
net/seafile-server/patches/012-automake-no-python-compile.patch View File

@ -0,0 +1,14 @@
--- a/python/seafile/Makefile.am
+++ b/python/seafile/Makefile.am
@@ -1,3 +1,3 @@
seafiledir=${pyexecdir}/seafile
-seafile_PYTHON = __init__.py rpcclient.py
+seafile_DATA = __init__.py rpcclient.py
--- a/python/seaserv/Makefile.am
+++ b/python/seaserv/Makefile.am
@@ -1,3 +1,3 @@
seaservdir=${pyexecdir}/seaserv
-seaserv_PYTHON = __init__.py service.py api.py
+seaserv_DATA = __init__.py service.py api.py

Loading…
Cancel
Save