Contents of /trunk/extras/samba/samba-3.6.4-r1.smage2
Parent Directory | Revision Log
Revision 11787 -
(show annotations)
(download)
Wed Apr 11 21:49:44 2012 UTC (12 years, 5 months ago) by niro
File size: 6972 byte(s)
Wed Apr 11 21:49:44 2012 UTC (12 years, 5 months ago) by niro
File size: 6972 byte(s)
auto added: ver bump to 3.6.4-r1
1 | # $Id$ |
2 | |
3 | PNAME="samba" |
4 | PVER="3.6.4" |
5 | PBUILD="r1" |
6 | |
7 | PCAT="net-fs" |
8 | |
9 | DESCRIPTION="Samba provides seamless file and print services to SMB/CIFS clients." |
10 | HOMEPAGE="http://www.samba.org" |
11 | |
12 | DEPEND=">= virtual/glibc |
13 | >= net-print/cups-1.4 |
14 | >= dev-db/tdb-1.2.9 |
15 | >= dev-libs/popt-1.16 |
16 | >= sys-libs/ncurses-5.9 |
17 | >= sys-libs/readline-6.2 |
18 | >= app-admin/gamin-0.1.10 |
19 | >= dev-libs/openssl-1.0.0 |
20 | >= net-dns/avahi-0.6.30 |
21 | >= net-fs/cifs-utils-5.1" |
22 | |
23 | SDEPEND=">= sys-dev/automake-4 |
24 | >= sys-dev/autoconf-5 |
25 | >= sys-apps/sed-4" |
26 | |
27 | SRCFILE="${PNAME}-${PVER}.tar.gz" |
28 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
29 | |
30 | FILESDIR="${SOURCEDIR}/samba" |
31 | |
32 | sminclude mtools |
33 | |
34 | SMBD_SVC_VER=1.3 |
35 | NMBD_SVC_VER=1.2 |
36 | |
37 | SRC_URI=( |
38 | http://us1.samba.org/samba/ftp/stable/${SRCFILE} |
39 | mirror://${PNAME}/${SRCFILE} |
40 | mirror://${PNAME}/smb.conf-3.0.14a |
41 | mirror://${PNAME}/lmhosts |
42 | mirror://${PNAME}/smbusers |
43 | mirror://${PNAME}/samba.confd |
44 | mirror://${PNAME}/samba.logrotate |
45 | mirror://${PNAME}/nmbd.service-${NMBD_SVC_VER} |
46 | mirror://${PNAME}/smbd.service-${SMBD_SVC_VER} |
47 | mirror://${PNAME}/winbindd.service |
48 | ) |
49 | |
50 | UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep ${PNAME}-[0-9].* | lasttarball gz" |
51 | |
52 | src_prepare() |
53 | { |
54 | munpack ${SRCFILE} || die |
55 | cd ${SRCDIR} |
56 | |
57 | # examples: to be copied as docs |
58 | rm -rf ${SRCDIR}/examples.ORIG || die |
59 | |
60 | # add our vendor suffix |
61 | sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" ${SRCDIR}/source3/VERSION || die |
62 | cd ${SRCDIR}/source3 |
63 | sh script/mkversion.sh || die |
64 | |
65 | # compilation fix |
66 | # (u)mount.cifs is broken; missing include/version.h header |
67 | ln -snf ../include ${SRCDIR}/source3/client || die |
68 | } |
69 | |
70 | src_compile() |
71 | { |
72 | cd ${SRCDIR}/source3 |
73 | |
74 | # remove swat completely now; since we have no httpd server yet |
75 | # if really needed we make an extra package to save diskspace |
76 | mconfigure \ |
77 | --with-fhs \ |
78 | --sysconfdir=/etc/samba \ |
79 | --localstatedir=/var \ |
80 | --with-configdir=/etc/samba \ |
81 | --libdir=/usr/$(mlibdir)/samba \ |
82 | --with-swatdir=/usr/share/doc/${PNAME}-${PVER}/swat \ |
83 | --with-piddir=/run/samba \ |
84 | --with-lockdir=/var/cache/samba \ |
85 | --with-logfilebase=/var/log/samba \ |
86 | --with-privatedir=/var/lib/samba/private \ |
87 | --enable-shared-libs \ |
88 | --with-automount \ |
89 | --with-libsmbclient \ |
90 | --with-syslog \ |
91 | --without-acl-support \ |
92 | --enable-cups \ |
93 | --without-krb5 \ |
94 | --without-ldap \ |
95 | --with-readline \ |
96 | --with-winbind \ |
97 | --without-pam \ |
98 | --without-pam_smbpass \ |
99 | --without-libtdb \ |
100 | --enable-external-libtdb \ |
101 | --with-quotas \ |
102 | --with-sys-quotas \ |
103 | --with-cifsmount=no \ |
104 | --disable-swat \ |
105 | --enable-avahi \ |
106 | --disable-developer \ |
107 | --disable-dmalloc \ |
108 | || die |
109 | |
110 | mmake || die |
111 | } |
112 | |
113 | src_install() |
114 | { |
115 | cd ${SRCDIR}/source3 |
116 | |
117 | # needed directories |
118 | minstalldir /etc/samba || die |
119 | minstalldir /usr/$(mlibdir)/cups/backend || die |
120 | minstalldir /usr/share/doc/${PNAME}-${PVER}/examples || die |
121 | |
122 | # needed directories by samba at runtime |
123 | mkeepdir /var/log/samba || die |
124 | mkeepdir /run/samba || die |
125 | mkeepdir /var/cache/samba || die |
126 | mkeepdir /var/lib/samba/netlogon || die |
127 | mkeepdir /var/lib/samba/profiles || die |
128 | mkeepdir /var/lib/samba/printers/W32X86 || die |
129 | mkeepdir /var/lib/samba/printers/WIN40 || die |
130 | mkeepdir /var/lib/samba/printers/W32ALPHA || die |
131 | mkeepdir /var/lib/samba/printers/W32MIPS || die |
132 | mkeepdir /var/lib/samba/printers/W32PPC || die |
133 | mkeepdir /var/lib/samba/private || die |
134 | mkeepdir /var/spool/samba || die |
135 | |
136 | # fix permissions |
137 | mchmod 0700 /var/lib/samba/private || die |
138 | mchmod 1777 /var/spool/samba || die |
139 | |
140 | make DESTDIR=${BINDIR} install-everything || die |
141 | |
142 | # if exist remove *.old binaries |
143 | if [[ -n $(find ${BINDIR}/usr/bin -type f -name '*.old') ]] |
144 | then |
145 | for i in ${BINDIR}/usr/bin/*.old |
146 | do |
147 | [[ -e ${i} ]] && rm -f ${i} || die |
148 | done |
149 | fi |
150 | |
151 | # install wins nsswitch extensions |
152 | minstalldir /usr/$(mlibdir) || die |
153 | minstallfile ${SRCDIR}/nsswitch/libnss_wins.so /usr/$(mlibdir) || die |
154 | mlink libnss_wins.so /usr/$(mlibdir)/libnss_wins.so.2 || die |
155 | minstallfile ${SRCDIR}/nsswitch/libnss_winbind.so /usr/$(mlibdir) || die |
156 | mlink libnss_winbind.so /usr/$(mlibdir)/libnss_winbind.so.2 || die |
157 | |
158 | # samba doesn't create these symlinks anymore |
159 | mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so.0 || die |
160 | mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so || die |
161 | mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so.1 || die |
162 | mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so || die |
163 | mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so.0 || die |
164 | mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so || die |
165 | |
166 | # add cups printing support |
167 | mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die |
168 | |
169 | # install our config files |
170 | # fake smb.conf to get smbmount work |
171 | memptyfile /etc/samba/smb.conf || die |
172 | |
173 | # our smb example config |
174 | minstalletc smb.conf-3.0.14a smb.conf.example /etc/samba || die |
175 | |
176 | # our lmhosts and smbusers config |
177 | minstalletc lmhosts lmhosts /etc/samba || die |
178 | minstalletc smbusers smbusers /etc/samba || die |
179 | |
180 | # install systemd units |
181 | minstallconf samba.confd samba || die |
182 | minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die |
183 | minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die |
184 | minstallunit winbindd.service || die |
185 | minstalldir /etc/tmpfiles.d || die |
186 | MCONFIG=/etc/tmpfiles.d/samba.conf |
187 | mclearconfig || die |
188 | maddconfig 'd /run/samba 0755 root root -' |
189 | |
190 | # install logrotate config |
191 | minstalllog samba.logrotate samba || die |
192 | |
193 | # # install example docs - not wanted anymore to save some space |
194 | # cp -a ${SRCDIR}/examples/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples || die |
195 | # |
196 | # # fix all permissions |
197 | # chmod -R 755 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples -type d) || die |
198 | # chmod -R 644 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples ! -type d) || die |
199 | |
200 | # # remove unneeded docs, this saves some space ;) |
201 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/help/{guide,howto,devel} || die |
202 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/using_samba || die |
203 | |
204 | # using a patch now |
205 | # # remove swat completely now; since we have no httpd server yet |
206 | # # if really needed we make an extra package to save diskspace |
207 | # rm -f ${BINDIR}/usr/sbin/swat || die |
208 | # rm -f ${BINDIR}/usr/share/man/man8/swat.8 || die |
209 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat || die |
210 | |
211 | # other docs |
212 | cd ${SRCDIR} |
213 | minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die |
214 | } |
215 | |
216 | postinstall() |
217 | { |
218 | mstartunit nmbd.service |
219 | mstartunit winbindd.service |
220 | mstartunit smbd.service |
221 | |
222 | echo |
223 | echo "To initialize samba's password database, please run:" |
224 | echo " pdbedit --force-initialized-passwords" |
225 | echo |
226 | echo "If you experience client locks in file transfers _only_, try the parameter" |
227 | echo " use sendfile = no (man smb.conf(5), man sendfile(2))" |
228 | echo |
229 | echo "There also seem some problems with the smbfs implementation of the recent 2.6 kernels." |
230 | echo "If you experience problems (lockups) with smbfs, try cifs as an alternative." |
231 | echo |
232 | } |
233 | |
234 | postremove() |
235 | { |
236 | mstopunit nmbd.service |
237 | mstopunit winbindd.service |
238 | mstopunit smbd.service |
239 | } |