From 294c0251f83671151c46fe3538e9bad27c0278bd Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 11 Jul 2024 16:43:07 -0700 Subject: webmin: Upgrade to 2.111 release Drop remove-python2.3.patch since corresponding script is gone License-Update: Formatting changes Signed-off-by: Khem Raj --- .../webmin/files/disable-version-check.patch | 76 ++++----- .../webmin/files/mount-excludefs.patch | 7 +- .../webmin/files/mysql-config-fix.patch | 7 +- .../webmin/files/net-generic.patch | 22 ++- .../recipes-webadmin/webmin/files/net-lib.pl.patch | 12 +- .../webmin/files/remove-python2.3.patch | 25 --- .../recipes-webadmin/webmin/webmin_1.850.bb | 170 --------------------- .../recipes-webadmin/webmin/webmin_2.111.bb | 166 ++++++++++++++++++++ 8 files changed, 215 insertions(+), 270 deletions(-) delete mode 100644 meta-webserver/recipes-webadmin/webmin/files/remove-python2.3.patch delete mode 100644 meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb create mode 100644 meta-webserver/recipes-webadmin/webmin/webmin_2.111.bb (limited to 'meta-webserver') diff --git a/meta-webserver/recipes-webadmin/webmin/files/disable-version-check.patch b/meta-webserver/recipes-webadmin/webmin/files/disable-version-check.patch index 1ca26ca0dd..46b1f7c7b8 100644 --- a/meta-webserver/recipes-webadmin/webmin/files/disable-version-check.patch +++ b/meta-webserver/recipes-webadmin/webmin/files/disable-version-check.patch @@ -7,58 +7,44 @@ Upstream-Status: Inappropriate Signed-off-by: Paul Eggleton -Index: webmin-1.850/webmin/webmin-lib.pl -=================================================================== ---- webmin-1.850.orig/webmin/webmin-lib.pl -+++ webmin-1.850/webmin/webmin-lib.pl -@@ -1112,28 +1112,28 @@ my %miniserv; +--- a/webmin/webmin-lib.pl ++++ b/webmin/webmin-lib.pl +@@ -1170,38 +1170,6 @@ my %miniserv; + &get_miniserv_config(\%miniserv); &load_theme_library(); # So that UI functions work - # Need OS upgrade --my %realos = &detect_operating_system(undef, 1); --if (($realos{'os_version'} ne $gconfig{'os_version'} || -- $realos{'os_type'} ne $gconfig{'os_type'}) && -- $realos{'os_version'} && $realos{'os_type'} && -- &foreign_available("webmin")) { -- my ($realminor) = split(/\./, $realos{'os_version'}); -- my ($minor) = split(/\./, $gconfig{'os_version'}); -- if ($realos{'os_type'} eq $gconfig{'os_type'} && -- $realminor == $minor) { -- # Only the minor version number changed - no need to apply -- &apply_new_os_version(\%realos); +-# Need OS upgrade, but only once per day or if the system was rebooted +-my $now = time(); +-my $uptime = &get_system_uptime(); +-if (&foreign_available("webmin")) { +- my %realos; +- my @st = stat($realos_cache_file); +- if (!@st || $now - $st[9] > 24*60*60 || +- $uptime && $now - $st[9] > $uptime) { +- %realos = &detect_operating_system(undef, 1); +- &write_file($realos_cache_file, \%realos); - } - else { -- # Large enough change to tell the user -- push(@notifs, -- &ui_form_start("$gconfig{'webprefix'}/webmin/fix_os.cgi"). -- &text('os_incorrect', $realos{'real_os_type'}, -- $realos{'real_os_version'})."

\n". +- &read_file($realos_cache_file, \%realos); +- } +- if (($realos{'os_version'} ne $gconfig{'os_version'} || +- $realos{'real_os_version'} ne $gconfig{'real_os_version'} || +- $realos{'os_type'} ne $gconfig{'os_type'}) && +- $realos{'os_version'} && $realos{'os_type'} && +- &foreign_available("webmin")) { +- # Tell the user that OS version was updated +- push(@notifs, +- &ui_form_start("@{[&get_webprefix()]}/webmin/fix_os.cgi"). +- &text('os_incorrect', +- $realos{'real_os_type'}, +- $realos{'real_os_version'}). +- &show_os_release_notes($realos{'real_os_version'}). +- "

\n". - &ui_form_end([ [ undef, $text{'os_fix'} ] ]) - ); - } - } -+#my %realos = &detect_operating_system(undef, 1); -+#if (($realos{'os_version'} ne $gconfig{'os_version'} || -+# $realos{'os_type'} ne $gconfig{'os_type'}) && -+# $realos{'os_version'} && $realos{'os_type'} && -+# &foreign_available("webmin")) { -+# my ($realminor) = split(/\./, $realos{'os_version'}); -+# my ($minor) = split(/\./, $gconfig{'os_version'}); -+# if ($realos{'os_type'} eq $gconfig{'os_type'} && -+# $realminor == $minor) { -+# # Only the minor version number changed - no need to apply -+# &apply_new_os_version(\%realos); -+# } -+# else { -+# # Large enough change to tell the user -+# push(@notifs, -+# &ui_form_start("$gconfig{'webprefix'}/webmin/fix_os.cgi"). -+# &text('os_incorrect', $realos{'real_os_type'}, -+# $realos{'real_os_version'})."

\n". -+# &ui_form_end([ [ undef, $text{'os_fix'} ] ]) -+# ); -+# } -+# } - +- # Password close to expiry my $warn_days = $config{'warn_days'}; + if (&foreign_check("acl")) { diff --git a/meta-webserver/recipes-webadmin/webmin/files/mount-excludefs.patch b/meta-webserver/recipes-webadmin/webmin/files/mount-excludefs.patch index 787bd8c69b..7d6a2275f9 100644 --- a/meta-webserver/recipes-webadmin/webmin/files/mount-excludefs.patch +++ b/meta-webserver/recipes-webadmin/webmin/files/mount-excludefs.patch @@ -8,9 +8,9 @@ Signed-off-by: Paul Eggleton Upstream-Status: Pending ---- webmin-1.570.orig/mount/index.cgi -+++ webmin-1.570/mount/index.cgi -@@ -33,10 +33,12 @@ elsif ($config{'sort_mode'} == 1) { +--- a/mount/index.cgi ++++ b/mount/index.cgi +@@ -34,9 +34,11 @@ elsif ($config{'sort_mode'} == 1) { } # Build visible filesystems list @@ -18,7 +18,6 @@ Upstream-Status: Pending foreach $m (@all) { @minfo = @$m; $p = &simplify_mount_path($minfo[0], $minfo[2]); - next if ($ignore{$minfo[2]}); + next if (grep {$_ eq $minfo[2]} @excludefs); @mmodes = &mount_modes($minfo[2], $minfo[0], $minfo[1]); $canedit = $can_edit{$minfo[2]} && !$mmodes[4] && diff --git a/meta-webserver/recipes-webadmin/webmin/files/mysql-config-fix.patch b/meta-webserver/recipes-webadmin/webmin/files/mysql-config-fix.patch index c6c1f0df79..d62353592e 100644 --- a/meta-webserver/recipes-webadmin/webmin/files/mysql-config-fix.patch +++ b/meta-webserver/recipes-webadmin/webmin/files/mysql-config-fix.patch @@ -10,8 +10,6 @@ Signed-off-by: Diego Rondini mysql/config | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -diff --git a/mysql/config b/mysql/config -index e5b6fb3..77bfe69 100644 --- a/mysql/config +++ b/mysql/config @@ -1,13 +1,13 @@ @@ -33,7 +31,7 @@ index e5b6fb3..77bfe69 100644 -mysqladmin=/usr/local/mysql/bin/mysqladmin +mysql_libs=/usr/lib +mysqladmin=/usr/bin/mysqladmin - style=0 + style=1 add_mode=1 nodbi=0 @@ -15,7 +15,7 @@ access=*: * @@ -45,6 +43,3 @@ index e5b6fb3..77bfe69 100644 max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 --- -2.5.0 - diff --git a/meta-webserver/recipes-webadmin/webmin/files/net-generic.patch b/meta-webserver/recipes-webadmin/webmin/files/net-generic.patch index 6ae3dced72..5fd83a4293 100644 --- a/meta-webserver/recipes-webadmin/webmin/files/net-generic.patch +++ b/meta-webserver/recipes-webadmin/webmin/files/net-generic.patch @@ -3,23 +3,19 @@ Add support for configuring network interfaces on a generic linux system Upstream-Status: Inappropriate [config] Signed-off-by: Paul Eggleton -Index: webmin-1.850/net/module.info -=================================================================== ---- webmin-1.850.orig/net/module.info -+++ webmin-1.850/net/module.info -@@ -14,7 +14,7 @@ desc_ko_KR.UTF-8=네트워크 구성 +--- a/net/module.info ++++ b/net/module.info +@@ -1,7 +1,7 @@ + version=2.111 + longdesc=Configure boot time and active interfaces, DNS, routing and /etc/hosts. name=Networking - desc_tr=A Yaplandrmas - desc_de=Netzwerkkonfiguration -os_support=solaris coherent-linux redhat-linux/5.0-* mandrake-linux united-linux suse-linux/6.0-* open-linux unixware turbo-linux/4.0 freebsd/3.2-* openbsd debian-linux/2.2-* cobalt-linux/2.2-* msc-linux gentoo-linux macos/1.5-* trustix-linux slackware-linux/8.0-* openmamba-linux cygwin windows pardus-linux +os_support=generic-linux solaris coherent-linux redhat-linux/5.0-* mandrake-linux united-linux suse-linux/6.0-* open-linux unixware turbo-linux/4.0 freebsd/3.2-* openbsd debian-linux/2.2-* cobalt-linux/2.2-* msc-linux gentoo-linux macos/1.5-* trustix-linux slackware-linux/8.0-* openmamba-linux cygwin windows pardus-linux - desc_sk=Konfigurcia siete - desc_zh_CN= - risk=low medium high -Index: webmin-1.850/net/generic-linux-lib.pl -=================================================================== + readonly=1 + desc=Network Configuration + category=net --- /dev/null -+++ webmin-1.850/net/generic-linux-lib.pl ++++ b/net/generic-linux-lib.pl @@ -0,0 +1,2 @@ +do 'linux-lib.pl'; + diff --git a/meta-webserver/recipes-webadmin/webmin/files/net-lib.pl.patch b/meta-webserver/recipes-webadmin/webmin/files/net-lib.pl.patch index bdba5e73f8..949525dfd7 100644 --- a/meta-webserver/recipes-webadmin/webmin/files/net-lib.pl.patch +++ b/meta-webserver/recipes-webadmin/webmin/files/net-lib.pl.patch @@ -4,16 +4,14 @@ XXX: need to work out a better fix. Signed-off-by: Dexuan Cui -diff -Nru webmin-1.570.orig//net/net-lib.pl webmin-1.570/net/net-lib.pl ---- webmin-1.570.orig//net/net-lib.pl 2011-10-03 09:01:48.000000000 +0800 -+++ webmin-1.570/net/net-lib.pl 2011-10-28 13:52:56.138873664 +0800 -@@ -21,7 +21,8 @@ - do "$gconfig{'os_type'}-9.1-ALL-lib.pl"; +--- a/net/net-lib.pl ++++ b/net/net-lib.pl +@@ -38,7 +38,7 @@ elsif ($gconfig{'os_type'} eq 'debian-li + $net_mode = "netplan"; } else { - do "$gconfig{'os_type'}-lib.pl"; -+ #do "$gconfig{'os_type'}-lib.pl"; + do "debian-linux-lib.pl"; + $net_mode = $gconfig{'os_type'}; } - # list_hosts() diff --git a/meta-webserver/recipes-webadmin/webmin/files/remove-python2.3.patch b/meta-webserver/recipes-webadmin/webmin/files/remove-python2.3.patch deleted file mode 100644 index 75e5bd1eaf..0000000000 --- a/meta-webserver/recipes-webadmin/webmin/files/remove-python2.3.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 6f04699d5d417122b67e8118fd1955c769f17e76 Mon Sep 17 00:00:00 2001 -From: Robert Yang -Date: Tue, 2 Sep 2014 00:11:05 -0700 -Subject: [PATCH] ajaxterm/ajaxterm/qweb.py: fix hardcode of python2.3 - -Upstream-Status: Pending - -Signed-off-by: Robert Yang ---- - ajaxterm/ajaxterm/qweb.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ajaxterm/ajaxterm/qweb.py b/ajaxterm/ajaxterm/qweb.py -index 20c5092..c658a6b 100644 ---- a/ajaxterm/ajaxterm/qweb.py -+++ b/ajaxterm/ajaxterm/qweb.py -@@ -1,4 +1,4 @@ --#!/usr/bin/python2.3 -+#!/usr/bin/env python - # - # vim:set et ts=4 fdc=0 fdn=2 fdl=0: - # --- -1.7.9.5 - diff --git a/meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb b/meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb deleted file mode 100644 index bbc59443c7..0000000000 --- a/meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb +++ /dev/null @@ -1,170 +0,0 @@ -SUMMARY = "Web-based administration interface" -HOMEPAGE = "http://www.webmin.com" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENCE;md5=0373ac9f611e542ddebe1ec6394afc3c" - -SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \ - file://setup.sh \ - file://init-exclude.patch \ - file://net-generic.patch \ - file://remove-startup-option.patch \ - file://disable-version-check.patch \ - file://nfs-export.patch \ - file://exports-lib.pl.patch \ - file://mount-excludefs.patch \ - file://samba-config-fix.patch \ - file://proftpd-config-fix.patch \ - file://net-lib.pl.patch \ - file://media-tomb.patch \ - file://remove-python2.3.patch \ - file://mysql-config-fix.patch \ - file://webmin.service \ - " - -SRC_URI[md5sum] = "cd6ee98f73f9418562197675b952d81b" -SRC_URI[sha256sum] = "c66caa9e4cb50d5447bc8aceb7989d2284dde060278f404b13e171c7ce1690e1" - -UPSTREAM_CHECK_URI = "http://www.webmin.com/download.html" -UPSTREAM_CHECK_REGEX = "webmin-(?P\d+(\.\d+)+).tar.gz" - -inherit perlnative update-rc.d systemd - -do_configure() { - # Remove binaries and plugins for other platforms - rm -rf acl/Authen-SolarisRBAC-0.1* - rm -rf format bsdexports hpuxexports sgiexports - rm -rf zones rbac smf ipfw ipfilter dfsadmin - rm -f mount/freebsd-mounts* mount/netbsd-mounts* - rm -f mount/openbsd-mounts* mount/macos-mounts* - - # Remove some plugins for the moment - rm -rf lilo frox wuftpd telnet pserver cpan shorewall webalizer cfengine fsdump pap - rm -rf majordomo fetchmail sendmail mailboxes procmail filter mailcap dovecot exim spam qmailadmin postfix - rm -rf stunnel squid sarg pptp-client pptp-server jabber openslp sentry cluster-* vgetty burner heartbeat - - # Adjust configs - [ -f init/config-debian-linux ] && mv init/config-debian-linux init/config-generic-linux - sed -i "s/shutdown_command=.*/shutdown_command=poweroff/" init/config-generic-linux - 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 - echo "excludefs=devpts,devtmpfs,usbdevfs,proc,tmpfs,sysfs,debugfs" >> mount/config-generic-linux - - [ -f exports/config-debian-linux ] && mv exports/config-debian-linux exports/config-generic-linux - sed -i "s/killall -HUP rpc.nfsd && //" exports/config-generic-linux - sed -i "s/netstd_nfs/nfsserver/g" exports/config-generic-linux - - # Fix insane naming that causes problems at packaging time (must be done before deleting below) - find . -name "*\**" | while read from - do - to=`echo "$from" | sed "s/*/ALL/"` - mv "$from" "$to" - done - - # Remove some other files we don't need - find . -name "config-*" -a \! -name "config-generic-linux" -a \! -name "config-ALL-linux" -a \! -name "*.pl" -delete - find . -regextype posix-extended -regex ".*/(openserver|aix|osf1|osf|openbsd|netbsd|freebsd|unixware|solaris|macos|irix|hpux|cygwin|windows)-lib\.pl" -delete - rm -f webmin-gentoo-init webmin-caldera-init webmin-debian-pam webmin-pam - - # Don't need these at runtime (and we have our own setup script) - rm -f setup.sh - rm -f setup.pl - - # Use pidof for finding PIDs - sed -i "s/find_pid_command=.*/find_pid_command=pidof NAME/" config-generic-linux -} - -WEBMIN_LOGIN ?= "admin" -WEBMIN_PASSWORD ?= "password" - -do_install() { - install -d ${D}${sysconfdir} - install -d ${D}${sysconfdir}/webmin - install -d ${D}${sysconfdir}/init.d - install -m 0755 webmin-init ${D}${sysconfdir}/init.d/webmin - - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${UNPACKDIR}/webmin.service ${D}${systemd_unitdir}/system - sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - ${D}${systemd_unitdir}/system/webmin.service - - install -d ${D}${localstatedir} - install -d ${D}${localstatedir}/webmin - - install -d ${D}${libexecdir}/webmin - cd ${S} || exit 1 - tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \ - | tar --no-same-owner -xpf - -C ${D}${libexecdir}/webmin - - rm -f ${D}${libexecdir}/webmin/webmin-init - rm -f ${D}${libexecdir}/webmin/ajaxterm/ajaxterm/configure.initd.gentoo - rm -rf ${D}${libexecdir}/webmin/patches - - # Run setup script - export perl=perl - export perl_runtime=${bindir}/perl - export prefix=${D} - export tempdir=${S}/install_tmp - export wadir=${libexecdir}/webmin - export config_dir=${sysconfdir}/webmin - export var_dir=${localstatedir}/webmin - export os_type=generic-linux - export os_version=0 - export real_os_type="${DISTRO_NAME}" - export real_os_version="${DISTRO_VERSION}" - export port=10000 - export login=${WEBMIN_LOGIN} - export password=${WEBMIN_PASSWORD} - export ssl=0 - export atboot=1 - export no_pam=1 - mkdir -p $tempdir - ${UNPACKDIR}/setup.sh - - # Ensure correct PERLLIB path - sed -i -e 's#${D}##g' ${D}${sysconfdir}/webmin/start -} - -INITSCRIPT_NAME = "webmin" -INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ." - -SYSTEMD_SERVICE:${PN} = "webmin.service" -SYSTEMD_AUTO_ENABLE:${PN} = "disable" - -# FIXME: some of this should be figured out automatically -RDEPENDS:${PN} += "perl perl-module-socket perl-module-exporter perl-module-exporter-heavy perl-module-carp perl-module-strict" -RDEPENDS:${PN} += "perl-module-warnings perl-module-xsloader perl-module-posix perl-module-autoloader" -RDEPENDS:${PN} += "perl-module-fcntl perl-module-tie-hash perl-module-vars perl-module-time-local perl-module-config perl-module-constant" -RDEPENDS:${PN} += "perl-module-file-glob perl-module-file-copy perl-module-sdbm-file perl-module-feature" - -PACKAGES_DYNAMIC += "webmin-module-* webmin-theme-*" -RRECOMMENDS:${PN} += "webmin-module-system-status" - -PACKAGES += "${PN}-module-proc ${PN}-module-raid ${PN}-module-exports ${PN}-module-fdisk ${PN}-module-lvm" -RDEPENDS:${PN}-module-proc = "procps" -RDEPENDS:${PN}-module-raid = "mdadm" -RDEPENDS:${PN}-module-exports = "perl-module-file-basename perl-module-file-path perl-module-cwd perl-module-file-spec perl-module-file-spec-unix" -RRECOMMENDS:${PN}-module-fdisk = "parted" -RRECOMMENDS:${PN}-module-lvm = "lvm2" - -python populate_packages:prepend() { - import os, os.path - - wadir = bb.data.expand('${libexecdir}/webmin', d) - wadir_image = bb.data.expand('${D}', d) + wadir - modules = [] - themes = [] - for mod in os.listdir(wadir_image): - modinfo = os.path.join(wadir_image, mod, "module.info") - themeinfo = os.path.join(wadir_image, mod, "theme.info") - if os.path.exists(modinfo): - modules.append(mod) - elif os.path.exists(themeinfo): - themes.append(mod) - - do_split_packages(d, wadir, '^(%s)$' % "|".join(modules), 'webmin-module-%s', 'Webmin module for %s', extra_depends='perl', allow_dirs=True, prepend=True) - do_split_packages(d, wadir, '^(%s)$' % "|".join(themes), 'webmin-theme-%s', 'Webmin theme for %s', extra_depends='perl', allow_dirs=True, prepend=True) -} - -# Time-savers -package_do_pkgconfig() { - : -} diff --git a/meta-webserver/recipes-webadmin/webmin/webmin_2.111.bb b/meta-webserver/recipes-webadmin/webmin/webmin_2.111.bb new file mode 100644 index 0000000000..6058afb8c2 --- /dev/null +++ b/meta-webserver/recipes-webadmin/webmin/webmin_2.111.bb @@ -0,0 +1,166 @@ +SUMMARY = "Web-based administration interface" +HOMEPAGE = "http://www.webmin.com" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENCE;md5=0a6446108c96d0819d21e40b48109507" + +SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \ + file://setup.sh \ + file://init-exclude.patch \ + file://net-generic.patch \ + file://remove-startup-option.patch \ + file://disable-version-check.patch \ + file://nfs-export.patch \ + file://exports-lib.pl.patch \ + file://mount-excludefs.patch \ + file://samba-config-fix.patch \ + file://proftpd-config-fix.patch \ + file://net-lib.pl.patch \ + file://media-tomb.patch \ + file://mysql-config-fix.patch \ + file://webmin.service \ + " +SRC_URI[sha256sum] = "9000ce55275494802ec433e2de634289989f5d99ea2970716d7d9c97e38f2f5e" +UPSTREAM_CHECK_URI = "http://www.webmin.com/download.html" +UPSTREAM_CHECK_REGEX = "webmin-(?P\d+(\.\d+)+).tar.gz" + +inherit perlnative update-rc.d systemd + +do_configure() { + # Remove binaries and plugins for other platforms + rm -rf acl/Authen-SolarisRBAC-0.1* + rm -rf format bsdexports hpuxexports sgiexports + rm -rf zones rbac smf ipfw ipfilter dfsadmin + rm -f mount/freebsd-mounts* mount/netbsd-mounts* + rm -f mount/openbsd-mounts* mount/macos-mounts* + + # Remove some plugins for the moment + rm -rf lilo frox wuftpd telnet pserver cpan shorewall webalizer cfengine fsdump pap + rm -rf majordomo fetchmail sendmail mailboxes procmail filter mailcap dovecot exim spam qmailadmin postfix + rm -rf stunnel squid sarg pptp-client pptp-server jabber openslp sentry cluster-* vgetty burner heartbeat + + # Adjust configs + [ -f init/config-debian-linux ] && mv init/config-debian-linux init/config-generic-linux + sed -i "s/shutdown_command=.*/shutdown_command=poweroff/" init/config-generic-linux + 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 + echo "excludefs=devpts,devtmpfs,usbdevfs,proc,tmpfs,sysfs,debugfs" >> mount/config-generic-linux + + [ -f exports/config-debian-linux ] && mv exports/config-debian-linux exports/config-generic-linux + sed -i "s/killall -HUP rpc.nfsd && //" exports/config-generic-linux + sed -i "s/netstd_nfs/nfsserver/g" exports/config-generic-linux + + # Fix insane naming that causes problems at packaging time (must be done before deleting below) + find . -name "*\**" | while read from + do + to=`echo "$from" | sed "s/*/ALL/"` + mv "$from" "$to" + done + + # Remove some other files we don't need + find . -name "config-*" -a \! -name "config-generic-linux" -a \! -name "config-ALL-linux" -a \! -name "*.pl" -delete + find . -regextype posix-extended -regex ".*/(openserver|aix|osf1|osf|openbsd|netbsd|freebsd|unixware|solaris|macos|irix|hpux|cygwin|windows)-lib\.pl" -delete + rm -f webmin-gentoo-init webmin-caldera-init webmin-debian-pam webmin-pam + + # Don't need these at runtime (and we have our own setup script) + rm -f setup.sh + rm -f setup.pl + + # Use pidof for finding PIDs + sed -i "s/find_pid_command=.*/find_pid_command=pidof NAME/" config-generic-linux +} + +WEBMIN_LOGIN ?= "admin" +WEBMIN_PASSWORD ?= "password" + +do_install() { + install -d ${D}${sysconfdir} + install -d ${D}${sysconfdir}/webmin + install -d ${D}${sysconfdir}/init.d + install -m 0755 webmin-init ${D}${sysconfdir}/init.d/webmin + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${UNPACKDIR}/webmin.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + ${D}${systemd_unitdir}/system/webmin.service + + install -d ${D}${localstatedir} + install -d ${D}${localstatedir}/webmin + + install -d ${D}${libexecdir}/webmin + cd ${S} || exit 1 + tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \ + | tar --no-same-owner -xpf - -C ${D}${libexecdir}/webmin + + rm -f ${D}${libexecdir}/webmin/webmin-init + rm -f ${D}${libexecdir}/webmin/ajaxterm/ajaxterm/configure.initd.gentoo + rm -rf ${D}${libexecdir}/webmin/patches + + # Run setup script + export perl=perl + export perl_runtime=${bindir}/perl + export prefix=${D} + export tempdir=${S}/install_tmp + export wadir=${libexecdir}/webmin + export config_dir=${sysconfdir}/webmin + export var_dir=${localstatedir}/webmin + export os_type=generic-linux + export os_version=0 + export real_os_type="${DISTRO_NAME}" + export real_os_version="${DISTRO_VERSION}" + export port=10000 + export login=${WEBMIN_LOGIN} + export password=${WEBMIN_PASSWORD} + export ssl=0 + export atboot=1 + export no_pam=1 + mkdir -p $tempdir + ${UNPACKDIR}/setup.sh + + # Ensure correct PERLLIB path + sed -i -e 's#${D}##g' ${D}${sysconfdir}/webmin/start +} + +INITSCRIPT_NAME = "webmin" +INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ." + +SYSTEMD_SERVICE:${PN} = "webmin.service" +SYSTEMD_AUTO_ENABLE:${PN} = "disable" + +# FIXME: some of this should be figured out automatically +RDEPENDS:${PN} += "perl perl-module-socket perl-module-exporter perl-module-exporter-heavy perl-module-carp perl-module-strict" +RDEPENDS:${PN} += "perl-module-warnings perl-module-xsloader perl-module-posix perl-module-autoloader" +RDEPENDS:${PN} += "perl-module-fcntl perl-module-tie-hash perl-module-vars perl-module-time-local perl-module-config perl-module-constant" +RDEPENDS:${PN} += "perl-module-file-glob perl-module-file-copy perl-module-sdbm-file perl-module-feature" + +PACKAGES_DYNAMIC += "webmin-module-* webmin-theme-*" +RRECOMMENDS:${PN} += "webmin-module-system-status" + +PACKAGES += "${PN}-module-proc ${PN}-module-raid ${PN}-module-exports ${PN}-module-fdisk ${PN}-module-lvm" +RDEPENDS:${PN}-module-proc = "procps" +RDEPENDS:${PN}-module-raid = "mdadm" +RDEPENDS:${PN}-module-exports = "perl-module-file-basename perl-module-file-path perl-module-cwd perl-module-file-spec perl-module-file-spec-unix" +RRECOMMENDS:${PN}-module-fdisk = "parted" +RRECOMMENDS:${PN}-module-lvm = "lvm2" + +python populate_packages:prepend() { + import os, os.path + + wadir = bb.data.expand('${libexecdir}/webmin', d) + wadir_image = bb.data.expand('${D}', d) + wadir + modules = [] + themes = [] + for mod in os.listdir(wadir_image): + modinfo = os.path.join(wadir_image, mod, "module.info") + themeinfo = os.path.join(wadir_image, mod, "theme.info") + if os.path.exists(modinfo): + modules.append(mod) + elif os.path.exists(themeinfo): + themes.append(mod) + + do_split_packages(d, wadir, '^(%s)$' % "|".join(modules), 'webmin-module-%s', 'Webmin module for %s', extra_depends='perl', allow_dirs=True, prepend=True) + do_split_packages(d, wadir, '^(%s)$' % "|".join(themes), 'webmin-theme-%s', 'Webmin theme for %s', extra_depends='perl', allow_dirs=True, prepend=True) +} + +# Time-savers +package_do_pkgconfig() { + : +} -- cgit v1.2.3-54-g00ecf