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