mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-05 08:28:00 +00:00
update readme
This commit is contained in:
275
README.md
275
README.md
@@ -6,7 +6,7 @@ A package manager for Linux From Scratch.
|
||||
|
||||
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 directory using tar.
|
||||
|
||||
Installing the packaged tar means it is extracted into real system. After that all files are extracted into an index directory. So scratchpkg will track all installed files. Scratchpkg can automatically resolve dependency order.
|
||||
Installing the packaged tar means it is extracted into real system. After that all files extracted is recorded into an index directory. So scratchpkg will track all installed files. Scratchpkg can automatically resolve dependencies order.
|
||||
|
||||
Scratchpkg reads the build script (spkgbuild) in the ports directory in order to get all necessary variables and functions before building them. Full package information like version, description, depends etc ... will be written into the package. So the built package isn't needing its port anymore for getting the necessary information. This is really an advantage supposing you would like to check for package dependencies or install a package that was built for another machine.
|
||||
|
||||
@@ -19,7 +19,6 @@ The example of `spkgbuild` as follows:
|
||||
# backup : etc/example.conf etc/foobar.conf
|
||||
# conflict : foobar2
|
||||
# depends : package1 package2 package3
|
||||
# makedepends : cmake gcc
|
||||
# noextract : example.tar.gz foobar.tar.xz
|
||||
|
||||
name=foobar
|
||||
@@ -45,7 +44,6 @@ You can also use headers (except for description, as it needs for search functio
|
||||
backup=(etc/example.conf etc/foobar.conf)
|
||||
conflict=(foobar2)
|
||||
depends=(package1 package2 package3)
|
||||
makedepends=(cmake gcc)
|
||||
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.*
|
||||
@@ -55,8 +53,7 @@ You can also use headers (except for description, as it needs for search functio
|
||||
* `description`: Short description for package.
|
||||
* `backup`: File need backup when upgrading package (without leading with '/').
|
||||
* `conflict`: Specify package conflict, separate with space.
|
||||
* `depends`: Dependencies and runtime dependencies, separate with space.
|
||||
* `makedepends`: Make dependencies, checked only when build package, not checked when install prebuit package, separate with space.
|
||||
* `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.
|
||||
@@ -94,68 +91,87 @@ Available options:
|
||||
Scratchpkg tools is separate into 4 main tools and several extra scripts (may added from time to time).
|
||||
|
||||
### scratch
|
||||
`scratch` is like multi tools. Its have many functions like search packages, check dependency, dependent, orphan package, duplicate ports, list installed package and etc. `scratch` also can build package without `cd` into port directory to build package. Run `scratch --help` to see available functions.
|
||||
`scratch` is like multi tools. Its have many functions like search packages, check dependency, dependent, orphan package, duplicate ports, list installed package and etc. `scratch` also can build package without `cd` into port directory to build package. Run `scratch help` to see available functions.
|
||||
|
||||
Usage:
|
||||
scratch [ <options> <arguments> ]
|
||||
scratch [ mode ] [ <pkgname> <options> ]
|
||||
|
||||
Options:
|
||||
-i, --install install package
|
||||
-u, --upgrade upgrade package
|
||||
-r, --reinstall reinstall package
|
||||
-id, --ignore-dependency skip dependency check
|
||||
-ic, --ignore-conflict skip file/package conflict check
|
||||
-fr, --force-rebuild rebuild package
|
||||
-sd, --source-dir <path> override directory path for sources
|
||||
-pd, --package-dir <path> override directory path for compiled package
|
||||
-v, --verbose verbose process
|
||||
-im, --ignore-mdsum skip md5sum check for sources
|
||||
-um, --update-mdsum update md5sum file for port
|
||||
-do, --download-only download sources only
|
||||
-eo, --extract-only extract sources only
|
||||
-kw, --keep-work keep working directory
|
||||
-rd, --redownload re-download sources
|
||||
--no-preinstall skip preinstall script before build/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-backup skip backup when upgrading package
|
||||
-p, --package <pkgnames> set package name to build
|
||||
-dup,--duplicate-ports list duplicate ports
|
||||
-l, --list-installed show list installed packages
|
||||
-lp, --list-ports <repo> show list ports for repository
|
||||
-lo, --list-orphan show list orphaned packages installed
|
||||
-ci, --check-integrity check integrity between package's index and files in system
|
||||
-cu, --check-update check for package updatehes
|
||||
-up, --update-ports update port's repository
|
||||
-c, --cat-port <pkgname> print port's buildscript (spkgbuild)
|
||||
-dp, --dependent <pkgname> show package's dependent (check through package index)
|
||||
-gdp,--global-dependent <pkgname> show package's dependent (check through port's repository)
|
||||
-d, --depends <pkgname> show package's depends
|
||||
-pi, --package-info <pkg> show package's info
|
||||
-co, --check-owner <file> show file's owner
|
||||
-st, --show-tree <pkgname> show list files of installed package
|
||||
-s, --search <pattern> search for packages in port's repository
|
||||
-t, --create-template <portname> create port's template for package
|
||||
-pp, --port-path show ports directory path
|
||||
--lock <pkgname> lock package from upgrade
|
||||
--unlock <pkgname> unlock package
|
||||
--listlocked list locked package
|
||||
--cache show old package and source caches
|
||||
--clear-cache remove all old package and source cac
|
||||
--missing-port list package that depends on non-exist port
|
||||
--missing-dep list package installed that missing it's dep in system
|
||||
--list-foreign list package installed but port not exist in repo
|
||||
--no-color disable colour for output
|
||||
--info show scratchpkg info (setting)
|
||||
-h, --help show this help message
|
||||
mode:
|
||||
install <packages> install packages and its dependencies
|
||||
upgrade <packages> upgrade packages and install new dependencies (if any)
|
||||
build <package> build only packages
|
||||
remove <packages> remove packages in system
|
||||
depends <package> show depends of a package
|
||||
deplist <packages> show list dependencies of a package
|
||||
search <pattern> search packages in port's repos
|
||||
lock <packages> lock packages from upgrade
|
||||
unlock <packages> unlock packages from upgrade
|
||||
listport <repo> list ports of a repo
|
||||
cat <package> view a package build scripts
|
||||
dependent <package> show package's dependent
|
||||
own <file> show package's owner of file
|
||||
pkgtree <package> show list files of installed package
|
||||
path <package> show package's buildscripts path
|
||||
sync update port's repo
|
||||
sysup full system update
|
||||
dup print duplicate ports in repo
|
||||
readme print readme file if exist
|
||||
listinst list installed package in system
|
||||
listorphan list orphan package
|
||||
integrity check integrity of package's files
|
||||
outdate check for outdate packages
|
||||
cache print leftover cache
|
||||
rmcache remove leftover cache
|
||||
missingdep check for mising dependency of installed package
|
||||
foreignpkg print package installed without port in repo
|
||||
listlocked print locked packages
|
||||
help print this help message
|
||||
|
||||
options for:
|
||||
build
|
||||
-f, --force-rebuild force rebuild
|
||||
-m, --skip-mdsum skip md5sum check for sources
|
||||
-d, --no-dep skip dependency check
|
||||
-e, --extract extract only
|
||||
-w, --keep-work keep woring directory
|
||||
-o, --download download source files only
|
||||
--redownload re-download source files
|
||||
--srcdir=<path> override default SOURCE_DIR
|
||||
--pkgdir=<path> override default PACKAGE_DIR
|
||||
--no-preinstall skip pre-install script
|
||||
|
||||
install
|
||||
-d, --no-dep skip installing dependencies
|
||||
-c, --ignore-conflict skip file conflict check
|
||||
-r, --reinstall reinstall installed package
|
||||
-v, --verbose print install process
|
||||
--no-preinstall skip pre-install script
|
||||
--no-postinstall skip post-install script
|
||||
|
||||
upgrade
|
||||
-d, --no-dep skip installing dependencies (new dependencies)
|
||||
-c, --ignore-conflict skip file conflict check
|
||||
-v, --verbose print install process
|
||||
--no-backup skip backup configuration file
|
||||
--no-preupgrade skip pre-upgrade script
|
||||
--no-postupgrade skip post-upgrade script
|
||||
|
||||
remove
|
||||
-d, --no-dep skip dependency check
|
||||
-v, --verbose print removed files
|
||||
--no-preremove skip pre-remove script
|
||||
--no-postremove skip post-remove script
|
||||
|
||||
global options:
|
||||
--no-color disable colour for output
|
||||
--debug debug scratch script
|
||||
|
||||
Example:
|
||||
scratch -p firefox sudo -id -kw -i build, keep working dir, ignore missing dependency
|
||||
and then install firefox and sudo
|
||||
scratch install firefox gvfs -cv build and install required dependencies and target package itself,
|
||||
ignore file conflict check and be verbose.
|
||||
|
||||
scratch -r -fr -im -p firefox sudo rebuild, skip md5sum check for sources and then
|
||||
reinstall firefox and sudo
|
||||
scratch remove firefox gvfs -dv remove package firefox and gvfs from system, ignore dependent check
|
||||
and be verbose
|
||||
|
||||
### buildpkg
|
||||
`buildpkg` is a tool to build package from ports. Is will source `spkgbuild` to get build information before creating package. Package is created into `<name>-<version>-<release>.spkg.txz` format. To build package, you need `cd` into port directory before run `buildpkg` command.
|
||||
@@ -164,92 +180,90 @@ Scratchpkg tools is separate into 4 main tools and several extra scripts (may ad
|
||||
buildpkg [ <options> <arguments> ]
|
||||
|
||||
Options:
|
||||
-i, --install install package into system
|
||||
-u, --upgrade upgrade package
|
||||
-r, --reinstall reinstall package
|
||||
-id, --ignore-dependency skip dependency check
|
||||
-ic, --ignore-conflict ignore conflict when installing package
|
||||
-v, --verbose verbose install process
|
||||
--no-preinstall skip preinstall script before build/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 when upgrading package
|
||||
-fr, --force-rebuild rebuild package
|
||||
-im, --ignore-mdsum skip md5sum checking
|
||||
-um, --update-mdsum update md5sum
|
||||
-cm, --check-mdsum check md5sum for source file
|
||||
-do, --download-only download only source file
|
||||
-eo, --extract-only extract only source file
|
||||
-kw, --keep-work keep working directory
|
||||
-rd, --redownload re-download source file
|
||||
-sd, --source-dir <path> override directory path for sources
|
||||
-pd, --package-dir <path> override directory path for compiled package
|
||||
-h, --help show this help message
|
||||
-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
|
||||
-g, --genmdsum generate md5sum
|
||||
-o, --download-only download only source file
|
||||
-e, --extract-only extract only source file
|
||||
-w, --keep-work keep working directory
|
||||
-h, --help show this help message
|
||||
--srcdir=<path> override directory path for sources
|
||||
--pkgdir=<path> override directory path for compiled package
|
||||
--no-preinstall skip preinstall script before build/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:
|
||||
buildpkg -fr -kw -i this will force rebuild, install package and keep working directory
|
||||
buildpkg -irw this will force rebuild, install package and keep working directory
|
||||
|
||||
Note:
|
||||
* use buildpkg without any options will only download source and build package by using other default options
|
||||
* buildpkg need run inside port directory
|
||||
|
||||
|
||||
### installpkg
|
||||
`installpkg` is a tool to install and upgrade package created by `buildpkg`. Install package is simply extract `<name>-<version>-<release>.spkg.txz` by using tar into real system then save list extracted file into package `INDEX_DIR`. Upgrading package is also using same extract as install, it will replace old files then compare list file from old and new package and remove old file which not exist in new package (like Slackware pkgtool does).
|
||||
|
||||
Usage:
|
||||
installpkg package.spkg.txz [ <options> <arguments> ]
|
||||
installpkg package.spkg.txz <options>
|
||||
|
||||
Options:
|
||||
-u, --upgrade update package
|
||||
-r, --reinstall reinstall package
|
||||
-id, --ignore-dependency skip dependency check
|
||||
-ic, --ignore-conflict ignore conflict when installing package
|
||||
-v, --verbose verbose install process
|
||||
--no-preinstall don't run pre-install script
|
||||
--no-postinstall don't run post-install script
|
||||
--no-preupgrade don't run pre-upgrade script
|
||||
--no-postupgrade don't run post-upgrade script
|
||||
--no-backup skip backup when upgrading package
|
||||
--no-orphan-check skip orphaned package check after install package
|
||||
--no-color disable colour for output
|
||||
-h, --help show this help message
|
||||
-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
|
||||
--no-preinstall skip preinstall script before build/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-backup skip backup when upgrading package
|
||||
--no-orphan-check skip orphaned package check after install package
|
||||
--no-color disable colour for output
|
||||
|
||||
Example:
|
||||
installpkg foobar-1.0-1.spkg.txz -u --no-backup upgrade package foobar-1.0-1 without backup
|
||||
its old configuration files
|
||||
installpkg foobar-1.0-1.spkg.txz -uc --no-backup upgrade package foobar-1.0-1 without backup its
|
||||
old configuration files and skip conflict check
|
||||
|
||||
### removepkg
|
||||
`removepkg` is a tool to remove package from system. It will read file listed in package `INDEX_DIR` and remove it.
|
||||
|
||||
Usage:
|
||||
removepkg package name [ <options> <arguments> ]
|
||||
removepkg [ <options> <package name> ]
|
||||
|
||||
Options:
|
||||
-id, --ignore-dependency skip dependency check
|
||||
-v, --verbose verbose install process
|
||||
--no-preremove don't run pre-remove script
|
||||
--no-postremove don't run post-remove script
|
||||
--no-orphan-check skip orphaned package check after install package
|
||||
--no-color disable colour for output
|
||||
-h, --help show this help message
|
||||
|
||||
-d, --no-dep skip dependency check
|
||||
-v, --verbose print removed files
|
||||
-h, --help show this help message
|
||||
--no-preremove don't run pre-remove script
|
||||
--no-postremove don't run post-remove script
|
||||
--no-color disable colour for output
|
||||
|
||||
Example:
|
||||
removepkg firefox -id -v remove package firefox, skipping dependency check
|
||||
and verbose deleted file
|
||||
removepkg firefox -dv --no-preremove remove package firefox, skipping dependency check,
|
||||
print deleted files and skipp pre-remove script
|
||||
|
||||
## Extra tools
|
||||
Extra tools is some scripts come with scratchpkg to help users do things more easier. More extra scripts may added from time to time.
|
||||
|
||||
* `baseinstall`: A script to build base system.
|
||||
* `chroot-scratch`: Chroot script.
|
||||
* `depinstall`: Install package listed by `deplist`.
|
||||
* `deplist`: Script for calculate all needed dependencies.
|
||||
* `libdepends`: Script to list package depends by shared libraries.
|
||||
* `listinstall`: Install listed packages in a file.
|
||||
* `s-baseinstall`: Script to build base system.
|
||||
* `s-chroot`: Chroot script.
|
||||
* `s-deplist`: Script for calculate all needed dependencies.
|
||||
* `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).
|
||||
* `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.
|
||||
* `sysupdate`: An update script to update all outdated packages, use `-up|--update-ports` flags to sync ports first.
|
||||
|
||||
## Hook
|
||||
|
||||
@@ -292,11 +306,28 @@ Example of install script for `dbus.install`:
|
||||
dbus-uuidgen --ensure
|
||||
}
|
||||
|
||||
## Port file
|
||||
## /etc/scratchpkg.repo
|
||||
|
||||
Port file is a file contain URL of port's repository. The suffix of this port file is `<repository name>.httpup` (repository name should be same as PORT_REPO stated in `/etc/scratchpkg.conf`). This file will get read by `scratch` to sync the port's repository into system using a tool called `httpup`. By default, Port file need to placed into `/etc/ports`. Example of port file for `core` repository:
|
||||
`/etc/scratchpkg.repo` is file to define repo directory and url to sync/update port's. This is example default `/etc/scratchpkg.repo`;
|
||||
|
||||
#
|
||||
# /etc/scratchpkg.repo : scratchpkg repo file
|
||||
#
|
||||
# format:
|
||||
# <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
|
||||
|
||||
*Note: url is optional. Add if need to sync it.*
|
||||
|
||||
URL=https://raw.githubusercontent.com/emmett1/ports/master/core
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
Reference in New Issue
Block a user