Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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