1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  | 
#!/usr/bin/env perl
#
# vim: set ts=4:noet
#
# sboinstall
# script to install a SlackBuild by name
#
# author: Jacob Pipkin <j@dawnrazor.net>
# date: Pungenday, the 40th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.12.3;
use strict;
use warnings FATAL => 'all';
use SBO::Lib;
use Getopt::Long qw(:config bundling);
use File::Basename;
my $self = basename ($0);
sub show_usage () {
	print <<EOF
Usage: $self [options] sbo
Options:
  -h: this screen.
  -v: version information.
  -c: do not clean working files/directories after the build.                   
  -d: clean distfiles afterward. 
  -i: do not run installpkg at the end of the build process.
  -j: specify "-j" setting to make, for multicore systems; overrides conf file.
  -p: install an SBo as a -compat32 pkg on a multilib x86_64 system.
  -r: skip viewing of the SBo README.
  -R: view the README but do not attempt to parse requirements.
EOF
}
my $clean = $config{NOCLEAN} eq 'TRUE' ? 1 : 0;                                 
my $distclean = $config{DISTCLEAN} eq 'TRUE' ? 1 : 0;                           
my $jobs = $config{JOBS};
my ($help, $vers, $no_install, $non_int, $no_reqs, $compat32);
GetOptions (
	'help|h'			=> \$help,
	'version|v'			=> \$vers,
	'clean|c!'			=> \$clean,
	'distclean|d!'		=> \$distclean,
	'noinstall|n'		=> \$no_install,
	'nointeractive|i'	=> \$non_int,
	'norequirements|R'	=> \$no_reqs,
	'compat32|p'		=> \$compat32,
	'jobs|j=s'			=> \$jobs,
);
show_usage and exit 0 if $help;
show_version and exit 0 if $vers;
show_usage and exit 0 unless exists $ARGV[0];
# setup any options
unshift @ARGV, $clean ? '-c' : '--noclean';
unshift @ARGV, $distclean ? '-d' : '--distclean';
unshift @ARGV, '-n' if $no_install;
unshift @ARGV, '-i' if $non_int;
unshift @ARGV, '-R' if $no_reqs;
unshift @ARGV, '-p' if $compat32;
unshift @ARGV, "-j $jobs" if $jobs;
system '/usr/sbin/sboupgrade', '-oN', @ARGV;
exit 0;
  |