aboutsummaryrefslogtreecommitdiff
path: root/sboinstall
blob: 2aa76cb16643029d5f2ac68ebda2fbc2330f1bec (plain)
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
#!/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.16.0;
use strict;
use warnings FATAL => 'all';
use SBO::Lib;
use Getopt::Std;
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 %options;
getopts ('hvcdripj:R', \%options);

show_usage and exit 0 if exists $options{h};
show_version and exit 0 if exists $options{v};

show_usage and exit 0 unless exists $ARGV[0];

# setup any options which do not require arguments
my @opts1 = ('c', 'd', 'r', 'i', 'p', 'R');
for my $opt (@opts1) {
	unshift @ARGV, "-$opt" if exists $options{$opt};
}

# setup any options which do require arguments
my @opts2 = ('j');
for my $opt (@opts2) {
	unshift @ARGV, "-$opt $options{$opt}" if exists $options{$opt};
}

system '/usr/sbin/sboupgrade', '-oN', @ARGV;

exit 0;