-
Notifications
You must be signed in to change notification settings - Fork 2
/
snort.spec
516 lines (412 loc) · 19.7 KB
/
snort.spec
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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# $Id$
# Snort.org's SPEC file for Snort
# Other useful bits
%define SnortRulesDir %{_sysconfdir}/snort/rules
%define noShell /bin/false
%define vendor Snort.org
%define for_distro RPMs
%define gitCommitIdSuffix 20190221.gita3afcbe
%define release 1
%define realname snort
# Look for a directory to see if we're building under cAos
# Exit status is usually 0 if the dir exists, 1 if not, so
# we reverse that with the '!'
%define caos %([ ! -d /usr/lib/rpm/caos ]; echo $?)
%if %{caos}
# We are building for cAos (www.caosity.org) and the autobuilder doesn't
# have command line options so we have to fake the options for whatever
# packages we actually want here, in addition to tweaking the package
# info.
%define vendor cAos Linux
%define for_distro RPMs for cAos Linux
%define release 1.caos
%endif
Name: %{realname}
Version: 3.0.0
Summary: An open source Network Intrusion Detection System (NIDS)
Epoch: 1
Release: %{release}.%{gitCommitIdSuffix}%{dist}
Group: Applications/Internet
License: GPL
Url: http://www.snort.org/
Source0: %{realname}-%{version}-%{gitCommitIdSuffix}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Official Snort.org %{for_distro}
Vendor: %{vendor}
Requires: daq >= 2.2.2, libdnet, hwloc, luajit, openssl, libpcap, pcre, hyperscan, flatbuffers, libuuid, gperftools-libs, zlib
#, lzma-libs
#, libsafec
BuildRequires: cmake, gcc, gcc-c++, daq-devel >= 2.2.2, libdnet-devel, hwloc-devel, luajit-devel, openssl-devel, libpcap-devel, pcre-devel, hyperscan-devel, flatbuffers-devel, glibc-headers, libuuid-devel, gperftools, gperftools-devel, zlib-devel, asciidoc, asciidoc-latex, dblatex
#, lzma-devel
#, libsafec-devel
%description
Snort is an open source network intrusion detection system, capable of
performing real-time traffic analysis and packet logging on IP networks.
It can perform protocol analysis, content searching/matching and can be
used to detect a variety of attacks and probes, such as buffer overflows,
stealth port scans, CGI attacks, SMB probes, OS fingerprinting attempts,
and much more.
Snort has three primary uses. It can be used as a straight packet sniffer
like tcpdump(1), a packet logger (useful for network traffic debugging,
etc), or as a full blown network intrusion detection system.
You MUST edit /etc/snort/snort.conf to configure snort before it will work!
Please see the documentation in %{_docdir}/%{realname}-%{version} for more
information on snort features and configuration.
%package devel
Summary: Development tools for Snort
Requires: %{name} == %{version}
%description devel
Development tools for Snort
%prep
%setup -q -n %{realname}3
%build
#%{__sed} -i -r -e '/-DCMAKE_EXPORT_COMPILE_COMMANDS/ a -DLIBLZMA_LIBRARIES=/usr/lib64/liblzma.so.5 \\' ./configure_cmake.sh
CFLAGS="$RPM_OPT_FLAGS"
export AM_CFLAGS="-g -O2"
./configure_cmake.sh --prefix=%{_prefix} --disable-static-daq --enable-hardened-build --enable-pie --enable-tcmalloc
# --disable-gdb
cd ./build
%{make_build} all
%install
cd ./build
%{make_install}
%{__mv} $RPM_BUILD_ROOT%{_libdir}/%{realname}/daqs $RPM_BUILD_ROOT%{_libdir}/daq
[[ "X$RPM_BUILD_ROOT" = "X/" ]] || %{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/%{realname}
%{__mkdir_p} $RPM_BUILD_ROOT%{_sbindir}
%{__mv} $RPM_BUILD_ROOT%{_bindir}/%{realname} $RPM_BUILD_ROOT%{_sbindir}/
%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/%{realname}
%{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/%{realname} $RPM_BUILD_ROOT%{_sysconfdir}/
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && %{__rm} -rf $RPM_BUILD_ROOT%{_prefix}/etc
%{__mkdir_p} $RPM_BUILD_ROOT%{SnortRulesDir}
%{__mv} $RPM_BUILD_ROOT%{_docdir}/%{realname} $RPM_BUILD_ROOT%{_docdir}/%{realname}-%{version}
%{__mkdir_p} $RPM_BUILD_ROOT%{_var}/log/snort
%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
%pre
# Don't do all this stuff if we are upgrading
if [ $1 = 1 ] ; then
/usr/sbin/groupadd snort 2> /dev/null || true
/usr/sbin/useradd -M -d %{_var}/log/snort -s %{noShell} -c "Snort" -g snort snort 2>/dev/null || true
fi
%postun
# Only do this if we are actually removing snort
if [ $1 = 0 ] ; then
if [ -L %{_sbindir}/snort ]; then
%__rm -f %{_sbindir}/snort
fi
/usr/sbin/userdel snort 2>/dev/null
fi
%files
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/daq/*.so
%attr(0755,root,root) %{_bindir}/appid_detector_builder.sh
%attr(0755,root,root) %{_bindir}/fbstreamer
%attr(0755,root,root) %{_bindir}/u2boat
%attr(0755,root,root) %{_bindir}/u2spewfoo
%attr(0755,root,root) %{_bindir}/snort2lua
%attr(0755,root,root) %{_sbindir}/%{realname}
%attr(0755,root,root) %dir %{_sysconfdir}/%{realname}
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{realname}/*.lua
%attr(0755,root,root) %dir %{SnortRulesDir}
%attr(0644,root,root) %{_includedir}/%{realname}/lua/*.lua
%attr(0755,snort,snort) %dir %{_var}/log/snort
%doc %{_docdir}/%{realname}-%{version}
%files devel
%{_libdir}/pkgconfig/%{realname}.pc
%{_includedir}/%{realname}/*/*.h
%{_includedir}/%{realname}/*/*/*.h
################################################################
# Thanks to the following for contributions to the Snort.org SPEC file:
# Henri Gomez <[email protected]>
# Chris Green <[email protected]>
# Karsten Hopp <[email protected]>
# Tim Powers <[email protected]>
# William Stearns <[email protected]>
# Hugo van der Kooij <[email protected]>
# Wim Vandersmissen <[email protected]>
# Dave Wreski <[email protected]>
# JP Vossen <[email protected]>
# Daniel Wittenberg <[email protected]>
# Jeremy Hewlett <[email protected]>
# Vlatko Kosturjak <[email protected]>
%changelog
* Sun Mar 10 2019 Nobuyuki Ito <[email protected]> - 3.0.0.20190221.gita3afcbe
- Fixed spec file for snort3 and Fedora 29
* Thu Jul 03 2014 Dilbagh Chahal <[email protected]> 2.9.7
- added --with openappid command line option
* Wed May 09 2012 Todd Wease <[email protected]> 2.9.3
- Removed --enable-decoder-preprocessor-rules since this is now the default
- behavior and not configurable.
* Fri Apr 27 2012 Russ Combs <[email protected]> 2.9.3
- Removed schemas related foo.
* Wed Mar 30 2012 Steve Sturges <[email protected]> 2.9.3
- Removed --with flexresp, --with inline, database output specific builds.
* Wed Apr 02 2008 Steve Sturges <[email protected]> 2.8.3
- Added --enable-targetbased --enable-decoder-preprocessor-rules by default.
* Wed Apr 02 2008 Steve Sturges <[email protected]> 2.8.1
- Added ssl
* Fri Aug 03 2007 Russ Combs <[email protected]> 2.8.0
- Removed README.build_rpms from description
- Removed 2nd "doc/" component from doc install path
- Changed doc file attributes to mode 0644
- Moved schemas from doc to data dir
- Added installation of schemas/create_*
- Removed redundant '/'s from mkdir path specs
- Eliminated find warning by moving -maxdepth ahead of -type
- Fixed "warning: File listed twice: ..." for libsf so files
* Wed Feb 28 2007 Steve Sturges <[email protected]> 2.7.0
- Removed smp flags to make command
* Wed Jan 17 2007 Steve Sturges <[email protected]> 2.7.0
- Updated version to 2.7.0
* Tue Nov 07 2006 Steve Sturges <[email protected]> 2.6.0
- Updated version to 2.6.1
* Thu Aug 31 2006 Steve Sturges <[email protected]> 2.6.0
- Added dynamic DNS preprocessor
* Wed May 24 2006 Steve Sturges <[email protected]> 2.6.0
- Updated to version 2.6.0
* Fri Apr 14 2006 Justin Heath <[email protected]> 2.6.0RC1
- Added conf fix for dynamic engine paths
- Added conf fix for dynamic preprocessors paths
- Added dynamic attributes in file list
- Added epoch to Requires for postgres, oracle and unixodbc
- Removed rule/signature references as these are not distributed with this tarball
* Thu Apr 13 2006 Steve Sturges <[email protected]> 2.6.0RC1
- Updated to 2.6.0RC1
- Added targets for dynamic engine
- Added targets for dynamic preprocessors
* Sun Dec 11 2005 Vlatko Kosturjak <[email protected]> 2.6.0RC1
- Added unixODBC support
* Sun Oct 16 2005 Marc Norton <[email protected]> 2.4.3
- Fixed buffer overflow in bo preprocessor
- Added alert for potential buffer overflow attack against snort
- Added noalert and drop options for all bo preprocessor events
* Fri Jul 22 2005 Martin Roesch <[email protected]> 2.4.0
- Modified to reflect rules not being distributed with Snort distros
* Tue May 03 2005 Daniel Wittenberg <[email protected]> 2.4.0RC1
- Removed more Fedora-specific options
- Renamed spec from snort.org.spec to snort.spec
- Removed CHANGES.rpms file since we have a changelog here no sense
- in maintaining two of them
- Replaced a ton of program names with macros to make more portable
- Removed all references to [email protected] since it just gets used
- for spam so the address is being nuked
- Updates to inline support for 2.4.0 Release and fedora changes
- Replaced initDir with system-provided _initdir macro for more portability
- Added Epoch back in so that way upgrades will work correctly. It will be
- removed at some point breaking upgrades for that version
* Tue Mar 29 2005 Jeremy Hewlett <[email protected]>
- Added Inline capability to RPMs. Thanks Matt Brannigan
- for helping with the RPM foo.
* Fri Mar 25 2005 Jeremy Hewlett <[email protected]>
- Add schemas to rpm distro
- Add sharedscripts to logrotate
- Remove installing unnecessary contrib remnants
* Sun Mar 13 2005 Daniel Wittenberg <[email protected]>
- Updates to conform to new Fedora Packageing guidelines
* Wed Dec 1 2004 Jeff Ball <[email protected]>
- Added initDir and noShell for more building compatibility.
* Thu Nov 17 2004 Brian Caswell <[email protected]> 2.3.0RC1
- handle the moving of RPM and the axing of contrib
* Sat Jun 03 2004 JP Vossen <[email protected]>
- Bugfix for 'snortd condrestart' redirect to /dev/null in %postun
* Wed May 12 2004 JP Vossen <[email protected]>
- Added code for cAos autobuilder
- Added buildrequires and requires for libpcap
* Thu May 06 2004 Daniel Wittenberg <[email protected]>
- Added JP's stats option to the standard rc script
* Sat Mar 06 2004 JP Vossen <[email protected]>
- Added gen-msg.map and sid-msg.map to /etc/snort
* Sat Feb 07 2004 Daniel Wittenberg <[email protected]>
- Applied postun/snortd patches from Nick Urbanik <[email protected]
* Mon Dec 22 2003 Daniel Wittenberg <[email protected]>
- Added threshold.conf, unicode.map and generators to /etc/snort thanks
- to notes from Nick Urbanik <[email protected]>
* Sat Dec 20 2003 Daniel Wittenberg <[email protected]> 2.1.0-2
- Added condrestart option to rc script from patch by
- Nick Urbanik <[email protected]>
- Fixed condrestart bug for installs
- Fixed gzip bug that happens on some builds
* Tue Dec 10 2003 JP Vossen <[email protected]>
- Removed flexresp from plain rpm package description
- Added a line about pcre to the package description
- Trivial tweaks to package description
* Sat Nov 29 2003 Daniel Wittenberg <[email protected]> 2.1.0-1
- Applied some updates from [email protected]
- Applied some updates from Torsten Schuetze <[email protected]>
- Applied some updates from Nick Urbanik <[email protected]>
- Fixed ALERTMODE rc script error reported by [email protected]
- Fixed CONF rc script error reported by ??
- Gzip signature files to save some space
- Added BuildRequires pcre-devel and Requires pcre
- Re-did %post <package> sections so the links are added and removed
- correctly when you add/remove various packages
* Fri Nov 07 2003 Daniel WIttenberg <[email protected]>
- Updated snort.logrotate
* Thu Nov 06 2003 Daniel Wittenberg <[email protected]> 2.0.4
- Minor updates for 2.0.4
* Tue Nov 04 2003 Daniel Wittenberg <[email protected]> 2.0.3
- Updated for 2.0.3
- Removed 2.0.2 patch
- Remove flexresp2 as it caused too many build problems and doesn't work
- cleanly with 2.0.3 anyway
- Minor documentation updated for 2.0.3
* Mon Oct 20 2003 Daniel Wittenberg <[email protected]> 2.0.2-6
- New release version
- Changed /etc/rc.d/init.d to /etc/init.d for more compatibility
* Fri Oct 17 2003 Daniel Wittenberg <[email protected]>
- Changed as many hard-coded references to programs and paths to use
- standard defined macros
* Fri Oct 10 2003 Daniel Wittenberg <[email protected]>
- Include SnortRulesDir in %%files section
- Added classification.config and reference.config in %%files section
- Minor cleanup of the for_fedora macro
* Sat Oct 04 2003 Dainel Wittenberg <[email protected]>
- Nuked post-install message as it caused too many problems
- Changed default ruledir to /etc/snort/rules
- Fixed problem with non-snort-plain symlinks getting created
* Fri Oct 03 2003 Dainel Wittenberg <[email protected]>
- Somehow the snort.logrotate cvs file got copied into the build tree
- and the wrong file got pushed out
- snort.logrotate wasn't included in the %%files section, so added
- it as a config(noreplace) file
* Thu Oct 02 2003 Dainel Wittenberg <[email protected]> 2.0.2-5
- Added --with fedora for building Fedora RPM's
- Removed references to old snort config patch
- Added noreplace option to /etc/rc.d/init.d/snortd just in case
- Gzip the man page to save (a small tiny) amount of space and make it
- more "standard"
- Added version number to changelog entries to denote when packages were
- released
* Wed Oct 01 2003 Dainel Wittenberg <[email protected]>
- Fixed permission problem with /etc/snort being 644
- Added noreplace option to /etc/sysconfig/snort
* Fri Sep 26 2003 Daniel Wittenberg <[email protected]>
- Fixed incorrect Version string in cvs version of the spec
- Added snort logrotate file
- Removed |more from output as it confuses some package managers
* Fri Sep 23 2003 Daniel Wittenberg <[email protected]> 2.0.2-4
- Released 2.0.2-3 and then 2.0.2-4
* Sat Sep 20 2003 Daniel Wittenberg <[email protected]>
- Added --with flexresp2 build option
* Fri Sep 19 2003 Daniel Wittenberg <[email protected]> 2.0.2-2
- Gave into JP and changed version back to stable :)
* Fri Sep 19 2003 Daniel Wittenberg <[email protected]>
- Fixed problems in snortd with "ALL" interfaces working correctly
- Removed history from individual files as they will get too big
- and unreadable quickly
* Thu Sep 18 2003 Daniel Wittenberg <[email protected]> 2.0.2-1
- Updated for 2.0.2 and release 2.0.2-1
* Tue Aug 26 2003 JP Vossen <[email protected]>
- Added code to run autojunk.sh for CVS tarball builds
* Mon Aug 25 2003 JP Vossen <[email protected]>
- Added missing comments to changelog
* Sun Aug 20 2003 Daniel Wittenberg <[email protected]>
- Moved snortd and snortd.sysconfig to contrib/rpm
- Changed contrib install to a cp -a so the build stops complaining
* Mon Aug 11 2003 JP Vossen <[email protected]>
- Removed the commented patch clutter and a TO DO note
- Fussed with white space
* Sun Aug 10 2003 Daniel Wittenberg <[email protected]>
- Fixed a couple minor install complaints
- userdel/groupdel added back into %%postun
- useradd/groupadd added to %%pre
* Sat Aug 9 2003 JP Vossen <[email protected]>
- Doubled all percent signs in this changelog due to crazy RH9 RPM bug.
- http://www.fedora.us/pipermail/fedora-devel/2003-June/001561.html
- http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=88620
- Turn off rpm debug due to RH9 RPM issue
- http://www.cs.helsinki.fi/linux/linux-kernel/2003-15/0763.html
- Removed unnecessary SourceX: since they will be in the tarball
* Thu Aug 7 2003 JP Vossen <[email protected]>
- Changed perms from 755 to 644 for %%{_mandir}/man8/snort.8*
* Sun Aug 3 2003 JP Vossen <[email protected]>
- Removed the conf patch (again) as we moved the funcationality
- Added sed to buildrequires and sed it to fix RULE_PATH
- Removed Dan's SPEC code that made a default sysconfig/snort file.
* Sun Aug 3 2003 JP Vossen <[email protected]>
- Trivial changes and additions to documentation and references
- Added --with flexresp option
- Changed libnet buildrequires per Chris
- Added docs and contrib back in, and moved sig docs out of doc.
- Moved CSV and signature 'fixes' into %%install where they should have
- been. Also fixed them.
- Added Dan's new snortd and snort.sysconfig
- Commented out alternate method of creating /etc/sysconfig/snort
- Created %%{OracleHome}
- Added BuildRequires: findutils
- Uncommented the patch and added the patch file
* Fri Jul 26 2003 Daniel Wittenberg <[email protected]>
- commented out the patch for now since it doesn't exist
- if doing a new install echo "INTERFACE=eth0" > /etc/sysconfig/snort
- changed --with-libpcap-includes=/usr/include/pcap to /usr/include since
- that is where the libpcap-snort rpm Chris sent puts things
- added missing " at the end of the SNORT_BASE_CONFIG
- minor change to the ./configure for plain so it actually works
- during an rpm -e of snort do a rm -f to make it a little more quiet in
- case of problems
- massive re-write of multi-package build system
- initial support for compiling with Oracle
* Sun Jul 20 2003 JP Vossen <[email protected]>
- Took over maintenance of Snort.org RPM releases just before v2.0.1
- Various cleanup of SPEC file and changes to support building from tarball
- Removed some old packages (like SNMP and Bloat), per Chris
- First attempt at using --with option for multi-package build system
- Added a patch to snort.conf for $RULE_PATH and default output plugins
* Wed Sep 25 2002 Chris Green <[email protected]>
- updated to 1.9.0
* Tue Nov 6 2001 Chris Green <[email protected]>
- merged in Hugo's changes
- updated to 1.8.3
- fixing symlinks on upgrades
* Tue Nov 6 2001 Hugo van der Kooij <[email protected]>
- added libpcap to the list as configure couldn't find it on RedHat 7.2
- added several packages to the build requirements
* Fri Nov 2 2001 Chris Green <[email protected]>
- updated to 1.8.2-RELEASE
- adding SQL defines
- created tons of packages so that all popular snort configs are accounted for
* Sat Aug 18 2001 Chris Green <[email protected]>
- 1.8.1-RELEASE
- cleaned up enough to release to general public
* Tue May 8 2001 Chris Green <[email protected]>
- moved to 1.8cvs
- changed rules files
- removed initial configuration
* Mon Nov 27 2000 Chris Green <[email protected]>
- removed strip
- upgrade to cvs version
- moved /var/snort/dev/null creation to install time
* Tue Nov 21 2000 Chris Green <[email protected]>
- changed to %%{SnortPrefix}
- upgrade to patch2
* Mon Jul 31 2000 Wim Vandersmissen <[email protected]>
- Integrated the -t (chroot) option and build a /home/snort chroot jail
- Installs a statically linked/stripped snort
- Updated /etc/rc.d/init.d/snortd to work with the chroot option
* Tue Jul 25 2000 Wim Vandersmissen <[email protected]>
- Added some checks to find out if we're upgrading or removing the package
* Sat Jul 22 2000 Wim Vandersmissen <[email protected]>
- Updated to version 1.6.3
- Fixed the user/group stuff (moved to %%post)
- Added userdel/groupdel to %%postun
- Automagically adds the right IP, nameservers to /etc/snort/rules.base
* Sat Jul 08 2000 Dave Wreski <[email protected]>
- Updated to version 1.6.2
- Removed references to xntpd
- Fixed minor problems with snortd init script
* Fri Jul 07 2000 Dave Wreski <[email protected]>
- Updated to version 1.6.1
- Added user/group snort
* Sat Jun 10 2000 Dave Wreski <[email protected]>
- Added snort init.d script (snortd)
- Added Dave Dittrich's snort rules header file (ruiles.base)
- Added Dave Dittrich's wget rules fetch script (check-snort)
- Fixed permissions on /var/log/snort
- Created /var/log/snort/archive for archival of snort logs
- Added post/preun to add/remove snortd to/from rc?.d directories
- Defined configuration files as %%config
* Tue Mar 28 2000 William Stearns <[email protected]>
- Quick update to 1.6.
- Sanity checks before doing rm-rf in install and clean
* Fri Dec 10 1999 Henri Gomez <[email protected]>
- 1.5-0 Initial RPM release