Package tor: Specfile

  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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# hey Emacs, its -*- mode: rpm-spec; coding: cp1251; -*-

## Things users may want to change
#
# User (and group) name under which the Tor daemon runs
%define toruser _tor

# Root directory for chrooted environment, must not be
# same as real system root.
%define _tor_root %_localstatedir/%name

Name: tor
Version: 0.4.8.6
Release: alt1

Summary: Anonymizing overlay network for TCP (The onion router)
Group: System/Servers
License: BSD-3-Clause
Url: http://tor.eff.org/

Source0: http://tor.eff.org/dist/%name-%version.tar
Source1: %name.init
Source2: %name.systemd.service
Source3: %name.tmpfiles

Patch1:	 %name-0.4.8.4-source-date.patch

# Automatically added by buildreq on Sun Apr 17 2022
# optimized out: asciidoc docbook-dtds docbook-style-xsl glibc-kernheaders-generic glibc-kernheaders-x86 libgpg-error perl pkg-config python2-base python3 python3-base sh4 termutils tzdata xml-common xml-utils xsltproc xz
BuildRequires: asciidoc-a2x libcap-devel libevent-devel liblzma-devel libseccomp-devel libssl-devel libsystemd-devel libzstd-devel zlib-devel

%ifarch %ix86 x86_64 aarch64
BuildRequires: libseccomp-devel
%endif

%description
Tor is a connection-based low-latency anonymous communication system.
This package provides the "tor" program, which serves as both a client
and a relay node.

Applications connect to the local Tor proxy using the SOCKS
protocol. The local proxy chooses a path through a set of relays, in
which each relay knows its predecessor and successor, but no
others. Traffic flowing down the circuit is unwrapped by a symmetric
key at each relay, which reveals the downstream relay.

Warnings: Tor does no protocol cleaning.  That means there is a danger
that application protocols and associated programs can be induced to
reveal information about the initiator. Tor depends on Privoxy and
similar protocol cleaners to solve this problem. This is alpha code,
and is even more likely than released code to have anonymity-spoiling
bugs. The present network is very small -- this further reduces the
strength of the anonymity provided. Tor is not presently suitable
for high-stakes anonymity.

%prep
%setup
%patch1 -p2

# Set default configuration values
sed -i 's:^#Log notice file.*:Log notice file %_var/log/%name/%name.log:' src/config/torrc.sample.in
sed -i 's:^#DataDirectory.*:DataDirectory %_var/cache/%name:' src/config/torrc.sample.in

%build
%autoreconf

%configure --with-tor-user=%{toruser} --with-tor-group=%{toruser} --localstatedir=/var
%make_build

%install
%makeinstall_std

cp README.md README
install -pD -m755 %SOURCE1 %buildroot/%_initdir/%name
mv %buildroot/%_sysconfdir/%name/torrc.sample %buildroot/%_sysconfdir/%name/torrc
mkdir -p %buildroot%_tor_root
mkdir -p %buildroot%_var/{cache/%name,log/%name,}
mkdir -p %buildroot/run/%name
mkdir -p %buildroot%_tmpfilesdir

install -D -p -m 0644 %SOURCE2 %buildroot/%_unitdir/%{name}.service
sed 's/@TOR_USER@/%toruser/g' %SOURCE3 > %buildroot%_tmpfilesdir/%name.conf

mkdir -p %buildroot%_sysconfdir/logrotate.d
cat >%buildroot%_sysconfdir/logrotate.d/%name <<__EOF__
%_var/log/%name/*log {
	weekly
	rotate 5
	compress
	missingok
	notifempty
	sharedscripts
	postrotate
		%_initdir/%name condreload >/dev/null
	endscript
}
__EOF__

# Chroot config
#mkdir -p %buildroot%_tor_root{/lib,%_var/{nis,yp/binding,log},%_sysconfdir/%name}

%pre
/usr/sbin/groupadd -r -f %toruser
/usr/sbin/useradd -r -g %toruser -d %_tor_root -s /dev/null -c 'Tor user' %toruser >/dev/null 2>&1 ||:
if [ $1 -gt 1 ]; then
	chown %toruser:auth /etc/tcb/%toruser
	/usr/sbin/usermod -d %_tor_root %toruser
fi

%post
#%_sysconfdir/chroot.d/%name.all force
%post_service %name

%preun
%preun_service %name

#if [ $1 = 0 ]; then
#	rm -f %_tor_root/lib/* %_tor_root/var/yp/binding/*
#fi

%define docdir %_docdir/%name

%files
%dir %_sysconfdir/%name
%config(noreplace) %_sysconfdir/%name/torrc
%config %_sysconfdir/logrotate.d/%name
%{_unitdir}/%{name}.service
%_bindir/tor
%_bindir/tor-print-ed-signing-cert
# torify is moved to torsocks package to avoid automatic dependency on it
%exclude %_bindir/torify
%_bindir/tor-resolve
%_bindir/tor-gencert
%_man1dir/*.1.*
%_initdir/%name
%_tmpfilesdir/%name.conf
%dir %_datadir/%name
%_datadir/%name/geoip
%_datadir/%name/geoip6
%doc README LICENSE ChangeLog INSTALL doc/HACKING
%dir %docdir
%docdir/*.html


%defattr(640,root,%toruser,2710)
%_tor_root
%defattr(640,root,%toruser,3770)
%_var/log/%name
%defattr(640,root,%toruser,2730)
/run/%name
%defattr(640,%toruser,%toruser,2700)
%_var/cache/%name

%changelog
* Tue Sep 19 2023 Vladimir Didenko <cow@altlinux.ru> 0.4.8.6-alt1
- new version

* Thu Aug 31 2023 Vladimir Didenko <cow@altlinux.ru> 0.4.8.5-alt1
- new version

* Thu Aug 24 2023 Vladimir Didenko <cow@altlinux.ru> 0.4.8.4-alt1
- new version

* Thu Jul 27 2023 Vladimir Didenko <cow@altlinux.ru> 0.4.7.14-alt1
- new version

* Thu Jan 12 2023 Vladimir Didenko <cow@altlinux.ru> 0.4.7.13-alt1
- new version (fixes: TROVE-2022-002)

* Tue Dec 6 2022 Vladimir Didenko <cow@altlinux.ru> 0.4.7.12-alt1
- new version

* Thu Nov 10 2022 Vladimir Didenko <cow@altlinux.ru> 0.4.7.11-alt1
- new version

* Fri Aug 12 2022 Vladimir Didenko <cow@altlinux.ru> 0.4.7.10-alt1
- new version

* Sat Jun 18 2022 Hihin Ruslan <ruslandh@altlinux.ru> 0.4.7.8-alt1
- Update version
- CVE-2021-3838

* Wed Apr 27 2022 Vladimir Didenko <cow@altlinux.ru> 0.4.7.7-alt1
- new version
- use SOURCE_DATE_EPOCH variable from the build environment
- remove ubt macro (it is empty now)

* Mon Apr 18 2022 Hihin Ruslan <ruslandh@altlinux.ru> 0.4.7.6-alt0.rc
- fix tor.service and spec

* Mon Apr 18 2022 Hihin Ruslan <ruslandh@altlinux.ru> 0.4.7.6-alt0.git_616c06c0b2
- Develop version

* Thu Feb 10 2022 Vladimir Didenko <cow@altlinux.ru> 0.4.6.10-alt1
- new version

* Thu Dec 16 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.6.9-alt1
- new version

* Thu Oct 26 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.6.8-alt1
- new version

* Wed Aug 18 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.6.7-alt1
- new version (fixes CVE-2021-38385)

* Tue Jun 15 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.6.5-alt1
- new version (fixes CVE-2021-34548, CVE-2021-34549, CVE-2021-34550)

* Wed May 12 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.5.8-alt1
- new version

* Tue Mar 16 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.5.7-alt1
- new version (fixes CVE-2021-28089, CVE-2021-28090)

* Tue Feb 16 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.5.6-alt1
- new version

* Thu Feb 4 2021 Vladimir Didenko <cow@altlinux.ru> 0.4.4.7-alt1
- new version

* Sat Nov 28 2020 Vladimir D. Seleznev <vseleznv@altlinux.org> 0.4.4.6-alt2
- fix SysVinit service startup: place pidfile to /run/tor

* Fri Nov 13 2020 Vladimir Didenko <cow@altlinux.ru> 0.4.4.6-alt1
- new version (fixes TROVE-2020-005)

* Fri Sep 18 2020 Vladimir Didenko <cow@altlinux.ru> 0.4.4.5-alt1
- new version

* Thu Jul 9 2020 Vladimir Didenko <cow@altlinux.ru> 0.4.3.6-alt1
- new version (fixes CVE-2020-15572)

* Fri May 15 2020 Vladimir Didenko <cow@altlinux.ru> 0.4.3.5-alt1
- new version

* Wed Mar 18 2020 Vladimir Didenko <cow@altlinux.ru> 0.4.2.7-alt1
- new version (fixes CVE-2020-10592)

* Sat Feb 22 2020 Vladimir D. Seleznev <vseleznv@altlinux.org> 0.4.2.6-alt2
- build against libcap, libsystemd, liblzma and libzstd
- build against libseccomp on ix86, x86_64 and aarch64
- spec:
  + update license field according to SPDX format
  + remove packager field

* Thu Jan 30 2020 Vladimir Didenko <cow@altlinux.ru> 0.4.2.6-alt1
- new version

* Tue Dec 10 2019 Vladimir Didenko <cow@altlinux.ru> 0.4.2.5-alt1
- new version
- fix license name

* Thu Sep 19 2019 Vladimir Didenko <cow@altlinux.ru> 0.4.1.6-alt1
- new version

* Thu Sep 5 2019 Vladimir Didenko <cow@altlinux.ru> 0.4.1.5-alt1
- new version

* Mon May 6 2019 Vladimir Didenko <cow@altlinux.ru> 0.4.0.5-alt1
- new version

* Fri Feb 22 2019 Vladimir Didenko <cow@altlinux.ru> 0.3.5.8-alt1
- new version (fixes: CVE-2019-8955)

* Wed Jan 9 2019 Vladimir Didenko <cow@altlinux.ru> 0.3.5.7-alt1
- new version

* Fri Nov 23 2018 Vladimir Didenko <cow@altlinux.ru> 0.3.4.9-alt1
- new version

* Tue Sep 11 2018 Vladimir Didenko <cow@altlinux.ru> 0.3.4.8-alt1
- new version
- get rid of ubt macros

* Thu Aug 30 2018 Grigory Ustinov <grenka@altlinux.org> 0.3.3.9-alt1.S1.1
- NMU: Rebuild with new openssl 1.1.0.

* Mon Jul 16 2018 Vladimir Didenko <cow@altlinux.ru> 0.3.3.9-alt1
- new version

* Wed May 23 2018 Vladimir Didenko <cow@altlinux.ru> 0.3.3.6-alt1
- new version

* Tue Mar 13 2018 Vladimir Didenko <cow@altlinux.ru> 0.3.2.10-alt1
- new version (Fixes: CVE-2018-0491)

* Fri Jan 26 2018 Vladimir D. Seleznev <vseleznv@altlinux.org> 0.3.2.9-alt2
- add tmpfiles.d conf (fix service startup)

* Fri Jan 12 2018 Vladimir Didenko <cow@altlinux.ru> 0.3.2.9-alt1
- new version

* Fri Dec 1 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.1.9-alt1
- new version (Fixes: CVE-2017-8819, CVE-2017-8820, CVE-2017-8821,
CVE-2017-8822, CVE-2017-8823)

* Fri Oct 27 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.1.8-alt1
- new version

* Mon Sep 18 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.1.7-alt1
- new version (Fixes: CVE-2017-0380)

* Wed Aug 2 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.0.10-alt1
- new version

* Fri Jun 30 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.0.9-alt1
- new version (Fixes: CVE-2017-0377)

* Thu Jun 8 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.0.8-alt1
- new version

* Tue May 16 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.0.7-alt1
- new version

* Fri Apr 28 2017 Vladimir Didenko <cow@altlinux.ru> 0.3.0.6-alt1
- new version

* Mon Mar 6 2017 Vladimir Didenko <cow@altlinux.ru> 0.2.9.10-alt1
- new version

* Tue Jan 24 2017 Vladimir Didenko <cow@altlinux.ru> 0.2.9.9-alt1
- new version

* Tue Dec 20 2016 Vladimir Didenko <cow@altlinux.ru> 0.2.9.8-alt1
- new version

* Fri Dec 09 2016 Anton Farygin <rider@altlinux.ru> 0.2.8.11-alt1
- new version
- %%ubt macros added for easy backporting to stable branches

* Fri Dec 2 2016 Vladimir Didenko <cow@altlinux.ru> 0.2.8.10-alt1
- new version

* Tue Oct 18 2016 Vladimir Didenko <cow@altlinux.ru> 0.2.8.9-alt1
- new version that fixes security issue (closes: #32634)

* Tue Oct 4 2016 Vladimir Didenko <cow@altlinux.ru> 0.2.8.8-alt1
- new version

* Thu Aug 4 2016 Vladimir Didenko <cow@altlinux.ru> 0.2.8.6-alt3
- don't run unit tests (requires IPv6 support)

* Thu Aug 4 2016 Vladimir Didenko <cow@altlinux.ru> 0.2.8.6-alt2
- print log of failed test

* Wed Aug 3 2016 Vladimir Didenko <cow@altlinux.ru> 0.2.8.6-alt1
- new version

* Tue Dec 15 2015 Vladimir Didenko <cow@altlinux.ru> 0.2.7.6-alt2
- add sticky bit on log directory

* Mon Dec 14 2015 Vladimir Didenko <cow@altlinux.ru> 0.2.7.6-alt1
- new version

* Mon Jul 13 2015 Vladimir Didenko <cow@altlinux.ru> 0.2.6.10-alt1
- new version

* Fri Jun 12 2015 Vladimir Didenko <cow@altlinux.ru> 0.2.6.9-alt1
- new version

* Thu Apr 9 2015 Vladimir Didenko <cow@altlinux.ru> 0.2.5.12-alt1
- new version

* Wed Mar 25 2015 Vladimir Didenko <cow@altlinux.ru> 0.2.5.11-alt1
- new version

* Wed Dec 24 2014 Vladimir Didenko <cow@altlinux.ru> 0.2.5.10-alt2
- don't pack torify (moved to torsocks package)

* Fri Dec 05 2014 Vladimir Didenko <cow@altlinux.ru> 0.2.5.10-alt1
- new version
- systemd support

* Mon Oct 07 2013 Anton Farygin <rider@altlinux.ru> 0.2.3.25-alt1
- new version

* Fri Jun 24 2011 Dmitry V. Levin <ldv@altlinux.org> 0.2.1.30-alt1
- Blindly updated 0.2.1.30 (fixes numerous bugs including CVE-2011-0427).
- Updated build dependencies.

* Tue Dec 07 2010 Mykola Grechukh <gns@altlinux.ru> 0.2.1.27-alt2
- new version. Rebuilt with openssl-1.0b

* Fri Sep 24 2010 Mykola Grechukh <gns@altlinux.ru> 0.2.1.26-alt2
- added torify

* Wed Jun 09 2010 Mykola Grechukh <gns@altlinux.ru> 0.2.1.26-alt1
- updated to 0.2.1.26

* Tue Jun 30 2009 Sviatoslav Sviridov <svd@altlinux.ru> 0.2.0.35-alt2
- Added directory /usr/share/tor to file list

* Mon Jun 29 2009 Sviatoslav Sviridov <svd@altlinux.ru> 0.2.0.35-alt1
- Updated to 0.2.0.35
- Packaged files:
  + /usr/bin/tor-gencert
  + /usr/share/tor/geoip

* Wed Sep 10 2008 Sviatoslav Sviridov <svd@altlinux.ru> 0.2.0.31-alt1
- Updated to 0.2.0.31

* Sun Sep 02 2007 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.2.17-alt1
- Updated to 0.1.2.17

* Thu Aug 09 2007 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.2.16-alt1
- Updated to 0.1.2.16
  + Major security fixes: close immediately after missing authentication
    on control port; do not allow multiple authentication attempts.

* Tue Jul 24 2007 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.2.15-alt1
- Updated to 0.1.2.15

* Sun May 27 2007 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.2.14-alt1
- Updated to 0.1.2.14
- Packaged more tor specs

* Sun Dec 17 2006 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.1.26-alt1
- Updated to 0.1.1.26

* Sun Dec 10 2006 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.1.25-alt1
- Updated to 0.1.1.25

* Tue Oct 10 2006 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.1.24-alt1
- Updated to 0.1.1.24
- Removed doc files (disappeared in upstream): doc/CLIENTS, doc/FAQ,
  doc/tor-doc.css, doc/tor-doc.html

* Wed May 24 2006 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.1.20-alt1
- Updated to 0.1.1.20 (first stable release of the 0.1.1.x branch)

* Sun Feb 19 2006 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.0.17-alt1
- Updated to 0.1.0.17

* Wed Jan 04 2006 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.0.16-alt1
- Updated to 0.1.0.16

* Mon Oct 10 2005 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.0.15-alt1
- Updated to 0.1.0.15

* Sat Aug 27 2005 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.0.14-alt1
- Updated to 0.1.0.14

* Wed Jul 13 2005 Sviatoslav Sviridov <svd@altlinux.ru> 0.1.0.11-alt1
- First build for ALT Linux
- Known problems:
  + service is not being chrooted