CPANPLUS-Dist-Slackware
view release on metacpan or search on metacpan
lib/CPANPLUS/Dist/Slackware.pm view on Meta::CPAN
my $status = $dist->status;
my $module = $dist->parent;
my $cb = $module->parent;
my $conf = $cb->configure_object;
my $pkgdesc = $status->_pkgdesc;
my $verbose = $param_ref->{verbose};
my $destdir = $pkgdesc->destdir;
my $outputname = $pkgdesc->outputname;
my $needs_chown = 0;
my $cmd = [ '/sbin/makepkg', '-l', 'y', '-c', 'y', $outputname ];
if ( $EFFECTIVE_USER_ID > 0 ) {
my $fakeroot = $status->_fakeroot_cmd;
if ($fakeroot) {
unshift @{$cmd}, $fakeroot;
}
else {
my $sudo = $conf->get_program('sudo');
if ($sudo) {
unshift @{$cmd}, $sudo;
$needs_chown = 1;
}
else {
error( loc($NONROOT_WARNING) );
return;
}
}
}
msg( loc( q{Creating package '%1'}, $outputname ) );
my $orig_uid = $UID;
my $orig_gid = ( split /\s+/, $GID )[0];
if ($needs_chown) {
my @stat = stat($destdir);
if ( !@stat ) {
error( loc( q{Could not stat '%1': %2}, $destdir, $OS_ERROR ) );
return;
}
$orig_uid = $stat[4];
$orig_gid = $stat[5];
$dist->_chown_recursively( 0, 0, $destdir ) or return;
}
my $fail = 0;
if ( !run( $cmd, { dir => $destdir, verbose => $verbose } ) ) {
++$fail;
}
if ($needs_chown) {
if ( -d $destdir ) {
if (!$dist->_chown_recursively( $orig_uid, $orig_gid, $destdir ) )
{
++$fail;
}
}
if ( -f $outputname ) {
if (!$dist->_chown_recursively(
$orig_uid, $orig_gid, $outputname
)
)
{
++$fail;
}
}
}
if ( !$param_ref->{keep_source} ) {
lib/CPANPLUS/Dist/Slackware.pm view on Meta::CPAN
my $module = $dist->parent;
my $cb = $module->parent;
my $pkgdesc = $status->_pkgdesc;
my $installdir = catdir( $pkgdesc->destdir, 'install' );
my $descfile = catfile( $installdir, 'slack-desc' );
my $desc = $pkgdesc->slack_desc;
return spurt( $descfile, $desc );
}
sub _chown_recursively {
my ( $dist, $uid, $gid, @filenames ) = @_;
my $module = $dist->parent;
my $cb = $module->parent;
my $conf = $cb->configure_object;
my $cmd = [ '/bin/chown', '-R', "$uid:$gid", @filenames ];
if ( $EFFECTIVE_USER_ID > 0 ) {
my $sudo = $conf->get_program('sudo');
if ($sudo) {
unshift @{$cmd}, $sudo;
}
else {
error( loc($NONROOT_WARNING) );
return;
}
}
lib/CPANPLUS/Dist/Slackware.pm view on Meta::CPAN
=item B<INSTALLDIRS>
The installation destination. Can be "vendor" or "site". Defaults to "vendor".
=back
=head1 DEPENDENCIES
Requires the Slackware Linux package management tools C<makepkg>,
C<installpkg>, C<updatepkg>, and C<removepkg>. Other required commands are
C<chown>, C<cp>, C<file>, C<make>, C<strip> and a C compiler.
In order to manage packages as a non-root user, which is highly recommended,
you must have C<sudo> and, optionally, C<fakeroot>. You can download a script
that builds C<fakeroot> from L<https://slackbuilds.org/>.
Requires the modules CPANPLUS and Module::Pluggable from CPAN.
The lowest supported Module::Build version is 0.36.
The required modules Cwd, ExtUtils::Packlist, File::Find, File::Spec,
lib/CPANPLUS/Dist/Slackware/Plugin/Mail/SpamAssassin.pm view on Meta::CPAN
After installing SpamAssassin, you need to download and install the
SpamAssassin ruleset using "sa-update". See the README file for details. If
you don't want to run "sa-update" as root, create a dedicated account and a
required directory before you run "sa-update". Example:
useradd -u 400 -r -U -c "User for SpamAssassin rule updates" \
-m -d /var/lib/spamassassin sa-update
mkdir -m 700 /etc/mail/spamassassin/sa-update-keys
chown sa-update:sa-update /etc/mail/spamassassin/sa-update-keys
su sa-update -c /usr/bin/sa-update
If "re2c", which is available at slackbuilds.org, is installed, the ruleset
can be compiled into native code to speed up SpamAssassin's operation:
su sa-update -c /usr/bin/sa-compile
The compiled rules are loaded if the Rule2XSBody plugin is enabled in
SpamAssassin's configuration.
( run in 2.018 seconds using v1.01-cache-2.11-cpan-71847e10f99 )