mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-06 01:16:34 +00:00
Merge branch 'master' of https://github.com/venomlinux/scratchpkg
This commit is contained in:
156
README.md
156
README.md
@@ -1,12 +1,11 @@
|
||||
# scratchpkg
|
||||
|
||||
A package manager for Linux From Scratch.
|
||||
A package manager for [Venom Linux](https://venomlinux.org/).
|
||||
|
||||
## Description
|
||||
|
||||
Scratchpkg is a package manager built in order to manage packages for the Linux From Scratch system/distro. This package manager
|
||||
is fully written in bash. The package building script uses the port system like in Arch's makepkg, CRUX's pkgmk and NuTyX's
|
||||
cards. Packages are built and installed into a temporary location using DESTDIR method and are afterwards compressed in a file
|
||||
Scratchpkg is a package manager built in order to manage packages for Venom Linux. This package manager
|
||||
is fully written in bash. The package building script uses the port system like in Arch's makepkg and CRUX's pkgmk. Packages are built and installed into a temporary location using DESTDIR method and are afterwards compressed in a file
|
||||
directory using tar.
|
||||
|
||||
Installing the packaged tar means it is extracted into real system. After that all files extracted is recorded into an index
|
||||
@@ -16,22 +15,28 @@ them.
|
||||
|
||||
## spkgbuild
|
||||
|
||||
`spkgbuild` is build script sourced by `buildpkg` to build the package.
|
||||
`spkgbuild` is build script sourced by `pkgbuild` to build the package.
|
||||
The example of `spkgbuild` as follows:
|
||||
|
||||
# description : This is example package
|
||||
# backup : etc/example.conf etc/foobar.conf
|
||||
# homepage : https://example.com/
|
||||
# maintainer : Emmett1, emmett1 dot 2miligrams at gmail dot com
|
||||
# depends : package1 package2 package3
|
||||
# noextract : example.tar.gz foobar.tar.xz
|
||||
|
||||
name=foobar
|
||||
version=1.0.0
|
||||
release=1
|
||||
options=(!docs libtool)
|
||||
backup=(etc/example.conf etc/foobar.conf)
|
||||
noextract=(foobar.tar.xz)
|
||||
options=(!strip libtool)
|
||||
source=(https://dl.example.com/foobar.tar.xz
|
||||
$name-$version.tar.gz::https://github.com/achieve/$version.tar.gz
|
||||
example.conf)
|
||||
|
||||
nostrip=(lib.*/ld-.*\.so$
|
||||
lib.*/libc-.*\.so$
|
||||
lib.*/libpthread-.*\.so$
|
||||
lib.*/libthread_db-.*\.so$)
|
||||
|
||||
build() {
|
||||
cd $name-$version
|
||||
|
||||
@@ -42,24 +47,21 @@ The example of `spkgbuild` as follows:
|
||||
install -d $SRC/example.conf $PKG/etc/example.conf
|
||||
}
|
||||
|
||||
You can also use headers (except for description, as it needs for search function of `scratch`) as array, example:
|
||||
|
||||
backup=(etc/example.conf etc/foobar.conf)
|
||||
depends=(package1 package2 package3)
|
||||
noextract=(example.tar.gz foobar.tar.xz)
|
||||
|
||||
*Note: When create new package, its recommended to build using fakeroot first to make sure the build script is not broken and leave untracked file inside system.*
|
||||
|
||||
#### spkgbuild format:
|
||||
|
||||
* `description`: Short description for package.
|
||||
* `backup`: File need backup when upgrading package (without leading with '/').
|
||||
* `homepage`: Url for software webpage
|
||||
* `maintainer`: maintainer name and email
|
||||
* `depends`: All required dependencies, separate with space.
|
||||
* `noextract`: Specify file no need to extract, separate with space.
|
||||
* `name`: Package name, need same as port directory's name.
|
||||
* `version`: Package's version.
|
||||
* `release`: Package's release version, useful when build script need change with same package version.
|
||||
* `options`: Package's build options, see 'Package options' for available options.
|
||||
* `backup`: File need backup when upgrading package (without leading with '/').
|
||||
* `noextract`: Specify file no need to extract, separate with space.
|
||||
* `nostrip`: list file to avoid strip, can use regex
|
||||
* `source`: Package's source urls, separate with space, can use as `<new-source-name>::<source-url>` to save source file with different name (see `spkgbuild` example).
|
||||
|
||||
## Package options
|
||||
@@ -81,9 +83,7 @@ Available options:
|
||||
libtool: Keep libtool file (*.la) in packages.
|
||||
emptydirs: Keep empty directories in packages.
|
||||
strip: Strip symbols from binaries/libraries.
|
||||
docs: Keep docs directories specified by DOC_DIRS.
|
||||
purge: Remove files specified in PURGE_FILES.
|
||||
zipman: Compress manual (man and info) pages in MAN_DIRS with gzip.
|
||||
zipman: Compress manual (man and info) pages with gzip.
|
||||
buildflags: Enable buildflags (CFLAGS and CXXFLAGS).
|
||||
makeflags: Enable makeflags (MAKEFLAGS).
|
||||
|
||||
@@ -97,28 +97,30 @@ Available options:
|
||||
-i, --install install package into system
|
||||
-u, --upgrade upgrade package
|
||||
-r, --reinstall reinstall package
|
||||
-d, --no-dep skip dependency check
|
||||
-c, --ignore-conflict ignore conflict when installing package
|
||||
-v, --verbose verbose install process
|
||||
-f, --force-rebuild rebuild package
|
||||
-m, --ignore-mdsum skip md5sum checking
|
||||
-m, --skip-mdsum skip md5sum checking
|
||||
-g, --genmdsum generate md5sum
|
||||
-o, --download-only download only source file
|
||||
-e, --extract-only extract only source file
|
||||
-o, --download download only source file
|
||||
-x, --extract extract only source file
|
||||
-w, --keep-work keep working directory
|
||||
-l, --log log build process
|
||||
-h, --help show this help message
|
||||
--config=<config> use custom config file
|
||||
--srcdir=<path> override directory path for sources
|
||||
--pkgdir=<path> override directory path for compiled package
|
||||
--no-preinstall skip preinstall script before build/install package
|
||||
--logdir=<path> override directory path for build logs
|
||||
--workdir=<path> override directory path for working dir
|
||||
--no-preinstall skip preinstall script before install package
|
||||
--no-postinstall skip postinstall script after install package
|
||||
--no-preupgrade skip preupgrade script before upgrade package
|
||||
--no-postupgrade skip postupgrade script after upgrade package
|
||||
--no-color disable color
|
||||
--no-backup skip backup configuration file when upgrading package
|
||||
--redownload re-download source file
|
||||
|
||||
Example:
|
||||
pkgbuild -irw this will force rebuild, install package and keep working directory
|
||||
pkgbuild -iw this will build, install package and keep working directory
|
||||
|
||||
Note:
|
||||
* use pkgbuild without any options will only download source and build package by using other default options
|
||||
@@ -137,7 +139,6 @@ package and remove old file which not exist in new package (like Slackware pkgto
|
||||
Options:
|
||||
-u, --upgrade upgrade package
|
||||
-r, --reinstall reinstall package
|
||||
-d, --no-dep skip dependency check
|
||||
-c, --ignore-conflict ignore conflict when installing package
|
||||
-v, --verbose print files installed
|
||||
-h, --help show this help message
|
||||
@@ -146,8 +147,7 @@ package and remove old file which not exist in new package (like Slackware pkgto
|
||||
--no-preupgrade skip preupgrade script before upgrade package
|
||||
--no-postupgrade skip postupgrade script after upgrade package
|
||||
--no-backup skip backup when upgrading package
|
||||
--no-orphan-check skip orphaned package check after install package
|
||||
--no-color disable colour for output
|
||||
--root=<path> install to custom root directory
|
||||
|
||||
Example:
|
||||
pkgadd foobar-1.0-1.spkg.txz -uc --no-backup upgrade package foobar-1.0-1 without backup its
|
||||
@@ -160,16 +160,14 @@ package and remove old file which not exist in new package (like Slackware pkgto
|
||||
pkgdel [ <options> <package name> ]
|
||||
|
||||
Options:
|
||||
-d, --no-dep skip dependency check
|
||||
-v, --verbose print removed files
|
||||
-h, --help show this help message
|
||||
-v, --verbose print removed files
|
||||
--no-preremove don't run pre-remove script
|
||||
--no-postremove don't run post-remove script
|
||||
--no-color disable colour for output
|
||||
--root=<path> remove package from custom root directory
|
||||
|
||||
Example:
|
||||
pkgdel firefox -dv --no-preremove remove package firefox, skipping dependency check,
|
||||
print deleted files and skipp pre-remove script
|
||||
pkgdel firefox -v --no-preremove remove package firefox, print deleted files and skip pre-remove script
|
||||
|
||||
### scratch
|
||||
`scratch` is front-end for pkgbuild, pkgadd and pkgdel. Its changed directory in ports and call pkgbuild to build package, then
|
||||
@@ -260,56 +258,50 @@ orphan package, duplicate ports, list installed package and etc. Run `scratch he
|
||||
Extra tools is some scripts come with scratchpkg to help users do things more easier. More extra scripts may added from time to
|
||||
time.
|
||||
|
||||
* `s-chroot`: Chroot script.
|
||||
* `s-libdepends`: Script to list package depends by shared libraries.
|
||||
* `s-portcreate`: Script to create template port.
|
||||
* `s-updateconf`: Script to update configuration files (*.spkgnew).
|
||||
* `vchroot`: Chroot script.
|
||||
* `pkglibdepends`: Script to list package depends by shared libraries.
|
||||
* `portcreate`: Script to create template port.
|
||||
* `updateconf`: Script to update configuration files (*.spkgnew).
|
||||
* `revdep`: A reverse dependency script (like in Gentoo and CRUX, but my version), need to run after upgrade and remove package to check broken package(s). Specify package name if want to check single package only.
|
||||
|
||||
## Hook
|
||||
|
||||
`hook` is specified command need to run after install/remove/upgrade package. `hook` suffix is `*.hook` and need to be placed in
|
||||
`HOOK_DIR` (default is `/etc/hook/`). The example of `hook` file for gdk-pixbuf package as follows:
|
||||
|
||||
# description : Probing GDK-Pixbuf loader modules...
|
||||
# operation : install upgrade remove
|
||||
# target : usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/
|
||||
|
||||
exechook() {
|
||||
/usr/bin/gdk-pixbuf-query-loaders --update-cache
|
||||
}
|
||||
|
||||
### Hook format:
|
||||
|
||||
* `description`: Short description, printed when cmd executed.
|
||||
* `operation`: Specify when cmd need to run, available options; install, upgrade & remove.
|
||||
* `target`: Path file/directory checked need to run the cmd (without leading with '/').
|
||||
* `exechook()`: Command need to run should be in this function.
|
||||
|
||||
## Install script
|
||||
|
||||
Install scripts is a bash script contains command need to run before/after install/upgrade/remove packages in system. The suffix
|
||||
of install script is `<portname>.install`. This install script need to placed in port directory and later will included in tar-ed
|
||||
of install script is `install`. This install script need to placed in port directory and later will included in tar-ed
|
||||
package. The script contains the following functions which run at different times:
|
||||
|
||||
* `pre_build()`: The script is run right before package is built.
|
||||
* `pre_install()`: The script is run right before files are extracted. One argument is passed: new package version.
|
||||
* `post_install()`: The script is run right after files are extracted. One argument is passed: new package version.
|
||||
* `pre_upgrade()`: The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.
|
||||
* `post_upgrade()`: The script is run right after files are extracted. Two arguments are passed in the following order: new package version, old package version.
|
||||
* `pre_remove()`: The script is run right before files are removed. One argument is passed: old package version.
|
||||
* `post_remove()`: The script is run right after files are removed. One argument is passed: old package version.
|
||||
This script is executed using `sh`. Argument is passed when this script is executed.
|
||||
|
||||
Example of install script for `dbus.install`:
|
||||
### install:
|
||||
$1 : pre-install/post-install
|
||||
$2 : version
|
||||
|
||||
### upgrade:
|
||||
$1 : pre-upgrade/post-upgrade
|
||||
$2 : version
|
||||
$3 : old version
|
||||
|
||||
### remove:
|
||||
$1 : pre-remove/post-remove
|
||||
$2 : old version
|
||||
|
||||
pre_install() {
|
||||
getent group messagebus >/dev/null || groupadd -g 18 messagebus
|
||||
getent passwd messagebus >/dev/null || useradd -c "D-Bus Message Daemon User" -d /var/run/dbus -u 18 -g messagebus -s /bin/false messagebus
|
||||
}
|
||||
Example of install script for `dbus`:
|
||||
|
||||
post_install() {
|
||||
dbus-uuidgen --ensure
|
||||
}
|
||||
# package install script
|
||||
|
||||
action=$1
|
||||
newversion=$2
|
||||
oldversion=$3
|
||||
|
||||
case $action in
|
||||
pre-install)
|
||||
getent group messagebus >/dev/null || groupadd -g 18 messagebus
|
||||
getent passwd messagebus >/dev/null || useradd -c "D-Bus Message Daemon User" -d /var/run/dbus -u 18 -g messagebus -s /bin/false messagebus
|
||||
;;
|
||||
post-install)
|
||||
dbus-uuidgen --ensure
|
||||
;;
|
||||
esac
|
||||
|
||||
## /etc/scratchpkg.repo
|
||||
|
||||
@@ -323,14 +315,12 @@ Example of install script for `dbus.install`:
|
||||
# <repo directory> <repo url for sync>
|
||||
#
|
||||
|
||||
/usr/ports/core https://raw.githubusercontent.com/emmett1/ports/master/core
|
||||
/usr/ports/xorg https://raw.githubusercontent.com/emmett1/ports/master/xorg
|
||||
/usr/ports/xfce4 https://raw.githubusercontent.com/emmett1/ports/master/xfce4
|
||||
/usr/ports/kf5 https://raw.githubusercontent.com/emmett1/ports/master/kf5
|
||||
/usr/ports/lxde https://raw.githubusercontent.com/emmett1/ports/master/lxde
|
||||
/usr/ports/extra https://raw.githubusercontent.com/emmett1/ports/master/extra
|
||||
/usr/ports/git https://raw.githubusercontent.com/emmett1/ports/master/git
|
||||
/usr/ports/wip https://raw.githubusercontent.com/emmett1/ports/master/wip
|
||||
/usr/ports/core https://raw.githubusercontent.com/venomlinux/ports/master/core
|
||||
/usr/ports/xorg https://raw.githubusercontent.com/venomlinux/ports/master/xorg
|
||||
/usr/ports/extra https://raw.githubusercontent.com/venomlinux/ports/master/extra
|
||||
/usr/ports/xfce4 https://raw.githubusercontent.com/venomlinux/ports/master/xfce4
|
||||
/usr/ports/kf5 https://raw.githubusercontent.com/venomlinux/ports/master/kf5
|
||||
/usr/ports/lxde https://raw.githubusercontent.com/venomlinux/ports/master/lxde
|
||||
|
||||
*Note: url is optional. Add if need to sync it.*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user