]>
Commit | Line | Data |
---|---|---|
bbf5053a ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build with tests | |
4 | %bcond_without tests # build without tests | |
5 | ||
6 | Summary: Open Source Continuous File Synchronization | |
7 | Name: syncthing | |
22118509 | 8 | Version: 1.21.0 |
e8d8469c | 9 | Release: 1 |
9637aa32 ER |
10 | # syncthing (MPLv2.0) bundles |
11 | # - angular, bootstrap, daterangepicker, fancytree, jQuery, moment (MIT), | |
12 | # - ForkAwesome (MIT and OFL and CC-BY 3.0), and | |
13 | # - a number of go packages (MIT and MPLv2.0 and BSD and ASL 2.0 and CC0 and ISC) | |
14 | License: MPLv2.0 and MIT and OFL and CC-BY and BSD and ASL 2.0 and CC0 and ISC | |
bbf5053a | 15 | Group: Applications/Networking |
9637aa32 | 16 | # Use official release tarball (contains vendored dependencies) |
72bd3ff2 | 17 | # https://github.com/syncthing/syncthing/releases/ |
9637aa32 | 18 | Source0: https://github.com/syncthing/syncthing/releases/download/v%{version}/%{name}-source-v%{version}.tar.gz |
22118509 | 19 | # Source0-md5: 4cec3f1ff8da9d62c8918aca70bc9ff3 |
bbf5053a | 20 | URL: https://syncthing.net/ |
9637aa32 | 21 | BuildRequires: golang >= 1.14 |
7aa73975 | 22 | ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 mips64 mips64le ppc64 ppc64le s390x |
bbf5053a ER |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
24 | ||
25 | %define _enable_debug_packages 0 | |
26 | %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; | |
27 | %define gopath %{_libdir}/golang | |
28 | %define import_path github.com/syncthing/syncthing | |
29 | ||
30 | %description | |
31 | Syncthing replaces proprietary sync and cloud services with something | |
32 | open, trustworthy and decentralized. Your data is your data alone and | |
33 | you deserve to choose where it is stored, if it is shared with some | |
34 | third party and how it's transmitted over the Internet. | |
35 | ||
36 | %prep | |
9637aa32 | 37 | %setup -qc |
bbf5053a | 38 | |
9637aa32 ER |
39 | install -d build/src/$(dirname %{import_path}) |
40 | mv %{name}/{AUTHORS,*.md} . | |
41 | mv %{name} build/src/%{import_path} | |
bbf5053a ER |
42 | |
43 | %build | |
9637aa32 ER |
44 | export GOPATH=$(pwd)/build |
45 | cd build/src/%{import_path} | |
46 | ||
47 | go run build.go -version "v%{version}" -no-upgrade build | |
48 | go run build.go -version "v%{version}" -no-upgrade install | |
bbf5053a ER |
49 | |
50 | %install | |
51 | rm -rf $RPM_BUILD_ROOT | |
39a738b8 | 52 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man{1,5,7}} |
9637aa32 ER |
53 | |
54 | cd build/src/%{import_path} | |
39a738b8 ER |
55 | install -p bin/* $RPM_BUILD_ROOT%{_bindir} |
56 | cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
57 | cp -p man/*.5 $RPM_BUILD_ROOT%{_mandir}/man5 | |
58 | cp -p man/*.7 $RPM_BUILD_ROOT%{_mandir}/man7 | |
bbf5053a ER |
59 | |
60 | %clean | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %files | |
64 | %defattr(644,root,root,755) | |
65 | %doc README.md AUTHORS CONTRIBUTING.md | |
66 | %attr(755,root,root) %{_bindir}/syncthing | |
e8d8469c ER |
67 | %{_mandir}/man1/stdiscosrv.1* |
68 | %{_mandir}/man1/strelaysrv.1* | |
39a738b8 ER |
69 | %{_mandir}/man1/syncthing.1* |
70 | %{_mandir}/man5/syncthing-config.5* | |
71 | %{_mandir}/man5/syncthing-stignore.5* | |
72 | %{_mandir}/man7/syncthing-bep.7* | |
73 | %{_mandir}/man7/syncthing-device-ids.7* | |
74 | %{_mandir}/man7/syncthing-event-api.7* | |
75 | %{_mandir}/man7/syncthing-faq.7* | |
76 | %{_mandir}/man7/syncthing-globaldisco.7* | |
77 | %{_mandir}/man7/syncthing-localdisco.7* | |
78 | %{_mandir}/man7/syncthing-networking.7* | |
79 | %{_mandir}/man7/syncthing-relay.7* | |
80 | %{_mandir}/man7/syncthing-rest-api.7* | |
81 | %{_mandir}/man7/syncthing-security.7* | |
82 | %{_mandir}/man7/syncthing-versioning.7* |