Slackware section added

This commit is contained in:
netico 2022-03-15 17:49:41 +01:00
parent 715a363749
commit 037cc88f17
9 changed files with 695 additions and 0 deletions

19
Slackware/README.md Normal file
View file

@ -0,0 +1,19 @@
# Slackware Linux
**Slackware** is the oldest **Linux** distribution [still developed](http://www.slackware.com/announce/15.0.php).
Unlike modern **Linux** distributions, **Slackware** does not have a graphical installation procedure and does not provide any automatic dependency resolution system for software packages.
It uses simple text files and some **bash** scripts for system configuration and administration.
**Slackware** is often considered more suitable for advanced and technically inclined **Linux** users.
## Minimal Slackware Installation
Just the [list of packages](slackware.minimal.txt).
## SlackBuilder
[SlackBuilder](SlackBuilder/README.md) is a program written in [Object Pascal](https://wiki.freepascal.org/Object_Pascal) that allows you to install the software packages provided by [SlackBuilds.org](https://slackbuilds.org).
![Slackware](f9ae0473c1f79023ef06bfab93cc6c9d.anon.png)

View file

@ -0,0 +1,27 @@
# SlackBuilder
## About
[SlackBuilder](SlackBuilder/README.md) is a program written in [Object Pascal](https://wiki.freepascal.org/Object_Pascal) that allows you to install the software packages provided by [SlackBuilds.org](https://slackbuilds.org).
## Install
You can compile **SlackBuilder** from the [source code](slackbuilder.lpr).
This [presentation](docs/slides.pdf) shows how to compile the program from source using [Lazarus IDE](https://www.lazarus-ide.org/).
A [64bit executable](slackbuilder) is still available ([SHA1 digest](slackbuilder.digest)).
## Usage
To update the list of available packages:
./slackbuilder sync
To search for a package:
./slackbuilder find torrent
To install a package:
./slackbuilder install ctorrent

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
4d5243c936cb3d4e45667199cf464d0219a1e7cd

View file

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<MainUnit Value="0"/>
<Title Value="slackbuilder"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<BuildModes Count="1" Active="Default">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default"/>
</Modes>
</RunParams>
<Units Count="1">
<Unit0>
<Filename Value="slackbuilder.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<TopLine Value="262"/>
<CursorPos X="4" Y="269"/>
<UsageCount Value="39"/>
<Loaded Value="True"/>
</Unit0>
</Units>
<JumpHistory Count="11" HistoryIndex="10">
<Position1>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="237" Column="64" TopLine="216"/>
</Position1>
<Position2>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="327" Column="13" TopLine="319"/>
</Position2>
<Position3>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="277" Column="65" TopLine="246"/>
</Position3>
<Position4>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="343" Column="25" TopLine="327"/>
</Position4>
<Position5>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="340" Column="31" TopLine="312"/>
</Position5>
<Position6>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="68" Column="70" TopLine="49"/>
</Position6>
<Position7>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="73" Column="32" TopLine="40"/>
</Position7>
<Position8>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="262" TopLine="211"/>
</Position8>
<Position9>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="396" Column="20" TopLine="28"/>
</Position9>
<Position10>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="275" Column="4" TopLine="262"/>
</Position10>
<Position11>
<Filename Value="slackbuilder.lpr"/>
<Caret Line="267" Column="4" TopLine="262"/>
</Position11>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="slackbuilder"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View file

@ -0,0 +1,396 @@
program slackbuilder;
{$mode objfpc}
uses
Sysutils,
BaseUnix,
Unix;
const
RsyncBin: String = 'rsync -r --stats -h --ignore-existing -c -z ';
WgetBin: String = 'wget -nc ';
InstallBin: String = 'upgradepkg --install-new --reinstall ';
Release: String = '0.2.2';
procedure buildPkg(Path: String; Name: String; TempDir: String; Force: Boolean);
var
Tarball: String;
Url: String;
S: Longint;
A: String;
Readme: TextFile;
InfoFile: TextFile;
Line: String;
sb: String;
sbCmd: String;
begin
// Workaround for compiler (?)
S := 0;
if (S <> 0) then
S := 0;
sb := Path + Name + '.SlackBuild';
sbCmd :=
'cd ' +
Path +
' && TAG=sb TMP=' +
TempDir +
' OUTPUT=' + '~ ' +
sb;
AssignFile(Readme, Path + 'README');
Reset(Readme);
repeat
Readln(Readme, Line);
Writeln('# ' + Line);
until(EOF(Readme));
CloseFile(Readme);
If (Force = False) then
begin
Writeln ('Install package "' + Name + '"? (y|n)');
Write ('>');
Readln (A);
end
else
A := 'y';
If (A = 'y') then
begin
AssignFile(InfoFile, Path + Name + '.info');
Reset(InfoFile);
repeat
Readln(InfoFile, Line);
If (Pos ('DOWNLOAD=', Line) <> 0) then
begin
Url := StringReplace(
StringReplace(
StringReplace(
Line,
'DOWNLOAD="',
'',
[rfReplaceAll, rfIgnoreCase]
),
'"',
'',
[rfReplaceAll, rfIgnoreCase]
),
'\',
'',
[rfReplaceAll, rfIgnoreCase]
);
Tarball := (ExtractFileName(Url));
S := fpSystem (
WgetBin +
Url +
' -O ' + Path + Tarball
);
S := fpSystem ('chmod +x ' + sb);
S := fpSystem (sbCmd);
S := fpSystem (
'rm -fr ' +
TempDir +
' &> /dev/null'
);
S := fpSystem (
'rm -fr ' + Path + Tarball + ' &> /dev/null'
);
S := fpSystem (InstallBin + '~/' + Name + '*sb.tgz');
end;
until(EOF(InfoFile));
CloseFile(InfoFile);
end;
end;
procedure installPkg(
RootDir: String; V: String; Pkg: String; TempDir: String; Force: Boolean
);
var
Info : TSearchRec;
Count : Longint;
I : TSearchRec;
C : Longint;
Pattern1: String;
Pattern2: String;
Path: String;
Dir: String;
Begin
Count := 0;
Pattern1 := RootDir + '/' + V + '/*';
If (FindFirst (Pattern1, faAnyFile and faDirectory, Info) = 0) then
begin
Repeat
Inc(Count);
With Info do
begin
If (Attr and faDirectory) = faDirectory then
begin
Pattern2 :=
RootDir +
'/' + V +
'/' + Name +
'/*' + Pkg + '*';
Dir := Name;
C := 0;
If (FindFirst (
Pattern2,
faAnyFile and faDirectory,
I
) = 0) then
begin
Repeat
Inc(C);
With I do
begin
If (
(Attr and faDirectory) = faDirectory
) then
begin
Path :=
RootDir +
'/' + V +
'/' + Dir +
'/' + Name + '/';
Writeln (
'# ' +
Name +
' (' + Dir + ')'
);
buildPkg (
Path,
Name,
TempDir,
Force
);
end;
end;
Until FindNext(I) <> 0;
end;
FindClose(I);
end;
end;
Until FindNext(Info) <> 0;
end;
FindClose(Info);
Writeln ();
end;
procedure findPkg(
RootDir: String;
V: String;
Pkg: String;
Install: Boolean;
TempDir: String;
Force: Boolean
);
var
Info : TSearchRec;
Count : Longint;
I : TSearchRec;
C : Longint;
P : Longint;
Pattern1: String;
Pattern2: String;
Begin
Count := 0;
P := 0;
Pattern1 := RootDir + '/' + V + '/*';
If (FindFirst (Pattern1, faAnyFile and faDirectory, Info) = 0) then
begin
Repeat
Inc(Count);
With Info do
begin
If (Attr and faDirectory) = faDirectory then
begin
Pattern2 :=
RootDir + '/' + V + '/' + Name + '/*' + Pkg + '*';
C := 0;
If (
FindFirst (
Pattern2,
faAnyFile and faDirectory,
I
) = 0
) then
begin
Repeat
Inc(C);
With I do
begin
If (
(Attr and faDirectory) = faDirectory
) then
begin
Inc(P);
Write(P);
Writeln (': ' + Name);
end;
end;
Until FindNext(I) <> 0;
end;
FindClose(I);
end;
end;
Until FindNext(Info) <> 0;
end;
FindClose(Info);
Writeln ('Found ', P, ' matches.');
if (P > 0) and (Install = True) then
begin
Writeln();
installPkg(RootDir, V, Pkg, TempDir, Force);
end ;
end;
var
Slackware: TextFile;
Version: String;
V: String;
Home: String;
User: String;
Mirror: String;
Temp: String;
RootDir: String;
TempDir: String;
Pkg: String;
S: Longint;
Force: Boolean = False;
begin
// Workaround for compiler (?)
S := 0;
if (S <> 0) then
S := 0;
// Check Slackware version
AssignFile(Slackware, '/etc/slackware-version');
Reset(Slackware);
repeat
Readln(Slackware, Version);
until(EOF(Slackware));
CloseFile(Slackware);
If (Pos ('13.37', Version) <> 0) then
V := '13.37'
Else If (Pos ('14.0', Version) <> 0) then
V := '14.0'
Else If (Pos ('14.1', Version) <> 0) then
V := '14.1'
Else If (Pos ('14.2', Version) <> 0) then
V := '14.2'
Else If (Pos ('15.0', Version) <> 0) then
V := '15.0'
else
begin
Writeln('Unknown Slackware version. Bye!');
Halt;
end;
Mirror := 'rsync://rsync.slackbuilds.org/slackbuilds/' + V;
// Check user
User := fpGetenv('USER');
If (User <> 'root') then
begin
Writeln('Try as root!');
Halt;
end;
// Help
If
(Length(ParamStr(1)) < 1) or
(ParamStr(1) = 'help') or (
(ParamStr(1) <> 'find') and
(ParamStr(1) <> 'sync') and
(ParamStr(1) <> 'install') and
(ParamStr(1) <> 'force-install') and
(ParamStr(1) <> 'version')
) then
begin
Writeln('Usage:');
Writeln(' slackbuilder sync');
Writeln(' slackbuilder {find|install|force-install} PACKAGE');
Writeln(' slackbuilder help');
Writeln(' slackbuilder version');
Halt;
end;
// Version
If(Length(ParamStr(1)) < 1) or (ParamStr(1) = 'version') then
begin
Writeln(Release);
Halt;
end;
// Settings
Home := fpGetenv('HOME');
Temp := IntToStr(Random(1000000)) ;
RootDir := Home + '/.slackbuilder';
TempDir := RootDir + '/' + Temp;
// Start
write ('SlackBuilder ' + Release);
Writeln (' (Slackware Linux ' + V + ')');
Writeln ();
// Make work directory
If (DirectoryExists(RootDir) = False) then
Mkdir (RootDir);
// Main flow
// Sync
If(ParamStr(1) = 'sync') then
begin
Writeln('Syncing ' + V + ' branch from slackbuilds.org...');
S := fpSystem (RsyncBin + Mirror + ' ' + RootDir);
Halt;
end;
// Find
If(ParamStr(1) = 'find') then
begin
If(length(ParamStr(2)) > 0) then
begin
Pkg := ParamStr(2);
Writeln ('Search results for "' + Pkg + '":');
findPkg(RootDir, V, Pkg, False, TempDir, Force);
Halt;
end;
end;
// Install
If(ParamStr(1) = 'install') or (ParamStr(1) = 'force-install') then
begin
If(length(ParamStr(2)) > 0) then
begin
if (ParamStr(1) = 'force-install') then
Force := True;
Pkg := ParamStr(2);
findPkg(RootDir, V, Pkg, True, TempDir, Force);
Halt;
end;
end;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -0,0 +1,142 @@
NetworkManager-1.32.12-x86_64-1
aaa_base-15.0-x86_64-4_slack15.0
aaa_glibc-solibs-2.33-x86_64-5
aaa_libraries-15.0-x86_64-19
aaa_terminfo-6.3-x86_64-1
acl-2.3.1-x86_64-1
attr-2.5.1-x86_64-1
bash-5.1.016-x86_64-1
bc-1.07.1-x86_64-5
bin-11.1-x86_64-5
bind-9.16.25-x86_64-1
binutils-2.37-x86_64-1
brotli-1.0.9-x86_64-7
bzip2-1.0.8-x86_64-3
ca-certificates-20220309-noarch-1_slack15.0
coreutils-9.0-x86_64-3
cpio-2.13-x86_64-3
cracklib-2.9.7-x86_64-3
curl-7.81.0-x86_64-1
cyrus-sasl-2.1.28-x86_64-1_slack15.0
dbus-1.12.20-x86_64-5
dcron-4.5-x86_64-11
devs-2.3.1-noarch-25
dhcpcd-9.4.1-x86_64-1
dialog-1.3_20211214-x86_64-1
diffutils-3.8-x86_64-1
e2fsprogs-1.46.5-x86_64-1
elfutils-0.186-x86_64-1
elogind-246.10-x86_64-1
elvis-2.2_0-x86_64-8
etc-15.0-x86_64-17
eudev-3.2.11-x86_64-1
file-5.41-x86_64-1
findutils-4.8.0-x86_64-3
flex-2.6.4-x86_64-5
gawk-5.1.1-x86_64-1
gc-8.0.6-x86_64-1
gcc-11.2.0-x86_64-2
gcc-g++-11.2.0-x86_64-2
gettext-0.21-x86_64-3
gettext-tools-0.21-x86_64-3
glib2-2.70.3-x86_64-1
glibc-2.33-x86_64-5
gnupg-1.4.23-x86_64-4
gnupg2-2.2.33-x86_64-1
gnutls-3.7.2-x86_64-1
gpgme-1.16.0-x86_64-3
grep-3.7-x86_64-1
groff-1.22.4-x86_64-4
guile-3.0.7-x86_64-1
gzip-1.11-x86_64-1
haveged-1.9.17-x86_64-1
hostname-3.23-x86_64-3
htop-3.1.2-x86_64-1
icu4c-69.1-x86_64-1
iftop-1.0pre4-x86_64-4
iproute2-5.16.0-x86_64-1
ipset-7.15-x86_64-1
iptables-1.8.7-x86_64-3
iptraf-ng-1.2.1-x86_64-3
iputils-20211215-x86_64-1
kbd-1.15.3-x86_64-6
kernel-firmware-20220124_eb8ea1b-noarch-1
kernel-generic-5.15.27-x86_64-1
kernel-headers-5.15.27-x86-1
kernel-huge-5.15.27-x86_64-1
kernel-modules-5.15.27-x86_64-1
kernel-source-5.15.27-noarch-1
kmod-29-x86_64-1
less-590-x86_64-1
libcap-ng-0.8.2-x86_64-5
libgpg-error-1.44-x86_64-1
libgudev-237-x86_64-1
libmnl-1.0.4-x86_64-5
libndp-1.8-x86_64-1
libnl-1.1.4-x86_64-5
libnl3-3.5.0-x86_64-3
libpcap-1.10.1-x86_64-1
libpwquality-1.4.4-x86_64-6
libseccomp-2.5.3-x86_64-1
libsodium-1.0.18-x86_64-3
libunistring-0.9.10-x86_64-3
libuv-1.43.0-x86_64-1
libxml2-2.9.13-x86_64-1_slack15.0
lilo-24.2-x86_64-12
lmdb-0.9.29-x86_64-1
logrotate-3.18.1-x86_64-1
lsof-4.94.0-x86_64-3
lynx-2.9.0dev.10-x86_64-1
lz4-1.9.3-x86_64-3
make-4.3-x86_64-3
man-db-2.9.4-x86_64-3
man-pages-5.13-noarch-1
mkinitrd-1.4.11-x86_64-28
mlocate-0.26-x86_64-4
mozilla-nss-3.74-x86_64-1
nano-6.0-x86_64-1
nc-1.10-x86_64-4
ncurses-6.3-x86_64-1
net-tools-20181103_0eebece-x86_64-3
network-scripts-15.0-noarch-18
nghttp2-1.46.0-x86_64-1
ninja-1.10.2-x86_64-3
nmap-7.92-x86_64-1
nvi-1.81.6-x86_64-3
openssh-8.8p1-x86_64-2
openssl-1.1.1m-x86_64-1
openssl-solibs-1.1.1m-x86_64-1
os-prober-1.79-x86_64-1
pam-1.5.2-x86_64-1
parted-3.4-x86_64-2
patch-2.7.6-x86_64-5
perl-5.34.0-x86_64-1
pkgtools-15.0-noarch-42
procps-ng-3.3.17-x86_64-2
python3-3.9.10-x86_64-1
rsync-3.2.3-x86_64-4
sed-4.8-x86_64-3
shadow-4.8.1-x86_64-12
sharutils-4.15.2-x86_64-4
slackpkg-15.0.10-noarch-1
sqlite-3.37.2-x86_64-1
strace-5.16-x86_64-1
sudo-1.9.9-x86_64-1
sysklogd-2.3.0-x86_64-1
sysvinit-3.01-x86_64-1
sysvinit-functions-8.53-x86_64-5
sysvinit-scripts-15.0-noarch-8
tar-1.34-x86_64-1
tcpdump-4.99.1-x86_64-1
telnet-0.17-x86_64-6
texinfo-6.8-x86_64-3
time-1.9-x86_64-4
traceroute-2.1.0-x86_64-4
tree-1.8.0-x86_64-3
util-linux-2.37.4-x86_64-1_slack15.0
vim-8.2.4256-x86_64-1
wget-1.21.2-x86_64-1
which-2.21-x86_64-4
whois-5.5.11-x86_64-1
xxHash-0.8.1-x86_64-2
xz-5.2.5-x86_64-3