1SUMMARY = "Kernel based automounter for linux"
2SECTION = "utils"
3LICENSE = "GPL-2.0-only"
4LIC_FILES_CHKSUM = "file://COPYING;md5=ee9324a6f564bb2376b63878ac396798"
5
6DEPENDS += "libtirpc flex-native bison-native e2fsprogs openssl libxml2 util-linux cyrus-sasl libnsl2"
7
8CFLAGS += "-I${STAGING_INCDIR}/tirpc"
9
10inherit autotools-brokensep systemd update-rc.d pkgconfig
11
12SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \
13           file://no-bash.patch \
14           file://cross.patch \
15           file://fix_disable_ldap.patch \
16           file://autofs-5.0.7-fix-lib-deps.patch \
17           file://add-the-needed-stdarg.h.patch \
18           file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \
19           file://force-STRIP-to-emtpy.patch \
20           file://remove-bashism.patch \
21           file://fix-the-YACC-rule-to-fix-a-building-failure.patch \
22           file://0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch \
23           file://0002-Replace-__S_IEXEC-with-S_IEXEC.patch \
24           file://pkgconfig-libnsl.patch \
25           file://0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch \
26           file://0001-Do-not-hardcode-path-for-pkg.m4.patch \
27           file://0001-Bug-fix-for-pid_t-not-found-on-musl.patch \
28           file://0001-Define-__SWORD_TYPE-if-undefined.patch \
29           file://mount_conflict.patch \
30           file://0001-autofs-5.1.8-add-autofs_strerror_r-helper-for-musl.patch \
31           file://0002-autofs-5.1.8-handle-innetgr-not-present-in-musl.patch \
32           file://0001-include-libgen.h-for-basename.patch \
33           "
34SRC_URI[sha256sum] = "0bd401c56f0eb1ca6251344c3a3d70bface3eccf9c67117cd184422c4cace30c"
35
36UPSTREAM_CHECK_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/"
37
38INITSCRIPT_NAME = "autofs"
39INITSCRIPT_PARAMS = "defaults"
40
41# FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS
42#CFLAGS += "${LDFLAGS}"
43
44PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd"
45
46PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
47
48EXTRA_OEMAKE = "DONTSTRIP=1"
49EXTRA_OECONF += "--disable-mount-locking \
50                --enable-ignore-busy --with-openldap=no \
51                --with-confdir=${sysconfdir}/default \
52                --with-fifodir=/run \
53                --with-flagdir=/run \
54                --with-sasl=no --with-libtirpc \
55                --with-mapdir=${sysconfdir} \
56                --with-path=${STAGING_BINDIR_NATIVE} \
57                --with-fifodir=${localstatedir}/run \
58                --with-flagdir=${localstatedir}/run \
59"
60CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \
61                        ac_cv_path_RPCGEN=rpcgen \
62                        initdir=${INIT_D_DIR} \
63                        piddir=/run \
64"
65
66do_configure:prepend () {
67    if [ ! -e ${S}/acinclude.m4 ]; then
68        cp ${S}/aclocal.m4 ${S}/acinclude.m4
69    fi
70    cp ${STAGING_DATADIR_NATIVE}/aclocal/pkg.m4 .
71}
72
73do_install:append () {
74    # samples have been removed from SUBDIRS from 5.1.5, need to install separately
75    oe_runmake 'DESTDIR=${D}' install_samples
76
77    if [ -d ${D}/run ]; then
78        rmdir ${D}/run
79    fi
80    if [ -d ${D}${localstatedir}/run ]; then
81        rmdir ${D}${localstatedir}/run
82    fi
83    # On hybrid systemd/sysvinit builds, we need to install the sysvinit script by hand.
84    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
85        install -d -m 755 ${D}${INIT_D_DIR}
86        install -m 755 ${S}/samples/rc.autofs ${D}${INIT_D_DIR}/autofs
87    fi
88}
89SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
90
91# all the libraries are unversioned, so don't pack it on PN-dev
92SOLIBS = ".so"
93FILES_SOLIBSDEV = ""
94# Some symlinks are created in plugins dir e.g.
95# mount_nfs4.so -> mount_nfs.so
96INSANE_SKIP:${PN} = "dev-so"
97
98RPROVIDES:${PN} += "${PN}-systemd"
99RREPLACES:${PN} += "${PN}-systemd"
100RCONFLICTS:${PN} += "${PN}-systemd"
101SYSTEMD_SERVICE:${PN} = "autofs.service"
102