Added a $BPM_PKG_ARCH variable to source script

Added a "keep" field to package descriptor files which will prevent the specified files from being overwritten
Completely revamped the bpm-setup script in the bpm-utils package
This commit is contained in:
2024-04-23 17:53:12 +03:00
parent d086b4a639
commit e75d2fb1da
10 changed files with 198 additions and 165 deletions
+18 -25
View File
@@ -52,44 +52,37 @@ bpm help
Creating a package for BPM is simple
To create a package you need to
1) Create a working directory
1) Make sure you have installed the bpm-utils package from the test-packages directory in the repository
2) Run the following command (You can run the comamnd with no arguments to see available options)
```
mkdir my_bpm_package
bpm-setup -D my_bpm_package -t <binary/source>
```
2) Create a pkg.info file following this format (You can find examples in the test_packages directory)
3) This will create a directory named 'my_bpm_package' under the current directory with all the required files for the chosen package type
4) You are able to edit the pkg.info descriptor file inside the newly created directory to your liking. Here's an example of what a descriptor file could look like
```
name: my_package
description: My package's description
version: 1.0
architecture: x86_64
url: https://www.my-website.com/ (Optional)
license: MyLicense (Optional)
type: <binary/source>
depends: dependency1,dependency2
make_depends: make_depend1,make_depend2
depends: dependency1,dependency2 (Optional)
make_depends: make_depend1,make_depend2 (Optional)
```
depends and make depends are optional fields, you may skip them if you'd like
### Binary Packages
3) If you are making a binary package, simply create a 'files' directory
3) If you are making a binary package, copy all your binaries along with the directories they reside in (i.e files/usr/bin/my_binary)
6) Run the following to create a package archive
```
mkdir files
```
4) Copy all your binaries along with the directories they reside in (i.e files/usr/bin/my_binary)
5) Either copy the bpm-create script from the bpm-utils test package into your /usr/local/bin directory or install the bpm-utils.bpm package
6) Run the following
```
bpm-create <filename.bpm>
bpm-package <filename.bpm>
```
7) It's done! You now hopefully have a working BPM package!
### Source Packages
3) If you are making a source package, you need to create a 'source.sh' file
3) If you would like to bundle patches or other files with your source package place them in the 'source-files' directory. They will be extracted to the same location as the source.sh file during compilation
4) You need to edit your 'source.sh' file, the default source.sh template should explain the basic process of compiling your program
5) Your goal is to download your program's source code with either git, wget, curl, etc. and put the binaries under a folder called 'output' in the root of the temp directory. There is a simple example script with helpful comments in the htop-src test package
6) When you are done making your source.sh script run the following to create a package archive
```
touch source.sh
bpm-package <filename.bpm>
```
4) If you would like to bundle patches or other files with your source package create a 'source-files' directory and place your files in there. They will be extracted to the same location as the source.sh file during compilation
5) You are able to run bash code in source.sh. BPM will extract this file in a directory under /tmp and it will be run there
6) Your goal is to download your program's source code with either git, wget, curl, etc. and put the binaries under a folder called 'output' in the root of the temp directory. There is a simple example script with helpful comments in the htop-src test package
7) When you are done making your source.sh script run the following to create a package archive
```
bpm-create <filename.bpm>
```
8) That's it! Your source package should now be compiling correctly!
7) That's it! Your source package should now be compiling correctly!