diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d5095b2..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Super Simple Package Manager - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..b474e97 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,13 @@ +# spm +## License + +--- + +### MIT License +#### Copyright (c) 2022 Simple Package Manager + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +##### 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. diff --git a/README.md b/README.md index 39bdbb2..ebfd0cc 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,36 @@ -# SSPM -## How simple is SSPM? -SSPM is arguably too simple, and that's the point. -It's more esoteric than functional, as the goal -is not to make a package manager but rather to make -a super simple package manager. +# spm +### Simple Package Manager -## Why no options? -Options add clutter. All you do is add what packages -you want to install, and they can be installed. +--- + +## How simple is spm? +#### spm is arguably too simple, and that's the point. +The intended design is to be brutally simple -Installing a package: `sudo sspm install ` -Removing a package: `sudo sspm remove ` +## Why no options? +#### Options add clutter. +All you do is add what packages you want to install, and they can be installed. +- Installing a package: `sudo spm install ` +- Removing a package: `sudo spm remove ` -## Why does SSPM just auto install the package? -Because it adds an extra step, which isn't super -simple. +## Why does spm just auto install the package? +#### Because it adds an extra step, which isn't super simple. +In the unlikelyness of something needing to be configurd. ## Why no dependency checking? -Actually, this one is a personal pet peeve. WHO THE -HELL DECIDED THAT DEPENDENCIES ARE COMPILED **SEPERATELY** -FROM THE PROGRAM!? If your program needs C libraries, -well then tough shit. Should have your make file deal -with it, or make a makefile that uses SSPM to download -dependencies. I am not cluttering my package manager -with a billion libraries. - -## Why no md5 checking? -Who needs checksums? Everything is super reliable! -(That was sarcasm, truth is I didn't feel like it). +Actually, this one is a personal pet peeve of the [SSPM project's maintainer](https://github.com/SuperSimplePackageManager/SSPM): +#### WHO THE HELL DECIDED THAT DEPENDENCIES ARE COMPILED ** ~ SEPERATELY ~ ** FROM THE PROGRAM!? +If your program needs C libraries, well then that's your problem! +- Should have your make file deal with it, or make a makefile that uses spm to download dependencies. + - We won't clutter the package manager with a billion libraries. + +Or as Linus Thorvalds said: +#### ["WE DO NOT BREAK USERSPACE!"](https://lkml.org/lkml/2012/12/23/75) +- Which is something Glibc constantly violates and which is why it's absolutely trash for every CCSS! + +## Why no MD5 / signature checking? +#### Who needs checksums or signatures? Everything is super reliable! +- That was sarcasm, truth is I didn't feel like adding it in yet. ## Is this really the most simple? -Probably, idk \ No newline at end of file +Probably not, as [SSPM](https://github.com/SuperSimplePackageManager/SSPM) will likely be simpler, and is the source that has been forked here. diff --git a/spm b/spm new file mode 100755 index 0000000..225ec21 --- /dev/null +++ b/spm @@ -0,0 +1,56 @@ +#! /usr/bin/env bash +set -e +export CWD=$(pwd) +export REPO="https://raw.githubusercontent.com/OS-1337/pkgs/main/bin/" +export SPM_DIR=/usr/local/spm +export ACTION="NONE" + +check_spm_foler(){ + if [ ! -d ${spm_DIR} ]; then + mkdir -pv ${spm_DIR} + fi +} + +install_package(){ + . ${PACKAGE}.spm + mkdir -p ${PACKAGE}-src + cd ${spm_DIR}/${PACKAGE}-src + wget -q ${source} + + if [ ${format} == "bz2" ]; then + tar xvf *.bz2 &>/dev/null + elif [ ${format} == "xz" ]; then + tar xvf *.xz &>/dev/null + fi + + cd ${spm_DIR}/${PACKAGE}-src/ + cp -r */. . &>/dev/null + ${PACKAGE} ${ACTION} &>/dev/null + cd ${spm_DIR} + rm -rf ${PACKAGE}* + echo "Done!" +} + +for PACKAGE in $* +do + if [ "${PACKAGE}" == "install" ]; then + export ACTION="INSTALL" + elif [ "${PACKAGE}" == "remove" ]; then + export ACTION="REMOVE" + elif [ ! -f ${CWD}/${PACKAGE}.spm ]; then + echo "Installing ${PACKAGE} from repo" + check_spm_foler + cd ${spm_DIR} + rm -rf ${PACKAGE}* + wget -q ${REPO}/${PACKAGE}.spm + install_package + else + echo "Installing ${CWD}/${PACKAGE}.spm" + check_spm_foler + cd ${spm_DIR} + rm -rf ${PACKAGE}* + cd ${CWD} + cp ${CWD}/${PACKAGE}.spm ${spm_DIR}/${PACKAGE}.spm + install_package + fi +done \ No newline at end of file diff --git a/sspm b/sspm deleted file mode 100755 index d2f4a81..0000000 --- a/sspm +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/bash -set -e -export CWD=$(pwd) -export REPO="https://raw.githubusercontent.com/SuperSimplePackageManager/packages/main/" -export SSPM_DIR=/usr/local/sspm -export ACTION="NONE" - -check_sspm_foler(){ - if [ ! -d ${SSPM_DIR} ]; then - mkdir -pv ${SSPM_DIR} - fi -} - -install_package(){ - . ${PACKAGE}.sspm - mkdir -p ${PACKAGE}-src - cd ${SSPM_DIR}/${PACKAGE}-src - wget -q ${source} - if [ ${format} == "tar" ]; then - tar xvf *.tar.* &>/dev/null - elif [ ${format} == "zip" ]; then - unzip *.zip - fi - cd ${SSPM_DIR}/${PACKAGE}-src/ - cp -r */. . &>/dev/null - ${PACKAGE} ${ACTION} &>/dev/null - cd ${SSPM_DIR} - rm -rf ${PACKAGE}* - echo "Done!" -} - -for PACKAGE in $* -do - if [ "${PACKAGE}" == "install" ]; then - export ACTION="INSTALL" - elif [ "${PACKAGE}" == "remove" ]; then - export ACTION="REMOVE" - elif [ ! -f ${CWD}/${PACKAGE}.sspm ]; then - echo "Installing ${PACKAGE} from repo" - check_sspm_foler - cd ${SSPM_DIR} - rm -rf ${PACKAGE}* - wget -q ${REPO}/${PACKAGE}.sspm - install_package - else - echo "Installing ${CWD}/${PACKAGE}.sspm" - check_sspm_foler - cd ${SSPM_DIR} - rm -rf ${PACKAGE}* - cd ${CWD} - cp ${CWD}/${PACKAGE}.sspm ${SSPM_DIR}/${PACKAGE}.sspm - install_package - fi -done \ No newline at end of file