5
5
6
6
PYTHON_COMPAT=( python3_{10..11} )
7
7
PYTHON_REQ_USE=" threads(+),xml(+)"
8
+ TMPFILES_OPTIONAL=1
8
9
inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info systemd pam tmpfiles
9
10
10
11
DESCRIPTION=" Samba Suite Version 4"
@@ -26,6 +27,7 @@ IUSE="acl addc ads ceph client cluster cpu_flags_x86_aes cups debug fam glusterf
26
27
IUSE+=" iprint json ldap llvm-libunwind pam profiling-data python quota +regedit selinux"
27
28
IUSE+=" snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test unwind winbind"
28
29
IUSE+=" zeroconf"
30
+ IUSE+=" +minimal" # Flatcar: Only install libraries, not executables.
29
31
30
32
REQUIRED_USE=" ${PYTHON_REQUIRED_USE}
31
33
addc? ( json python !system-mitkrb5 winbind )
@@ -59,14 +61,13 @@ TALLOC_VERSION="2.4.0"
59
61
TDB_VERSION=" 1.4.8"
60
62
TEVENT_VERSION=" 0.14.1"
61
63
64
+ # Flatcar: exclude perl, icu, libtasn1, Parse-Yapp from DEPEND
62
65
COMMON_DEPEND="
63
66
>=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP} ]
64
- dev-lang/perl:=
65
- dev-libs/icu:=[${MULTILIB_USEDEP} ]
67
+ spotlight? ( dev-libs/icu:=[${MULTILIB_USEDEP} ] )
66
68
dev-libs/libbsd[${MULTILIB_USEDEP} ]
67
- dev-libs/libtasn1:=[${MULTILIB_USEDEP} ]
69
+ !minimal? ( dev-libs/libtasn1:=[${MULTILIB_USEDEP} ] )
68
70
dev-libs/popt[${MULTILIB_USEDEP} ]
69
- dev-perl/Parse-Yapp
70
71
>=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP} ]
71
72
>=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP} ]
72
73
>=sys-libs/ldb-2.7.2:=[ldap(+)?,${MULTILIB_USEDEP} ]
@@ -117,8 +118,9 @@ COMMON_DEPEND="
117
118
)
118
119
zeroconf? ( net-dns/avahi[dbus] )
119
120
"
121
+ # Flatcar: pull in JSON only if json is enabled
120
122
DEPEND=" ${COMMON_DEPEND}
121
- dev-perl/JSON
123
+ json? ( dev-perl/JSON )
122
124
net-libs/libtirpc[${MULTILIB_USEDEP} ]
123
125
net-libs/rpcsvc-proto
124
126
spotlight? ( dev-libs/glib )
@@ -138,6 +140,8 @@ RDEPEND="${COMMON_DEPEND}
138
140
selinux? ( sec-policy/selinux-samba )
139
141
"
140
142
BDEPEND=" ${PYTHON_DEPS}
143
+ dev-lang/perl:=
144
+ dev-perl/Parse-Yapp
141
145
app-text/docbook-xsl-stylesheets
142
146
dev-libs/libxslt
143
147
virtual/pkgconfig
@@ -248,6 +252,10 @@ multilib_src_configure() {
248
252
EOF
249
253
fi
250
254
255
+ # Flatcar: we need only the mandatory bundled library, ldb by default.
256
+ # Without that, configure will fail because of a missing bundled library.
257
+ bundled_libs=" ldb"
258
+
251
259
local myconf=(
252
260
--enable-fhs
253
261
--sysconfdir=" ${EPREFIX} /etc"
@@ -358,7 +366,8 @@ multilib_src_install() {
358
366
newinitd " ${CONFDIR} /samba4.initd-r1" samba
359
367
newconfd " ${CONFDIR} /samba4.confd" samba
360
368
361
- dotmpfiles " ${FILESDIR} " /samba.conf
369
+ # Flatcar: do not create samba config if minimal enabled
370
+ use minimal || dotmpfiles " ${FILESDIR} " /samba.conf
362
371
if ! use addc ; then
363
372
rm " ${D} /$( systemd_get_systemunitdir) /samba.service" \
364
373
|| die
@@ -376,8 +385,22 @@ multilib_src_install() {
376
385
insinto /etc/security
377
386
doins examples/pam_winbind/pam_winbind.conf
378
387
fi
388
+
389
+ # Flatcar: clean up unnecessary files
390
+ rm -f " ${ED%/ } " /etc/samba/*
391
+ rm -f " ${ED%/ } " /usr/lib* /samba/ldb/*
392
+ if use minimal ; then
393
+ mv " ${ED%/ } " /usr/bin/net " ${T} " /
394
+ rm -f " ${ED%/ } " /usr/bin/* " ${ED%/ } " /usr/sbin/*
395
+ mv " ${T} " /net " ${ED%/ } " /usr/bin/net
396
+ rm -rf ${ED%/ } /lib* /security
397
+ rm -rf ${ED%/ } /usr/lib/systemd
398
+ rm -rf ${ED%/ } /usr/lib* /perl*
399
+ rm -rf ${ED%/ } /usr/lib* /python*
400
+ rm -rf ${ED%/ } /var
401
+ fi
379
402
}
380
403
381
404
pkg_postinst () {
382
- tmpfiles_process samba.conf
405
+ use minimal || tmpfiles_process samba.conf
383
406
}
0 commit comments