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