blob: 34052a147bfd27c9ff3faeeeb23c5fbd3655694d [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -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 "
22
23SRC_URI[md5sum] = "4007c390323d840f26c2e0f43c5c81a3"
24SRC_URI[sha256sum] = "5111f820adc6fbca997a58d4b2fa186dac6cded9cff0e70724f8cae6021123d9"
25
26inherit perlnative update-rc.d
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}${localstatedir}
81 install -d ${D}${localstatedir}/webmin
82
83 install -d ${D}${libexecdir}/webmin
84 cd ${S} || exit 1
85 tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \
86 | tar --no-same-owner -xpf - -C ${D}${libexecdir}/webmin
87
88 rm -f ${D}${libexecdir}/webmin/webmin-init
89 rm -f ${D}${libexecdir}/webmin/ajaxterm/ajaxterm/configure.initd.gentoo
90 rm -rf ${D}${libexecdir}/webmin/patches
91
92 # Run setup script
93 export perl=perl
94 export perl_runtime=${bindir}/perl
95 export prefix=${D}
96 export tempdir=${S}/install_tmp
97 export wadir=${libexecdir}/webmin
98 export config_dir=${sysconfdir}/webmin
99 export var_dir=${localstatedir}/webmin
100 export os_type=generic-linux
101 export os_version=0
102 export real_os_type="${DISTRO_NAME}"
103 export real_os_version="${DISTRO_VERSION}"
104 export port=10000
105 export login=${WEBMIN_LOGIN}
106 export password=${WEBMIN_PASSWORD}
107 export ssl=0
108 export atboot=1
109 export no_pam=1
110 mkdir -p $tempdir
111 ${S}/../setup.sh
112}
113
114INITSCRIPT_NAME = "webmin"
115INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ."
116
117# FIXME: some of this should be figured out automatically
118RDEPENDS_${PN} += "perl perl-module-socket perl-module-exporter perl-module-exporter-heavy perl-module-carp perl-module-strict"
119RDEPENDS_${PN} += "perl-module-warnings perl-module-xsloader perl-module-posix perl-module-autoloader"
120RDEPENDS_${PN} += "perl-module-fcntl perl-module-tie-hash perl-module-vars perl-module-time-local perl-module-config perl-module-constant"
121RDEPENDS_${PN} += "perl-module-file-glob perl-module-file-copy perl-module-sdbm-file perl-module-feature"
122
123PACKAGES_DYNAMIC += "webmin-module-* webmin-theme-*"
124RRECOMMENDS_${PN} += "webmin-module-system-status"
125
126PACKAGES += "${PN}-module-proc ${PN}-module-raid ${PN}-module-exports ${PN}-module-fdisk ${PN}-module-lvm"
127RDEPENDS_${PN}-module-proc = "procps"
128RDEPENDS_${PN}-module-raid = "mdadm"
129RDEPENDS_${PN}-module-exports = "perl-module-file-basename perl-module-file-path perl-module-cwd perl-module-file-spec perl-module-file-spec-unix"
130RRECOMMENDS_${PN}-module-fdisk = "parted"
131RRECOMMENDS_${PN}-module-lvm = "lvm2"
132
133python populate_packages_prepend() {
134 import os, os.path
135
136 wadir = bb.data.expand('${libexecdir}/webmin', d)
137 wadir_image = bb.data.expand('${D}', d) + wadir
138 modules = []
139 themes = []
140 for mod in os.listdir(wadir_image):
141 modinfo = os.path.join(wadir_image, mod, "module.info")
142 themeinfo = os.path.join(wadir_image, mod, "theme.info")
143 if os.path.exists(modinfo):
144 modules.append(mod)
145 elif os.path.exists(themeinfo):
146 themes.append(mod)
147
148 do_split_packages(d, wadir, '^(%s)$' % "|".join(modules), 'webmin-module-%s', 'Webmin module for %s', allow_dirs=True, prepend=True)
149 do_split_packages(d, wadir, '^(%s)$' % "|".join(themes), 'webmin-theme-%s', 'Webmin theme for %s', allow_dirs=True, prepend=True)
150}
151
152# Time-savers
153package_do_pkgconfig() {
154 :
155}