diff options
Diffstat (limited to 'other/rpm/toxcore.spec.in')
-rw-r--r-- | other/rpm/toxcore.spec.in | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/other/rpm/toxcore.spec.in b/other/rpm/toxcore.spec.in new file mode 100644 index 00000000..4c5132ce --- /dev/null +++ b/other/rpm/toxcore.spec.in | |||
@@ -0,0 +1,126 @@ | |||
1 | %define full_name c-@PROJECT_NAME@ | ||
2 | %define commit 0 | ||
3 | %if "${commit}" != "0" | ||
4 | %define shortcommit %(c=%{commit}; echo ${c:0:7}) | ||
5 | %endif | ||
6 | |||
7 | Name: @PROJECT_NAME@ | ||
8 | Version: @PROJECT_VERSION@ | ||
9 | Release: 1%{?dist} | ||
10 | Summary: All-in-one secure communication platform | ||
11 | |||
12 | License: GPLv3 | ||
13 | URL: https://github.com/TokTok/%{full_name} | ||
14 | %if "%{commit}" == "0" | ||
15 | Source0: https://github.com/TokTok/%{full_name}/archive/v%{version}.tar.gz | ||
16 | %else | ||
17 | Source0: https://github.com/TokTok/%{full_name}/archive/%{commit}/%{full_name}-%{shortcommit}.tar.gz | ||
18 | %endif | ||
19 | |||
20 | BuildRequires: cmake | ||
21 | BuildRequires: libvpx-devel | ||
22 | BuildRequires: opus-devel | ||
23 | BuildRequires: libsodium-devel | ||
24 | BuildRequires: libconfig-devel | ||
25 | BuildRequires: systemd-units | ||
26 | |||
27 | %description | ||
28 | With the rise of governmental monitoring programs, Tox, a FOSS initiative, aims | ||
29 | to be an easy to use, all-in-one communication platform that ensures their users | ||
30 | full privacy and secure message delivery. | ||
31 | |||
32 | %package devel | ||
33 | Summary: Development files for @PROJECT_NAME@ | ||
34 | Requires: %{name} = %{version}-%{release} | ||
35 | |||
36 | %description devel | ||
37 | Development package for @PROJECT_NAME@ | ||
38 | |||
39 | %package static | ||
40 | Summary: @PROJECT_NAME@ static libraries | ||
41 | Requires: %{name}-devel = %{version}-%{release} | ||
42 | |||
43 | %description static | ||
44 | @PROJECT_NAME@ static libraries | ||
45 | |||
46 | %package -n tox-bootstrapd | ||
47 | Summary: Tox DHT bootstrap daemon. | ||
48 | Requires: %{name} = %{version}-%{release} | ||
49 | Requires(pre): shadow-utils | ||
50 | Requires(post): systemd-units | ||
51 | Requires(preun): systemd-units | ||
52 | Requires(postun): systemd-units | ||
53 | |||
54 | %description -n tox-bootstrapd | ||
55 | Tox DHT bootstrap daemon. | ||
56 | |||
57 | %prep | ||
58 | %if "%{commit}" == "0" | ||
59 | %setup -q -n %{full_name}-%{version} | ||
60 | %else | ||
61 | %setup -q -n %{full_name}-%{commit} | ||
62 | %endif | ||
63 | |||
64 | %build | ||
65 | %cmake | ||
66 | %{__make} %{?_smp_mflags} | ||
67 | |||
68 | %install | ||
69 | %make_install | ||
70 | mkdir -p %{buildroot}%{_unitdir} | ||
71 | install -m 0644 other/rpm/tox-bootstrapd.service %{buildroot}%{_unitdir}/tox-bootstrapd.service | ||
72 | install -d "%{buildroot}%{_sharedstatedir}/tox-bootstrapd" | ||
73 | mkdir -p %{buildroot}%{_sysconfdir} | ||
74 | install -m 0644 other/bootstrap_daemon/tox-bootstrapd.conf %{buildroot}%{_sysconfdir}/tox-bootstrapd.conf | ||
75 | |||
76 | %check | ||
77 | %{__make} %{?_smp_mflags} test | ||
78 | |||
79 | %pre -n tox-bootstrapd | ||
80 | getent group tox-bootstrapd >/dev/null || groupadd -r tox-bootstrapd | ||
81 | getent passwd tox-bootstrapd >/dev/null || \ | ||
82 | useradd -r -g tox-bootstrapd -d /var/lib/tox-bootstrapd -s /sbin/nologin \ | ||
83 | -c "Account to run Tox's DHT bootstrap daemon" tox-bootstrapd | ||
84 | |||
85 | %post -p /sbin/ldconfig | ||
86 | |||
87 | %postun -p /sbin/ldconfig | ||
88 | |||
89 | %post -n tox-bootstrapd | ||
90 | %systemd_post tox-bootstrapd.service | ||
91 | |||
92 | %postun -n tox-bootstrapd | ||
93 | %systemd_postun_with_restart tox-bootstrapd.service | ||
94 | |||
95 | %preun -n tox-bootstrapd | ||
96 | %systemd_preun tox-bootstrapd.service | ||
97 | |||
98 | %files | ||
99 | %defattr(-, root, root) | ||
100 | %doc COPYING README.md CHANGELOG.md | ||
101 | %{_libdir}/libtoxcore.so* | ||
102 | |||
103 | %files devel | ||
104 | %defattr(-, root, root) | ||
105 | %{_includedir}/tox/ | ||
106 | %{_libdir}/pkgconfig/toxcore.pc | ||
107 | |||
108 | %files static | ||
109 | %defattr(-, root, root) | ||
110 | %{_libdir}/libtoxcore.a | ||
111 | |||
112 | %files -n tox-bootstrapd | ||
113 | %defattr(-, root, root) | ||
114 | %{_bindir}/tox-bootstrapd | ||
115 | %{_unitdir}/tox-bootstrapd.service | ||
116 | %{_sharedstatedir}/tox-bootstrapd | ||
117 | %attr(-,tox-bootstrapd,tox-bootstrapd) %{_sharedstatedir}/tox-bootstrapd/ | ||
118 | %config(noreplace) %{_sysconfdir}/tox-bootstrapd.conf | ||
119 | |||
120 | |||
121 | %changelog | ||
122 | * Sat Nov 25 2017 SmokedCheese <root@ubuntology.ru> - 0.0.0-2 | ||
123 | - Rewrite spec file | ||
124 | |||
125 | * Tue Mar 3 2015 Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc> - 0.0.0-1 | ||
126 | - initial package | ||