openSUSE package for Syncthing

I’m not really sure what you’re trying to do here. Is there some particular reason you need to create all those dependency packages and work with godep etc instead of “just” building the source that is in syncthing?

I was building the code pulling it from git, which allows me to build revisions in between releases.

I realize now that the releases bundle the dependencies. However, what is the standard build process so that Godeps/_workspace/src is used? Both go run build.go and ./build.sh go to the network. There is no network when building packages.

All the necessary dependencies are in the repo, not only in releases. What is fetched from the network are some build tools and test coverage stuff. The build.go will try to install that from the network if godep is not found in the path. But, if you do some work manually you can skip all that. Basically, the following should work as the minimal manual build steps:

Create a directory somewhere, wherever, and put the full path in the environment variable $GOPATH.

Check out the git repo to $GOPATH/src/github.com/syncthing/syncthing.

Then put the bundled dependencies at the front of the GOPATH, and build.

cd "$GOPATH/src/github.com/syncthing/syncthing"
export GOPATH="$(pwd)/Godeps/_workspace:$GOPATH"
go build -ldflags "-w -X main.Version v0.9.8+9-gfaf519a \
  -X main.BuildStamp 1408971319 -X main.BuildUser jb \
  -X main.BuildHost jborg-mbp.local -X main.BuildEnv default" \
  -tags noupgrade ./cmd/syncthing

You’ll want to set the Version, BuildStamp, BuildUser, BuildStamp and BuildEnv to useful values as above. The first four should be obvious, BuildEnv should always be default unless you’re building for Android, in which case it’s android.

Version is supposed to be git describe with the dash after the tag name replaced by a plus sign to be more semver-y.

There are some things that can be tweaked with environment variables to adjust linking etc; the above should give you a binary for the native architecture that’s linked towards the libc version on that system.

Thanks. With those guidelines I was able to make it work and the package is now simpler in terms of dependencies.

You can see the result here: https://build.opensuse.org/package/show/home:dmacvicar:syncthing/syncthing I now set the timestamp, BuildEnv, host, user, version, etc.

Updated packages for 0.9.9. Grab them here:

http://software.opensuse.org/download/package?project=home:dmacvicar:syncthing&package=syncthing

Or, if you added my repo, just

zypper ref
zypper in syncthing

Updated packages for 0.10.4. Grab them here:

http://software.opensuse.org/download/package?project=home:dmacvicar:syncthing&package=syncthing

Or, if you added my repo, just

zypper ref
zypper in syncthing

I’ve just installed syncthing from your repository on an OpenSUSE 13.1 machine. And first thanks for creating and maintaining this package/repository! The installation was smooth and almost everything seems to work very well. However, the restart from the admin page does not work for me. Restart with systemd works fine, and is acceptable, but obviously it is more inconveniant.

Updated packages for 0.10.5. Grab them here:

http://software.opensuse.org/download/package?project=home:dmacvicar:syncthing&package=syncthing

Or, if you added my repo, just

zypper ref
zypper in syncthing

Hi. I fixed this in the 0.10.5 build. Let me know if you have more issues.

Thanks! Works well now!

Updated packages for 0.10.11. Grab them here:

http://software.opensuse.org/download/package?project=home:dmacvicar:syncthing&package=syncthing

Or, if you added my repo, just

zypper ref
zypper in syncthing

Updated packages for 0.10.26. Grab them here:

http://software.opensuse.org/download/package?project=home:dmacvicar:syncthing&package=syncthing

Or, if you added my repo, just

zypper ref
zypper in syncthing

Updated packages for 0.11.5. Grab them here:

http://software.opensuse.org/download/package?project=home:dmacvicar:syncthing&package=syncthing

Or, if you added my repo, just

zypper ref
zypper in syncthing

Any chanses that You’ll build v0.12x? Your repo was the only source of 32bit builds for openSUSE 13.1.

zypper ar http://download.opensuse.org/repositories/home:/MasterPatricko/openSUSE_Leap_42.1/home:MasterPatricko.repo

:smile:

Its for 42.1, not 13.1. And 42.1 is 64bit only.

oh ok … bad sry

I have been building my own Syncthing 0.12.x packages for openSUSE 13.1 (64-bit) and they work with no problems. So I have just built a 32-bit package that should work for you.

The repo is http://download.opensuse.org/repositories/home:/grb01/openSUSE_13.1/

Hope that helps

1 Like

Many thanx! You’ve saved my day! For several reasons I would like to leave openSUSE 13.1 on this computer, and while other instances of syncthing was already upgraded to 0.12, this one was out of sync due to compatibility issues between 0.11 and 0.12. Thanx to you it’s online again.

My pleasure. Will try and keep it updated as new versions of Syncthing are released.