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