forked from jelaas/bifrost-build
-
Notifications
You must be signed in to change notification settings - Fork 2
minos-org/bifrost-build
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ABOUT ----- This is a custom version of bifrost-build for autobuilds at http://static.minos.io/bifrost, the original project lives at https://github.com/jelaas/bifrost-build. BUILD ENVIRONMENT FOR BIFROST ----------------------------- A predictable and repeatable building environment for Bifrost binaries. Consists of a uclibc mini-native chroot environment and a this package of management and build scripts. Each package is identified by source version and build script version. A package may install dependencies in the form of other bifrost packages from this build environment. The 'pkg_build' script will ensure a clean environment (all installed dependencies are uninstalled) before the package's own build script is run. Installation: ------------- Fetch the uclibc chroot tarball: $ wget http://uclibc.org/downloads/binaries/0.9.30.1/mini-native-i586.tar.bz2 Decompress the tarball $ tar xf mini-native-i586.tar.bz2 Install this package: $ git clone git://github.com/jelaas/bifrost-build.git mini-native-i586/var/lib/build Install helpful scripts: $ cd mini-native-i586/var/lib/build $ cp -p mini-native-i586/var/lib/build/util/chroot-i586.sh . $ cp -p mini-native-i586/var/lib/build/util/chroot-i586-build.sh . $ cp -p mini-native-i586/var/lib/build/util/chroot-i586-install.sh . $ cp -p mini-native-i586/var/lib/build/util/env-setup.sh mini-native-i586/bin $ cp -p mini-native-i586/var/lib/build/util/env-build.sh mini-native-i586/bin $ cp -p mini-native-i586/var/lib/build/util/env-install.sh mini-native-i586/bin $ cp -p mini-native-i586/var/lib/build/util/env-hooks.sh mini-native-i586/bin Now enter chroot: $ ./chroot-i586.sh $ cd /var/lib/build Build gnu tar: $ ./pkg_build tar-1.23-1 Note: the first time you install a package it will try to install GNU tar. Build and install newer bash $ ./pkg_build bash-4.1-1 $ ./pkg_install --permanent bash-4.1-1 Exit chroot: $ exit Done! The build environment is ready for use. Usage: ------ $ ./chroot-i586.sh $ cd /var/lib/build To build a package: $ ./pkg_build <package-name> or $ ./pkg_build /path/that/is/ignored/<package-name> or from outside the chroot $ ./chroot-i586-build.sh <package-name> The results are saved at ./mini-native-i586/var/spool/pkg/ Package: -------- Files in a package: Build.sh Fetch-source.sh "Build.sh" Configures, compiles and creates a package tarball which must be put in '/var/spool/pkg/' and names '<package>.tar.gz'. Where package is the same name as the directory under '/var/lib/build' that contains the package scripts. "Fetch-source.sh" Responsible for fetching any source files the package might need. These should be put under '/var/spool/src'. Example package: ---------------- The best way to create a new package is to copy the example scripts from the package 'example-1.0.0-1', which is located under the staging directory. The name of a package should be: "<application>-<version>-<build-version>". After a package has been published and you wish to change the logic in the scripts you need to create a new build-version for this. The same goes for a new version of the source. This to ensure that the resulting build is always identical. The management scripts: ----------------------- pkg_available: Help script for use by 'Build.sh'. It is there to help the user when more the package needs more than one dependency. pkg_available will report which dependencies need to be build (not recursively though). pkg_build: Makes sure a working environment exists. Uninstalls any previously installed packages (dependencies). Calls the 'Build.sh' script for the package. pkg_install: Installs a package. Keeps track of which files are installed. Also takes backup copies of any files that will be overwritten. pkg_src_fetch: Calls 'Fetch-source.sh' for the package. This may be useful if you want to stock up on source files before starting building. pkg_uninstall: Removes the packages files. Also reinstalls any files that were backuped. pkg_depend: Display dependencies, forward or reverse. Creating a package ------------------ While working on a new package there is a staging directory that is not tracked by git ("/var/lib/build/staging"). $ cd /var/lib/build/staging For a base package: $ cp -a example-1.0.0-1 <pkg>-<version>-<build-version> For an optional package: $ cp -a opt-example-1.0.0-1 opt-<pkg>-<version>-<build-version> Edit Fetch-source.sh. Edit Build.sh. Testrun: $ /var/lib/build/pkg_build <pkg>-<version>-<build-version> Dependencies ------------ A package may have a number of dependencies for building. These dependencies may be in the form of libraries or utilities. The build script 'Build.sh' must install these dependencies by using the script 'pkg_install'. 'pkg_install' will keep track of what it installs so everything can be retracted later by 'pkg_uninstall'. Each build is supposed to start with a "clean" environment. Before each build the 'pkg_build' script will run the 'pkg_uninstall' script. __Important note_!!_ Be careful with the install part of making the package. Make sure that for instance 'make install' wont install files under a real prefix into the actual build environment. You might inadvertently insert unknown dependencies into the environment. Many package will support the DESTDIR variable for 'make install'. You can use the pkg_depend script to find out existing dependencies. Configuration ------------- If the file /var/lib/build/conf/tmpfs contains "yes" then all building will be done within a tmpfs filesystem (mounted on /var/tmp/src).
About
uclibc build environment for predictable and repeatable building of binary packages
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Roff 38.5%
- Shell 29.5%
- Max 22.1%
- C 9.5%
- Makefile 0.3%
- Assembly 0.1%