Inital commit

This commit is contained in:
2026-01-26 20:34:48 -05:00
commit 58436c6b73
5 changed files with 199 additions and 0 deletions

15
LICENSE Normal file
View File

@@ -0,0 +1,15 @@
ISC License
Copyright (c) 2026 fSD
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

11
Makefile Normal file
View File

@@ -0,0 +1,11 @@
all:
@echo "nothing to do"
install:
cp bin/fp /usr/local/bin
cp fp.1 /usr/local/share/man/man1/fp.1
chmod 644 /usr/local/share/man/man1/fp.1
uninstall:
$(RM) /usr/local/bin/fp
$(RM) /usr/local/share/man/man1/fp.1

27
README.md Normal file
View File

@@ -0,0 +1,27 @@
# fp
https://fsdproject.org/releases/fp
Easily install fSD packages:
- Install fSD packages
- Update fSD packages
## Install
#### Dependencies
```bash
git clone https://git.vxserver.dev/fSD/fp
cd fp
sudo make install
```
## Usage
This tool runs via the command `fp`.
- `fp search` -- Search for a package
- `fp install` -- Install a package
- `fp remove` -- Uninstall a package
- `fp update` -- Update fp

125
bin/fp Executable file
View File

@@ -0,0 +1,125 @@
#! /bin/sh
# Easily install fSD packages
scriptversion="0.0.1"
#
#
# Copyright (C) 2026 fSD
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
prefix=/usr/local/bin/
me="$(basename "$0")"
pkgs_descs=$(cat <<EOF
yait C and SH project init tool.
fes An embedded Lua microwebframework.
fp A package manager for the Free Software Distributions Project
EOF
)
http_download() {
url="$1"
outfile="$2"
if command -v curl >/dev/null 2>&1; then
curl -fSL "$url" -o "$outfile"
return $?
elif command -v wget >/dev/null 2>&1; then
wget --retry-connrefused --waitretry=1 --read-timeout=20 "$url" -O "$outfile"
return $?
elif command -v fetch >/dev/null 2>&1; then
fetch -o "$outfile" "$url"
return $?
else
echo "$me: error: No HTTP client (curl, wget, fetch) found." >&2
return 1
fi
}
search() {
pkg="$1"
echo "$pkgs_descs" | GREP_COLORS='mt=0;92' grep -Fi --color=always "$pkg"
}
install() {
pkg="$1"
if [ "$(id -u)" -ne 0 ]; then
echo "$me: error: please run as root."
exit 1
fi
echo "starting install for $pkg"
http_download "https://dl.fsdproject.org/$pkg" "$prefix$pkg" && chmod +x "$prefix$pkg"
echo "done"
}
upgrade() {
echo "upgrade is an alias to 'fp install $1'"
install "$1"
}
update() {
if [ "$(id -u)" -ne 0 ]; then
echo "$me: error: please run as root."
exit 1
fi
echo "updating $pkg"
http_download "https://dl.fsdproject.org/fp" "${prefix}fp"
echo "done"
}
remove() {
pkg="$1"
if [ "$(id -u)" -ne 0 ]; then
echo "$me: error: please run as root."
exit 1
fi
echo "removing $pkg"
rm -f "$prefix$pkg"
echo "done"
}
version="$me/fSD v$scriptversion
Copyright (C) 2026 fSD.
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
usage="Usage: $me [OPTION]... <arg1> <arg2>
Easily install fSD packages for x86_64
Options:
--help print this help and exit
--version output version information
search search for a package
install install a package
remove remove a package
update update FreePkg"
if ! [ $# -gt 0 ]; then
echo "$usage"
exit 0
fi
while [ $# -gt 0 ]; do
case $1 in
--help) echo "$usage"; exit 0 ;;
--version) echo "$version"; exit 0 ;;
-*) echo "$me: Unknown option '$1'." >&2; exit 1 ;;
search) shift; search "$*"; exit 0 ;;
install) shift; install "$1"; shift ;;
upgrade) shift; upgrade "$1"; shift ;;
remove) shift; remove "$1"; shift ;;
update) update; exit 0 ;;
*) echo "$me: Unknown option '$1'." >&2; exit 1 ;;
esac
done

21
fp.1 Normal file
View File

@@ -0,0 +1,21 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH FSD "1" "January 2026" "fSD v0.0.1" "User Commands"
.SH NAME
fp \- manual page for fp v0.0.1
.SH SYNOPSIS
.B fp
[\fI\,OPTION\/\fR]... \fI\,<version> <dir>\/\fR
.SH DESCRIPTION
Easily install fSD packages for x86_64
.SH OPTIONS
.TP
\fB\-\-help\fR
print this help and exit
.TP
\fB\-\-version\fR
output version information
.SH COPYRIGHT
Copyright \(co 2026 fSD.
.br
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.