Magellan Linux

Contents of /trunk/extras/samba/samba-4.2.3-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 26815 - (show annotations) (download)
Mon Jul 20 07:08:55 2015 UTC (8 years, 10 months ago) by niro
File size: 6024 byte(s)
auto added: ver bump to 4.2.3-r1
1 # $Id$
2
3 PNAME="samba"
4 PVER="4.2.3"
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 # todo: external ldb and tevent!
13 DEPEND=">= virtual/glibc
14 >= net-print/cups-2.0
15 >= dev-db/tdb-1.3
16 >= dev-libs/popt-1.16
17 >= dev-libs/talloc-2.1
18 >= sys-apps/acl-2.2
19 >= sys-libs/ncurses-5.9
20 >= sys-libs/readline-6.3
21 >= sys-libs/pam-1.1
22 >= sys-libs/libsystemd-daemon-220
23 >= app-admin/gamin-0.1.10
24 >= dev-libs/openssl-1.0.2
25 >= net-dns/avahi-0.6.31
26 >= net-nds/libldap-2.4
27 >= net-fs/cifs-utils-6.3"
28
29 SDEPEND=">= sys-dev/automake-4
30 >= sys-dev/autoconf-5
31 >= virtual/sed
32 >= dev-lang/perl-5.22.0
33 >= dev-lang/python-2.7
34 >= net-nds/openldap-2.4
35 >= app-text/docbook-xsl-stylesheets-1.78"
36
37 SRCFILE="${PNAME}-${PVER}.tar.gz"
38 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
39
40 msetfeature "!check" # no check target in Makefile
41 sminclude mtools multilib systemd
42
43 # imap modules
44 SMB_SHARED_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
45 # pdb modules
46 SMB_SHARED_MODULES+=",pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4,auth_unix"
47 # auth modules
48 SMB_SHARED_MODULES+=",auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
49
50 # use external tdb
51 SMB_BUNDLED_LIBRARIES="!tdb"
52 # use external talloc
53 SMB_BUNDLED_LIBRARIES+=",!talloc,!pytalloc-util"
54 # use internal tevent
55 SMB_BUNDLED_LIBRARIES+=",tevent"
56 # use external popt
57 SMB_BUNDLED_LIBRARIES+=",!popt"
58 # use internal ldb
59 SMB_BUNDLED_LIBRARIES+=",ldb,pyldb-util"
60
61 CONFD_VER=1.2
62 SMBD_SVC_VER=1.5
63 NMBD_SVC_VER=1.3
64 WINBINDD_SVC_VER=1.2
65
66 SRC_URI=(
67 http://us1.samba.org/samba/ftp/stable/${SRCFILE}
68 mirror://${PNAME}/${SRCFILE}
69 mirror://${PNAME}/lmhosts
70 mirror://${PNAME}/smbusers
71 mirror://${PNAME}/samba.confd-${CONFD_VER}
72 mirror://${PNAME}/samba.pamd
73 mirror://${PNAME}/samba.logrotate
74 mirror://${PNAME}/samba.service
75 mirror://${PNAME}/nmbd.service-${NMBD_SVC_VER}
76 mirror://${PNAME}/smbd.service-${SMBD_SVC_VER}
77 mirror://${PNAME}/winbindd.service-${WINBINDD_SVC_VER}
78 )
79
80 UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep '${PNAME}-[0-9].*' | highesttarball gz"
81
82 src_prepare()
83 {
84 munpack ${SRCFILE} || die
85
86 # add our vendor suffix
87 all-abis 'sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" VERSION || die'
88 #all-abis 'sh script/mkversion.sh || die' # new waf build system creates this one automatically
89 }
90
91 src_compile()
92 {
93 mconfigure \
94 --enable-fhs \
95 --sysconfdir=/etc/samba \
96 --localstatedir=/var \
97 --with-configdir=/etc/samba \
98 --with-modulesdir=/usr/'$(mlibdir)'/samba \
99 --with-piddir=/run/samba \
100 --with-lockdir=/var/cache/samba \
101 --with-logfilebase=/var/log/samba \
102 --with-privatedir=/var/lib/samba/private \
103 --bundled-libraries="${SMB_BUNDLED_LIBRARIES}" \
104 --with-shared-modules="${SMB_SHARED_MODULES}" \
105 --with-syslog \
106 --with-acl-support \
107 --enable-cups \
108 --with-ads \
109 --with-ldap \
110 --with-winbind \
111 --with-pam \
112 --with-quotas \
113 --with-systemd \
114 --enable-avahi \
115 --disable-rpath \
116 --disable-rpath-install \
117 || die
118
119 mmake || die
120 }
121
122 src_install()
123 {
124 # required directories
125 minstalldir /etc/samba || die
126 all-abis 'minstalldir /usr/$(mlibdir)/cups/backend || die'
127 minstalldir /usr/share/doc/${PNAME}-${PVER}/examples || die
128
129 # required directories by samba at runtime
130 mkeepdir /var/log/samba || die
131 mkeepdir /run/samba || die
132 mkeepdir /var/cache/samba || die
133 mkeepdir /var/lib/samba/netlogon || die
134 mkeepdir /var/lib/samba/profiles || die
135 mkeepdir /var/lib/samba/printers/W32X86 || die
136 mkeepdir /var/lib/samba/printers/WIN40 || die
137 mkeepdir /var/lib/samba/printers/W32ALPHA || die
138 mkeepdir /var/lib/samba/printers/W32MIPS || die
139 mkeepdir /var/lib/samba/printers/W32PPC || die
140 mkeepdir /var/lib/samba/private || die
141 mkeepdir /var/spool/samba || die
142
143 # fix permissions
144 mchmod 0700 /var/lib/samba/private || die
145 mchmod 1777 /var/spool/samba || die
146
147 mmake DESTDIR=${BINDIR} install || die
148
149 # if exist remove *.old binaries
150 if [[ -n $(find ${BINDIR}/usr/bin -type f -name '*.old') ]]
151 then
152 for i in ${BINDIR}/usr/bin/*.old
153 do
154 [[ -e ${i} ]] && rm -f ${i} || die
155 done
156 fi
157
158 # add cups printing support
159 all-abis 'mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die'
160
161 # install our config files
162 # fake smb.conf to get smbmount work
163 memptyfile /etc/samba/smb.conf || die
164
165 # our smb example config
166 minstalletc packaging/LSB/smb.conf smb.conf.example /etc/samba || die
167 # fix logrotate
168 sed -i 's:log.%m:%m.log:g' ${BINDIR}/etc/samba/smb.conf.example || die
169
170 # our lmhosts and smbusers config
171 minstalletc lmhosts lmhosts /etc/samba || die
172 minstalletc smbusers smbusers /etc/samba || die
173
174 # install systemd units
175 minstallconf samba.confd-${CONFD_VER} samba || die
176 minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die
177 minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die
178 minstallunit winbindd.service-${WINBINDD_SVC_VER} winbindd.service || die
179 minstallunit samba.service || die
180 minstalldir /etc/tmpfiles.d || die
181 MCONFIG=/etc/tmpfiles.d/samba.conf
182 mclearconfig || die
183 maddconfig 'd /run/samba 0755 root root -'
184
185 # install pam configuration
186 minstallpam samba.pamd samba || die
187
188 # install logrotate config
189 minstalllog samba.logrotate samba || die
190
191 # other docs
192 minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die
193 }
194
195 postinstall()
196 {
197 mstartunit nmbd.service
198 mstartunit winbindd.service
199 mstartunit smbd.service
200
201 echo
202 echo "To initialize samba's password database, please run:"
203 echo " pdbedit --force-initialized-passwords"
204 echo
205 echo "If you experience client locks in file transfers _only_, try the parameter"
206 echo " use sendfile = no (man smb.conf(5), man sendfile(2))"
207 echo
208 echo "There also seem some problems with the smbfs implementation of the recent 2.6 kernels."
209 echo "If you experience problems (lockups) with smbfs, try cifs as an alternative."
210 echo
211 }
212
213 postremove()
214 {
215 mstopunit nmbd.service
216 mstopunit winbindd.service
217 mstopunit smbd.service
218 }