Skip to content

Commit

Permalink
Merge branch 'master' of github.com:webmin/usermin
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Jun 25, 2022
2 parents 904db68 + 37de560 commit 255d5e7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
9 changes: 8 additions & 1 deletion makedist.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
if (@ARGV != 1) {
die "usage: makedist.pl [--webmail] <version>";
}
$vers = $ARGV[0];
$fullvers = $ARGV[0];
$fullvers =~ /^([0-9\.]+)(\-(\d+))?$/ || usage();
$vers = $1;
$release = $3;

@files = ("config-*-linux",
"config-solaris", "images", "index.cgi", "mime.types",
Expand Down Expand Up @@ -65,6 +68,10 @@
system("cp -r -L $flist tarballs/$dir");
system("touch tarballs/$dir/install-type");
system("echo $vers > tarballs/$dir/version");
# Store release version, if set
if ($release && $release != 1) {
system("echo $release > tarballs/$dir/release");
}

# Add module files
foreach $m (@mlist) {
Expand Down
22 changes: 12 additions & 10 deletions makerpm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@
Version: $ver
Release: $rel
Provides: %{name}-%{version}
PreReq: /bin/sh /usr/bin/perl /bin/rm
Requires: /bin/sh /usr/bin/perl /bin/rm perl(Net::SSLeay) perl(Time::Local) perl(Encode::Detect) perl(Data::Dumper)
Requires(pre): /bin/sh /usr/bin/perl /bin/rm
Requires: /bin/sh /usr/bin/perl /bin/rm perl(Net::SSLeay) perl(Time::Local) perl(Encode::Detect) perl(Data::Dumper) openssl unzip tar
AutoReq: 0
License: BSD-3-clause
Group: System/Tools
Source: http://www.webmin.com/download/%{name}-%{version}.tar.gz
Vendor: Jamie Cameron
BuildRoot: /tmp/%{name}-%{version}
BuildArchitectures: noarch
AutoReq: 0
%description
A web-based user account administration interface for Unix systems.
Expand Down Expand Up @@ -256,13 +256,15 @@

$cmd = -x "/usr/bin/rpmbuild" ? "rpmbuild" : "rpm";
system("$cmd -ba --target=noarch $spec_dir/$pkgname-$ver.spec") && exit;
system("mv $base_dir/RPMS/noarch/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.noarch.rpm");
print "Moved to rpm/$pkgname-$ver-$rel.noarch.rpm\n";
system("mv $base_dir/SRPMS/$pkgname-$ver-$rel.src.rpm rpm/$pkgname-$ver-$rel.src.rpm");
print "Moved to rpm/$pkgname-$ver-$rel.src.rpm\n";
system("chown jcameron: rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm");
if (!$nosign) {
system("rpm --resign rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm");
if (-d "rpm") {
system("mv $base_dir/RPMS/noarch/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.noarch.rpm");
print "Moved to rpm/$pkgname-$ver-$rel.noarch.rpm\n";
system("mv $base_dir/SRPMS/$pkgname-$ver-$rel.src.rpm rpm/$pkgname-$ver-$rel.src.rpm");
print "Moved to rpm/$pkgname-$ver-$rel.src.rpm\n";
system("chown jcameron: rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm");
if (!$nosign) {
system("rpm --resign rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm");
}
}

if (-d "/usr/local/webadmin/rpm/yum") {
Expand Down
7 changes: 5 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ else
fi
cd "$wadir"

# Export Usermin root dir
WEBMIN_LIBDIR=$wadir
export WEBMIN_LIBDIR

# Display install directory
allmods=`cd "$srcdir"; echo */module.info | sed -e 's/\/module.info//g'`
if [ "$allmods" = "" ]; then
Expand Down Expand Up @@ -596,8 +600,7 @@ if [ -x "$systemctlcmd" ]; then
echo "$systemctlcmd start usermin" >>$config_dir/restart-by-force-kill
# Reload systemd
echo "#!/bin/sh" >>$config_dir/reload
echo "$config_dir/.reload-init >/dev/null 2>&1" >>$config_dir/reload

echo "$systemctlcmd reload usermin" >>$config_dir/reload

chmod 755 $config_dir/stop $config_dir/start $config_dir/restart $config_dir/restart-by-force-kill $config_dir/reload
else
Expand Down
2 changes: 1 addition & 1 deletion updateboot.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
&copy_source_dest("$root_directory/usermin-systemd", $temp);
my $lref = &read_file_lines($temp);
foreach my $l (@{$lref}) {
$l =~ s/(WEBMIN_[A-Z]+)/$ENV{$1}/;
$l =~ s/(WEBMIN_[A-Z]+)/$ENV{$1}/g;
}
&flush_file_lines($temp);
copy_source_dest($temp, "$systemd_root/$product.service");
Expand Down
10 changes: 5 additions & 5 deletions usermin-systemd
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[Unit]
Description=Usermin server daemon
After=syslog.target

[Service]
ExecStart=WEBMIN_CONFIG/.start-init
ExecStop=WEBMIN_CONFIG/.stop-init
ExecReload=WEBMIN_CONFIG/.reload-init
Environment="PERLLIB=WEBMIN_LIBDIR"
ExecStart=WEBMIN_LIBDIR/miniserv.pl WEBMIN_CONFIG/miniserv.conf
ExecStop=/usr/bin/kill $MAINPID
ExecReload=/usr/bin/kill -USR1 $MAINPID
PIDFile=WEBMIN_VAR/miniserv.pid
Type=forking
Restart=always
RestartSec=2s
OOMPolicy=kill
TimeoutSec=15s

[Install]
WantedBy=multi-user.target

0 comments on commit 255d5e7

Please sign in to comment.