forked from SynoCommunity/spksrc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
PKG_NAME = syncthing | ||
PKG_VERS = v0.8.11 | ||
PKG_EXT = tar.gz | ||
PKG_DIST_NAME = $(PKG_NAME)-linux-$(SYNCTHING_ARCH)-$(PKG_VERS).$(PKG_EXT) | ||
PKG_DIST_SITE = https://github.com/calmh/syncthing/releases/download/$(PKG_VERS) | ||
PKG_DIR = $(PKG_NAME)-linux-$(SYNCTHING_ARCH)-$(PKG_VERS) | ||
|
||
DEPENDS = | ||
|
||
HOMEPAGE = http://www.syncthing.net/ | ||
COMMENT = Syncthing replaces Dropbox and BitTorrent Sync with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how ... | ||
LICENSE = | ||
|
||
CONFIGURE_TARGET = nop | ||
COMPILE_TARGET = nop | ||
INSTALL_TARGET = myInstall | ||
GNU_CONFIGURE = 1 | ||
CONFIGURE_ARGS = | ||
|
||
# Define SYNCTHING_ARCH as per SyncThing standards | ||
ifeq ($(findstring $(ARCH),88f5281 88f6281),$(ARCH)) | ||
SYNCTHING_ARCH = armv5 | ||
endif | ||
ifeq ($(findstring $(ARCH),armada370 armadaxp),$(ARCH)) | ||
SYNCTHING_ARCH = armv7 | ||
endif | ||
ifeq ($(findstring $(ARCH),evansport),$(ARCH)) | ||
SYNCTHING_ARCH = 386 | ||
endif | ||
ifeq ($(findstring $(ARCH),x86 cedarview bromolow),$(ARCH)) | ||
SYNCTHING_ARCH = amd64 | ||
endif | ||
ifeq ($(SYNCTHING_ARCH),) | ||
$(error Unsupported ARCH $(ARCH)) | ||
endif | ||
|
||
include ../../mk/spksrc.cross-cc.mk | ||
|
||
myInstall: | ||
mkdir -p $(STAGING_INSTALL_PREFIX)/bin | ||
install -m 755 $(WORK_DIR)/$(PKG_DIR)/syncthing $(STAGING_INSTALL_PREFIX)/bin/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin:bin/syncthing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
SPK_NAME = syncthing | ||
SPK_VERS = v0.8.11 | ||
SPK_REV = 4 | ||
SPK_ICON = src/syncthing.png | ||
DSM_UI_DIR = app | ||
BETA = 1 | ||
DEPENDS = cross/busybox cross/$(SPK_NAME) | ||
|
||
MAINTAINER = SynoCommunity | ||
DESCRIPTION = Automatically sync files via secure, distributed technology. | ||
DESCRIPTION_FRE = Synchronisation automatique de fichiers via une technologie sûre et distribuée. | ||
ADMIN_PORT = 7070 | ||
RELOAD_UI = yes | ||
DISPLAY_NAME = Syncthing | ||
|
||
HOMEPAGE = http://www.syncthing.net/ | ||
LICENSE = | ||
|
||
WIZARDS_DIR = src/wizard/ | ||
|
||
INSTALLER_SCRIPT = src/installer.sh | ||
SSS_SCRIPT = src/dsm-control.sh | ||
|
||
INSTALL_PREFIX = /usr/local/$(SPK_NAME) | ||
|
||
POST_STRIP_TARGET = syncthing_extra_install | ||
|
||
BUSYBOX_CONFIG = usrmng | ||
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)" | ||
|
||
include ../../mk/spksrc.spk.mk | ||
|
||
.PHONY: syncthing_extra_install | ||
syncthing_extra_install: | ||
install -m 755 -d $(STAGING_DIR)/var | ||
install -m 600 src/config.xml $(STAGING_DIR)/var/config.xml | ||
install -m 755 -d $(STAGING_DIR)/app | ||
install -m 644 src/app/config $(STAGING_DIR)/app/config | ||
install -m 755 -d $(STAGING_DIR)/app/images | ||
for size in 16 24 32 48 72; do \ | ||
convert $(SPK_ICON) -thumbnail $${size}x$${size} \ | ||
$(STAGING_DIR)/app/images/$(SPK_NAME)-$${size}.png ; \ | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
".url": { | ||
"com.synocommunity.packages.syncthing": { | ||
"title": "Syncthing", | ||
"desc": "Syncthing Web UI", | ||
"icon": "images/syncthing-{0}.png", | ||
"type": "url", | ||
"protocol": "http", | ||
"port": "7070", | ||
"url": "/", | ||
"allUsers": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<configuration version="2"> | ||
<gui enabled="true" tls="false"> | ||
<address>0.0.0.0:7070</address> | ||
</gui> | ||
<options> | ||
<listenAddress>0.0.0.0:22000</listenAddress> | ||
<globalAnnounceServer>announce.syncthing.net:22025</globalAnnounceServer> | ||
<globalAnnounceEnabled>true</globalAnnounceEnabled> | ||
<localAnnounceEnabled>true</localAnnounceEnabled> | ||
<localAnnouncePort>21025</localAnnouncePort> | ||
<parallelRequests>16</parallelRequests> | ||
<maxSendKbps>0</maxSendKbps> | ||
<rescanIntervalS>60</rescanIntervalS> | ||
<reconnectionIntervalS>60</reconnectionIntervalS> | ||
<maxChangeKbps>10000</maxChangeKbps> | ||
<startBrowser>false</startBrowser> | ||
<upnpEnabled>true</upnpEnabled> | ||
</options> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/sh | ||
|
||
# Package | ||
PACKAGE="syncthing" | ||
DNAME="Syncthing" | ||
|
||
# Others | ||
INSTALL_DIR="/usr/local/${PACKAGE}" | ||
PATH="${INSTALL_DIR}/bin:${PATH}" | ||
USER="syncthing" | ||
SYNCTHING="${INSTALL_DIR}/bin/syncthing" | ||
CONFIG_DIR="${INSTALL_DIR}/var/" | ||
|
||
|
||
start_daemon () | ||
{ | ||
su - ${USER} -c "PATH=${PATH} ${SYNCTHING} --home ${CONFIG_DIR}" | ||
} | ||
|
||
stop_daemon () | ||
{ | ||
# Kill the application | ||
kill `ps w | grep ${PACKAGE} | grep -v -E 'stop|grep' | awk '{print $1}'` | ||
} | ||
|
||
daemon_status () | ||
{ | ||
if [ `ps w | grep ${PACKAGE} | grep -v -E 'status|grep' | wc -l` -gt 0 ] | ||
then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
wait_for_status () | ||
{ | ||
counter=$2 | ||
while [ ${counter} -gt 0 ]; do | ||
daemon_status | ||
[ $? -eq $1 ] && return | ||
let counter=counter-1 | ||
sleep 1 | ||
done | ||
return 1 | ||
} | ||
|
||
|
||
case $1 in | ||
start) | ||
if daemon_status; then | ||
echo ${DNAME} is already running | ||
else | ||
echo Starting ${DNAME} ... | ||
start_daemon | ||
fi | ||
;; | ||
stop) | ||
if daemon_status; then | ||
echo Stopping ${DNAME} ... | ||
stop_daemon | ||
else | ||
echo ${DNAME} is not running | ||
fi | ||
;; | ||
status) | ||
if daemon_status; then | ||
echo ${DNAME} is running | ||
exit 0 | ||
else | ||
echo ${DNAME} is not running | ||
exit 1 | ||
fi | ||
;; | ||
log) | ||
exit 1 | ||
;; | ||
*) | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/sh | ||
|
||
# Package | ||
PACKAGE="syncthing" | ||
DNAME="Syncthing" | ||
|
||
# Others | ||
INSTALL_DIR="/usr/local/${PACKAGE}" | ||
SSS="/var/packages/${PACKAGE}/scripts/start-stop-status" | ||
PATH="${INSTALL_DIR}/bin:${PATH}" | ||
USER="syncthing" | ||
GROUP="users" | ||
TMP_DIR="${SYNOPKG_PKGDEST}/../../@tmp" | ||
|
||
|
||
preinst () | ||
{ | ||
exit 0 | ||
} | ||
|
||
postinst () | ||
{ | ||
# Link | ||
ln -s ${SYNOPKG_PKGDEST} ${INSTALL_DIR} | ||
|
||
# Install busybox stuff | ||
${INSTALL_DIR}/bin/busybox --install ${INSTALL_DIR}/bin | ||
|
||
# Create user | ||
adduser -h ${INSTALL_DIR}/var -g "${DNAME} User" -G ${GROUP} -s /bin/sh -S -D ${USER} | ||
|
||
# Correct the files ownership | ||
chown -R ${USER}:root ${SYNOPKG_PKGDEST} | ||
|
||
exit 0 | ||
} | ||
|
||
preuninst () | ||
{ | ||
# Stop the package | ||
${SSS} stop > /dev/null | ||
|
||
# Remove the user (if not upgrading) | ||
if [ "${SYNOPKG_PKG_STATUS}" != "UPGRADE" ]; then | ||
delgroup ${USER} ${GROUP} | ||
deluser ${USER} | ||
fi | ||
|
||
exit 0 | ||
} | ||
|
||
postuninst () | ||
{ | ||
# Remove link | ||
rm -f ${INSTALL_DIR} | ||
|
||
exit 0 | ||
} | ||
|
||
preupgrade () | ||
{ | ||
# Stop the package | ||
${SSS} stop > /dev/null | ||
|
||
# Save some stuff | ||
rm -fr ${TMP_DIR}/${PACKAGE} | ||
mkdir -p ${TMP_DIR}/${PACKAGE} | ||
mv ${INSTALL_DIR}/var ${TMP_DIR}/${PACKAGE}/ | ||
|
||
exit 0 | ||
} | ||
|
||
postupgrade () | ||
{ | ||
# Restore some stuff | ||
rm -fr ${INSTALL_DIR}/var | ||
mv ${TMP_DIR}/${PACKAGE}/var ${INSTALL_DIR}/ | ||
rm -fr ${TMP_DIR}/${PACKAGE} | ||
|
||
exit 0 | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.