diff --git a/makedist.pl b/makedist.pl index 701a9fd6..30953a73 100755 --- a/makedist.pl +++ b/makedist.pl @@ -8,7 +8,10 @@ if (@ARGV != 1) { die "usage: makedist.pl [--webmail] "; } -$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", @@ -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) { diff --git a/makerpm.pl b/makerpm.pl index aa459862..354b58d1 100755 --- a/makerpm.pl +++ b/makerpm.pl @@ -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. @@ -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") { diff --git a/setup.sh b/setup.sh index e942a945..27e194f1 100755 --- a/setup.sh +++ b/setup.sh @@ -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 @@ -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 diff --git a/updateboot.pl b/updateboot.pl index 818e3a8e..99d7e924 100755 --- a/updateboot.pl +++ b/updateboot.pl @@ -29,7 +29,7 @@ ©_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"); diff --git a/usermin-systemd b/usermin-systemd index 8519cf05..a279b8f7 100644 --- a/usermin-systemd +++ b/usermin-systemd @@ -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