| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- ##
- ## samba.spec -- OpenPKG RPM Specification
- ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
- ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
- ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package information
- Name: samba
- Summary: SMB/CIFS Server
- URL: http://www.samba.org/
- Vendor: Andrew Tridgell
- Packager: The OpenPKG Project
- Distribution: OpenPKG
- Class: BASE
- Group: Filesystem
- License: GPL
- Version: 3.0.4
- Release: 20040701
- # package options
- %option with_pam no
- %option with_swat no
- %option with_acl no
- %option with_ldap no
- # list of sources
- Source0: http://download.samba.org/samba/ftp/samba-%{version}.tar.gz
- Source1: smb.conf
- Source2: smb.hosts
- Source3: rc.samba
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040130
- PreReq: OpenPKG, openpkg >= 20040130
- BuildPreReq: openssl, popt, perl
- PreReq: openssl, popt, perl
- %if "%{with_pam}" == "yes"
- BuildPreReq: PAM
- PreReq: PAM
- %endif
- %if "%{with_ldap}" == "yes"
- BuildPreReq: openldap
- PreReq: openldap
- %endif
- AutoReq: no
- AutoReqProv: no
- %description
- Samba is an open source software suite that provides seamless file
- and print services to SMB/CIFS clients plus name resolution services
- to NetBIOS clients. The Samba software suite is a collection of
- programs that implements the Server Message Block (SMB) protocol
- for UNIX systems. This protocol is sometimes also referred to as
- the Common Internet File System (CIFS) and is the network protocol
- which provides filesharing and printing services to MSCLIENT 3.0 for
- DOS, Windows for Workgroups (LanManager), Windows 95/98/ME, Windows
- NT/2000/XP/2003, OS/2, MacOS DAVE and Linux smbfs clients.
- %track
- prog samba = {
- version = %{version}
- url = http://download.samba.org/samba/ftp/
- regex = samba-(__VER__)\.tar\.gz
- }
- %prep
- %setup -q
- %{l_patch} -p1 <packaging/Mandrake/samba-3.0-smbmount-sbin.patch
- %build
- cd source
- CC="%{l_cc}"
- CFLAGS="%{l_cflags -O}"
- CPPFLAGS="%{l_cppflags openssl} -DOPENSSL_DISABLE_OLD_DES_SUPPORT"
- LDFLAGS="%{l_ldflags}"
- %if "%{with_pam}" == "yes"
- CPPFLAGS="$CPPFLAGS -I`%{l_prefix}/etc/rc --query pam_incdir`"
- LDFLAGS="$LDFLAGS -L`%{l_prefix}/etc/rc --query pam_libdir`"
- %endif
- options=""
- case "%{l_platform -t}" in
- *-linux2.[46]* ) options="--with-smbmount" ;;
- esac
- export CC
- export CFLAGS
- export CPPFLAGS
- export LDFLAGS
- ./configure \
- --prefix=%{l_prefix} \
- --libexecdir=%{l_prefix}/libexec/samba \
- --localstatedir=%{l_prefix}/var/samba/run \
- --sysconfdir=%{l_prefix}/etc/samba \
- --with-libdir=%{l_prefix}/lib/samba \
- --with-privatedir=%{l_prefix}/etc/samba \
- --with-configdir=%{l_prefix}/etc/samba \
- --with-lockdir=%{l_prefix}/var/samba/run/locks \
- --with-piddir=%{l_prefix}/var/samba/run \
- --with-privatedir=%{l_prefix}/var/samba/run/private \
- --with-swatdir=%{l_prefix}/share/samba \
- --without-included-popt \
- %if "%{with_acl}" == "yes"
- --with-acl-support \
- %endif
- %if "%{with_pam}" == "yes"
- --with-pam \
- %endif
- %if "%{with_ldap}" == "yes"
- --with-ldap \
- %endif
- --with-vfs \
- $options
- %{l_make} %{l_mflags}
- %install
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/etc/samba \
- $RPM_BUILD_ROOT%{l_prefix}/var/samba/spool \
- $RPM_BUILD_ROOT%{l_prefix}/var/samba/netlogon \
- $RPM_BUILD_ROOT%{l_prefix}/var/samba/profiles
- ( cd source
- %{l_make} %{l_mflags} \
- DESTDIR=$RPM_BUILD_ROOT \
- LIBDIR=%{l_prefix}/lib/samba \
- installbin installman installscripts installdat installmodules
- %if "%{with_swat}" == "yes"
- %{l_make} %{l_mflags} installswat DESTDIR=$RPM_BUILD_ROOT
- %endif
- ) || exit $?
- l_hostname=`%{l_shtool} echo -e %h`
- l_domainname=`%{l_shtool} echo -e %d`
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@l_hostname@;$l_hostname;g" \
- -e "s;@l_domainname@;$l_domainname;g" \
- %{SOURCE smb.conf} \
- %{SOURCE smb.hosts} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/samba/
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.samba} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/samba/*' \
- '%attr(1777,%{l_musr},%{l_mgrp}) %{l_prefix}/var/samba/spool' \
- '%attr(1777,%{l_musr},%{l_mgrp}) %{l_prefix}/var/samba/profiles'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %pre
- # before upgrade, save status and stop service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} samba status 2>/dev/null | tee %{l_tmpfile}`
- %{l_rc} samba stop 2>/dev/null
- exit 0
- %post
- %if "%{with_pam}" == "yes"
- if [ $1 -eq 1 ]; then
- # after install, add PAM configuration entry
- $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=smbd
- fi
- %endif
- if [ $1 -eq 2 ]; then
- # after upgrade, restore status
- { eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}; true; } >/dev/null 2>&1
- [ ".$samba_active" = .yes ] && %{l_rc} samba start
- fi
- exit 0
- %preun
- # before erase, stop service and remove log files
- [ $1 -eq 0 ] || exit 0
- %{l_rc} samba stop 2>/dev/null
- rm -f $RPM_INSTALL_PREFIX/var/samba/run/log.[sn]mbd* >/dev/null 2>&1 || true
- %if "%{with_pam}" == "yes"
- # remove PAM configuration entry
- $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=smbd
- %endif
- exit 0
|