Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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