samba.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ##
  2. ## samba.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: samba
  26. Summary: SMB/CIFS Server
  27. URL: http://www.samba.org/
  28. Vendor: Andrew Tridgell
  29. Packager: The OpenPKG Project
  30. Distribution: OpenPKG [EXP]
  31. Group: Filesystem
  32. License: GPL
  33. Version: 2.2.2
  34. Release: %{l_branch}.0
  35. # list of sources
  36. Source0: ftp://ftp.samba.org/pub/samba/samba-%{version}.tar.gz
  37. Source1: smb.conf
  38. Source2: smb.hosts
  39. Source3: rc.samba
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20011023.0, openssl
  44. PreReq: OpenPKG, openpkg >= 20011023.0
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. Samba is an open source software suite that provides seamless file
  49. and print services to SMB/CIFS clients.
  50. %prep
  51. %setup -q
  52. %build
  53. ( cd source
  54. CC="%{l_cc}" \
  55. CFLAGS="%{l_cflags -O} -I%{l_prefix}/include -I%{l_prefix}/include/openssl" \
  56. LDFLAGS="-L%{l_prefix}/lib" \
  57. ./configure \
  58. --prefix=%{l_prefix} \
  59. --localstatedir=%{l_prefix}/var/samba/run \
  60. --sysconfdir=%{l_prefix}/etc/samba \
  61. --with-privatedir=%{l_prefix}/var/samba/run \
  62. --with-sambaconfdir=%{l_prefix}/etc/samba \
  63. --with-lockdir=%{l_prefix}/var/samba/run \
  64. --with-swatdir=%{l_prefix}/share/samba \
  65. --with-codepagedir=%{l_prefix}/share/samba \
  66. --with-ssl --with-sslinc=%{l_prefix}/include \
  67. --with-pam \
  68. --with-vfs
  69. %{l_make} %{l_mflags -O} \
  70. CONFIGFILE=%{l_prefix}/etc/samba/smb.conf \
  71. LMHOSTSFILE=%{l_prefix}/etc/samba/smb.hosts
  72. )
  73. %install
  74. rm -rf $RPM_BUILD_ROOT
  75. %{l_shtool} mkdir -f -p -m 755 \
  76. $RPM_BUILD_ROOT%{l_prefix} \
  77. $RPM_BUILD_ROOT%{l_prefix}/etc/samba \
  78. $RPM_BUILD_ROOT%{l_prefix}/var/samba \
  79. $RPM_BUILD_ROOT%{l_prefix}/share/samba \
  80. $RPM_BUILD_ROOT%{l_prefix}/libexec/samba \
  81. $RPM_BUILD_ROOT%{l_prefix}/var/samba/run \
  82. $RPM_BUILD_ROOT%{l_prefix}/var/samba/spool \
  83. $RPM_BUILD_ROOT%{l_prefix}/var/samba/netlogon \
  84. $RPM_BUILD_ROOT%{l_prefix}/var/samba/profiles
  85. ( cd source
  86. %{l_make} %{l_mflags} install \
  87. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  88. BASEDIR=$RPM_BUILD_ROOT%{l_prefix} \
  89. CONFIGDIR=$RPM_BUILD_ROOT%{l_prefix}/etc/samba \
  90. VARDIR=$RPM_BUILD_ROOT%{l_prefix}/var/samba/run \
  91. SWATDIR=$RPM_BUILD_ROOT%{l_prefix}/share/samba \
  92. CODEPAGEDIR=$RPM_BUILD_ROOT%{l_prefix}/share/samba \
  93. CONFIGFILE=%{l_prefix}/etc/samba/smb.conf \
  94. LMHOSTSFILE=%{l_prefix}/etc/samba/smb.hosts
  95. )
  96. l_hostname=`%{l_shtool} echo -e %h%d`
  97. %{l_shtool} install -c -m 644 \
  98. -e "s;@l_prefix@;%{l_prefix};g" \
  99. -e "s;@l_hostname@;$l_hostname;g" \
  100. %{SOURCE smb.conf} \
  101. %{SOURCE smb.hosts} \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/samba/
  103. for file in make_printerdef make_smbcodepage make_unicodemap \
  104. testparm testprns; do
  105. mv $RPM_BUILD_ROOT%{l_prefix}/bin/$file \
  106. $RPM_BUILD_ROOT%{l_prefix}/libexec/samba/$file
  107. done
  108. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/samba/using_samba
  109. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/samba/help
  110. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/samba/images
  111. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/samba/include
  112. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  113. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  114. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  115. %{SOURCE rc.samba} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  116. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  117. %{l_files_std} \
  118. '%config %{l_prefix}/etc/samba/*' \
  119. '%attr(1777,%{l_fsusr},%{l_fsgrp}) %{l_prefix}/var/samba/spool' \
  120. '%attr(1777,%{l_fsusr},%{l_fsgrp}) %{l_prefix}/var/samba/profiles'
  121. %files -f files
  122. %clean
  123. rm -rf $RPM_BUILD_ROOT