Пакет dspam: 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
%define priority 50

Name: dspam
Version: 3.9.0
Release: alt1.beta2.2.qa1
Summary: DSPAM is an open-source, freely available anti-spam solution
License: GPL
Group:	 Networking/Mail
Source0: %name-%version.tar
Source1: %name.init
Source2: %name-clean
Source3: %name.http
Source4: dspam_corpus
Source5: train.pl
Source6: %name.logrotate

URL: http://dspam.sourceforge.net/
Packager: Alexey Shentzev <ashen@altlinux.ru>
Requires: %name-storage = %version-%release

#hash storage always enabled
%def_with    mysql
%def_with    pgsql
%def_with    sqlite3
%def_with    hash

%def_without libdb3
%def_without libdb4

BuildPreReq: zlib-devel
BuildPreReq: gcc-c++
BuildPreReq: libstdc++-devel

%{?_with_libdb3:BuildPreReq: libdb3-devel}
%{?_with_libdb4:BuildPreReq: libdb4-devel}
%{?_with_sqlite3:BuildPreReq: libsqlite3-devel}
%{?_with_mysql:BuildPreReq: libMySQL-devel}
%{?_with_pgsql:BuildPreReq: libpq-devel postgresql-devel}

BuildRequires: glibc-devel-static

%description
DSPAM is an open-source, freely available anti-spam solution designed to combat
unsolicited commercial email using advanced statistical analysis. In short,
DSPAM filters spam by learning what spam is and isn't by learning
each user's individual mail behavior. This allows DSPAM to provide
highly-accurate, personalized filtering for each user on even a large system
and provides an administratively maintenance free solution capable of learning
each user's email behaviors with very few false positives.

You need to install one of storage package (%name-*).

%if_with hash
%package hash
Summary: DSPAM is an open-source, freely available anti-spam solution (hash storage)
Group: Networking/Mail
Requires: %name = %version-%release
Provides: %name-storage = %version-%release
%description hash
DSPAM is an open-source, freely available anti-spam solution designed to combat
unsolicited commercial email using advanced statistical analysis. In short,
DSPAM filters spam by learning what spam is and isn't by learning
each user's individual mail behavior. This allows DSPAM to provide
highly-accurate, personalized filtering for each user on even a large system
and provides an administratively maintenance free solution capable of learning
each user's email behaviors with very few false positives.
%endif #with hash

%if_with sqlite3
%package sqlite3
Summary: DSPAM is an open-source, freely available anti-spam solution (SQLite3 storage)
Group: Networking/Mail
Requires: %name = %version-%release
Provides: %name-storage = %version-%release
%description sqlite3
DSPAM is an open-source, freely available anti-spam solution designed to combat
unsolicited commercial email using advanced statistical analysis. In short,
DSPAM filters spam by learning what spam is and isn't by learning
each user's individual mail behavior. This allows DSPAM to provide
highly-accurate, personalized filtering for each user on even a large system
and provides an administratively maintenance free solution capable of learning
each user's email behaviors with very few false positives.
%endif #with sqlite3

%if_with pgsql
%package pgsql
Summary: DSPAM is an open-source, freely available anti-spam solution (PostgreSQL storage)
Group: Networking/Mail
Requires: %name = %version-%release
Provides: %name-storage = %version-%release
%description pgsql
DSPAM is an open-source, freely available anti-spam solution designed to combat
unsolicited commercial email using advanced statistical analysis. In short,
DSPAM filters spam by learning what spam is and isn't by learning
each user's individual mail behavior. This allows DSPAM to provide
highly-accurate, personalized filtering for each user on even a large system
and provides an administratively maintenance free solution capable of learning
each user's email behaviors with very few false positives.
%endif #with pgsql

%if_with mysql
%package mysql
Summary: DSPAM is an open-source, freely available anti-spam solution (MySQL storage)
Group: Networking/Mail
Requires: %name = %version-%release
Provides: %name-storage = %version-%release
%description mysql
DSPAM is an open-source, freely available anti-spam solution designed to combat
unsolicited commercial email using advanced statistical analysis. In short,
DSPAM filters spam by learning what spam is and isn't by learning
each user's individual mail behavior. This allows DSPAM to provide
highly-accurate, personalized filtering for each user on even a large system
and provides an administratively maintenance free solution capable of learning
each user's email behaviors with very few false positives.
%endif #with mysql

%package -n lib%name
Summary: The DSPAM core processing engine
Group: Development/C
%description -n lib%name
The DSPAM core processing engine, also known as libdspam, provides all primary
spam filtering functions.  The engine is linked to other dspam components (or
shells) to provide functionality. libdspam is capable of being linked
in with any other application as a "drop-in" to provide spam filtering to
mail clients, other anti-spam tools, and other such type projects that
would benefit from its use.  Both static and shared versions are built by
libtool and installed upon 'make install'.

%package -n lib%name-devel
Summary: The DSPAM core processing engine
Group: Development/C
Requires: lib%name = %version-%release
%description -n lib%name-devel
The DSPAM core processing engine, also known as libdspam, provides all primary
spam filtering functions.  The engine is linked to other dspam components (or
shells) to provide functionality. libdspam is capable of being linked
in with any other application as a "drop-in" to provide spam filtering to
mail clients, other anti-spam tools, and other such type projects that
would benefit from its use.  Both static and shared versions are built by
libtool and installed upon 'make install'.

%package webui
Summary: The DSPAM core processing engine
Group: Development/C
BuildPreReq: perl-CGI perl-GD-Text perl-GD-Graph3d
Requires: %name = %version-%release webserver perl-CGI perl-GD-Text perl-GD-Graph3d
Provides: perl(configure.pl)
%description webui
The DSPAM core processing engine, also known as libdspam, provides all primary
spam filtering functions. The engine is web user interface.

%prep
%setup -q

%build
STORAGES_LIST="hash_drv"
STORAGES_INCLUDE_LIST=""
%if_with pgsql
STORAGES_LIST="${STORAGES_LIST},pgsql_drv"
STORAGES_INCLUDE_LIST="${STORAGES_INCLUDE_LIST} --with-pgsql-includes=%_includedir/pgsql/"
%endif #with pgsql

%if_with mysql
STORAGES_LIST="${STORAGES_LIST},mysql_drv"
STORAGES_INCLUDE_LIST="${STORAGES_INCLUDE_LIST} --with-mysql-includes=%_includedir/mysql/"
%endif #with mysql

%if_with sqlite3
STORAGES_LIST="${STORAGES_LIST},sqlite3_drv"
%endif #with sqlite3

%if_with libdb4
STORAGES_LIST="${STORAGES_LIST},libdb4_drv"
%endif #with libdb4

%autoreconf -fisv
%configure --with-storage-driver=${STORAGES_LIST} ${STORAGES_INCLUDE_LIST} \
           --disable-dependency-tracking \
	   --enable-daemon \
           --enable-neural-networking \
	   --enable-preferences-extension \
           --enable-virtual-users \
	   --enable-long-usernames \
	   --enable-large-scale \
	   --with-gnu-ld \
	   --with-pic \
	   --enable-homedir \
	   --with-dspam-home=%_localstatedir/%name \
	   --enable-clamav \
	   --enable-syslog \
	   --sysconfdir=%_sysconfdir/%name \
	   --with-logdir=%_logdir/%name \
	   --with-logfile=%_logdir/%name/%name.log

%make CFLAGS="%optflags %optflags_shared"

%install
%__mkdir_p %buildroot%_localstatedir/%name
%make DESTDIR=%buildroot install
%__mkdir_p %buildroot/%_initdir
%__install -m 0755 %SOURCE1 %buildroot%_initdir/%name
%__mkdir_p %buildroot%_sysconfdir/cron.daily
%__install -m 0755 %SOURCE2 %buildroot%_sysconfdir/cron.daily
%__mkdir_p %buildroot/var/lib/%name
%__mkdir_p %buildroot/%_logdir/%name

%__mkdir_p %buildroot/%_docdir/%name-%version
cp CHANGELOG %buildroot/%_docdir/%name-%version/
cp LICENSE %buildroot/%_docdir/%name-%version/
cp README.* %buildroot/%_docdir/%name-%version/
cp UPGRADING %buildroot/%_docdir/%name-%version/
cp src/%name.conf %buildroot%_sysconfdir/%name/%name.conf
%__mkdir_p %buildroot%_docdir/%name-%version/doc
cp doc/*.txt %buildroot%_docdir/%name-%version/doc
%__install -m 0755 %SOURCE4 %buildroot/%_bindir/

%__mkdir_p %buildroot/%_datadir/%name-%version/txt
cp txt/*.txt %buildroot/%_datadir/%name-%version/txt
%__install -m 0755 %SOURCE5 %buildroot/%_datadir/%name-%version


%__mkdir_p %buildroot/%_datadir/%name-%version/sql/mysql
cp src/tools.mysql_drv/*.sql %buildroot/%_datadir/%name-%version/sql/mysql/
%__mkdir_p %buildroot/%_datadir/%name-%version/sql/pgsql
cp src/tools.pgsql_drv/*.sql %buildroot/%_datadir/%name-%version/sql/pgsql/
%__mkdir_p %buildroot/%_datadir/%name-%version/sql/sqlite
cp src/tools.sqlite_drv/*.sql %buildroot/%_datadir/%name-%version/sql/sqlite/

%__mkdir_p %buildroot%_datadir/%name-%version/webui/cgi-bin
cp webui/cgi-bin/*.cgi %buildroot%_datadir/%name-%version/webui/cgi-bin/
cp webui/cgi-bin/*.pl %buildroot%_datadir/%name-%version/webui/cgi-bin/
cp webui/cgi-bin/*.prefs %buildroot%_datadir/%name-%version/webui/cgi-bin/
cp webui/cgi-bin/*.txt %buildroot%_datadir/%name-%version/webui/cgi-bin/
cp webui/cgi-bin/admins %buildroot%_datadir/%name-%version/webui/cgi-bin/
%__mkdir_p %buildroot%_datadir/%name-%version/webui/cgi-bin/templates
cp webui/cgi-bin/templates/*.html %buildroot%_datadir/%name-%version/webui/cgi-bin/templates/
%__mkdir_p %buildroot%_datadir/%name-%version/webui/htdocs
cp webui/htdocs/base.css %buildroot%_datadir/%name-%version/webui/htdocs/
cp webui/htdocs/dspam-logo-small.gif %buildroot%_datadir/%name-%version/webui/htdocs/
%__install -m 0644 %SOURCE3 %buildroot%_datadir/%name-%version/

install -pD %SOURCE6 %buildroot%_sysconfdir/logrotate.d/%name

%files
%_bindir/*
%exclude %_bindir/css*
%exclude %_bindir/dspam_pg2int8
%config(noreplace) %_sysconfdir/%name/%name.conf
%_initdir/%name
%attr(0750,root,mail) %config(noreplace) %_sysconfdir/cron.daily/%name-clean
%attr(0640,root,mail) %config(noreplace) %_sysconfdir/logrotate.d/%name
%_datadir/%name-%version/txt/*
%_datadir/%name-%version/train.pl
%_man1dir/*
%doc %_docdir/%name-%version/*
%attr(0750,root,mail) %_bindir/%name
%attr(0770,root,mail) /var/lib/%name
%attr(0770,root,mail) %_logdir/%name
%dir %_docdir/dspam-%version

%files -n lib%name
%_libdir/lib%name.so.*
%exclude %_libdir/lib*.a

%files -n lib%name-devel
%dir %_includedir/%name
%_includedir/%name/*
%_man3dir/*
%_libdir/lib%name.so
%_libdir/pkgconfig/%name.pc

%if_with hash
%files hash
%_bindir/css*
%_libdir/%name/libhash_drv.so*
%endif #with hash

%if_with sqlite3
%files sqlite3
%_libdir/%name/libsqlite3_drv.so
%_libdir/%name/libsqlite3_drv.so.*
%_datadir/%name-%version/sql/sqlite/*

%endif #with sqlite3

%if_with pgsql
%files pgsql
%_bindir/dspam_pg2int8
%_libdir/%name/libpgsql_drv.so
%_libdir/%name/libpgsql_drv.so.*
%_datadir/%name-%version/sql/pgsql/*
%endif #with pgsql

%if_with mysql
%files mysql
%_libdir/%name/libmysql_drv.so
%_libdir/%name/libmysql_drv.so.*
%_datadir/%name-%version/sql/mysql/*
%endif #with mysql

%files webui
%_datadir/%name-%version/webui/cgi-bin/*.cgi 
%_datadir/%name-%version/webui/cgi-bin/*.pl
%_datadir/%name-%version/webui/cgi-bin/*.prefs
%_datadir/%name-%version/webui/cgi-bin/*.txt
%_datadir/%name-%version/webui/cgi-bin/admins
%_datadir/%name-%version/webui/cgi-bin/templates/*.html
%_datadir/%name-%version/webui/htdocs/base.css
%_datadir/%name-%version/webui/htdocs/dspam-logo-small.gif
%_datadir/%name-%version/dspam.http

%changelog
* Sun Apr 14 2013 Dmitry V. Levin (QA) <qa_ldv@altlinux.org> 3.9.0-alt1.beta2.2.qa1
- NMU: rebuilt with libmysqlclient.so.18.

* Tue Jul 24 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.9.0-alt1.beta2.2
- Rebuilt for debuginfo (ALT #26910)

* Mon Dec 06 2010 Igor Vlasenko <viy@altlinux.ru> 3.9.0-alt1.beta2.1
- rebuild with new libmysqlclient by request of libmysqlclient maintainer

* Fri Sep 18 2009 Aleksey Avdeev <solo@altlinux.ru> 3.9.0-alt1.beta2
- NMU
- 3.9.0-BETA2 build
- Fix dspam.init for use condrestart
- Use logrotate for %%_logdir/%%name/%%name.log (Closes: #13576)
- Set %%config(noreplace) for %%_sysconfdir/cron.daily/%%name-clean

* Thu Aug 20 2009 Alexey Shentzev <ashen@altlinux.ru> 3.9.0-alt1.alpha2
- new version build

* Mon Sep 29 2008 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.9
- add BuildRequires: glibc-devel-static

* Thu Mar 20 2008 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.8
- disable ldap support
- set attribute 750 root:mail on /usr/bin/dspam
- add changes train.pl from http://devnull.com/kyler/dspam.20040512.html

* Fri Feb 01 2008 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.7
- fix bug #13576 
- bug #13575 is invalid, ignored
- build with --enable-ldap, --enable-syslog, --with-logfile=%_logdir/%name/%name.log

* Tue Dec 04 2007 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.5
- modify file locations and persmissions
- add default configuration file
- change dspam-clean
- add dspam_corpus from dspam 3.6.x
- thanks Eugene Prokopiev <enp@altlinux.ru> for help

* Thu Aug 30 2007 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.4
- closed bugs #12112, #11228, #11243, #7531 of https: // bugzilla.altlinux.org/

* Mon Aug 27 2007 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.3
- add init-scripts, thanks enp@altlinux.ru
- add documentation, sql-scripts for sqlite, postgresql, mysql

* Tue Aug 07 2007 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.2
- fixx BuildRequires

* Sun May 20 2007 Alexey Shentzev <ashen@altlinux.ru> 3.8.0-alt1.1
- new version build
- fix build with --as-needed
- build with --enable-clam options
- thanks Vyacheslav Dubrovsky <slava@tangramltd.com> for the help

* Wed Dec 06 2006 Eugene Ostapets <eostapets@altlinux.ru> 3.6.8-alt1
- return from orphaned
- new version 3.6.8
- fix build with --as-needed

* Sat Dec 10 2005 Ivan Fedorov <ns@altlinux.ru> 3.6.2-alt1
- 3.6.2
- fixed #7531

* Thu Sep 15 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.9-alt2
- add virtual users support to mysql and pgsql drivers

* Tue Aug 09 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.9-alt1
- 3.4.9

* Fri Jul 22 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.8-alt1
- 3.4.8
- Fix #7247

* Sun May 15 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.6-alt1
- 3.4.6

* Fri Apr 29 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.0-alt3
- Rebuilt with postgresql 8.0

* Sat Apr 09 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.0-alt1
- Spec rewritten.
- Added alternatives

* Sat Apr 09 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.0-alt0.2
- Enable daemon mode

* Sat Mar 26 2005 Ivan Fedorov <ns@altlinux.ru> 3.4.0-alt0.1
- 3.4.0

* Fri Jan 07 2005 Ivan Fedorov <ns@altlinux.ru> 3.2.3-alt0.1
- Initial build