1SUMMARY = "Web-based administration interface" 2HOMEPAGE = "http://www.webmin.com" 3LICENSE = "BSD-3-Clause" 4LIC_FILES_CHKSUM = "file://LICENCE;md5=0a6446108c96d0819d21e40b48109507" 5 6SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \ 7 file://setup.sh \ 8 file://init-exclude.patch \ 9 file://net-generic.patch \ 10 file://remove-startup-option.patch \ 11 file://disable-version-check.patch \ 12 file://nfs-export.patch \ 13 file://exports-lib.pl.patch \ 14 file://mount-excludefs.patch \ 15 file://samba-config-fix.patch \ 16 file://proftpd-config-fix.patch \ 17 file://net-lib.pl.patch \ 18 file://media-tomb.patch \ 19 file://mysql-config-fix.patch \ 20 file://webmin.service \ 21 " 22SRC_URI[sha256sum] = "4f1c467aeda0ded546e69f332c768665b6a0537d6a69e609221f9465121f775e" 23UPSTREAM_CHECK_URI = "http://www.webmin.com/download.html" 24UPSTREAM_CHECK_REGEX = "webmin-(?P<pver>\d+(\.\d+)+).tar.gz" 25 26inherit perlnative update-rc.d systemd 27 28do_configure() { 29 # Remove binaries and plugins for other platforms 30 rm -rf acl/Authen-SolarisRBAC-0.1* 31 rm -rf format bsdexports hpuxexports sgiexports 32 rm -rf zones rbac smf ipfw ipfilter dfsadmin 33 rm -f mount/freebsd-mounts* mount/netbsd-mounts* 34 rm -f mount/openbsd-mounts* mount/macos-mounts* 35 36 # Remove some plugins for the moment 37 rm -rf lilo frox wuftpd telnet pserver cpan shorewall webalizer cfengine fsdump pap 38 rm -rf majordomo fetchmail sendmail mailboxes procmail filter mailcap dovecot exim spam qmailadmin postfix 39 rm -rf stunnel squid sarg pptp-client pptp-server jabber openslp sentry cluster-* vgetty burner heartbeat 40 41 # Adjust configs 42 [ -f init/config-debian-linux ] && mv init/config-debian-linux init/config-generic-linux 43 sed -i "s/shutdown_command=.*/shutdown_command=poweroff/" init/config-generic-linux 44 echo "exclude=bootmisc.sh,single,halt,reboot,hostname.sh,modutils.sh,mountall.sh,mountnfs.sh,networking,populate-volatile.sh,rmnologin.sh,save-rtc.sh,umountfs,umountnfs.sh,hwclock.sh,checkroot.sh,banner.sh,udev,udev-cache,devpts.sh,psplash.sh,sendsigs,fbsetup,bootlogd,stop-bootlogd,sysfs.sh,syslog,syslog.busybox,urandom,webmin,functions.initscripts,read-only-rootfs-hook.sh" >> init/config-generic-linux 45 echo "excludefs=devpts,devtmpfs,usbdevfs,proc,tmpfs,sysfs,debugfs" >> mount/config-generic-linux 46 47 [ -f exports/config-debian-linux ] && mv exports/config-debian-linux exports/config-generic-linux 48 sed -i "s/killall -HUP rpc.nfsd && //" exports/config-generic-linux 49 sed -i "s/netstd_nfs/nfsserver/g" exports/config-generic-linux 50 51 # Fix insane naming that causes problems at packaging time (must be done before deleting below) 52 find . -name "*\**" | while read from 53 do 54 to=`echo "$from" | sed "s/*/ALL/"` 55 mv "$from" "$to" 56 done 57 58 # Remove some other files we don't need 59 find . -name "config-*" -a \! -name "config-generic-linux" -a \! -name "config-ALL-linux" -a \! -name "*.pl" -delete 60 find . -regextype posix-extended -regex ".*/(openserver|aix|osf1|osf|openbsd|netbsd|freebsd|unixware|solaris|macos|irix|hpux|cygwin|windows)-lib\.pl" -delete 61 rm -f webmin-gentoo-init webmin-caldera-init webmin-debian-pam webmin-pam 62 63 # Don't need these at runtime (and we have our own setup script) 64 rm -f setup.sh 65 rm -f setup.pl 66 67 # Use pidof for finding PIDs 68 sed -i "s/find_pid_command=.*/find_pid_command=pidof NAME/" config-generic-linux 69} 70 71WEBMIN_LOGIN ?= "admin" 72WEBMIN_PASSWORD ?= "password" 73 74do_install() { 75 install -d ${D}${sysconfdir} 76 install -d ${D}${sysconfdir}/webmin 77 install -d ${D}${sysconfdir}/init.d 78 install -m 0755 webmin-init ${D}${sysconfdir}/init.d/webmin 79 80 install -d ${D}${systemd_unitdir}/system 81 install -m 0644 ${UNPACKDIR}/webmin.service ${D}${systemd_unitdir}/system 82 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ 83 ${D}${systemd_unitdir}/system/webmin.service 84 85 install -d ${D}${localstatedir} 86 install -d ${D}${localstatedir}/webmin 87 88 install -d ${D}${libexecdir}/webmin 89 cd ${S} || exit 1 90 tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \ 91 | tar --no-same-owner -xpf - -C ${D}${libexecdir}/webmin 92 93 rm -f ${D}${libexecdir}/webmin/webmin-init 94 rm -f ${D}${libexecdir}/webmin/ajaxterm/ajaxterm/configure.initd.gentoo 95 rm -rf ${D}${libexecdir}/webmin/patches 96 97 # Run setup script 98 export perl=perl 99 export perl_runtime=${bindir}/perl 100 export prefix=${D} 101 export tempdir=${S}/install_tmp 102 export wadir=${libexecdir}/webmin 103 export config_dir=${sysconfdir}/webmin 104 export var_dir=${localstatedir}/webmin 105 export os_type=generic-linux 106 export os_version=0 107 export real_os_type="${DISTRO_NAME}" 108 export real_os_version="${DISTRO_VERSION}" 109 export port=10000 110 export login=${WEBMIN_LOGIN} 111 export password=${WEBMIN_PASSWORD} 112 export ssl=0 113 export atboot=1 114 export no_pam=1 115 mkdir -p $tempdir 116 ${UNPACKDIR}/setup.sh 117 118 # Ensure correct PERLLIB path 119 sed -i -e 's#${D}##g' ${D}${sysconfdir}/webmin/start 120} 121 122INITSCRIPT_NAME = "webmin" 123INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ." 124 125SYSTEMD_SERVICE:${PN} = "webmin.service" 126SYSTEMD_AUTO_ENABLE:${PN} = "disable" 127 128# FIXME: some of this should be figured out automatically 129RDEPENDS:${PN} += "perl perl-module-socket perl-module-exporter perl-module-exporter-heavy perl-module-carp perl-module-strict" 130RDEPENDS:${PN} += "perl-module-warnings perl-module-xsloader perl-module-posix perl-module-autoloader" 131RDEPENDS:${PN} += "perl-module-fcntl perl-module-tie-hash perl-module-vars perl-module-time-local perl-module-config perl-module-constant" 132RDEPENDS:${PN} += "perl-module-file-glob perl-module-file-copy perl-module-sdbm-file perl-module-feature" 133 134PACKAGES_DYNAMIC += "webmin-module-* webmin-theme-*" 135RRECOMMENDS:${PN} += "webmin-module-system-status" 136 137PACKAGES += "${PN}-module-proc ${PN}-module-raid ${PN}-module-exports ${PN}-module-fdisk ${PN}-module-lvm" 138RDEPENDS:${PN}-module-proc = "procps" 139RDEPENDS:${PN}-module-raid = "mdadm" 140RDEPENDS:${PN}-module-exports = "perl-module-file-basename perl-module-file-path perl-module-cwd perl-module-file-spec perl-module-file-spec-unix" 141RRECOMMENDS:${PN}-module-fdisk = "parted" 142RRECOMMENDS:${PN}-module-lvm = "lvm2" 143 144python populate_packages:prepend() { 145 import os, os.path 146 147 wadir = bb.data.expand('${libexecdir}/webmin', d) 148 wadir_image = bb.data.expand('${D}', d) + wadir 149 modules = [] 150 themes = [] 151 for mod in os.listdir(wadir_image): 152 modinfo = os.path.join(wadir_image, mod, "module.info") 153 themeinfo = os.path.join(wadir_image, mod, "theme.info") 154 if os.path.exists(modinfo): 155 modules.append(mod) 156 elif os.path.exists(themeinfo): 157 themes.append(mod) 158 159 do_split_packages(d, wadir, '^(%s)$' % "|".join(modules), 'webmin-module-%s', 'Webmin module for %s', extra_depends='perl', allow_dirs=True, prepend=True) 160 do_split_packages(d, wadir, '^(%s)$' % "|".join(themes), 'webmin-theme-%s', 'Webmin theme for %s', extra_depends='perl', allow_dirs=True, prepend=True) 161} 162 163# Time-savers 164package_do_pkgconfig() { 165 : 166} 167