diff --git a/net-p2p/syncthing/Manifest b/net-p2p/syncthing/Manifest new file mode 100644 index 0000000..97ac7fe --- /dev/null +++ b/net-p2p/syncthing/Manifest @@ -0,0 +1 @@ +DIST syncthing-linux-amd64-v0.11.16.tar.gz 4387631 SHA256 5ed60fa10c45b8c40436cd79d613111f74d06a8df5273f49a2c2cbcd7144409c SHA512 96a274da5e591ae500f4187e9798d02a5532ed5c8d13919a0da9105560cd053a448cb77f2c30e794626c41c8cf50c71f6b25e225234af6e2a79cc3ee309b087d WHIRLPOOL 0c1ac761eccc1afd77eb7b6c3c1abcd0df264df7aa798cae765f5a2296b9f6df21b55e76d94c4cd6227c54f0276e52779ec62f40f2c7b0ee7fbea8ce0a4f5dd7 diff --git a/net-p2p/syncthing/syncthing-0.11.16.ebuild b/net-p2p/syncthing/syncthing-0.11.16.ebuild new file mode 100644 index 0000000..c4308b8 --- /dev/null +++ b/net-p2p/syncthing/syncthing-0.11.16.ebuild @@ -0,0 +1,79 @@ +# Copyright 2014 Jonathan Vasquez +# 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/" + +SRC_URI=" + amd64? ( https://github.com/${GITHUB_USER}/${GITHUB_REPO}/releases/download/v${GITHUB_TAG}/syncthing-linux-amd64-v${PV}.tar.gz )" +#https://github.com/$//archive/v${GITHUB_TAG}.tar.gz -> ${P}.tar.gz +#https://github.com/{GITHUB_USER}/${GITHUB_REPO}/releases/download/v${GITHUB_TAG}/syncthing-linux-amd64-v${PV}.tar.gz +RESTRICT="mirror" +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND=">=dev-lang/go-1.3.0" + +S="${WORKDIR}" + +configDir="/etc/${PN}" +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 + dobin "${WORKDIR}/syncthing-linux-amd64-v${PV}/syncthing" + + # Install the OpenRC init file + doinitd "${FILESDIR}/init.d/${NAME}" + + # Install the systemd unit file + systemd_newunit "${FILESDIR}/${PN}_.service" "${PN}@.service" + #Install the systemd user unit file + systemd_douserunit "${FILESDIR}/${PN}.service" +} + +pkg_postinst() { + if [[ ! -d "${configDir}" ]]; then + mkdir "${configDir}" + fi + + if [[ ! -e "${config}" ]]; then + einfo "Generating default configuration file ..." + + syncthing -generate "${configDir}" + + # Remove 'default' folder (it has an incorrect path anyway) + sed -i '//d' "${config}" + fi + + 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" + elog "the 'address' section." + elog "" + elog "After checking your config, run 'rc-config start ${PN}' to start the application." + elog "Point your browser to the address above to access the Web UI." + elog "" +}