2 # Copyright (C) 2007-2017 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
10 PKG_NAME
:=seafile-server
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=https
://codeload.github.com
/haiwen
/seafile-server
/tar.gz
/v
$(PKG_VERSION
)-server?
17 PKG_HASH
:=1ba4c641bad8d7592fd2592827e81470c88b8e802707d2b1e6d551c16d0da100
18 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)-server
19 PKG_MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
24 include $(INCLUDE_DIR
)/package.mk
25 include $(INCLUDE_DIR
)/nls.mk
26 include ..
/..
/lang
/python
/python-package.mk
28 # Check that the actual Makefile version-relase match the above.
29 $(eval
$(shell awk
'/^PKG_VERSION.*=/ { print "SEAHUB_" $$$$0 }' ..
/seafile-seahub
/Makefile
))
30 ifneq ($(PKG_VERSION
),$(SEAHUB_PKG_VERSION
))
31 $(error
$(if
$(SEAHUB_PKG_VERSION
), \
32 Version mismatch between seafile-seahub
($(SEAHUB_PKG_VERSION
)) and \
33 seafile-server
($(PKG_VERSION
)), \
34 Could not
get PKG_VERSION from seafile-seahub Makefile
))
37 define Package
/seafile-server
41 URL
:=https
://seafile.com
/
42 DEPENDS
:=+libarchive
+libopenssl
+glib2
+libsearpc
+seafile-ccnet
+seafile-seahub
+sqlite3-cli
+python-mysql
+python-urllib3 \
43 +jansson
+libevent2
+libevent2-openssl
+zlib
+libzdb
+libsqlite3
+libmysqlclient \
44 +libpthread
+libuuid
+bash
+procps-ng
+procps-ng-pkill
+SEAFILE_FUSE_SUPPORT
:libfuse
$(ICONV_DEPENDS
)
48 define Package
/seafile-server
/config
49 source
"$(SOURCE)/Config.in"
52 define Package
/seafile-server
/description
53 Open source cloud storage with advanced features on privacy protection and teamwork.
56 CONFIGURE_ARGS
+= --enable-python
58 ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT
),y
)
59 CONFIGURE_ARGS
+= --enable-fuse
60 TARGET_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/fuse
62 CONFIGURE_ARGS
+= --disable-fuse
65 ifeq ($(CONFIG_SEAFILE_CONSOLE_SUPPORT
),y
)
66 CONFIGURE_ARGS
+= --enable-console
68 CONFIGURE_ARGS
+= --disable-console
71 PKG_BUILD_DEPENDS
:=vala
/host libevhtp
73 # This is required as python-package.mk overrides the default setting of having interlinking enabled
74 ifdef CONFIG_USE_MIPS16
75 TARGET_CFLAGS
+= -minterlink-mips16
77 TARGET_LDFLAGS
+= -Wl
,-rpath-link
=$(STAGING_DIR
)/usr
/lib
-liconv \
78 -L
$(STAGING_DIR
)/usr
/lib
/mysql
-lmysqlclient
-lz
-levent_openssl
-levent
80 define Package
/seafile-server
/conffiles
84 define Package
/seafile-server
/install
85 $(INSTALL_DIR
) $(1)/usr
/{bin
,lib
}
86 $(INSTALL_DIR
) $(1)$(PYTHON_PKG_DIR
)
87 $(INSTALL_DIR
) $(1)/usr
/share
/seafile
/seafile-server
88 $(INSTALL_DIR
) $(1)/usr
/share
/seafile
/conf
89 $(INSTALL_DIR
) $(1)/etc
/{config
,init.d
}
90 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/* $(1)/usr
/bin
/
91 $(CP
) $(PKG_INSTALL_DIR
)$(PYTHON_PKG_DIR
)/seafile
/ $(1)$(PYTHON_PKG_DIR
)/
92 $(CP
) $(PKG_INSTALL_DIR
)$(PYTHON_PKG_DIR
)/seaserv
/ $(1)$(PYTHON_PKG_DIR
)/
93 $(CP
) $(PKG_BUILD_DIR
)/scripts
/seaf-gc.sh
$(1)/usr
/share
/seafile
/seafile-server
/
94 $(CP
) $(PKG_BUILD_DIR
)/scripts
/seaf-fsck.sh
$(1)/usr
/share
/seafile
/seafile-server
/
95 ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT
),y
)
96 $(CP
) $(PKG_BUILD_DIR
)/scripts
/seaf-fuse.sh
$(1)/usr
/share
/seafile
/seafile-server
/
98 $(CP
) $(PKG_BUILD_DIR
)/scripts
/setup-seafile-mysql.py
$(1)/usr
/share
/seafile
/seafile-server
/
99 $(CP
) $(PKG_BUILD_DIR
)/scripts
/setup-seafile-mysql.sh
$(1)/usr
/share
/seafile
/seafile-server
/
100 $(CP
) $(PKG_BUILD_DIR
)/scripts
/sqlite2mysql.py
$(1)/usr
/share
/seafile
/seafile-server
/
101 $(CP
) $(PKG_BUILD_DIR
)/scripts
/sqlite2mysql.sh
$(1)/usr
/share
/seafile
/seafile-server
/
102 $(CP
) $(PKG_BUILD_DIR
)/scripts
/check_init_admin.py
$(1)/usr
/share
/seafile
/seafile-server
/
103 $(CP
) $(PKG_BUILD_DIR
)/scripts
/upgrade
/ $(1)/usr
/share
/seafile
/seafile-server
/
104 $(CP
) .
/files
/seafile.conf
$(1)/etc
/config
/seafile
105 $(INSTALL_BIN
) .
/files
/seafile.init
$(1)/etc
/init.d
/seafile
106 $(INSTALL_BIN
) .
/files
/seahub.init
$(1)/etc
/init.d
/seahub
107 find
$(1) -name
"*\.pyc" -o
-name
"*\.pyo" | xargs
rm -f
110 define Build
/InstallDev
111 $(INSTALL_DIR
) $(1)/usr
/include
112 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
113 $(INSTALL_DIR
) $(1)$(PYTHON_PKG_DIR
)
114 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/seafile
/ $(1)/usr
/include/
115 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libseafile.
pc $(1)/usr
/lib
/pkgconfig
/
116 $(CP
) $(PKG_INSTALL_DIR
)$(PYTHON_PKG_DIR
)/seafile
/ $(1)$(PYTHON_PKG_DIR
)/
117 $(CP
) $(PKG_INSTALL_DIR
)$(PYTHON_PKG_DIR
)/seaserv
/ $(1)$(PYTHON_PKG_DIR
)/
120 define Package
/seafile-server
/postinst
122 [ ! -f
/etc
/init.d
/seafile
] && exit
0
124 if
[ ! -d
/usr
/share
/seafile
/seafile-data
]
126 echo
"*** Installation completed, running configuration script..."
127 /etc
/init.d
/seafile setup
132 echo
"*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
133 echo
"*** \"/etc/init.d/seafile setup\""
136 echo
"*** seafile-data directory already exists."
138 echo
"*** In case you are upgrading seafile, please run the appropriate upgrade script"
139 echo
"*** manually before using the new version."
140 echo
"*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
142 echo
"*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
146 $(eval
$(call BuildPackage
,seafile-server
))