Magellan Linux

Annotation of /branches/R11-unstable/extras/samba/samba-3.6.25-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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