Compare commits
13
Commits
main
...
version-support
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fb1d40acc | ||
|
|
755df2c2c1 | ||
|
|
a8c4a287eb | ||
|
|
29d7ea9d66 | ||
|
|
ef47824b17 | ||
|
|
e05c7bba21 | ||
|
|
950f6bc0b3 | ||
|
|
0c7652fe09 | ||
|
|
291761f074 | ||
|
|
42da0fb84f | ||
|
|
73750d289b | ||
|
|
96d820ece0 | ||
|
|
fa04c30d6c |
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 Tola Mironcenko
|
||||||
|
|
||||||
|
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.
|
||||||
@@ -4,7 +4,6 @@ DESTDIR=/
|
|||||||
install:
|
install:
|
||||||
@if [ ! -d ${DESTDIR}/etc/pm ]; then \
|
@if [ ! -d ${DESTDIR}/etc/pm ]; then \
|
||||||
mkdir -p ${DESTDIR}/etc/pm; \
|
mkdir -p ${DESTDIR}/etc/pm; \
|
||||||
# touch ${DESTDIR}/etc/pm/repo; \
|
|
||||||
fi
|
fi
|
||||||
@if [ ! -d ${DESTDIR}/tmp ]; then \
|
@if [ ! -d ${DESTDIR}/tmp ]; then \
|
||||||
mkdir -p ${DESTDIR}/tmp; \
|
mkdir -p ${DESTDIR}/tmp; \
|
||||||
@@ -14,7 +13,6 @@ install:
|
|||||||
fi
|
fi
|
||||||
@if [ ! -d ${DESTDIR}/usr/share/pm ]; then \
|
@if [ ! -d ${DESTDIR}/usr/share/pm ]; then \
|
||||||
mkdir -p ${DESTDIR}/usr/share/pm/{packages,repos}; \
|
mkdir -p ${DESTDIR}/usr/share/pm/{packages,repos}; \
|
||||||
# touch ${DESTDIR}/usr/share/pm/query; \
|
|
||||||
fi
|
fi
|
||||||
@if [ ! -d ${DESTDIR}/var/cache/pm/pkg ]; then \
|
@if [ ! -d ${DESTDIR}/var/cache/pm/pkg ]; then \
|
||||||
mkdir -p ${DESTDIR}/var/cache/pm/pkg; \
|
mkdir -p ${DESTDIR}/var/cache/pm/pkg; \
|
||||||
|
|||||||
@@ -1,33 +1,138 @@
|
|||||||
# PM - package manager for simple linux
|
# PM - Package Manager for Simple Linux
|
||||||
|
|
||||||
## Filetree
|
A lightweight, shell-based package manager designed for simple Linux systems. PM provides essential package management functionality with minimal dependencies and a straightforward command-line interface.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Lightweight**: Written in pure shell script with minimal dependencies
|
||||||
|
- **Simple**: Easy-to-use command-line interface
|
||||||
|
- **Flexible**: Supports local and remote package installation
|
||||||
|
- **Portable**: Works on any POSIX-compliant system
|
||||||
|
- **Efficient**: Fast package operations with local caching
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### From Source
|
||||||
|
|
||||||
|
1. Clone or download the repository
|
||||||
|
2. Run the installation command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Installation
|
||||||
|
|
||||||
|
Copy the `src/pm` script to `/usr/bin/pm` and ensure it's executable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo cp src/pm /usr/bin/pm
|
||||||
|
sudo chmod +x /usr/bin/pm
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Basic Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install a package
|
||||||
|
pm add package-name
|
||||||
|
|
||||||
|
# Download package without installing
|
||||||
|
pm down package-name
|
||||||
|
|
||||||
|
# Install from local package file
|
||||||
|
pm unpack /path/to/package.pkg.gz
|
||||||
|
|
||||||
|
# Remove a package
|
||||||
|
pm del package-name
|
||||||
|
|
||||||
|
# List files in a package
|
||||||
|
pm list package-name
|
||||||
|
|
||||||
|
# Search for packages
|
||||||
|
pm search package-name
|
||||||
|
|
||||||
|
# Show installed packages
|
||||||
|
pm query
|
||||||
|
|
||||||
|
# Show help
|
||||||
|
pm help
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install pfetch package
|
||||||
|
pm add pfetch
|
||||||
|
|
||||||
|
# Download busybox without installing
|
||||||
|
pm down busybox
|
||||||
|
|
||||||
|
# Install from local package
|
||||||
|
pm unpack ./custom-package.pkg.gz
|
||||||
|
|
||||||
|
# Remove pfetch
|
||||||
|
pm del pfetch
|
||||||
|
|
||||||
|
# List all files in busybox package
|
||||||
|
pm list busybox
|
||||||
|
|
||||||
|
# Search for packages containing "fetch"
|
||||||
|
pm search fetch
|
||||||
|
```
|
||||||
|
|
||||||
|
## Directory Structure
|
||||||
|
|
||||||
|
PM uses the following directory structure:
|
||||||
|
|
||||||
```
|
```
|
||||||
/
|
/
|
||||||
├── etc
|
├── etc
|
||||||
│ └── pm
|
│ └── pm
|
||||||
│ └── repo
|
│ └── repo # Repository configuration
|
||||||
├── tmp
|
├── tmp # Temporary files
|
||||||
├── usr
|
├── usr
|
||||||
│ ├── bin
|
│ ├── bin
|
||||||
│ │ └── pm
|
│ │ └── pm # Main PM executable
|
||||||
│ └── share
|
│ └── share
|
||||||
│ └── pm
|
│ └── pm
|
||||||
│ ├── packages
|
│ ├── packages # Package metadata
|
||||||
│ ├── query
|
│ ├── query # Query cache
|
||||||
│ └── repos
|
│ └── repos # Repository data
|
||||||
│ └── localhost
|
│ └── localhost
|
||||||
│ └── query
|
│ └── query
|
||||||
└── var
|
└── var
|
||||||
└── cache
|
└── cache
|
||||||
└── pm
|
└── pm
|
||||||
└── pkg
|
└── pkg # Cached package files
|
||||||
```
|
```
|
||||||
|
|
||||||
## Package structure (pfetch for example)
|
## Package Format
|
||||||
|
|
||||||
|
PM packages use a simple archive format with the following structure:
|
||||||
|
|
||||||
```
|
```
|
||||||
pfetch.pkg
|
package-name.pkg.gz
|
||||||
|
├── list # List of files in package
|
||||||
|
├── deps # Package dependencies
|
||||||
|
├── post_install # Post-installation script (optional)
|
||||||
|
└── usr/ # Package files
|
||||||
|
└── bin/
|
||||||
|
└── executable
|
||||||
|
```
|
||||||
|
|
||||||
|
### Package Files
|
||||||
|
|
||||||
|
- **list**: Contains a list of all files included in the package
|
||||||
|
- **deps**: Lists package dependencies (one per line)
|
||||||
|
- **post_install**: Optional script executed after installation
|
||||||
|
- **Package files**: The actual files to be installed
|
||||||
|
|
||||||
|
### Example Package Structure (pfetch)
|
||||||
|
|
||||||
|
```
|
||||||
|
pfetch.pkg.gz
|
||||||
├── list
|
├── list
|
||||||
├── deps
|
├── deps
|
||||||
├── post_install
|
├── post_install
|
||||||
@@ -36,14 +141,73 @@ pfetch.pkg
|
|||||||
└── pfetch
|
└── pfetch
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example list file (pfetch for example)
|
**list file:**
|
||||||
|
|
||||||
```
|
```
|
||||||
usr/bin/pfetch
|
usr/bin/pfetch
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example deps file (pfetch for example)
|
**deps file:**
|
||||||
|
|
||||||
```
|
```
|
||||||
busybox
|
busybox
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Creating Packages
|
||||||
|
|
||||||
|
To create a package for PM:
|
||||||
|
|
||||||
|
1. Create a directory with your package name
|
||||||
|
2. Add your files in the appropriate directory structure
|
||||||
|
3. Create a `list` file with all file paths
|
||||||
|
4. Create a `deps` file with dependencies
|
||||||
|
5. Optionally add a `post_install` script
|
||||||
|
6. Archive with gzip: `tar -czf package.pkg.gz package-dir/`
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
### Build Package
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make package
|
||||||
|
```
|
||||||
|
|
||||||
|
### Clean Build Files
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make clean
|
||||||
|
```
|
||||||
|
|
||||||
|
### Uninstall
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo make uninstall
|
||||||
|
```
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- POSIX-compliant shell (bash, dash, etc.)
|
||||||
|
- Basic Unix utilities (tar, gzip, etc.)
|
||||||
|
- Root privileges for installation/removal
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
1. Fork the repository
|
||||||
|
2. Create a feature branch
|
||||||
|
3. Make your changes
|
||||||
|
4. Test thoroughly
|
||||||
|
5. Submit a pull request
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
**Tola Mironcenko**
|
||||||
|
|
||||||
|
## Version
|
||||||
|
|
||||||
|
Current version: 1.0.0
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
PM is designed to be simple, efficient, and reliable. For bug reports or feature requests, please open an issue in the project repository.
|
||||||
Reference in New Issue
Block a user