1
0
mirror of synced 2024-09-22 00:21:46 +02:00
TheChymera-overlay/net-p2p/syncthing/syncthing-0.11.16.ebuild

64 lines
1.7 KiB
Bash
Raw Normal View History

2015-07-22 03:26:06 +02:00
# Copyright 2014-2015 Jonathan Vasquez <jvasquez1011@gmail.com>
2015-07-21 02:54:16 +02:00
# Distributed under the terms of the GNU General Public License v2
EAPI=5
inherit user systemd
GITHUB_USER="syncthing"
GITHUB_REPO="syncthing"
GITHUB_TAG="${PV}"
NAME="syncthing"
DESCRIPTION="Open Source Continuous File Synchronization"
HOMEPAGE="http://syncthing.net/"
2015-07-22 03:26:06 +02:00
SRC_URI="https://github.com/${GITHUB_USER}/${GITHUB_REPO}/archive/v${GITHUB_TAG}.tar.gz -> ${P}.tar.gz"
2015-07-21 02:54:16 +02:00
RESTRICT="mirror"
2015-07-22 03:26:06 +02:00
LICENSE="MPL-2.0"
2015-07-21 02:54:16 +02:00
SLOT="0"
2015-07-22 03:26:06 +02:00
KEYWORDS="~x86 ~amd64"
2015-07-21 02:54:16 +02:00
DEPEND=">=dev-lang/go-1.3.0"
S="${WORKDIR}"
2015-07-22 03:26:06 +02:00
configDir="~/.config/syncthing"
2015-07-21 02:54:16 +02:00
config="${configDir}/config.xml"
src_install() {
# Create directory structure recommended by SyncThing Documentation
# Since Go is "very particular" about file locations.
local newBaseDir="src/github.com/${PN}"
local newWorkDir="${newBaseDir}/${PN}"
mkdir -p "${newBaseDir}"
mv "${P}" "${newWorkDir}"
cd "${newWorkDir}"
# Build SyncThing ;D
go run build.go -version v${PV} -no-upgrade=true
# Copy compiled binary over to image directory
2015-07-22 03:26:06 +02:00
dobin "bin/${PN}"
2015-07-21 02:54:16 +02:00
2015-07-22 03:26:06 +02:00
# Install the OpenRC init/conf files
2015-07-21 02:54:16 +02:00
doinitd "${FILESDIR}/init.d/${NAME}"
2015-07-22 03:26:06 +02:00
doconfd "${FILESDIR}/conf.d/${NAME}"
2015-07-21 02:54:16 +02:00
# Install the systemd unit file
2015-07-22 03:26:06 +02:00
local systemdServiceFile="etc/linux-systemd/system/${PN}@.service"
systemd_dounit "${systemdServiceFile}"
2015-07-21 02:54:16 +02:00
}
pkg_postinst() {
elog "In order to be able to view the Web UI remotely (from another machine),"
elog "edit your ${config} and change the 127.0.0.1:8080 to 0.0.0.0:8080 in"
2015-07-22 03:26:06 +02:00
elog "the 'address' section. This file will only be generated once you start syncthing."
2015-07-21 02:54:16 +02:00
elog ""
2015-07-22 03:26:06 +02:00
elog "Modify the /etc/conf.d/${PN} file and set the user/group/ and syncthing home directory"
elog "before launching. Afterwards, you can start ${PN} by doing a: rc-config start ${PN}"
2015-07-21 02:54:16 +02:00
}