summaryrefslogtreecommitdiff
path: root/other/rpm/toxcore.spec.in
blob: 3391d4b9472b610513bcb106a21360b424717c0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
%define full_name c-@PROJECT_NAME@
%define commit 0
%if "${commit}" != "0"
%define shortcommit %(c=%{commit}; echo ${c:0:7})
%endif

Name:           @PROJECT_NAME@
Version:        @PROJECT_VERSION@
Release:        1%{?dist}
Summary:        All-in-one secure communication platform

License:        GPLv3
URL:            https://github.com/TokTok/%{full_name}
%if "%{commit}" == "0"
Source0:        https://github.com/TokTok/%{full_name}/archive/v%{version}.tar.gz
%else
Source0:        https://github.com/TokTok/%{full_name}/archive/%{commit}/%{full_name}-%{shortcommit}.tar.gz
%endif

BuildRequires:  cmake
BuildRequires:  libvpx-devel
BuildRequires:  opus-devel
BuildRequires:  libsodium-devel
BuildRequires:  libconfig-devel
BuildRequires:  systemd-units

%description
With the rise of governmental monitoring programs, Tox, a FOSS initiative, aims
to be an easy to use, all-in-one communication platform that ensures their users
full privacy and secure message delivery.

%package devel
Summary:        Development files for @PROJECT_NAME@
Requires:       %{name} = %{version}-%{release}

%description devel
Development package for @PROJECT_NAME@

%package static
Summary:        @PROJECT_NAME@ static libraries
Requires:       %{name}-devel = %{version}-%{release}

%description static
@PROJECT_NAME@ static libraries

%package -n tox-bootstrapd
Summary:        Tox DHT bootstrap daemon.
Requires:       %{name} = %{version}-%{release}
Requires(pre):  shadow-utils
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units

%description -n tox-bootstrapd
Tox DHT bootstrap daemon.

%prep
%if "%{commit}" == "0"
%setup -q -n %{full_name}-%{version}
%else
%setup -q -n %{full_name}-%{commit}
%endif

%build
%cmake
%{__make} %{?_smp_mflags}

%install
%make_install
mkdir -p %{buildroot}%{_unitdir}
install -m 0644 other/rpm/tox-bootstrapd.service %{buildroot}%{_unitdir}/tox-bootstrapd.service
install -d "%{buildroot}%{_sharedstatedir}/tox-bootstrapd"
mkdir -p %{buildroot}%{_sysconfdir}
install -m 0644 other/bootstrap_daemon/tox-bootstrapd.conf %{buildroot}%{_sysconfdir}/tox-bootstrapd.conf

%check
%{__make} %{?_smp_mflags} test

%pre -n tox-bootstrapd
getent group tox-bootstrapd >/dev/null || groupadd -r tox-bootstrapd
getent passwd tox-bootstrapd >/dev/null || \
    useradd -r -g tox-bootstrapd -d /var/lib/tox-bootstrapd -s /sbin/nologin \
    -c "Account to run Tox's DHT bootstrap daemon" tox-bootstrapd

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n tox-bootstrapd
%systemd_post tox-bootstrapd.service

%postun -n tox-bootstrapd
%systemd_postun_with_restart tox-bootstrapd.service

%preun -n tox-bootstrapd
%systemd_preun tox-bootstrapd.service

%files
%defattr(-, root, root)
%doc LICENSE.md README.md CHANGELOG.md
%{_libdir}/libtoxcore.so*

%files devel
%defattr(-, root, root)
%{_includedir}/tox/
%{_libdir}/pkgconfig/toxcore.pc

%files static
%defattr(-, root, root)
%{_libdir}/libtoxcore.a

%files -n tox-bootstrapd
%defattr(-, root, root)
%{_bindir}/tox-bootstrapd
%{_unitdir}/tox-bootstrapd.service
%{_sharedstatedir}/tox-bootstrapd
%attr(-,tox-bootstrapd,tox-bootstrapd) %{_sharedstatedir}/tox-bootstrapd/
%config(noreplace) %{_sysconfdir}/tox-bootstrapd.conf


%changelog
* Sat Nov 25 2017 SmokedCheese <root@ubuntology.ru> - 0.0.0-2
- Rewrite spec file

* Tue Mar  3 2015 Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc> - 0.0.0-1
- initial package