samba.spec 5.1 KB

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