Merge pull request #1905 from kissg1988/seafile

seafile-server: fix dependency and postinst script
This commit is contained in:
Steven Barth
2015-11-01 07:18:21 +01:00
+25 -16
View File
@@ -5,11 +5,13 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
# NOTE: make sure to update EXTRA_DEPENDS in case of version/release changes!
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-server PKG_NAME:=seafile-server
PKG_VERSION:=4.1.2 PKG_VERSION:=4.1.2
PKG_RELEASE=$(PKG_SOURCE_VERSION)-4 PKG_RELEASE=$(PKG_SOURCE_VERSION)-5
PKG_LICENSE:=GPL-3.0 PKG_LICENSE:=GPL-3.0
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
@@ -29,11 +31,11 @@ define Package/seafile-server
TITLE:=Seafile server TITLE:=Seafile server
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com> MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=http://seafile.com/ URL:=http://seafile.com/
DEPENDS:=+shadow-useradd +libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub \ DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub \
+sqlite3-cli +python-mysql +jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 \ +sqlite3-cli +python-mysql +jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 \
+libmysqlclient +libpthread +libuuid \ +libmysqlclient +libpthread +libuuid \
+bash +sudo +procps-ng +procps-ng-pkill $(ICONV_DEPENDS) +bash +sudo +procps-ng +procps-ng-pkill $(ICONV_DEPENDS)
EXTRA_DEPENDS:=seafile-ccnet (=4.1.2-a73109f09af4ecc49cdc4c57cdde51b38e15c31a), seafile-seahub (=4.1.2-3fb1288f920de03a4e2e6a06b60671ce98971742) EXTRA_DEPENDS:=seafile-ccnet (=4.1.2-a73109f09af4ecc49cdc4c57cdde51b38e15c31a-2), seafile-seahub (=4.1.2-3fb1288f920de03a4e2e6a06b60671ce98971742)
endef endef
define Package/seafile-server/description define Package/seafile-server/description
@@ -91,13 +93,20 @@ endef
define Package/seafile-server/postinst define Package/seafile-server/postinst
#!/bin/sh #!/bin/sh
if ! id -u seafile >/dev/null 2>&1; then if ! group_exists seafile; then
useradd seafile -d "/usr/share/seafile" -s /bin/sh; fi group_add_next seafile; fi
SEAFILE_GID=$$(grep -s '^seafile:' "$${IPKG_INSTROOT}/etc/group" | cut -d: -f3)
if ! user_exists seafile; then
user_add seafile "" "$${SEAFILE_GID}" seafile /usr/share/seafile /bin/sh; fi
if [ -z "$${IPKG_INSTROOT}" ]
then
chown -R seafile:seafile /usr/share/seafile/ chown -R seafile:seafile /usr/share/seafile/
chmod -R o-rwx /usr/share/seafile/ chmod -R o-rwx /usr/share/seafile/
if [ ! -d "/usr/share/seafile/seafile-data" ] if [ ! -d /usr/share/seafile/seafile-data ]
then then
echo "*** Installation completed, running configuration script..." echo "*** Installation completed, running configuration script..."
/etc/init.d/seafile setup /etc/init.d/seafile setup
@@ -113,21 +122,21 @@ then
echo "*** NOTE: you need to create an admin account before using Seafile." echo "*** NOTE: you need to create an admin account before using Seafile."
echo "*** Please run \"/etc/init.d/seafile create_admin\" to do so." echo "*** Please run \"/etc/init.d/seafile create_admin\" to do so."
else else
echo "*** WARNING: it seems you are upgrading from an older version." echo "*** It seems you are upgrading from an older version."
echo "*** If so, please run the appropriate upgrade script before using the new version of Seafile." echo "*** If so, please run the appropriate upgrade scripts before using the new version of Seafile."
echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\"" echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
echo echo
echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html" echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
exit
fi fi
else
/etc/init.d/seafile enable cat > "$${IPKG_INSTROOT}/etc/uci-defaults/99_seafile-server" << EOF
/etc/init.d/seafile restart
endef
define Package/seafile-server/prerm
#!/bin/sh #!/bin/sh
/etc/init.d/seafile stop
chown -R seafile:seafile /usr/share/seafile/
chmod -R o-rwx /usr/share/seafile/
exit 0
EOF
fi
endef endef
$(eval $(call BuildPackage,seafile-server)) $(eval $(call BuildPackage,seafile-server))