/[packages]/cauldron/samba/current/SPECS/samba.spec
ViewVC logotype

Contents of /cauldron/samba/current/SPECS/samba.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 404859 - (show annotations) (download)
Sun Mar 24 15:20:47 2013 UTC (11 years ago) by colin
File size: 66413 byte(s)
Add systemd requires and general post/pre fixes (mga#9302)
1 %define pkg_name samba
2 %define version 3.6.12
3 %define rel 2
4 #define subrel 1
5 %define vscanver 0.1.3
6 %define libsmbmajor 0
7 %define netapimajor 0
8 %define smbsharemodesmajor 0
9 %define tallocmajor 1
10 %define tdbmajor 1
11 %define wbclientmajor 0
12
13 %define check_sig() export GNUPGHOME=%{_tmppath}/rpm-gpghome \
14 if [ -d "$GNUPGHOME" ] \
15 then echo "Error, GNUPGHOME $GNUPGHOME exists, remove it and try again"; exit 1 \
16 fi \
17 install -d -m700 $GNUPGHOME \
18 gpg --import %{1} \
19 gpg --trust-model always --verify %{2} %{?3} \
20 rm -Rf $GNUPGHOME \
21
22
23 # Samba has started using -Wl,z,nodefs upstream, without libtool (after patch
24 # submission to them, handled in samba bug 6792. To allow
25 # plugins to link now, we have to avoid any such flags by default
26 #define _disable_ld_no_undefined 1
27 # or, instead, filter them out of the right line in the Makefile, like before
28 # see LDSHFLAGS_MODULES below
29
30 %{!?lib: %global lib lib}
31 %{!?mklibname: %global mklibname(ds) %lib%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel}}
32
33 %{?!mga_ver:%global mga_ver(r:) %{-r:%(perl -e '$_="%{1}";m/(((\\d\\.?)+)(\\w\*))(.\*)/;$pre=$4;print "0.$pre." if $pre =~ /\\w\{2,\}/;print "%{-r*}"')}%{!-r:%(perl -e '$_="%{1}";m/(((\\d\\.?)+)(\\w\*))(.\*)/;$pre=$4;print "$2";print $pre if $pre !~ /\\w{2,}/')}}
34
35 %define libname %mklibname smbclient %libsmbmajor
36 %define libnetapi %mklibname netapi %netapimajor
37 %define netapidevel %mklibname -d netapi
38 %define libsmbsharemodes %mklibname smbsharemodes %smbsharemodesmajor
39 %define smbsharemodesdevel %mklibname -d smbsharemodes
40 %define libtalloc %mklibname talloc %tallocmajor
41 %define tallocdevel %mklibname -d talloc
42 %define libtdb %mklibname tdb %tdbmajor
43 %define tdbdevel %mklibname -d tdb
44 %define libwbclient %mklibname wbclient %wbclientmajor
45 %define wbclientdevel %mklibname -d wbclient
46
47 # Version and release replaced by samba-team at release from samba cvs
48 %define pversion PVERSION
49 %define prelease PRELEASE
50
51 #Check to see if p(version|release) has been replaced (1 if replaced)
52 %define have_pversion %(if [ "%pversion" = `echo "pversion" |tr '[:lower:]' '[:upper:]'` ];then echo 0; else echo 1; fi)
53
54 %if %have_pversion
55 %define source_ver %{pversion}
56 %define rel %mkrel 1.%{prelease}
57 # Don't abort for stupid reasons on builds from tarballs:
58 %global _unpackaged_files_terminate_build 0
59 %global _missing_doc_files_terminate_build 0
60 %else
61 %define source_ver %{version}
62 %endif
63
64 %define prerel %mga_ver -r %rel %source_ver
65 %define real_version %mga_ver %source_ver
66 %define release %mkrel %prerel
67 %define have_pre %([ "%version" == "%source_ver" ]; echo $?)
68
69 # Check to see if we are running a build from a tarball release from samba.org
70 # (%have_pversion) If so, disable vscan, unless explicitly requested
71 # (--with vscan).
72 %define build_vscan 1
73 %if %have_pversion
74 %define build_vscan 0
75 %{?_with_vscan: %define build_vscan 1}
76 %endif
77
78 # Default options
79 %define build_talloc 0
80 %define build_tdb 0
81 %define build_ldb 0
82 %define build_ctdb 1
83 %define build_alternatives 1
84 %define build_system 1
85 %define build_acl 1
86 %define build_winbind 1
87 %define build_wins 1
88 %define build_ldap 0
89 %define build_ads 1
90 %define build_scanners 0
91 %define build_test 0
92 # CUPS supports functionality for 'printcap name = cups' (9.0 and later):
93 %define build_cupspc 1
94 # %_{pre,postun}_service are provided by rpm-helper in 9.0 and later
95 %define have_rpmhelper 1
96 %define build_mysql 0
97 %define build_pgsql 0
98
99 # Allow commandline option overrides (borrowed from Vince's qmail srpm):
100 # To use it, do rpm [-ba|--rebuild] --with 'xxx'
101 # Check if the rpm was built with the defaults, otherwise we inform the user
102 %define build_non_default 0
103 %{?_with_system: %global build_system 1}
104 %{?_without_system: %global build_system 0}
105 %{?_with_acl: %global build_acl 1}
106 %{?_with_acl: %global build_non_default 1}
107 %{?_without_acl: %global build_acl 0}
108 %{?_without_acl: %global build_non_default 1}
109 %{?_with_winbind: %global build_winbind 1}
110 %{?_with_winbind: %global build_non_default 1}
111 %{?_without_winbind: %global build_winbind 0}
112 %{?_without_winbind: %global build_non_default 1}
113 %{?_with_wins: %global build_wins 1}
114 %{?_with_wins: %global build_non_default 1}
115 %{?_without_wins: %global build_wins 0}
116 %{?_without_wins: %global build_non_default 1}
117 %{?_with_ldap: %global build_ldap 1}
118 %{?_with_ldap: %global build_non_default 1}
119 %{?_without_ldap: %global build_ldap 0}
120 %{?_without_ldap: %global build_non_default 1}
121 %{?_with_ads: %global build_ads 1}
122 %{?_with_ads: %global build_non_default 1}
123 %{?_without_ads: %global build_ads 0}
124 %{?_without_ads: %global build_non_default 1}
125 %{?_with_scanners: %global build_scanners 1}
126 %{?_with_scanners: %global build_non_default 1}
127 %{?_without_scanners: %global build_scanners 0}
128 %{?_without_scanners: %global build_non_default 1}
129 %{?_with_vscan: %global build_vscan 1}
130 %{?_with_vscan: %global build_non_default 1}
131 %{?_without_vscan: %global build_vscan 0}
132 %{?_without_vscan: %global build_non_default 1}
133 %{?_with_test: %global build_test 1}
134 %{?_with_test: %global build_non_default 1}
135 %{?_without_test: %global build_test 0}
136 %{?_without_test: %global build_non_default 1}
137 %{?_with_mysql: %global build_mysql 1}
138 %{?_with_pgsql: %global build_pgsql 1}
139 # As if that weren't enough, we're going to try building with antivirus
140 # support as an option also
141 %global build_antivir 0
142 %global build_clamav 0
143 %global build_fprot 0
144 %global build_fsav 0
145 %global build_icap 0
146 %global build_kaspersky 0
147 %global build_mks 0
148 %global build_nai 0
149 %global build_openav 0
150 %global build_sophos 0
151 %global build_symantec 0
152 %global build_trend 0
153 %if %build_vscan
154 # These we build by default
155 %global build_clamav 1
156 %global build_icap 0
157 %global build_fsav 1
158 %global build_sophos 1
159 %endif
160 %if %build_vscan && %build_scanners
161 # These scanners are built if scanners are selected
162 # symantec requires their library present and must be selected
163 # individually
164 %global build_fprot 1
165 %global build_kaspersky 1
166 %global build_mks 1
167 %global build_nai 1
168 %global build_openav 1
169 %global build_trend 1
170 %endif
171 %if %build_vscan
172 %{?_with_fprot: %{expand: %%global build_fprot 1}}
173 %{?_with_kaspersky: %{expand: %%global build_kaspersky 1}}
174 %{?_with_mks: %{expand: %%global build_mks 1}}
175 %{?_with_openav: %{expand: %%global build_openav 1}}
176 %{?_with_sophos: %{expand: %%global build_sophos 1}}
177 #%{?_with_symantec: %{expand: %%global build_symantec 1}}
178 %{?_with_trend: %{expand: %%global build_trend 1}}
179 %global vscandir samba-virusfilter-%{vscanver}
180 %endif
181 %global vfsdir examples.bin/VFS
182
183 #Standard texts for descriptions:
184 %define message_bugzilla() %(echo -e -n "Please file bug reports for this package at Mageia bugzilla \\n(http://bugs.mageia.org) under the product name %{1}")
185 %define message_system %(echo -e -n "NOTE: These packages of samba-%{version}, are provided, parallel installable\\nwith samba-2.2.x, to allow easy migration from samba-2.2.x to samba-%{version},\\nbut are not officially supported")
186
187 #check gcc version to disable some optimisations on gcc-3.3.1
188 # gcc is not mandatory to do rpm queries on a .src.rpm, which is what the buildsystem
189 # ends up doing, so we need to guard against that
190 %define gcc331 %((gcc -dumpversion 2>/dev/null || echo 4.1.2) |awk '{if ($1>3.3) print 1; else print 0}')
191
192 #Define sets of binaries that we can use in globs and loops:
193 %global commonbin net,ntlm_auth,rpcclient,smbcacls,smbcquotas,smbpasswd,smbtree,testparm
194
195 %global serverbin pdbedit,profiles,smbcontrol,smbstatus,sharesec,smbta-util
196 %if %build_ldb
197 %global serverldbbin ldbadd,ldbdel,ldbedit,ldbmodify,ldbsearch,ldbrename
198 %endif
199 %global serversbin nmbd,samba,smbd
200
201 %global clientbin findsmb,nmblookup,smbclient,smbprint,smbspool,smbtar,smbget
202 %global client_sbin mount.smb,mount.smbfs
203 %global client_man man1/findsmb.1,man1/nmblookup.1,man1/smbclient.1,man1/smbget.1,man1/smbtar.1,man5/smbgetrc.5,man8/smbspool.8
204
205 %global testbin debug2html,smbtorture,msgtest,masktest,locktest,locktest2,nsstest,vfstest
206
207 %ifarch alpha
208 %define build_expsam xml
209 %else
210 %define build_expsam xml%{?_with_pgsql:,pgsql}%{?_with_mysql:,mysql}
211 %endif
212
213 # Determine whether this is the system samba or not.
214 %if %build_system
215 %define samba_major %{nil}
216 %else
217 %define samba_major 3
218 %endif
219 # alternatives_major is %{nil} if we aren't system and not using alternatives
220 %if !%build_system || %build_alternatives
221 %define alternative_major 3
222 %else
223 %define alternative_major %{nil}
224 %endif
225
226 Summary: Samba SMB server
227 Name: %{pkg_name}%{samba_major}
228
229 Version: %{source_ver}
230 Release: %mkrel %rel
231
232 License: GPLv3
233 Group: System/Servers
234 Source: http://ftp.samba.org/pub/samba/stable/samba-%{source_ver}.tar.gz
235 Source99: http://ftp.samba.org/pub/samba/stable/samba-%{source_ver}.tar.asc
236 Source98: http://ftp.samba.org/pub/samba/samba-pubkey.asc
237 URL: http://www.samba.org
238 Source1: samba.log
239 Source3: samba.xinetd
240 Source4: swat_48.png
241 Source5: swat_32.png
242 Source6: swat_16.png
243 Source7: README.%{name}-mageia-rpm
244 Source8: https://github.com/downloads/fumiyas/samba-virusfilter/samba-virusfilter-%{vscanver}.tar.bz2
245 %if %build_vscan
246 %endif
247 %if %build_vscan
248 BuildRequires: file-devel
249 %endif
250 Source10: samba-print-pdf.sh
251 Source11: smb-migrate
252
253 #Sources that used to be in packaging patch:
254 Source20: smbusers
255 Source21: smbprint
256 #Source22: smbadduser
257 Source23: findsmb
258 Source24: smb.init
259 Source25: winbind.init
260 Source26: wrepld.init
261 Source27: samba.pamd
262 Source28: samba.pamd0_9
263 Source29: system-auth-winbind.pamd
264 Source30: smb.conf
265 Source31: %{name}-tmpfiles.conf
266
267
268 %if !%have_pversion
269 # Version specific patches: current version
270 Patch11: samba-3.0-mageia-packaging.patch
271 # https://bugzilla.samba.org/show_bug.cgi?id=3571, bug 21387
272 Patch19: samba-3.0.21c-swat-fr-translaction.patch
273 Patch30: samba-3.5-check-undefined-before-zdefs.patch
274 Patch31: samba-3.5.3-fix-nss-wins-syslog.patch
275 Patch33: samba-3.5.8-fix-netapi-examples-linking.patch
276 %else
277 # Version specific patches: upcoming version
278 %endif
279 # Limbo patches (applied to prereleases, but not preleases, ie destined for
280 # samba CVS)
281 %if %have_pversion && %have_pre
282 %endif
283 Requires: pam >= 0.64, samba-common = %{version}
284 BuildRequires: pam-devel readline-devel libncurses-devel popt-devel
285 BuildRequires: libxml2-devel
286 # Samba 3.2 and later should be built with capabilities support:
287 # http://lists.samba.org/archive/samba/2009-March/146821.html
288 BuildRequires: libcap-devel
289 BuildRequires: gnupg
290 BuildRequires: avahi-client-devel
291 BuildRequires: libaio-devel
292 BuildRequires: libuuid-devel
293 %if %build_ctdb
294 BuildRequires: ctdb-devel >= 1.0.114.4
295 %endif
296 %if %build_pgsql
297 BuildRequires: postgresql-devel
298 %endif
299 %ifnarch alpha
300 %if %build_mysql
301 BuildRequires: mysql-devel
302 %endif
303 %endif
304 %if %build_acl
305 BuildRequires: libacl-devel
306 %endif
307 BuildRequires: libcups-devel cups-common
308 BuildRequires: libldap-devel
309 %if %build_ads
310 BuildRequires: libldap-devel krb5-devel
311 %endif
312 BuildRequires: keyutils-devel
313 %if !%build_tdb
314 BuildRequires: tdb-devel
315 %endif
316 %if !%build_ldb
317 #BuildRequires: ldb-devel
318 %endif
319 %if !%build_talloc
320 BuildRequires: talloc-devel
321 %endif
322 # for domain-join gui
323 BuildRequires: gtk2-devel
324 BuildRoot: %{_tmppath}/%{name}-%{version}-root
325 Requires(pre): chkconfig mktemp psmisc
326 Requires(pre): coreutils sed grep
327
328 %description
329 Samba provides an SMB server which can be used to provide
330 network services to SMB (sometimes called "Lan Manager")
331 clients, including various versions of MS Windows, OS/2,
332 and other Linux machines. Samba also provides some SMB
333 clients, which complement the built-in SMB filesystem
334 in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
335 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
336 protocol.
337
338 Samba-3.0 features working NT Domain Control capability and
339 includes the SWAT (Samba Web Administration Tool) that
340 allows samba's smb.conf file to be remotely managed using your
341 favourite web browser. For the time being this is being
342 enabled on TCP port 901 via xinetd. SWAT is now included in
343 it's own subpackage, samba-swat.
344
345 Please refer to the WHATSNEW.txt document for fixup information.
346 This binary release includes encrypted password support.
347
348 Please read the smb.conf file and ENCRYPTION.txt in the
349 docs directory for implementation details.
350 %if %have_pversion
351 %message_bugzilla samba3
352 %endif
353 %if !%build_system
354 %message_system
355 %endif
356 %if %build_non_default
357 WARNING: This RPM was built with command-line options. Please
358 see README.%{name}-mageia-rpm in the documentation for
359 more information.
360 %endif
361
362 %package server
363 URL: http://www.samba.org
364 Summary: Samba (SMB) server programs
365 Requires: %{name}-common = %{version}
366 Requires: %libwbclient >= %{version}
367 %if %have_rpmhelper
368 Requires(pre): rpm-helper
369 %endif
370 Group: Networking/Other
371 %if %build_system
372 Provides: samba
373 Obsoletes: samba
374 Provides: samba-server-ldap
375 Obsoletes: samba-server-ldap
376 Provides: samba3-server
377 Obsoletes: samba3-server
378 %else
379 #Provides: samba-server
380 %endif
381
382 %description server
383 Samba-server provides a SMB server which can be used to provide
384 network services to SMB (sometimes called "Lan Manager")
385 clients. Samba uses NetBIOS over TCP/IP (NetBT) protocols
386 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
387 protocol.
388
389 Samba-3.0 features working NT Domain Control capability and
390 includes the SWAT (Samba Web Administration Tool) that
391 allows samba's smb.conf file to be remotely managed using your
392 favourite web browser. For the time being this is being
393 enabled on TCP port 901 via xinetd. SWAT is now included in
394 it's own subpackage, samba-swat.
395
396 Please refer to the WHATSNEW.txt document for fixup information.
397 This binary release includes encrypted password support.
398
399 Please read the smb.conf file and ENCRYPTION.txt in the
400 docs directory for implementation details.
401 %if %have_pversion
402 %message_bugzilla samba3-server
403 %endif
404 %if !%build_system
405 %message_system
406 %endif
407
408 %package client
409 URL: http://www.samba.org
410 Summary: Samba (SMB) client programs
411 Group: Networking/Other
412 Requires: %{name}-common = %{version}
413 Requires: cifs-utils >= 4.4
414 %if %build_alternatives
415 #Conflicts: samba-client < 2.2.8a-9mdk
416 %endif
417 %if %build_system
418 Provides: samba3-client
419 Obsoletes: samba3-client
420 Obsoletes: smbfs
421 %else
422 #Provides: samba-client
423 %endif
424 %if !%build_system && %build_alternatives
425 Provides: samba-client
426 %endif
427
428 %description client
429 Samba-client provides some SMB clients, which complement the built-in
430 SMB filesystem in Linux. These allow the accessing of SMB shares, and
431 printing to SMB printers.
432 %if %have_pversion
433 %message_bugzilla samba3-client
434 %endif
435 %if !%build_system
436 %message_system
437 %endif
438
439 %package common
440 URL: http://www.samba.org
441 Summary: Files used by both Samba servers and clients
442 Group: System/Servers
443 Conflicts: %{name}-server < 3.6.6-2
444 Requires(post): systemd >= %{systemd_required_version}
445 %if %build_system
446 Provides: samba-common-ldap
447 Obsoletes: samba-common-ldap
448 Provides: samba3-common
449 Obsoletes: samba3-common
450 %else
451 #Provides: samba-common
452 %endif
453
454 %description common
455 Samba-common provides files necessary for both the server and client
456 packages of Samba.
457 %if %have_pversion
458 %message_bugzilla samba3-common
459 %endif
460 %if !%build_system
461 %message_system
462 %endif
463
464 %package doc
465 URL: http://www.samba.org
466 Summary: Documentation for Samba servers and clients
467 Group: System/Servers
468 Requires: %{name}-common = %{version}
469 BuildArch: noarch
470 %if %build_system
471 Obsoletes: samba3-doc
472 Provides: samba3-doc
473 %else
474 #Provides: samba-doc
475 %endif
476
477 %description doc
478 Samba-doc provides documentation files for both the server and client
479 packages of Samba.
480 %if %have_pversion
481 %message_bugzilla samba3-doc
482 %endif
483 %if !%build_system
484 %message_system
485 %endif
486
487 %package swat
488 URL: http://www.samba.org
489 Summary: The Samba Web Administration Tool
490 Requires: %{name}-server = %{version}
491 Requires: xinetd
492 Group: System/Servers
493 %if %build_system
494 Provides: samba-swat-ldap
495 Obsoletes: samba-swat-ldap
496 Provides: samba3-swat
497 Obsoletes: samba3-swat
498 %else
499 #Provides: samba-swat
500 %endif
501 Conflicts: %{name}-server < 3.4.0
502 Suggests: %{name}-doc
503
504 %description swat
505 SWAT (the Samba Web Administration Tool) allows samba's smb.conf file
506 to be remotely managed using your favourite web browser. For the time
507 being this is being enabled on TCP port 901 via xinetd. Note that
508 SWAT does not use SSL encryption, nor does it preserve comments in
509 your smb.conf file. Webmin uses SSL encryption by default, and
510 preserves comments in configuration files, even if it does not display
511 them, and is therefore the preferred method for remotely managing
512 Samba.
513 %if %have_pversion
514 %message_bugzilla samba3-swat
515 %endif
516 %if !%build_system
517 %message_system
518 %endif
519
520 %if %build_winbind
521 %package winbind
522 URL: http://www.samba.org
523 Summary: Samba-winbind daemon, utilities and documentation
524 Group: System/Servers
525 Requires: %{name}-common = %{version}
526 %endif
527 %if %build_winbind && !%build_system
528 Conflicts: samba-winbind
529 %endif
530 %if %build_winbind
531 %description winbind
532 Provides the winbind daemon and testing tools to allow authentication
533 and group/user enumeration from a Windows or Samba domain controller.
534 %endif
535 %if %have_pversion
536 %message_bugzilla samba3-winbind
537 %endif
538 %if !%build_system
539 %message_system
540 %endif
541
542 %if %build_wins
543 %package -n nss_wins%{samba_major}
544 URL: http://www.samba.org
545 Summary: Name Service Switch service for WINS
546 Group: System/Servers
547 Requires: %{name}-common = %{version}
548 Requires(pre): glibc
549 %endif
550 %if %build_wins && !%build_system
551 Conflicts: nss_wins
552 %endif
553 %if %build_wins
554 %description -n nss_wins%{samba_major}
555 Provides the libnss_wins shared library which resolves NetBIOS names to
556 IP addresses.
557 %endif
558 %if %have_pversion
559 %message_bugzilla nss_wins3
560 %endif
561 %if !%build_system
562 %message_system
563 %endif
564
565 %if %build_test
566 %package test
567 URL: http://www.samba.org
568 Summary: Debugging and benchmarking tools for samba
569 Group: System/Servers
570 Requires: %{name}-common = %{version}
571 %endif
572 %if %build_system && %build_test
573 Provides: samba3-test samba3-debug
574 Obsoletes: samba3-test samba3-debug
575 %endif
576 %if !%build_system && %{build_test}
577 Provides: samba-test samba3-debug
578 Obsoletes: samba3-debug
579 %endif
580 %if %{build_test}
581
582 %description test
583 This package provides tools for benchmarking samba, and debugging
584 the correct operation of tools against smb servers.
585 %endif
586
587 %if %build_system
588 %package -n %{libname}
589 URL: http://www.samba.org
590 Summary: SMB Client Library
591 Group: System/Libraries
592 Provides: libsmbclient
593
594 %description -n %{libname}
595 This package contains the SMB client library, part of the samba
596 suite of networking software, allowing other software to access
597 SMB shares.
598 %endif
599 %if %have_pversion && %build_system
600 %message_bugzilla %{libname}
601 %endif
602
603 %if %build_system
604 %package -n %{libname}-devel
605 URL: http://www.samba.org
606 Summary: SMB Client Library Development files
607 Group: Development/C
608 Provides: libsmbclient-devel = %{version}-%{release}
609 Requires: %{libname} = %{version}-%{release}
610
611 %description -n %{libname}-devel
612 This package contains the development files for the SMB client
613 library, part of the samba suite of networking software, allowing
614 the development of other software to access SMB shares.
615 %endif
616 %if %have_pversion && %build_system
617 %message_bugzilla %{libname}-devel
618 %endif
619
620 %if %build_system
621 %package -n %{libname}-static-devel
622 URL: http://www.samba.org
623 Summary: SMB Client Static Library Development files
624 Group: Development/C
625 Provides: libsmbclient-static-devel = %{version}-%{release}
626 Requires: %{libname}-devel = %{version}-%{release}
627
628 %description -n %{libname}-static-devel
629 This package contains the static development files for the SMB
630 client library, part of the samba suite of networking software,
631 allowing the development of other software to access SMB shares.
632 %endif
633 %if %have_pversion && %build_system
634 %message_bugzilla %{libname}-devel
635 %endif
636
637 %package -n %libnetapi
638 Summary: Samba library for accessing functions in 'net' binary
639 Group: System/Libraries
640
641 %description -n %libnetapi
642 Samba library for accessing functions in 'net' binary
643
644 %package -n %netapidevel
645 Group: Development/C
646 Summary: Samba library for accessing functions in 'net' binary
647 Provides: netapi-devel = %{version}-%{release}
648
649 %description -n %netapidevel
650 Samba library for accessing functions in 'net' binary
651
652 %package -n %libsmbsharemodes
653 Group: System/Libraries
654 Summary: Samba Library for accessing smb share modes (locks etc.)
655
656 %description -n %libsmbsharemodes
657 Samba Library for accessing smb share modes (locks etc.)
658
659 %package -n %smbsharemodesdevel
660 Group: Development/C
661 Summary: Samba Library for accessing smb share modes (locks etc.)
662 Provides: smbsharemodes-devel = %{version}-%{release}
663
664 %description -n %smbsharemodesdevel
665 Samba Library for accessing smb share modes (locks etc.)
666
667 %if %build_talloc
668 %package -n %libtalloc
669 Group: System/Libraries
670 Summary: Library implementing Samba's memory allocator
671
672 %description -n %libtalloc
673 Library implementing Samba's memory allocator
674
675 %package -n %tallocdevel
676 Group: Development/C
677 Summary: Library implementing Samba's memory allocator
678 Provides: talloc-devel = %{version}-%{release}
679
680 %description -n %tallocdevel
681 Library implementing Samba's memory allocator
682 %endif
683
684 %if %build_tdb
685 %package -n %libtdb
686 Group: System/Libraries
687 Summary: Library implementing Samba's embedded database
688
689 %description -n %libtdb
690 Library implementing Samba's embedded database
691
692 %package -n %tdbdevel
693 Group: Development/C
694 Summary: Library implementing Samba's embedded database
695 Provides: tdb-devel = %{version}-%{release}
696 Requires: %libtdb
697 # because /usr/include/tdb.h was moved from libsmbclient0-devel to libtdb-devel
698 Conflicts: %{mklibname smbclient 0 -d} < 3.2.6-3
699
700 %description -n %tdbdevel
701 Library implementing Samba's embedded database
702 %endif
703
704 %package -n %libwbclient
705 Group: System/Libraries
706 Summary: Library providing access to winbindd
707
708 %description -n %libwbclient
709 Library providing access to winbindd
710
711 %package -n %wbclientdevel
712 Group: Development/C
713 Summary: Library providing access to winbindd
714 Provides: wbclient-devel = %{version}-%{release}
715 Requires: %libwbclient >= %{version}
716
717 %description -n %wbclientdevel
718 Library providing access to winbindd
719
720 #%package passdb-ldap
721 #URL: http://www.samba.org
722 #Summary: Samba password database plugin for LDAP
723 #Group: System/Libraries
724 #
725 #%description passdb-ldap
726 #The passdb-ldap package for samba provides a password database
727 #backend allowing samba to store account details in an LDAP
728 #database
729 #_if %have_pversion
730 #_message_bugzilla samba3-passdb-ldap
731 #_endif
732 #_if !%build_system
733 #_message_system
734 #_endif
735
736 %ifnarch alpha
737 %if %{build_mysql}
738 %package passdb-mysql
739 URL: http://www.samba.org
740 Summary: Samba password database plugin for MySQL
741 Group: System/Libraries
742 Requires: %{name}-server = %{version}-%{release}
743 %endif
744 %endif
745 %ifnarch alpha
746 %if %build_system && %{build_mysql}
747 Obsoletes: samba3-passdb-mysql
748 Provides: samba3-passdb-mysql
749 %endif
750 %endif
751 %ifnarch alpha
752 %if %{build_mysql}
753
754 %description passdb-mysql
755 The passdb-mysql package for samba provides a password database
756 backend allowing samba to store account details in a MySQL
757 database
758 %endif
759 %endif
760
761 #does postgresql build on alpha?
762 #ifnarch alpha
763 %if %{build_pgsql}
764 %package passdb-pgsql
765 URL: http://www.samba.org
766 Summary: Samba password database plugin for PostgreSQL
767 Group: System/Libraries
768 Requires: %{name}-server = %{version}-%{release}
769 #endif
770 #ifnarch alpha && %build_system
771 %endif
772 %if %build_system && %{build_pgsql}
773 Obsoletes: samba3-passdb-pgsql
774 Provides: samba3-passdb-pgsql
775 %endif
776 %if %{build_pgsql}
777
778 %description passdb-pgsql
779 The passdb-pgsql package for samba provides a password database
780 backend allowing samba to store account details in a PostgreSQL
781 database
782 %endif
783
784 #Antivirus packages:
785 %if %build_antivir
786 %package vscan-antivir
787 Summary: On-access virus scanning for samba using Antivir
788 Group: System/Servers
789 Requires: %{name}-server = %{version}
790 Provides: %{name}-vscan
791 %description vscan-antivir
792 A vfs-module for samba to implement on-access scanning using the
793 Antivir antivirus scanner daemon.
794 %endif
795
796
797 %if %build_clamav
798 %package virusfilter-clamav
799 Summary: On-access virus scanning for samba using Clam Antivirus
800 Group: System/Servers
801 URL: https://github.com/fumiyas/samba-virusfilter
802 Requires: %{name}-server = %{version}
803 Provides: %{name}-vscan
804 Provides: %{name}-virusfilter
805 Requires: clamd
806 %description virusfilter-clamav
807 This is a Samba VFS module to scan and filter virus files on Samba file
808 services with an anti-virus scanner.
809
810 This package includes the VFS module supporting:
811 * ClamAV (clamd daemon) http://www.clamav.net
812
813 %endif
814
815 %if %build_fprot
816 %package vscan-fprot
817 Summary: On-access virus scanning for samba using FPROT
818 Group: System/Servers
819 Requires: %{name}-server = %{version}
820 Provides: %{name}-vscan
821 %description vscan-fprot
822 A vfs-module for samba to implement on-access scanning using the
823 FPROT antivirus software (which must be installed to use this).
824 %endif
825
826 %if %build_fsav
827 %package virusfilter-fsecure
828 Summary: On-access virus scanning for samba using F-Secure
829 Group: System/Servers
830 URL: https://github.com/fumiyas/samba-virusfilter
831 Requires: %{name}-server = %{version}
832 Provides: %{name}-vscan
833 Provides: %{name}-virusfilter
834 %description virusfilter-fsecure
835 This is a Samba VFS module to scan and filter virus files on Samba file
836 services with an anti-virus scanner.
837
838 This package provides the VFS module supporting:
839 * F-Secure Anti-Virus (fsavd daemon) http://www.f-secure.com
840
841 %endif
842
843 %if %build_icap
844 %package vscan-icap
845 Summary: On-access virus scanning for samba using ICAP
846 Group: System/Servers
847 Requires: %{name}-server = %{version}
848 Provides: %{name}-icap
849 %description vscan-icap
850 A vfs-module for samba to implement on-access scanning using
851 ICAP-capable antivirus software.
852 %endif
853
854 %if %build_kaspersky
855 %package vscan-kaspersky
856 Summary: On-access virus scanning for samba using Kaspersky
857 Group: System/Servers
858 Requires: %{name}-server = %{version}
859 Provides: %{name}-vscan
860 %description vscan-kaspersky
861 A vfs-module for samba to implement on-access scanning using the
862 Kaspersky antivirus software (which must be installed to use this).
863 %endif
864
865 %if %build_mks
866 %package vscan-mks
867 Summary: On-access virus scanning for samba using MKS
868 Group: System/Servers
869 Requires: %{name}-server = %{version}
870 Provides: %{name}-vscan
871 %description vscan-mks
872 A vfs-module for samba to implement on-access scanning using the
873 MKS antivirus software (which must be installed to use this).
874 %endif
875
876 %if %build_nai
877 %package vscan-nai
878 Summary: On-access virus scanning for samba using NAI McAfee
879 Group: System/Servers
880 Requires: %{name}-server = %{version}
881 Provides: %{name}-vscan
882 %description vscan-nai
883 A vfs-module for samba to implement on-access scanning using the
884 NAI McAfee antivirus software (which must be installed to use this).
885 %endif
886
887 %if %build_openav
888 %package vscan-openav
889 Summary: On-access virus scanning for samba using OpenAntivirus
890 Group: System/Servers
891 Requires: %{name}-server = %{version}
892 Provides: %{name}-vscan
893 %description vscan-openav
894 A vfs-module for samba to implement on-access scanning using the
895 OpenAntivirus antivirus software (which must be installed to use this).
896 %endif
897
898 %if %build_sophos
899 %package virusfilter-sophos
900 Summary: On-access virus scanning for samba using Sophos
901 Group: System/Servers
902 URL: https://github.com/fumiyas/samba-virusfilter
903 Requires: %{name}-server = %{version}
904 Provides: %{name}-vscan
905 %description virusfilter-sophos
906 This is a Samba VFS module to scan and filter virus files on Samba file
907 services with an anti-virus scanner.
908
909 This package includes the VFS module supporting:
910 * Sophos Anti-Virus (savdid daemon) http://www.sophos.com
911 %endif
912
913 %if %build_symantec
914 %package vscan-symantec
915 Summary: On-access virus scanning for samba using Symantec
916 Group: System/Servers
917 Requires: %{name}-server = %{version}
918 Provides: %{name}-vscan
919 Autoreq: 0
920 %description vscan-symantec
921 A vfs-module for samba to implement on-access scanning using the
922 Symantec antivirus software (which must be installed to use this).
923 %endif
924
925
926 %if %build_trend
927 %package vscan-trend
928 Summary: On-access virus scanning for samba using Trend
929 Group: System/Servers
930 Requires: %{name}-server = %{version}
931 Provides: %{name}-vscan
932 %description vscan-trend
933 A vfs-module for samba to implement on-access scanning using the
934 Trend antivirus software (which must be installed to use this).
935 %endif
936
937 %package domainjoin-gui
938 Summary: Domainjoin GUI
939 Requires: samba-common = %{version}
940 Group: System/Configuration
941
942 %description domainjoin-gui
943 The samba-domainjoin-gui package includes a domainjoin gtk application.
944
945 %prep
946
947 # Allow users to query build options with --with options:
948 #%%define opt_status(%1) %(echo %{1})
949 %if %{?_with_options:1}%{!?_with_options:0}
950 %define opt_status(%{1}) %(if [ %{1} -eq 1 ];then echo enabled;else echo disabled;fi)
951 #exit 1
952 %{error: }
953 %{error:Build options available are:}
954 %{error:--with[out] system Build as the system samba package [or as samba3]}
955 %{error:--with[out] acl Build with support for file ACLs - %opt_status %build_acl}
956 %{error:--with[out] winbind Build with Winbind support - %opt_status %build_winbind}
957 %{error:--with[out] wins Build with WINS name resolution support - %opt_status %build_wins}
958 %{error:--with[out] ldap Build with legacy (samba2) LDAP support - %opt_status %build_ldap}
959 %{error:--with[out] ads Build with Active Directory support - %opt_status %build_ads}
960 %{error:--with[out] mysql Build MySQL passdb backend - %opt_status %build_mysql}
961 %{error:--with[out] pgsql Build PostgreSQL passdb backend - %opt_status %build_pgsql}
962 %{error:--with[out] scanners Enable on-access virus scanners - %opt_status %build_scanners}
963 %{error:--with[out] test Enable testing and benchmarking tools - %opt_status %build_test}
964 %{error: }
965 %else
966 #{error: }
967 #{error: This rpm has build options available, use --with options to see them}
968 #{error: }
969 echo -e "\n This rpm has build options available, use --with options to see them\n" >&2
970 sleep 1
971 %endif
972
973 %if %{?_with_options:1}%{!?_with_options:0} && %build_scanners
974 #{error:--with scanners enables the following:%{?build_clamav:clamav,}%{?build_icap:icap,}%{?build_fprot:fprot,}%{?build_mks:mks,}%{?build_openav:openav,}%{?build_sophos:sophos,}%{?build_symantec:symantec,}%{?build_trend:trend}}
975 %{error:--with scanners enables the following: antivir,clamav,icap,fprot,fsav,mks,nai,openav,sophos,trend}
976 %{error: }
977 %{error:To enable others (requires development libraries for the scanner):}
978 %{error:--with symantec Enable on-access scanning with Symantec - %opt_status %build_symantec}
979 %{error: }
980 %endif
981
982 %if %{?_with_options:1}%{!?_with_options:0}
983 clear
984 exit 1
985 %endif
986
987
988 %if %build_non_default
989 RPM_EXTRA_OPTIONS="\
990 %{?_with_system: --with system}\
991 %{?_without_system: --without system}\
992 %{?_with_acl: --with acl}\
993 %{?_without_acl: --without acl}\
994 %{?_with_winbind: --with winbind}\
995 %{?_without_winbind: --without winbind}\
996 %{?_with_wins: --with wins}\
997 %{?_without_wins: --without wins}\
998 %{?_with_ldap: --with ldap}\
999 %{?_without_ldap: --without ldap}\
1000 %{?_with_ads: --with ads}\
1001 %{?_without_ads: --without ads}\
1002 %{?_with_scanners: --with scanners}\
1003 %{?_without_scanners: --without scanners}\
1004 "
1005 echo "Building a non-default rpm with the following command-line arguments:"
1006 echo "$RPM_EXTRA_OPTIONS"
1007 echo "This rpm was built with non-default options, thus, to build ">%{SOURCE7}
1008 echo "an identical rpm, you need to supply the following options">>%{SOURCE7}
1009 echo "at build time: $RPM_EXTRA_OPTIONS">>%{SOURCE7}
1010 echo -e "\n%{name}-%{version}-%{release}\n">>%{SOURCE7}
1011 %else
1012 echo "This rpm was built with default options">%{SOURCE7}
1013 echo -e "\n%{name}-%{version}-%{release}\n">>%{SOURCE7}
1014 %endif
1015
1016
1017 #Try and validate signatures on source:
1018 VERIFYSOURCE=%{SOURCE0}
1019 VERIFYSOURCE=${VERIFYSOURCE%%.gz}
1020 gzip -dc %{SOURCE0} > $VERIFYSOURCE
1021 %check_sig %{SOURCE98} %{SOURCE99} $VERIFYSOURCE
1022
1023 %if %build_vscan
1024 %setup -q -a 8 -n %{pkg_name}-%{source_ver}
1025 %else
1026 %setup -q -n %{pkg_name}-%{source_ver}
1027 %endif
1028 # Version specific patches: current version
1029 %if !%have_pversion
1030 echo "Applying patches for current version: %{ver}"
1031 %patch11 -p1 -b .mga
1032 pushd source3
1033 popd
1034 %patch30 -p1 -b .checkflags
1035 #patch31 -p1 -b .nss_wins_log
1036 %patch33 -p1 -b .netapi_link
1037
1038 # patches from cvs/samba team
1039 pushd source3
1040 popd
1041 %else
1042 # Version specific patches: upcoming version
1043 echo "Applying patches for new versions: %{pversion}"
1044 %endif
1045
1046 # Limbo patches
1047 %if %have_pversion && %have_pre
1048 echo "Appling patches which should only be applied to prereleases"
1049 %endif
1050
1051 cp %{SOURCE7} .
1052
1053 # Make a copy of examples so that we have a clean one for doc:
1054 cp -a examples examples.bin
1055
1056 %if %build_vscan
1057 pushd samba-virusfilter-%{vscanver}
1058 perl -pi -e 's,/var/run/clamav/clamd.ctl,/var/lib/clamav/clamd.socket,g' clamav/svf-clamav.c
1059 popd
1060 %endif
1061
1062 # Edit some files when not building system samba:
1063 %if !%build_system
1064 perl -pi -e 's/%{pkg_name}/%{name}/g' source3/auth/pampass.c
1065 %endif
1066
1067 #remove cvs internal files from docs:
1068 find docs examples -name '.cvsignore' -exec rm -f {} \;
1069
1070 #make better doc trees:
1071 chmod -R a+rX examples docs *Manifest* README Roadmap COPYING
1072 mkdir -p clean-docs/samba-doc
1073 cp -a examples docs clean-docs/samba-doc
1074 mv -f clean-docs/samba-doc/examples/libsmbclient clean-docs/
1075 rm -Rf clean-docs/samba-doc/docs/{docbook,manpages,htmldocs,using_samba}
1076 #ln -s %{_datadir}/swat%{samba_major}/using_samba clean-docs/samba-doc/docs/using_samba
1077 mkdir clean-docs/samba-doc/docs/htmldocs
1078 cp docs/htmldocs/*.{html,css} clean-docs/samba-doc/docs/htmldocs
1079 ln -sf %{_datadir}/swat%{samba_major}/help/{Samba3-ByExample,Samba3-HOWTO,Samba3-Developers-Guide,using_samba,manpages} clean-docs/samba-doc/docs/htmldocs/
1080
1081 %build
1082 %serverbuild
1083 (cd source3
1084 CFLAGS="`echo "$RPM_OPT_FLAGS"|sed -e 's/ -g / /g'` -DLDAP_DEPRECATED"
1085 %if %gcc331
1086 CFLAGS=`echo "$CFLAGS"|sed -e 's/-O2/-O/g'`
1087 %endif
1088 ./autogen.sh
1089 # Don't use --with-fhs now, since it overrides libdir, it sets configdir,
1090 # lockdir,piddir logfilebase,privatedir and swatdir
1091 %configure2_5x --prefix=%{_prefix} \
1092 --sysconfdir=%{_sysconfdir}/%{name} \
1093 --localstatedir=/var \
1094 --with-modulesdir=%{_libdir}/%{name} \
1095 --with-privatedir=%{_sysconfdir}/%{name} \
1096 --with-lockdir=/var/cache/%{name} \
1097 --with-piddir=/var/run \
1098 --with-swatdir=%{_datadir}/swat%{samba_major} \
1099 --with-configdir=%{_sysconfdir}/%{name} \
1100 --with-logfilebase=/var/log/%{name} \
1101 --with-pammodulesdir=%{_lib}/security/ \
1102 --with-rootsbindir=/bin \
1103 %if %build_talloc
1104 --with-libtalloc=yes \
1105 %else
1106 --enable-external-libtalloc=yes \
1107 %endif
1108 %if %build_tdb
1109 --with-libtdb = yes \
1110 %else
1111 --enable-external-libtdb=yes \
1112 %endif
1113 %if %build_ctdb
1114 --with-cluster-support \
1115 %endif
1116 %if !%build_ads
1117 --with-ads=no \
1118 %endif
1119 --with-automount \
1120 --with-pam \
1121 --with-pam_smbpass \
1122 --with-aio-support \
1123 %if %build_ldap
1124 --with-ldapsam \
1125 %endif
1126 --with-syslog \
1127 --with-quotas \
1128 --with-utmp \
1129 %if %build_acl
1130 --with-acl-support \
1131 %endif
1132 --with-shared-modules=idmap_rid,idmap_ad \
1133 --enable-avahi \
1134 --with-dnsupdate \
1135 --program-suffix=%{samba_major}
1136 # --with-expsam=%build_expsam \
1137 # --with-shared-modules=pdb_ldap,idmap_ldap \
1138 # --with-manpages-langs=en,ja,pl \
1139 #_if !%build_system
1140 # --with-smbwrapper \
1141 #_endif
1142 # --with-nisplussam \
1143 # --with-fhs \
1144
1145 # Remove -Wl,--no-undefined for plugins:
1146 grep ^LDSHFLAGS_MODULES Makefile
1147 perl -pi -e 'if ( m/^LDSHFLAGS_MODULES/ ) { $_ =~ s/-Wl,--no-undefined//g;};' Makefile
1148 grep ^LDSHFLAGS_MODULES Makefile
1149
1150 #Should be a patch instead?
1151 %if !%build_talloc
1152 perl -pi -e 's,-I./lib/talloc,,g;s,bin/libtalloc.so,,g;s,^(installlibs:: )installlibtalloc,$1,g' Makefile
1153 %endif
1154 %if !%build_tdb
1155 perl -pi -e 's,-I./lib/tdb/include,,g;s,bin/libtdb.so,,g;s,^(installlibs:: )installlibtdb,$1,g' Makefile
1156 %endif
1157 %if !%build_ldb
1158 perl -pi -e 's,\$\(BIN_PROGS4\),,g' Makefile
1159 %endif
1160
1161 perl -pi -e 's|-Wl,-rpath,%{_libdir}||g;s|-Wl,-rpath -Wl,%{_libdir}||g' Makefile
1162
1163 make proto_exists || :
1164 %make all libsmbclient smbfilter wins %{?_with_test: torture debug2html bin/log2pcap} bin/smbget
1165 make -C lib/netapi/examples
1166 )
1167
1168 %if %build_vscan
1169 echo -e "\n\nBuild antivirus VFS modules\n\n"
1170 pushd %{vscandir}
1171 %configure --with-samba-source=../
1172 make
1173 popd
1174 %endif
1175
1176 # Build antivirus vfs objects
1177 %if %build_symantec
1178 echo "Building Symantec"
1179 make -C %{vfsdir}/%{vscandir} symantec
1180 %endif
1181
1182 %install
1183 rm -rf %{buildroot}
1184 mkdir -p %{buildroot}
1185
1186 #Ensure all docs are readable
1187 chmod a+r docs -R
1188
1189 # Any entries here mean samba makefile is *really* broken:
1190 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
1191 mkdir -p %{buildroot}/%{_datadir}
1192 mkdir -p %{buildroot}%{_libdir}/%{name}/vfs
1193
1194 (cd source3
1195 make DESTDIR=%{buildroot} install installclientlib installmodules)
1196
1197 # we ship docs in the docs supackage, and lik it into swat, delete the extra copy:
1198 rm -Rf %{buildroot}/%{_datadir}/swat/using_samba
1199
1200 #install -m755 source/bin/smbget %{buildroot}/%{_bindir}
1201
1202
1203 #need to stay
1204 mkdir -p %{buildroot}/{sbin,bin}
1205 mkdir -p %{buildroot}%{_sysconfdir}/{logrotate.d,pam.d,xinetd.d}
1206 mkdir -p %{buildroot}/%{_initrddir}
1207 mkdir -p %{buildroot}/var/cache/%{name}
1208 mkdir -p %{buildroot}/var/log/%{name}
1209 mkdir -p %{buildroot}/var/spool/%{name}
1210 mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/{netlogon,profiles,printers}
1211 mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC}
1212 mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}/codepages/src
1213 mkdir -p %{buildroot}/%{_lib}/security
1214 mkdir -p %{buildroot}%{_libdir}/pkgconfig
1215 mkdir -p %{buildroot}%{_sbindir}
1216 mkdir -p %{buildroot}%{_bindir}
1217 mkdir -p %{buildroot}%{_libdir}/%{name}/vfs
1218 mkdir -p %{buildroot}%{_datadir}/%{name}/scripts
1219
1220 install -m755 source3/bin/lib*.a %{buildroot}%{_libdir}/
1221
1222 # tmpfiles for runtime dir creation
1223 install -D -p -m 0644 %{SOURCE31} %{buildroot}%{_tmpfilesdir}/%{name}.conf
1224
1225 # smbsh forgotten
1226 #install -m 755 source/bin/smbsh %{buildroot}%{_bindir}/
1227
1228 %if %build_vscan
1229 %makeinstall_std -C %{vscandir}
1230 install -m 644 %{vscandir}/etc/*.conf.example %{buildroot}/%{_sysconfdir}/%{name}
1231 for i in %{buildroot}/%{_sysconfdir}/%{name}/*.example
1232 do mv $i ${i%%.example}
1233 done
1234 #mv %{buildroot}/%{_datadir}/%{name}/bin/svf-notify %{buildroot}/%{_datadir}/%{name}/scripts
1235 # script uses ksh, which we don't have
1236 rm %{buildroot}/%{_datadir}/%{name}/bin/svf-notify
1237 perl -pi -e 's,%{_datadir}/%{name}/bin,%{_datadir}/%{name}/scripts,g' %{buildroot}/%{_sysconfdir}/%{name}/smb.svf-*.conf
1238 %endif
1239
1240 #libnss_* still not handled by make:
1241 # Install the nsswitch library extension file
1242 for i in wins winbind; do
1243 install -m755 nsswitch/libnss_${i}.so %{buildroot}/%{_lib}/libnss_${i}.so
1244 done
1245 # Make link for wins and winbind resolvers
1246 ( cd %{buildroot}/%{_lib}; ln -s libnss_wins.so libnss_wins.so.2; ln -s libnss_winbind.so libnss_winbind.so.2)
1247 install -d %{buildroot}/%{_libdir}/krb5/plugins
1248 install -m755 source3/bin/winbind_krb5_locator.so %{buildroot}/%{_libdir}/krb5/plugins
1249
1250 install -m 755 source3/lib/netapi/examples/bin/netdomjoin-gui %{buildroot}/%{_sbindir}/netdomjoin-gui
1251 mkdir -p %{buildroot}%{_datadir}/pixmaps/%{name}
1252 install -m 644 source3/lib/netapi/examples/netdomjoin-gui/samba.ico %{buildroot}/%{_datadir}/pixmaps/%{name}/samba.ico
1253 install -m 644 source3/lib/netapi/examples/netdomjoin-gui/logo.png %{buildroot}/%{_datadir}/pixmaps/%{name}/logo.png
1254 install -m 644 source3/lib/netapi/examples/netdomjoin-gui/logo-small.png %{buildroot}/%{_datadir}/pixmaps/%{name}/logo-small.png
1255
1256 %if %{build_test}
1257 for i in {%{testbin}};do
1258 #install -m755 source/bin/${i} %{buildroot}/%{_bindir}/${i}%{samba_major}
1259 done
1260 %endif
1261
1262 # Install other stuff
1263
1264 # install -m644 examples/VFS/recycle/recycle.conf %{buildroot}%{_sysconfdir}/samba/
1265 install -m644 %{SOURCE20} %{buildroot}%{_sysconfdir}/%{name}/smbusers
1266 install -m755 %{SOURCE21} %{buildroot}/%{_bindir}
1267 #install -m755 %{SOURCE22} %{buildroot}/usr/bin
1268 install -m755 %{SOURCE23} %{buildroot}/%{_bindir}
1269 install -m755 %{SOURCE24} %{buildroot}/%{_initrddir}/smb%{samba_major}
1270 install -m755 %{SOURCE24} %{buildroot}/%{_sbindir}/%{name}
1271 install -m755 %{SOURCE25} %{buildroot}/%{_initrddir}/winbind
1272 install -m755 %{SOURCE25} %{buildroot}/%{_sbindir}/winbind
1273 # install -m755 %{SOURCE26} %{buildroot}/%{_initrddir}/wrepld%{samba_major}
1274 install -m644 %{SOURCE28} %{buildroot}/%{_sysconfdir}/pam.d/%{name}
1275 install -m644 %{SOURCE29} %{buildroot}/%{_sysconfdir}/pam.d/system-auth-winbind
1276 #
1277 install -m644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
1278
1279 # install pam_winbind.conf sample file
1280 mkdir -p %{buildroot}%{_sysconfdir}/security
1281 install -m 0644 examples/pam_winbind/pam_winbind.conf %{buildroot}%{_sysconfdir}/security/pam_winbind.conf
1282
1283 install -m755 examples/LDAP/convertSambaAccount %{buildroot}/%{_datadir}/%{name}/scripts/
1284
1285 # make a conf file for winbind from the default one:
1286 cat %{SOURCE30}|sed -e 's/^; winbind/ winbind/g;s/^; obey pam/ obey pam/g;s/ printer admin = @adm/# printer admin = @adm/g; s/^# printer admin = @"D/ printer admin = @"D/g;s/^; password server = \*/ password server = \*/g;s/^; template/ template/g; s/^ security = user/ security = domain/g' > packaging/Mageia/smb-winbind.conf
1287 install -m644 packaging/Mageia/smb-winbind.conf %{buildroot}/%{_sysconfdir}/%{name}/smb-winbind.conf
1288
1289 # Some inline fixes for smb.conf for non-winbind use
1290 install -m644 %{SOURCE30} %{buildroot}/%{_sysconfdir}/%{name}/smb.conf
1291 cat %{SOURCE30} | \
1292 sed -e 's/^; printer admin = @adm/ printer admin = @adm/g' >%{buildroot}/%{_sysconfdir}/%{name}/smb.conf
1293 %if %build_cupspc
1294 perl -pi -e 's/printcap name = lpstat/printcap name = cups/g' %{buildroot}/%{_sysconfdir}/%{name}/smb.conf
1295 perl -pi -e 's/printcap name = lpstat/printcap name = cups/g' %{buildroot}/%{_sysconfdir}/%{name}/smb-winbind.conf
1296 %endif
1297
1298 #%if !%build_system
1299 # Fix script paths in smb.conf
1300 #perl -pi -e 's,%{_datadir}/samba,%{_datadir}/%{name},g' %{buildroot}/%{_sysconfdir}/%{name}/smb*.conf
1301 #%endif
1302
1303
1304 echo 127.0.0.1 localhost > %{buildroot}/%{_sysconfdir}/%{name}/lmhosts
1305
1306 # Link smbspool to CUPS (does not require installed CUPS)
1307
1308 mkdir -p %{buildroot}/%{_prefix}/lib/cups/backend
1309 ln -s %{_bindir}/smbspool%{alternative_major} %{buildroot}/%{_prefix}/lib/cups/backend/smb%{alternative_major}
1310
1311 # xinetd support
1312
1313 mkdir -p %{buildroot}/%{_sysconfdir}/xinetd.d
1314 install -m644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/xinetd.d/swat%{samba_major}
1315
1316 # menu support
1317
1318 mkdir -p %{buildroot}/%{_datadir}/applications
1319 cat > %{buildroot}/%{_datadir}/applications/mageia-%{name}-swat.desktop << EOF
1320 [Desktop Entry]
1321 Name=Samba Configuration (SWAT)
1322 Comment=The Swat Samba Administration Tool
1323 Exec=www-browser http://localhost:901/
1324 Icon=swat%{samba_major}
1325 Terminal=false
1326 Type=Application
1327 StartupNotify=true
1328 Categories=X-MandrivaLinux-System-Configuration-Networking;
1329 EOF
1330
1331 mkdir -p %{buildroot}%{_liconsdir} %{buildroot}%{_iconsdir} %{buildroot}%{_miconsdir}
1332
1333 # install html man pages for swat
1334 install -d %{buildroot}/%{_datadir}/swat%{samba_major}/help/manpages
1335 #install -m644 docs/htmldocs/manpages-3/* %{buildroot}/%{_datadir}/swat%{samba_major}/help/manpages
1336
1337 install %{SOURCE4} %{buildroot}%{_liconsdir}/swat%{samba_major}.png
1338 install %{SOURCE5} %{buildroot}%{_iconsdir}/swat%{samba_major}.png
1339 install %{SOURCE6} %{buildroot}%{_miconsdir}/swat%{samba_major}.png
1340
1341 install %{SOURCE10} %{buildroot}%{_datadir}/%{name}/scripts/print-pdf
1342 install %{SOURCE11} %{buildroot}%{_datadir}/%{name}/scripts/smb-migrate
1343
1344 # Fix configs when not building system samba:
1345
1346 #Client binaries will have suffixes while we use alternatives, even
1347 # if we are system samba
1348 %if !%build_system || %build_alternatives
1349 for OLD in %{buildroot}/%{_bindir}/{%{clientbin},eventlogadm} %{buildroot}/%{_prefix}/lib/cups/backend/smb
1350 do
1351 NEW=`echo ${OLD}%{alternative_major}`
1352 [ -e $OLD ] && mv -f $OLD $NEW
1353 done
1354 for OLD in %{buildroot}/%{_mandir}/man?/{%{clientbin},eventlogadm}*
1355 do
1356 if [ -e $OLD ]
1357 then
1358 BASE=`perl -e '$_="'${OLD}'"; m,(%buildroot)(.*?)(\.[0-9]),;print "$1$2\n";'`
1359 EXT=`echo $OLD|sed -e 's,'${BASE}',,g'`
1360 NEW=`echo ${BASE}%{alternative_major}${EXT}`
1361 mv $OLD $NEW
1362 fi
1363 done
1364 %endif
1365 # Server/common binaries are versioned only if not system samba:
1366 %if !%build_system
1367 for OLD in %{buildroot}/%{_bindir}/{%{commonbin}} %{buildroot}/%{_bindir}/{%{serverbin}%{?serverldbbin:,%serverldbbin}} %{buildroot}/%{_sbindir}/{%{serversbin},swat}
1368 do
1369 NEW=`echo ${OLD}%{alternative_major}`
1370 mv $OLD $NEW -f ||:
1371 done
1372 # And the man pages too:
1373 for OLD in %{buildroot}/%{_mandir}/man?/{%{commonbin},%{serverbin}%{?serverldbbin:,%serverldbbin},%{serversbin},swat,{%testbin},smb.conf,lmhosts}*
1374 do
1375 if [ -e $OLD ]
1376 then
1377 BASE=`perl -e '$_="'${OLD}'"; m,(%buildroot)(.*?)(\.[0-9]),;print "$1$2\n";'`
1378 # BASE=`perl -e '$name="'${OLD}'"; print "",($name =~ /(.*?)\.[0-9]/), "\n";'`
1379 EXT=`echo $OLD|sed -e 's,'${BASE}',,g'`
1380 NEW=`echo ${BASE}%{samba_major}${EXT}`
1381 mv $OLD $NEW
1382 fi
1383 done
1384 # Replace paths in config files and init scripts:
1385 for i in smb ;do
1386 perl -pi -e 's,/subsys/'$i',/subsys/'$i'%{samba_major},g' %{buildroot}/%{_initrddir}/${i}%{samba_major}
1387 done
1388 for i in %{_sysconfdir}/%{name}/smb.conf %{_initrddir}/smb%{samba_major} %{_sbindir}/%{name} %{_initrddir}/winbind /%{_sysconfdir}/logrotate.d/%{name} /%{_sysconfdir}/xinetd.d/swat%{samba_major} %{_initrddir}/wrepld%{samba_major}; do
1389 perl -pi -e 's,/%{pkg_name},/%{name},g; s,smbd,%{_sbindir}/smbd%{samba_major},g; s,nmbd,%{_sbindir}/nmbd%{samba_major},g; s,/usr/sbin/swat,%{_sbindir}/swat%{samba_major},g;s,wrepld,%{_sbindir}/wrepld%{samba_major},g' %{buildroot}/$i;
1390 done
1391 # Fix xinetd file for swat:
1392 perl -pi -e 's,/usr/sbin,%{_sbindir},g' %{buildroot}/%{_sysconfdir}/xinetd.d/swat%{samba_major}
1393 %endif
1394
1395 #Clean up unpackaged files:
1396 #for i in %{_bindir}/pam_smbpass.so %{_bindir}/smbwrapper.so;do
1397 #rm -f %{buildroot}/$i
1398 #done
1399 # the binary gets removed ... but not the man page ...
1400 rm -f %{buildroot}/%{_mandir}/man1/testprns*
1401
1402 # (sb) make a smb.conf.clean we can use for the merge, since an existing
1403 # smb.conf won't get overwritten
1404 cp %{buildroot}/%{_sysconfdir}/%{name}/smb.conf %{buildroot}/%{_datadir}/%{name}/smb.conf.clean
1405
1406 # (sb) leave a README.mga.conf to explain what has been done
1407 cat << EOF > %{buildroot}/%{_datadir}/%{name}/README.mga.conf
1408 In order to facilitate upgrading an existing samba install, and merging
1409 previous configuration data with any new syntax used by samba3, a merge
1410 script has attempted to combine your local configuration data with the
1411 new conf file format. The merged data is in smb.conf, with comments like
1412
1413 # *** merged from original smb.conf: ***
1414
1415 near the additional entries. Any local shares should have been appended to
1416 smb.conf. A log of what took place should be in:
1417
1418 /var/log/samba/smb-migrate.log
1419
1420 A clean samba3 smb.conf is in /usr/share/samba, named smb.conf.clean.
1421 Your original conf should be /etc/samba/smb.conf.tomerge.
1422
1423 The actual merge script is /usr/share/samba/scripts/smb-migrate.
1424
1425 EOF
1426
1427 # Development pkgconfig files
1428
1429 # 1. Generate the .pc files that are not done automatically
1430 # (NB: This does not work when done at the same time as configure above)
1431 for i in \
1432 %if %build_talloc
1433 talloc \
1434 %endif
1435 %if %build_tdb
1436 tdb \
1437 %endif
1438 ; do
1439 pushd lib/$i
1440 ./autogen.sh -V && ./configure --prefix=%{_prefix} --libdir=%{_libdir}
1441 popd
1442 install -m 644 lib/$i/$i.pc %{buildroot}%{_libdir}/pkgconfig/
1443 done
1444
1445 # 2. Install them
1446 for i in smbclient smbsharemodes netapi wbclient; do
1447 install -m 644 source3/pkgconfig/$i.pc %{buildroot}%{_libdir}/pkgconfig/
1448 done
1449
1450 %if !%build_ldb
1451 rm -f %{buildroot}/%{_bindir}/ldb*
1452 rm -fr %{buildroot}%{_mandir}/man1/ldbadd.1
1453 rm -fr %{buildroot}%{_mandir}/man1/ldbdel.1
1454 rm -fr %{buildroot}%{_mandir}/man1/ldbedit.1
1455 rm -fr %{buildroot}%{_mandir}/man1/ldbmodify.1
1456 rm -fr %{buildroot}%{_mandir}/man1/ldbrename.1
1457 rm -fr %{buildroot}%{_mandir}/man1/ldbsearch.1
1458 %endif
1459
1460 %if %{build_test}
1461 rm -fr %{buildroot}%{_mandir}/man1/log2pcap*.1*
1462 %else
1463 rm -fr %{buildroot}%{_mandir}/man1/vfstest%{samba_major}*.1*
1464 rm -fr %{buildroot}%{_mandir}/man1/log2pcap*.1*
1465 %endif
1466
1467 rm -fr %{buildroot}%{_mandir}/man8/tdb*.8*
1468
1469 %if %build_winbind
1470 %find_lang pam_winbind
1471 %endif
1472 %find_lang net
1473
1474 %ifarch alpha
1475 rm -f %{_bindir}/smb*m*nt%{samba_major}
1476 rm -f %{_mandir}/man8/smb*m*nt*.8*
1477 %endif
1478
1479 %if !%build_system
1480 rm -f %{_libdir}/libsmbclient.so.*
1481 rm -f %{_includedir}/*
1482 rm -f %{_libdir}/libsmbclient.so
1483 rm -f %{_libdir}/lib*.a
1484 rm -f %{_mandir}/man8/libsmbclient.8*
1485 rm -f %{_libdir}/pkgconfig/smbclient.pc
1486 %endif
1487
1488 %if %build_vscan
1489 #rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan*.so
1490
1491 %if !%build_antivir
1492 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-antivir.so
1493 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-antivir.conf
1494 %endif
1495
1496 %if !%build_clamav
1497 rm -f %{buildroot}%{_libdir}/%{name}/vfs/svf-clamav.so
1498 rm -f %{buildroot}%{_sysconfdir}/%{name}/smb.svf-clamav.conf
1499 %endif
1500
1501 %if !%build_fprot
1502 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-fprotd.so
1503 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-fprotd.conf
1504 %endif
1505
1506 %if !%build_fsav
1507 rm -f %{buildroot}%{_libdir}/%{name}/vfs/svf-fsav.so
1508 rm -f %{buildroot}%{_sysconfdir}/%{name}/smb.svf-fsav.conf
1509 %endif
1510
1511 %if !%build_icap
1512 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-icap.so
1513 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-icap.conf
1514 %endif
1515
1516 %if !%build_kaspersky
1517 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-kavp.so
1518 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-kavp.conf
1519 %endif
1520
1521 %if !%build_mks
1522 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-mksd.so
1523 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-mks*.conf
1524 %endif
1525
1526 %if !%build_nai
1527 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-mcdaemon.so
1528 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-mcdaemon.conf
1529 %endif
1530
1531 %if !%build_openav
1532 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-oav.so
1533 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-oav.conf
1534 %endif
1535
1536 %if !%build_sophos
1537 rm -f %{buildroot}%{_libdir}/%{name}/vfs/svf-sophos.so
1538 rm -f %{buildroot}%{_sysconfdir}/%{name}/smb.svf-sophos.conf
1539 %endif
1540
1541 %if !%build_symantec
1542 rm -rf %{buildroot}%{_sysconfdir}/%{name}/vscan-symantec.conf
1543 %endif
1544
1545 %if !%build_trend
1546 rm -f %{buildroot}%{_libdir}/%{name}/vfs/vscan-trend.so
1547 rm -f %{buildroot}%{_sysconfdir}/%{name}/vscan-trend.conf
1548 %endif
1549 %endif
1550
1551 # these are provided by ldb-utils
1552 rm -f %{buildroot}%{_mandir}/man1/ldbadd.1*
1553 rm -f %{buildroot}%{_mandir}/man1/ldbdel.1*
1554 rm -f %{buildroot}%{_mandir}/man1/ldbedit.1*
1555 rm -f %{buildroot}%{_mandir}/man1/ldbmodify.1*
1556 rm -f %{buildroot}%{_mandir}/man1/ldbrename.1*
1557 rm -f %{buildroot}%{_mandir}/man1/ldbsearch.1*
1558
1559 # these are provided by tdb-utils
1560 rm -f %{buildroot}%{_mandir}/man8/tdbbackup.8*
1561 rm -f %{buildroot}%{_mandir}/man8/tdbdump.8*
1562 rm -f %{buildroot}%{_mandir}/man8/tdbtool.8*
1563
1564 # these are not built
1565 rm -f %{buildroot}%{_mandir}/man1/log2pcap.1*
1566 rm -f %{buildroot}%{_mandir}/man1/vfstest.1*
1567
1568 %clean
1569 rm -rf %{buildroot}
1570
1571 %post server
1572
1573 %_post_service smb%{samba_major}
1574 #%_post_service wrepld%{samba_major}
1575
1576 # Add a unix group for samba machine accounts
1577 groupadd -frg 421 machines
1578
1579 # Migrate tdb's from /var/lock/samba (taken from official samba spec file):
1580 for i in /var/lock/samba/*.tdb
1581 do
1582 if [ -f $i ]; then
1583 newname=`echo $i | sed -e's|var\/lock\/samba|var\/cache\/samba|'`
1584 echo "Moving $i to $newname"
1585 mv $i $newname
1586 fi
1587 done
1588
1589 %post common
1590 %_tmpfilescreate %{name}
1591
1592 # Basic migration script for pre-2.2.1 users,
1593 # since smb config moved from /etc to %{_sysconfdir}/samba
1594
1595 # Let's create a proper %{_sysconfdir}/samba/smbpasswd file
1596 [ -f %{_sysconfdir}/%{name}/smbpasswd ] || {
1597 echo "Creating password file for samba..."
1598 touch %{_sysconfdir}/%{name}/smbpasswd
1599 }
1600
1601 # And this too, in case we don't have smbd to create it for us
1602 [ -f /var/cache/%{name}/unexpected.tdb ] || {
1603 touch /var/cache/%{name}/unexpected.tdb
1604 }
1605
1606 # Let's define the proper paths for config files
1607 perl -pi -e 's/(\/etc\/)(smb)/\1%{name}\/\2/' %{_sysconfdir}/%{name}/smb.conf
1608
1609 # Fix the logrotate.d file from smb and nmb to smbd and nmbd
1610 if [ -f %{_sysconfdir}/logrotate.d/samba ]; then
1611 perl -pi -e 's/smb /smbd /' %{_sysconfdir}/logrotate.d/samba
1612 perl -pi -e 's/nmb /nmbd /' %{_sysconfdir}/logrotate.d/samba
1613 fi
1614
1615 # And not loose our machine account SID
1616 [ -f %{_sysconfdir}/MACHINE.SID ] && mv -f %{_sysconfdir}/MACHINE.SID %{_sysconfdir}/%{name}/ ||:
1617
1618 # FIXME: Can be removed in mageia ?
1619 %triggerpostun common -- samba-common < 3.0.1-3mdk
1620 # (sb) merge any existing smb.conf with new syntax file
1621 if [ $1 = 2 ]; then
1622 # (sb) save existing smb.conf for merge
1623 echo "Upgrade: copy smb.conf to smb.conf.tomerge for merging..."
1624 cp -f %{_sysconfdir}/%{name}/smb.conf %{_sysconfdir}/%{name}/smb.conf.tomerge
1625 echo "Upgrade: merging previous smb.conf..."
1626 if [ -f %{_datadir}/%{name}/smb.conf.clean ]; then
1627 cp %{_datadir}/%{name}/smb.conf.clean %{_sysconfdir}/%{name}/smb.conf
1628 cp %{_datadir}/%{name}/README.mga.conf %{_sysconfdir}/%{name}/
1629 %{_datadir}/%{name}/scripts/smb-migrate commit
1630 fi
1631 fi
1632
1633 %postun common
1634 if [ -f %{_sysconfdir}/%{name}/README.mga.conf ];then rm -f %{_sysconfdir}/%{name}/README.mga.conf;fi
1635
1636 %if %build_winbind
1637 %post winbind
1638 if [ $1 = 1 ]; then
1639 /sbin/chkconfig winbind on
1640 cp -af %{_sysconfdir}/nsswitch.conf %{_sysconfdir}/nsswitch.conf.rpmsave
1641 cp -af %{_sysconfdir}/nsswitch.conf %{_sysconfdir}/nsswitch.conf.rpmtemp
1642 for i in passwd group;do
1643 grep ^$i %{_sysconfdir}/nsswitch.conf |grep -v 'winbind' >/dev/null
1644 if [ $? = 0 ];then
1645 echo "Adding a winbind entry to the $i section of %{_sysconfdir}/nsswitch.conf"
1646 awk '/^'$i'/ {print $0 " winbind"};!/^'$i'/ {print}' %{_sysconfdir}/nsswitch.conf.rpmtemp >%{_sysconfdir}/nsswitch.conf;
1647 cp -af %{_sysconfdir}/nsswitch.conf %{_sysconfdir}/nsswitch.conf.rpmtemp
1648 else
1649 echo "$i entry found in %{_sysconfdir}/nsswitch.conf"
1650 fi
1651 done
1652 if [ -f %{_sysconfdir}/nsswitch.conf.rpmtemp ];then rm -f %{_sysconfdir}/nsswitch.conf.rpmtemp;fi
1653 fi
1654
1655 %preun winbind
1656 if [ $1 = 0 ]; then
1657 echo "Removing winbind entries from %{_sysconfdir}/nsswitch.conf"
1658 perl -pi -e 's/ winbind//' %{_sysconfdir}/nsswitch.conf
1659
1660 /sbin/chkconfig winbind reset
1661 fi
1662 %endif %build_winbind
1663
1664 %if %build_wins
1665 %post -n nss_wins%{samba_major}
1666 if [ $1 = 1 ]; then
1667 cp -af %{_sysconfdir}/nsswitch.conf %{_sysconfdir}/nsswitch.conf.rpmsave
1668 grep '^hosts' %{_sysconfdir}/nsswitch.conf |grep -v 'wins' >/dev/null
1669 if [ $? = 0 ];then
1670 echo "Adding a wins entry to the hosts section of %{_sysconfdir}/nsswitch.conf"
1671 awk '/^hosts/ {print $0 " wins"};!/^hosts/ {print}' %{_sysconfdir}/nsswitch.conf.rpmsave >%{_sysconfdir}/nsswitch.conf;
1672 else
1673 echo "wins entry found in %{_sysconfdir}/nsswitch.conf"
1674 fi
1675 # else
1676 # echo "Upgrade, leaving nsswitch.conf intact"
1677 fi
1678
1679 %preun -n nss_wins%{samba_major}
1680 if [ $1 = 0 ]; then
1681 echo "Removing wins entry from %{_sysconfdir}/nsswitch.conf"
1682 perl -pi -e 's/ wins//' %{_sysconfdir}/nsswitch.conf
1683 #else
1684 # echo "Leaving %{_sysconfdir}/nsswitch.conf intact"
1685 fi
1686 %endif %build_wins
1687
1688 %preun server
1689
1690 %_preun_service smb%{samba_major}
1691 #%_preun_service wrepld%{samba_major}
1692
1693 #if [ $1 = 0 ] ; then
1694 # /sbin/chkconfig --level 35 smb reset
1695 # Let's not loose /var/cache/samba
1696 #
1697 # if [ -d /var/cache/%{name} ]; then
1698 # mv -f /var/cache/%{name} /var/cache/%{name}.BAK
1699 # fi
1700 #fi
1701
1702 %post swat
1703 if [ -f /var/lock/subsys/xinetd ]; then
1704 service xinetd reload >/dev/null 2>&1 || :
1705 fi
1706
1707 %postun swat
1708
1709 # Remove swat entry from xinetd
1710 if [ $1 = 0 -a -f %{_sysconfdir}/xinetd.conf ] ; then
1711 rm -f %{_sysconfdir}/xinetd.d/swat%{samba_major}
1712 service xinetd reload &>/dev/null || :
1713 fi
1714
1715 if [ "$1" = "0" -a -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
1716
1717 %if %build_alternatives
1718 %post client
1719
1720 update-alternatives --install %{_bindir}/smbclient smbclient \
1721 %{_bindir}/smbclient%{alternative_major} 10 \
1722 $(for i in %{_bindir}/{%{clientbin},eventlogadm};do
1723 j=`basename $i`
1724 [ "$j" = "smbclient" ] || \
1725 echo -n " --slave ${i} ${j} ${i}%{alternative_major}";done) \
1726 $(for i in %{_mandir}/{%{client_man}};do
1727 echo -n " --slave ${i}%{_extension} `basename $i` ${i%%.?}%{alternative_major}.${i##*.}%{_extension}";done) \
1728 --slave %{_prefix}/lib/cups/backend/smb cups_smb %{_prefix}/lib/cups/backend/smb%{alternative_major} || \
1729 update-alternatives --auto smbclient
1730
1731 %preun client
1732 [ $1 = 0 ] && update-alternatives --remove smbclient %{_bindir}/smbclient%{alternative_major} ||:
1733 %endif
1734
1735 %if %build_alternatives
1736 %triggerpostun client -- samba-client, samba2-client
1737 [ ! -e %{_bindir}/smbclient ] && update-alternatives --auto smbclient || :
1738 %endif
1739
1740 %files server
1741 %defattr(-,root,root)
1742 %(for i in %{_sbindir}/{%{serversbin}}%{samba_major};do echo $i;done)
1743 %(for i in %{_bindir}/{%{serverbin}%{?serverldbbin:,%serverldbbin}}%{samba_major};do echo $i;done)
1744 %attr(755,root,root) /%{_lib}/security/pam_smbpass*
1745 %dir %{_libdir}/%{name}/vfs
1746 %{_libdir}/%{name}/vfs/*.so
1747 %dir %{_libdir}/%{name}/pdb
1748 %{_libdir}/%{name}/auth
1749 #{_libdir}/%{name}/*.so
1750 %dir %{_libdir}/%{name}/nss_info
1751 %{_libdir}/%{name}/nss_info/rfc2307.so
1752 %{_libdir}/%{name}/nss_info/sfu*.so
1753
1754 %attr(-,root,root) %config(noreplace) %{_sysconfdir}/%{name}/smbusers
1755 %attr(-,root,root) %config(noreplace) %{_initrddir}/smb%{samba_major}
1756 #%attr(-,root,root) %config(noreplace) %{_initrddir}/wrepld%{samba_major}
1757 %attr(-,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
1758 %attr(-,root,root) %config(noreplace) %{_sysconfdir}/pam.d/%{name}
1759 #%attr(-,root,root) %config(noreplace) %{_sysconfdir}/%{name}/samba-slapd.include
1760 %(for i in %{_mandir}/man?/{%{serverbin}%{?serverldbbin:,%serverldbbin},%{serversbin}}%{samba_major}\.[0-9]\\*;do echo $i|grep -v mkntpwd;done)
1761 %attr(775,root,adm) %dir %{_localstatedir}/lib/%{name}/netlogon
1762 %attr(755,root,root) %dir %{_localstatedir}/lib/%{name}/profiles
1763 %attr(755,root,root) %dir %{_localstatedir}/lib/%{name}/printers
1764 %attr(2775,root,adm) %dir %{_localstatedir}/lib/%{name}/printers/*
1765 %attr(1777,root,root) %dir /var/spool/%{name}
1766 %dir %{_datadir}/%{name}
1767 %dir %{_datadir}/%{name}/scripts
1768 %attr(0755,root,root) %{_datadir}/%{name}/scripts/*
1769 %exclude %{_datadir}/%{name}/scripts/smb-migrate
1770 %{_mandir}/man8/idmap_*.8*
1771 %{_mandir}/man8/vfs_*.8*
1772
1773 %files doc
1774 %defattr(-,root,root)
1775 %doc README COPYING Manifest Read-Manifest-Now
1776 %doc WHATSNEW.txt Roadmap
1777 %doc README.%{name}-mageia-rpm
1778 %doc clean-docs/samba-doc/docs/*
1779 %doc clean-docs/samba-doc/examples
1780 #%attr(-,root,root) %{_datadir}/swat%{samba_major}/using_samba/
1781 %attr(-,root,root) %{_datadir}/swat%{samba_major}/help/
1782
1783 %files swat
1784 %defattr(-,root,root)
1785 %config(noreplace) %{_sysconfdir}/xinetd.d/swat%{samba_major}
1786 #%attr(-,root,root) /sbin/*
1787 %{_sbindir}/swat%{samba_major}
1788 %{_datadir}/applications/mageia-%{name}-swat.desktop
1789 %{_miconsdir}/*.png
1790 %{_liconsdir}/*.png
1791 %{_iconsdir}/*.png
1792 #%attr(-,root,root) %{_datadir}/swat%{samba_major}/help/
1793 %attr(-,root,root) %{_datadir}/swat%{samba_major}/images/
1794 %attr(-,root,root) %{_datadir}/swat%{samba_major}/include/
1795 %lang(ja) %{_datadir}/swat%{samba_major}/lang/ja
1796 %lang(tr) %{_datadir}/swat%{samba_major}/lang/tr
1797 %{_mandir}/man8/swat*.8*
1798 %lang(de) %{_libdir}/%{name}/de.msg
1799 %lang(en) %{_libdir}/%{name}/en.msg
1800 %lang(fr) %{_libdir}/%{name}/fr.msg
1801 %lang(it) %{_libdir}/%{name}/it.msg
1802 %lang(ja) %{_libdir}/%{name}/ja.msg
1803 %lang(nl) %{_libdir}/%{name}/nl.msg
1804 %lang(pl) %{_libdir}/%{name}/pl.msg
1805 %lang(tr) %{_libdir}/%{name}/tr.msg
1806 %lang(fi) %{_libdir}/%{name}/fi.msg
1807 %lang(ru) %{_libdir}/%{name}/ru.msg
1808 #%doc swat/README
1809
1810 %files client
1811 %defattr(-,root,root)
1812 %(for i in %{_bindir}/{%{clientbin},eventlogadm}%{alternative_major};do echo $i;done)
1813 %(for i in %{_mandir}/man?/{%{clientbin}}%{alternative_major}.\\?.\\*;do echo $i|grep -v smbprint;done)
1814 #xclude %{_mandir}/man?/smbget*
1815 %{_mandir}/man5/smbgetrc%{alternative_major}.5*
1816 %ifnarch alpha
1817 #(for i in /sbin/{%{client_sbin}}%{alternative_major};do echo $i|grep -v "smb.*m.*nt";done)
1818 %endif
1819 %{_mandir}/man8/eventlogadm3.8*
1820 # Link of smbspool to CUPS
1821 %{_prefix}/lib*/cups/backend/smb%{alternative_major}
1822
1823 %files common -f net.lang
1824 %defattr(-,root,root)
1825 %dir /var/cache/%{name}
1826 %dir /var/log/%{name}
1827 %{_tmpfilesdir}/%{name}.conf
1828 %(for i in %{_bindir}/{%{commonbin}}%{samba_major};do echo $i;done)
1829 %(for i in %{_mandir}/man?/{%{commonbin}}%{samba_major}\.[0-9]\\*;do echo $i;done)
1830 #%{_libdir}/smbwrapper%{samba_major}.so
1831 %dir %{_libdir}/%{name}
1832 %{_libdir}/%{name}/*.dat
1833 %{_libdir}/%{name}/charset
1834 #%{_libdir}/%{name}/lowcase.dat
1835 #%{_libdir}/%{name}/valid.dat
1836 %dir %{_sysconfdir}/%{name}
1837 %attr(-,root,root) %config(noreplace) %{_sysconfdir}/%{name}/smb.conf
1838 %attr(-,root,root) %config(noreplace) %{_sysconfdir}/%{name}/smb-winbind.conf
1839 %attr(-,root,root) %config(noreplace) %{_sysconfdir}/%{name}/lmhosts
1840 %dir %{_localstatedir}/lib/%{name}
1841 %attr(-,root,root) %{_localstatedir}/lib/%{name}/codepages
1842 %{_mandir}/man5/smb.conf*.5*
1843 %{_mandir}/man5/lmhosts*.5*
1844 #%{_mandir}/man7/Samba*.7*
1845 %dir %{_datadir}/swat%{samba_major}
1846 %attr(0750,root,adm) %{_datadir}/%{name}/scripts/smb-migrate
1847 %attr(-,root,root) %{_datadir}/%{name}/smb.conf.clean
1848 %attr(-,root,root) %{_datadir}/%{name}/README.mga.conf
1849
1850 %if %build_winbind
1851 %files winbind -f pam_winbind.lang
1852 %defattr(-,root,root)
1853 %config(noreplace) %{_sysconfdir}/security/pam_winbind.conf
1854 %{_sbindir}/winbindd
1855 %{_sbindir}/winbind
1856 %{_bindir}/wbinfo
1857 %attr(755,root,root) /%{_lib}/security/pam_winbind*
1858 %attr(755,root,root) /%{_lib}/libnss_winbind*
1859 %{_libdir}/%{name}/idmap
1860 %{_libdir}/krb5/plugins/winbind_krb5_locator.so
1861 %attr(-,root,root) %config(noreplace) %{_initrddir}/winbind
1862 %attr(-,root,root) %config(noreplace) %{_sysconfdir}/pam.d/system-auth-winbind*
1863 %{_mandir}/man8/winbindd*.8*
1864 %{_mandir}/man8/pam_winbind.8*
1865 %{_mandir}/man5/pam_winbind.conf.5.*
1866 %{_mandir}/man7/winbind_krb5_locator.7.*
1867 %{_mandir}/man1/wbinfo*.1*
1868 %endif
1869
1870 %if %build_wins
1871 %files -n nss_wins%{samba_major}
1872 %defattr(-,root,root)
1873 %attr(755,root,root) /%{_lib}/libnss_wins.so*
1874 %endif
1875
1876 %if %{build_test}
1877 %files test
1878 %defattr(-,root,root)
1879 %(for i in %{_bindir}/{%{testbin}}%{samba_major};do echo $i;done)
1880 %{_mandir}/man1/vfstest%{samba_major}*.1*
1881 %endif
1882
1883 %if %build_system
1884 %files -n %{libname}
1885 %defattr(-,root,root)
1886 %{_libdir}/libsmbclient.so.%{libsmbmajor}
1887 %endif
1888
1889 %if %build_system
1890 %files -n %{libname}-devel
1891 %defattr(-,root,root)
1892 %{_includedir}/libsmbclient.h
1893 %{_libdir}/libsmbclient.so
1894 %doc clean-docs/libsmbclient/*
1895 %{_mandir}/man7/libsmbclient.7*
1896 %{_libdir}/pkgconfig/smbclient.pc
1897 %endif
1898
1899 %if %build_system
1900 %files -n %{libname}-static-devel
1901 %defattr(-,root,root)
1902 %{_libdir}/lib*.a
1903 %endif
1904
1905 %files -n %libnetapi
1906 %defattr(-,root,root)
1907 %{_libdir}/libnetapi.so.%{netapimajor}*
1908
1909 %files -n %netapidevel
1910 %defattr(-,root,root)
1911 %{_libdir}/libnetapi*.so
1912 %{_includedir}/netapi.h
1913 %{_libdir}/pkgconfig/netapi.pc
1914
1915 %files -n %libsmbsharemodes
1916 %defattr(-,root,root)
1917 %{_libdir}/libsmbsharemodes.so.%{smbsharemodesmajor}*
1918
1919 %files -n %smbsharemodesdevel
1920 %defattr(-,root,root)
1921 %{_libdir}/libsmbsharemodes.so
1922 %{_includedir}/smb_share_modes.h
1923 %{_libdir}/pkgconfig/smbsharemodes.pc
1924
1925 %if %build_talloc
1926 %files -n %libtalloc
1927 %defattr(-,root,root)
1928 %{_libdir}/libtalloc.so.%{tallocmajor}*
1929
1930 %files -n %tallocdevel
1931 %defattr(-,root,root)
1932 %{_libdir}/libtalloc.so
1933 %{_includedir}/talloc.h
1934 %{_libdir}/pkgconfig/talloc.pc
1935 %endif
1936
1937 %if %build_tdb
1938 %files -n %libtdb
1939 %defattr(-,root,root)
1940 %{_libdir}/libtdb.so.%{tdbmajor}*
1941
1942 %files -n %tdbdevel
1943 %defattr(-,root,root)
1944 %{_libdir}/libtdb.so
1945 %{_includedir}/tdb.h
1946 %{_libdir}/pkgconfig/tdb.pc
1947 %endif
1948
1949 %files -n %libwbclient
1950 %defattr(-,root,root)
1951 %{_libdir}/libwbclient.so.%{wbclientmajor}
1952
1953 %files -n %wbclientdevel
1954 %defattr(-,root,root)
1955 %{_libdir}/libwbclient.so
1956 %{_includedir}/wbclient.h
1957 %{_libdir}/pkgconfig/wbclient.pc
1958
1959 #%files passdb-ldap
1960 #%defattr(-,root,root)
1961 #%{_libdir}/%{name}/*/*ldap.so
1962
1963 %ifnarch alpha
1964 %if %{build_mysql}
1965 %files passdb-mysql
1966 %defattr(-,root,root)
1967 %{_libdir}/%{name}/pdb/*mysql.so
1968 %endif
1969 %endif
1970
1971 %if %{build_pgsql}
1972 %files passdb-pgsql
1973 %defattr(-,root,root)
1974 %{_libdir}/%{name}/pdb/*pgsql.so
1975 %endif
1976
1977 #Files for antivirus support:
1978 %if %build_antivir
1979 %files vscan-antivir
1980 %defattr(-,root,root)
1981 %{_libdir}/%{name}/vfs/vscan-antivir.so
1982 %config(noreplace) %{_sysconfdir}/%{name}/vscan-antivir.conf
1983 %endif
1984
1985 %if %build_clamav
1986 %files virusfilter-clamav
1987 %defattr(-,root,root)
1988 %{_libdir}/%{name}/vfs/svf-clamav.so
1989 %config(noreplace) %{_sysconfdir}/%{name}/smb.svf-clamav.conf
1990 %endif
1991
1992 %if %build_fprot
1993 %files vscan-fprot
1994 %defattr(-,root,root)
1995 %{_libdir}/%{name}/vfs/vscan-fprotd.so
1996 %config(noreplace) %{_sysconfdir}/%{name}/vscan-fprotd.conf
1997 %doc %{vfsdir}/%{vscandir}/INSTALL
1998 %endif
1999
2000 %if %build_fsav
2001 %files virusfilter-fsecure
2002 %defattr(-,root,root)
2003 %{_libdir}/%{name}/vfs/svf-fsav.so
2004 %config(noreplace) %{_sysconfdir}/%{name}/smb.svf-fsav.conf
2005 %endif
2006
2007 %if %build_icap
2008 %files vscan-icap
2009 %defattr(-,root,root)
2010 %{_libdir}/%{name}/vfs/vscan-icap.so
2011 %config(noreplace) %{_sysconfdir}/%{name}/vscan-icap.conf
2012 %doc %{vfsdir}/%{vscandir}/INSTALL
2013 %endif
2014
2015 %if %build_kaspersky
2016 %files vscan-kaspersky
2017 %defattr(-,root,root)
2018 %{_libdir}/%{name}/vfs/vscan-kavp.so
2019 %config(noreplace) %{_sysconfdir}/%{name}/vscan-kavp.conf
2020 %doc %{vfsdir}/%{vscandir}/INSTALL
2021 %endif
2022
2023 %if %build_mks
2024 %files vscan-mks
2025 %defattr(-,root,root)
2026 %{_libdir}/%{name}/vfs/vscan-mksd.so
2027 %config(noreplace) %{_sysconfdir}/%{name}/vscan-mks*.conf
2028 %doc %{vfsdir}/%{vscandir}/INSTALL
2029 %endif
2030
2031 %if %build_nai
2032 %files vscan-nai
2033 %defattr(-,root,root)
2034 %{_libdir}/%{name}/vfs/vscan-mcdaemon.so
2035 %config(noreplace) %{_sysconfdir}/%{name}/vscan-mcdaemon.conf
2036 %doc %{vfsdir}/%{vscandir}/INSTALL
2037 %endif
2038
2039 %if %build_openav
2040 %files vscan-openav
2041 %defattr(-,root,root)
2042 %{_libdir}/%{name}/vfs/vscan-oav.so
2043 %config(noreplace) %{_sysconfdir}/%{name}/vscan-oav.conf
2044 %doc %{vfsdir}/%{vscandir}/INSTALL
2045 %endif
2046
2047 %if %build_sophos
2048 %files virusfilter-sophos
2049 %defattr(-,root,root)
2050 %{_libdir}/%{name}/vfs/svf-sophos.so
2051 %config(noreplace) %{_sysconfdir}/%{name}/smb.svf-sophos.conf
2052 %endif
2053
2054 %if %build_symantec
2055 %files vscan-symantec
2056 %defattr(-,root,root)
2057 %{_libdir}/%{name}/vfs/vscan-symantec.so
2058 %config(noreplace) %{_sysconfdir}/%{name}/vscan-symantec.conf
2059 %doc %{vfsdir}/%{vscandir}/INSTALL
2060 %endif
2061
2062 %if %build_trend
2063 %files vscan-trend
2064 %defattr(-,root,root)
2065 %{_libdir}/%{name}/vfs/vscan-trend.so
2066 %config(noreplace) %{_sysconfdir}/%{name}/vscan-trend.conf
2067 %doc %{vfsdir}/%{vscandir}/INSTALL
2068 %endif
2069
2070 %files domainjoin-gui
2071 %defattr(-,root,root)
2072 %{_sbindir}/netdomjoin-gui
2073 %dir %{_datadir}/pixmaps/samba
2074 %{_datadir}/pixmaps/samba/samba.ico
2075 %{_datadir}/pixmaps/samba/logo.png
2076 %{_datadir}/pixmaps/samba/logo-small.png
2077

  ViewVC Help
Powered by ViewVC 1.1.30