summaryrefslogtreecommitdiff
path: root/other/rpm/toxcore.spec.in
diff options
context:
space:
mode:
Diffstat (limited to 'other/rpm/toxcore.spec.in')
-rw-r--r--other/rpm/toxcore.spec.in126
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
7Name: @PROJECT_NAME@
8Version: @PROJECT_VERSION@
9Release: 1%{?dist}
10Summary: All-in-one secure communication platform
11
12License: GPLv3
13URL: https://github.com/TokTok/%{full_name}
14%if "%{commit}" == "0"
15Source0: https://github.com/TokTok/%{full_name}/archive/v%{version}.tar.gz
16%else
17Source0: https://github.com/TokTok/%{full_name}/archive/%{commit}/%{full_name}-%{shortcommit}.tar.gz
18%endif
19
20BuildRequires: cmake
21BuildRequires: libvpx-devel
22BuildRequires: opus-devel
23BuildRequires: libsodium-devel
24BuildRequires: libconfig-devel
25BuildRequires: systemd-units
26
27%description
28With the rise of governmental monitoring programs, Tox, a FOSS initiative, aims
29to be an easy to use, all-in-one communication platform that ensures their users
30full privacy and secure message delivery.
31
32%package devel
33Summary: Development files for @PROJECT_NAME@
34Requires: %{name} = %{version}-%{release}
35
36%description devel
37Development package for @PROJECT_NAME@
38
39%package static
40Summary: @PROJECT_NAME@ static libraries
41Requires: %{name}-devel = %{version}-%{release}
42
43%description static
44@PROJECT_NAME@ static libraries
45
46%package -n tox-bootstrapd
47Summary: Tox DHT bootstrap daemon.
48Requires: %{name} = %{version}-%{release}
49Requires(pre): shadow-utils
50Requires(post): systemd-units
51Requires(preun): systemd-units
52Requires(postun): systemd-units
53
54%description -n tox-bootstrapd
55Tox 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
70mkdir -p %{buildroot}%{_unitdir}
71install -m 0644 other/rpm/tox-bootstrapd.service %{buildroot}%{_unitdir}/tox-bootstrapd.service
72install -d "%{buildroot}%{_sharedstatedir}/tox-bootstrapd"
73mkdir -p %{buildroot}%{_sysconfdir}
74install -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
80getent group tox-bootstrapd >/dev/null || groupadd -r tox-bootstrapd
81getent 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