From 7072e1faf4f91f0343e9ff11221b19c8fcc6de87 Mon Sep 17 00:00:00 2001 From: Thomas Pegg Date: Wed, 1 Feb 2012 23:29:37 +0000 Subject: [PATCH] Commit Pierre Labastie's patch for including package management support in jhalfs. NOTE: Package management is by default disabled. --- Config.in | 42 +- FUNCTION_LIST | 388 +++++++++++ LFS/lfs.xsl | 608 ++++++++++++------ LFS/master.sh | 2 +- README.PACKGE_MANAGEMENT | 63 ++ common/blfs-tool-deps/901-libxml2 | 24 +- common/blfs-tool-deps/902-libxslt | 24 +- common/blfs-tool-deps/903-tidy | 30 +- common/blfs-tool-deps/904-unzip | 36 +- common/blfs-tool-deps/905-docbook-xml | 57 +- common/blfs-tool-deps/907-gpm | 38 +- common/blfs-tool-deps/908-lynx | 28 +- common/blfs-tool-deps/909-sudo | 37 +- common/blfs-tool-deps/910-wget | 28 +- common/blfs-tool-deps/911-sqlite | 38 ++ common/blfs-tool-deps/911-subversion | 19 - common/blfs-tool-deps/912-apr | 35 + common/blfs-tool-deps/913-apr-util | 35 + common/blfs-tool-deps/914-subversion | 36 ++ common/blfs-tool-deps/apr-1.4.5-config.patch | 37 ++ .../apr-util-1.4.1-config.patch | 31 + common/common-functions | 4 +- common/libs/func_blfs_deps | 38 +- common/libs/func_book_parser | 8 +- common/libs/func_check_version.sh | 53 +- common/libs/func_download_pkgs | 17 +- common/libs/func_validate_configs.sh | 2 +- common/libs/func_wrt_Makefile | 5 +- common/makefile-functions | 12 +- common/packages.xsl | 12 +- common/progress_bar.sh | 2 +- common/urls.xsl | 9 +- jhalfs | 117 ++-- optimize/opt_config | 4 +- optimize/opt_config.d/O2pipe | 20 + optimize/opt_config.d/O3pipe_march | 8 +- pkgmngt/packInstall.sh | 38 ++ pkgmngt/packInstall.sh.template | 50 ++ pkgmngt/packageManager.xml | 341 ++++++++++ pkgmngt/packageManager.xml.template | 143 ++++ 40 files changed, 2119 insertions(+), 400 deletions(-) create mode 100644 FUNCTION_LIST create mode 100644 README.PACKGE_MANAGEMENT create mode 100644 common/blfs-tool-deps/911-sqlite delete mode 100644 common/blfs-tool-deps/911-subversion create mode 100644 common/blfs-tool-deps/912-apr create mode 100644 common/blfs-tool-deps/913-apr-util create mode 100644 common/blfs-tool-deps/914-subversion create mode 100644 common/blfs-tool-deps/apr-1.4.5-config.patch create mode 100644 common/blfs-tool-deps/apr-util-1.4.1-config.patch create mode 100644 optimize/opt_config.d/O2pipe create mode 100644 pkgmngt/packInstall.sh create mode 100644 pkgmngt/packInstall.sh.template create mode 100644 pkgmngt/packageManager.xml create mode 100644 pkgmngt/packageManager.xml.template diff --git a/Config.in b/Config.in index f85f2bf..5bbf4dc 100644 --- a/Config.in +++ b/Config.in @@ -824,16 +824,16 @@ menu "--- Build Settings" help #-- Run test suites # - # You will can to select between: + # You will have to select between: # # - Only final system Glibc, GCC and Binutils testsuites # - All final system testsuites # - Both temporary tools and final system testsuites # - # HLFS and CLFS has no testsuites available in the + # HLFS and CLFS have no testsuites available in the # temporary tools phase - # You will be promt also about the "flavour" of the + # You will be prompted also about the "flavour" of the # testsuites run: # # - Don't stop on test suite failures @@ -843,10 +843,10 @@ menu "--- Build Settings" choice prompt "Tests level" depends CONFIG_TESTS - default TEST_1 + default TST_1 config TST_1 - bool "Only final system Glibc, GCC and Binutils testsuites" + bool "Only final system Glibc, GMP, MPFR, GCC and Binutils testsuites" config TST_2 bool "All final system testsuites" @@ -880,6 +880,28 @@ menu "--- Build Settings" #--- End Test Suites + #--- Package Management + config PKGMNGT + bool "Package management" + depends BOOK_LFS + default n + help + #-- Use package management + # + # If set, the packages in the final phase are built + # in a separate directory PKG_DEST. + # You should provide a bash function for packing + # and installing the package. + # Also you have to provide the instructions + # to build the package manager during the + # temporary tools phase, in the form of a + # sect1 of the book identical to a package + # sect1. See README.PACKAGE_MANAGEMENT + # + # For now, works only with LFS + + #--- End package management + #--- Installed files logs config INSTALL_LOG bool "Create installed files logs" @@ -914,7 +936,7 @@ menu "--- Build Settings" # # You will be prompted for the full path to the .config # file. It will be copied to the 'sources' directory and - # rename kernel-config + # renamed kernel-config config CONFIG string "Kernel config file" @@ -937,13 +959,15 @@ menu "--- Build Settings" depends on !BOOK_HLFS && !BOOK_CLFS3 help #-- Install the optional vim-lang package + # NOTE: This option is obsolete with the 7.3 release of Vim + # which is included in all recent releases of LFS. config NO_PROGRESS_BAR bool "DO NOT use/display progress_bar " default n help - #-- No not use the progress bar routine. On slower machines - # this functions consumes precious CPU cycles. + #-- Do not use the progress bar routine. On slower machines + # this function consumes precious CPU cycles. config TIMEZONE string "TimeZone" @@ -1135,7 +1159,7 @@ config REBUILD_MAKEFILE help #-- Rebuild the Makefile # - # This option alow to rebuild the Makefile after + # This option allows to rebuild the Makefile after # customizing the base system build scripts. # # See README.CUSTOM for more info about this feature. diff --git a/FUNCTION_LIST b/FUNCTION_LIST new file mode 100644 index 0000000..41b046a --- /dev/null +++ b/FUNCTION_LIST @@ -0,0 +1,388 @@ +$Id:$ + +This is the list of functions used in jhalfs, excluding BLFS tool functions +and functions defined in {C,H}LFS/master.sh. +I felt the need for documenting it when trying to add package management. +Functions are listed in alphabetical order, with a short description and the +file where they are defined. + +----------------------------------------------------------------------------- +add_blfs_deps_urls(): +From common/libs/func_blfs_deps. +Description: Since the URLS and MD5 of BLFS dependencies are hardcoded, +there is no easy way to extrat them. So this function adds them at the +end of `urls.lst'. +Called by: create_urls +-------------------------------------------------------------------------- +copy_blfs_deps_scripts(): +From common/libs/func_blfs_deps. +Description: Copies the scriptlets from `blfs-tools-deps' to the +subdirectory `blfs-tools-deps' in `${PROGNAME}-commands'. Must +be called from `$JHALFSDIR' where `$COMMON/blfs-tools-deps' should have +been copied first. Removes `$JHALFSDIR/blfs-tools-deps' at the end. +Called by: extract_commands +-------------------------------------------------------------------------- +wrt_blfs_tool_targets(): +From common/libs/func_blfs_deps. +Description: Writes Makefile entries for BLFS tools dependencies. +should be called from the `${PROGNAME}-commands' directory and +with `$MKFILE' set. +TODO: Notice that tidy, unzip, lynx and docbook versions are hardcoded there. +TODO: This function does not implement the mechanism described in +`README.CUSTOM' for the `ddd-d-scriptlet' naming scheme. +Called by: build_Makefiles (from master.sh) +Uses: makefile helper functions to write in makefile. +-------------------------------------------------------------------------- +get_sources(): +From common/libs/func_download_pkgs. +Description: Downloads packages if `GETPKG' is `y'. Writes package name +and md5 checksum to `MISSING_FILES.DMP' if a package cannot be found in +`$SRC_ARCHIVE' and cannot be downloaded, or if md5 checksum does not agree +book's one. If `MISSING_FILES.DMP' is not empty at the end of the process, +disable the excution of the makefile. +Actually, if `$BUILDDIR/sources' does not exist, it is not created if +`GETPKG' is `n'. And an empty or non existent `$BUILDDIR/sources' is +not flagged... +If `GETPKG' is `y', removes `MD5SUMS', `MISSING_FILES.DMP', and `urls.lst' +from `$BUILDDIR/sources' and generates them in the course of the process. +Called by: get_book and extract_commands +-------------------------------------------------------------------------- +gs_wrt_message(): +From common/libs/func_download_pkgs. +Description: internal function in get_sources. Writes a message to the screen +and a package name to `MISSING_FILES.DMP'. +-------------------------------------------------------------------------- +create_urls(): +From common/libs/func_download_pkgs. +Description: Runs xsltproc with stylesheet urls.xsl on chapter 3 of the +book. Add BLFS dependencies and custom dependencies if `BLFS_TOOLS' is `y' +and `CUSTOM_TOOLS' is `y' respectively. +Called by: get_sources +-------------------------------------------------------------------------- +wrt_CustomTools_target(): +From common/libs/func_custom_pkgs. +Description: Add users supplied scripts to `$JHALFSDIR/custom-tools', with +corresponding entry in the Makefile. +TODO: Add package management (instructions to user and Makefile entry) +Called by: All master.sh `build_Makefile'. +-------------------------------------------------------------------------- +add_CustomToolsURLS(): +From common/libs/func_custom_pkgs. +Description: Add any users supplied scripts URL information to urls.lst +Called by: create_urls +-------------------------------------------------------------------------- +wrt_Makefile_header(): +From common/libs/func_wrt_Makefile. +Description: Writes the beginning of the Makefile into $MKFILE, which created +or erased before. +Called by: All master.sh `build_Makefile'. +-------------------------------------------------------------------------- +get_package_tarball_name(): +From common/libs/func_wrt_Makefile. +Arguments: $1 contains the script_name +Description: Retrieves the tarball name from `pkg_tarball_list' by comparing +script-name to the beginning of a line in the list. Writes the name found +to stdout. +Implements the behavior described in README.CUSTOM, that is, if script_name +begins with d-, strip that part. +Called by: various functions in master.sh +-------------------------------------------------------------------------- +LUSER_wrt_target(): +From common/libs/func_wrt_Makefile. +Arguments: $1 contains target name; $2 contains dependency(ies) +Description: Add lines in the Makefile, which create target and +initialize log file. +LUSER version uses $MOUNT_PT in absolute path names. +Called by: chapter5_Makefiles and chapter6_Makefiles in LFS/master.sh +and other master.sh +-------------------------------------------------------------------------- +CHROOT_wrt_target(): +From common/libs/func_wrt_Makefile. +Arguments: $1 contains target name; $2 contains dependency(ies) +Description: Add lines in the Makefile, which create target and +initialize log file. +CHROOT version uses / in absolute path names. +Called by: chapter6_Makefiles and chapter78_Makefiles in LFS/master.sh +and other functions in other master.sh +-------------------------------------------------------------------------- +LUSER_wrt_unpack(): +From common/libs/func_wrt_Makefile. +Arguments: $1 contains tarball name; $2 contains 1 if the existing directory +is to be presserved. +Description: Add lines in the Makefile, which unpack and set 'ROOT' var and +remove existing dir if $2 != 1 +LUSER version uses $MOUNT_PT in absolute path names. +Uses: Makefile functions remove_existing_dirs, unpack, get_pkg_root. +-------------------------------------------------------------------------- +CHROOT_Unpack(): +From common/libs/func_wrt_Makefile. +Arguments: $1 contains tarball name; $2 contains 1 if the existing directory +is to be presserved. +Description: Add lines in the Makefile, which unpack and set 'ROOT' var and +remove existing dir if $2 != 1 +CHROOT version uses / in absolute path names. +Uses: Makefile functions remove_existing_dirs2, unpack2, get_pkg_root2. +-------------------------------------------------------------------------- +LUSER_wrt_test_log(): +From common/libs/func_wrt_Makefile. +Description: Add lines in the Makefile, which initialize testsuite +log file. +LUSER version uses $MOUNT_PT in absolute path names. +-------------------------------------------------------------------------- +CHROOT_wrt_test_log(): +From common/libs/func_wrt_Makefile. +Description: Add lines in the Makefile, which initialize testsuite +log file. +CHROOT version uses / in absolute path names. +-------------------------------------------------------------------------- +wrt_RunAsRoot(): +From common/libs/func_wrt_Makefile. +Description: Some scripts must be run as root.. +-------------------------------------------------------------------------- +LUSER_wrt_RunAsUser(): +From common/libs/func_wrt_Makefile. +Description: Calculate time with perl, footer to log file +-------------------------------------------------------------------------- +CHROOT_wrt_RunAsRoot(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +LUSER_wrt_CopyFstab(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +CHROOT_wrt_CopyFstab(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +LUSER_wrt_TouchTimestamp(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +CHROOT_wrt_TouchTimestamp(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +LUSER_wrt_LogNewFiles(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +CHROOT_wrt_LogNewFiles(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +LUSER_RemoveBuildDirs(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +CHROOT_wrt_RemoveBuildDirs(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +wrt_touch(): +From common/libs/func_wrt_Makefile. +Description: +-------------------------------------------------------------------------- +wrt_compare_targets(): +From common/libs/func_compare.sh. +Description: +-------------------------------------------------------------------------- +wrt_system_build(): +From common/libs/func_compare.sh. +Description: +-------------------------------------------------------------------------- +wrt_compare_work(): +From common/libs/func_compare.sh. +Description: +-------------------------------------------------------------------------- +wrt_do_ica_work(): +From common/libs/func_compare.sh. +Description: +-------------------------------------------------------------------------- +wrt_do_farce_work(): +From common/libs/func_compare.sh. +Description: +-------------------------------------------------------------------------- +wrt_logs(): +From common/libs/func_compare.sh. +Description: +-------------------------------------------------------------------------- +validate_config(): +From common/libs/func_validate_configs.sh. +Description: Are the config values sane (within reason) +-------------------------------------------------------------------------- + write_error_and_die(): +From common/libs/func_validate_configs.sh. +Description: +-------------------------------------------------------------------------- + validate_file(): +From common/libs/func_validate_configs.sh. +Description: +-------------------------------------------------------------------------- + validate_dir(): +From common/libs/func_validate_configs.sh. +Description: +-------------------------------------------------------------------------- +get_book(): +From common/libs/func_book_parser. +Description: +-------------------------------------------------------------------------- +extract_commands(): +From common/libs/func_book_parser. +Description: +-------------------------------------------------------------------------- +create_package_list(): +From common/libs/func_book_parser. +Description: +-------------------------------------------------------------------------- +check_version(): +From common/libs/func_check_version.sh. +Description: +-------------------------------------------------------------------------- + write_error_and_die(): +From common/libs/func_check_version.sh. +Description: +-------------------------------------------------------------------------- +check_prerequisites(): +From common/libs/func_check_version.sh. +Description: +-------------------------------------------------------------------------- +write_or_exit(): +From common/progress_bar.sh. +Description: +-------------------------------------------------------------------------- +no_empty_builddir(): +From common/common-functions. +Description: +-------------------------------------------------------------------------- +run_make(): +From common/common-functions. +Description: +-------------------------------------------------------------------------- +clean_builddir(): +From common/common-functions. +Description: +-------------------------------------------------------------------------- +function dohelp(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function emessage(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function expected(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function failure(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +extras/farce: emessage "internal error in failure() for TYPE $TYPE" +function fatal(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function filetype(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function message(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function onlyone(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function testar(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function testgzip(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function testso(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function tokenize(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function tokenizeanddiff(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +function validateargs(): +From extras/farce. +Description: +-------------------------------------------------------------------------- +process_toolchain(): +From HLFS/master.sh. +Description: embryo,cocoon and butterfly need special handling +-------------------------------------------------------------------------- +chapter3_Makefiles(): +From HLFS/master.sh. +Description: Initialization of the system +-------------------------------------------------------------------------- +chapter5_Makefiles(): +From HLFS/master.sh. +Description: Bootstrap or temptools phase +-------------------------------------------------------------------------- +chapter6_Makefiles(): +From HLFS/master.sh. +Description: sysroot or chroot build phase +-------------------------------------------------------------------------- +chapter7_Makefiles(): +From HLFS/master.sh. +Description: Create a bootable system.. kernel, bootscripts..etc +-------------------------------------------------------------------------- +build_Makefile(): +From HLFS/master.sh. +Description: Construct a Makefile from the book scripts +-------------------------------------------------------------------------- +simple_error(): +From jhalfs. +Description: Basic error trap.... JUST DIE +-------------------------------------------------------------------------- +see_ya(): +From jhalfs. +Description: +-------------------------------------------------------------------------- +jhalfs: # Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets() +jhalfs: # Create $BUILDDIR/sources even though it could be created by get_sources() +chapter4_Makefiles(): +From LFS/master.sh. +Description: +-------------------------------------------------------------------------- +chapter5_Makefiles(): +From LFS/master.sh. +Description: +-------------------------------------------------------------------------- +chapter6_Makefiles(): +From LFS/master.sh. +Description: +-------------------------------------------------------------------------- +chapter78_Makefiles(): +From LFS/master.sh. +Description: +-------------------------------------------------------------------------- +build_Makefile(): +From LFS/master.sh. +Description: +-------------------------------------------------------------------------- +validate_opt_settings(): +From optimize/optimize_functions. +Description: Show optimize setting and wait user agreement +-------------------------------------------------------------------------- +wrt_optimize(): +From optimize/optimize_functions. +Description: Apply pkg specific opt's to build +-------------------------------------------------------------------------- +wrt_makeflags(): +From optimize/optimize_functions. +Description: Apply MAKEFLAGS to build +-------------------------------------------------------------------------- diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl index d8f7232..12e575b 100644 --- a/LFS/lfs.xsl +++ b/LFS/lfs.xsl @@ -1,18 +1,19 @@ - - - %general-entities; -]> + - - - + + + + - - - + + + - + - + - + - + - + count(descendant::screen[@role='nodump'])"> - - - - - - - - - - 00 - - - - 0 - - - - - - - - - - - - #!/tools/bin/bash set +h - - - #!/bin/bash set +h - - - - set -e + + + + + + + + + + 00 + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + #!/tools/bin/bash set +h + + + #!/bin/bash set +h + + + + set -e + + + + cd $PKGDIR + + + + mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin} +mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include} +mkdir -pv $PKG_DEST/usr/share/{doc,info,man} +mkdir -pv $PKG_DEST/usr/share/man/man{1..8} +ln -sv share/{man,doc,info} $PKG_DEST/usr +case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; +esac + + + + mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc} + + + + + + + rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5} + + rm -fv $PKG_DEST/{,usr/}lib64 +rm -fv $PKG_DEST/usr/{man,doc,info} +for dir in $PKG_DEST/usr/share/man/man{1..8}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir +done +for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir +done +for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir +done +for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir +done +packInstall +rm -rf $PKG_DEST + + + + - - cd $PKGDIR - - tar -xvf ../vim-&vim-version;-lang.* --strip-components=1 - - - - - - - - - echo -e "\n\nTotalseconds: $SECONDS\n" - - exit - + + + + + + + + + + echo -e "\n\nTotalseconds: $SECONDS\n" + + exit + - - - - + + + + + + + + + + + #!/bin/bash +set +h +set -e + +cd $PKGDIR + + + + packInstall +rm -rf $PKG_DEST + + + + +echo -e "\n\nTotalseconds: $SECONDS\n" +exit + + - + + + + + + - - - - tar.* - - - - - - - patch -Z - - - - - - if [[ ! -d /lib/udev/devices ]] ; then - - fi - make mrproper - + cp -v ../kernel-config .config - - - - - - - - - - - - - - - -k check - - >> $TEST_LOG 2>&1 || true - - - - >> $TEST_LOG 2>&1 - - || true - - - - - - - - - - - -k tests - - >> $TEST_LOG 2>&1 || true - - - - >> $TEST_LOG 2>&1 - - || true - - - - - - - - - - - - - - - make -k check >> $TEST_LOG 2>&1 || true - - - - >> $TEST_LOG 2>&1 - - || true - - - - - - - - - - - - >> $TEST_LOG 2>&1 || true - - - - - - - - >> $TEST_LOG - - - - - + + - - make -k - - >> $TEST_LOG 2>&1 || true + + + + + >> $TEST_LOG 2>&1 || true + + + + >> $TEST_LOG 2>&1 || true + + + + make -k + + >> $TEST_LOG 2>&1 || true + + + + + >> $TEST_LOG 2>&1 + + + + - - >> $TEST_LOG 2>&1 - - || true - - + + + + + + >> $TEST_LOG 2>&1 + + + + + >> $TEST_LOG 2>&1 + + + + + || true + + + + + + + + if [[ ! -d /lib/udev/devices ]] ; then + + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -291,7 +382,7 @@ - + @@ -310,5 +401,96 @@ - + + + + + + + + + + + + + + + + + + + make install_root=$PKG_DEST -j1 + + install + + + make PREFIX=$PKG_DEST/usr install + + + make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install + + + make DESTDIR=$PKG_DEST + + install + + + make ROOT=$PKG_DEST + + install + + + make INSTALL_MOD_PATH=$PKG_DEST + + install + + + make DESTDIR=$PKG_DEST + + + + + + + + + + + + + >$PKG_DEST/ + + + + + + + $PKG_DEST/ + + + + + + + + + + + + diff --git a/LFS/master.sh b/LFS/master.sh index cfa4041..c8e7839 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -244,7 +244,7 @@ chapter6_Makefiles() { CHROOT_Unpack "$pkg_tarball" # If the testsuites must be run, initialize the log file case $name in - binutils | gcc | glibc ) + binutils | gcc | glibc | gmp | mpfr ) [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" ;; * ) diff --git a/README.PACKGE_MANAGEMENT b/README.PACKGE_MANAGEMENT new file mode 100644 index 0000000..8ed353c --- /dev/null +++ b/README.PACKGE_MANAGEMENT @@ -0,0 +1,63 @@ +TITLE : Package management in jhalfs +ADDED : $Date:$ +BY : Pierre Labastie + +1. INTRODUCTION: + + There are several hints discussing package management for LFS, but + nothing under jhalfs. There used to be a patch for PACO that I cannot + find now. This is a modification, which allows to use a package manager + inside jhalfs. I hope it is flexible enough to support several package + managers. My implementation uses dpkg, from Debian, in a very crude way. + Debian has a sophisticated package management system, which I have not + tried to use here. For example, it should be usable with Pacman from + Arch Linux (http://www.archlinux.org), as far as I remember from my old + days with DIYL. I am sorry to say I have (almost) no experience with + rpm, so I cannot tell whether it would fit. + +2. OVERVIEW OF THE SYSTEM: + + For now, package management is only available for LFS. I plan to + upgrade BLFS tools, but nothing usable right now. The other flavours of + LFS do not seem very active, so there is no point in updating jhalfs + for them. + The first thing to do is to modify the install instructions of the + chapter 6, 7 and 8 of the book so that the installed files end up in a + directory other than `/'. We choose to call this directory by the name + of the executed script, and to put the path to this directory in the + PKG_DEST variable which is made available to the scriplets. + Almost all the packages have a way to redirect the destination of + the files they install at the `make install' stage with the variable + DESTDIR. Furthermore, the authors of the book have been kind enough to + flag the installation instructions with `remap=install'. This allows an + xsl stylesheet to find those instructions. Then, places where `make ' + occurs (make followed by a space) are replaced by `make DESTDIR=$PKG_DEST '. + Places where the book instructions move files into their destination + are harder to deal with: it is possible to change all occurences of ` /' or + `>/' (beginning of absolute paths) to `$PKG_DEST', but you end up moving + files to non existent directories. There is no simple way to automatically + create those directories, because you have sometimes to use the full path + (instructions of the form `cp file dir') and sometimes only the dirname + (instructions of the form `cp file1 file2'). So I am conservative and + create a reasonable subset of the FHS hierarchy into the destination + directory. Empty directories should then be removed before packing the + binary package. + Supposing now that the scriptlets have been adequately modified, the + package manager installation instructions have to be added at the end of + chapter 5 and chapter 6. Furthermore, the administrative files and + directories have to be created during the `Creating Directories' and + `Creating Essential Files' stage. For all this, the user has to supply a + file in docbook format, with the necessary instructions and enough + information to download the tarball. A template is provided in the pkgmngt + subdirectory. + The last thing to do is to tell how to use the package manager. When + the binary package is ready, the scriptlets call a shell function named + `packInstall', which should pack the binary package and install it on the + system. Note that nothing has been done to manage configuration files, + which are ususally treated specially by package managers. Depending on + the book layout, it is sometimes possible to create those files afterwards, + and sometimes not, which means that you have to check them after each + upgrade. The user has to provide his own function. A template is provided + in the pkgmngt subdirectory. + + diff --git a/common/blfs-tool-deps/901-libxml2 b/common/blfs-tool-deps/901-libxml2 index 5c48d38..2afcea4 100644 --- a/common/blfs-tool-deps/901-libxml2 +++ b/common/blfs-tool-deps/901-libxml2 @@ -6,6 +6,28 @@ set -e cd $PKGDIR ./configure --prefix=/usr make -make install +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/902-libxslt b/common/blfs-tool-deps/902-libxslt index 5c48d38..3cc2984 100644 --- a/common/blfs-tool-deps/902-libxslt +++ b/common/blfs-tool-deps/902-libxslt @@ -6,6 +6,28 @@ set -e cd $PKGDIR ./configure --prefix=/usr make -make install +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/903-tidy b/common/blfs-tool-deps/903-tidy index b3053c1..fc92682 100644 --- a/common/blfs-tool-deps/903-tidy +++ b/common/blfs-tool-deps/903-tidy @@ -7,7 +7,33 @@ cd $PKGDIR ./configure --prefix=/usr make -make install -make -C htmldoc install_apidocs +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +install -v -m644 -D htmldoc/tidy.1 \ + $PKG_DEST/usr/share/man/man1/tidy.1 +install -v -m755 -d $PKG_DEST/usr/share/doc/tidy-cvs_20101110 +install -v -m644 htmldoc/*.{html,gif,css} \ + $PKG_DEST/usr/share/doc/tidy-cvs_20101110 +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/904-unzip b/common/blfs-tool-deps/904-unzip index c25e898..e7023fa 100644 --- a/common/blfs-tool-deps/904-unzip +++ b/common/blfs-tool-deps/904-unzip @@ -5,8 +5,38 @@ set -e cd $PKGDIR -patch -Np1 -i ../unzip-5.52-security_fix-1.patch -make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 linux -make prefix=/usr install +case `uname -m` in + i?86) + sed -i -e 's/DASM"/DASM -DNO_LCHMOD"/' unix/Makefile + make -f unix/Makefile linux + ;; + *) + sed -i -e 's/CFLAGS="-O -Wall/& -DNO_LCHMOD/' unix/Makefile + make -f unix/Makefile linux_noasm + ;; +esac +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make prefix=$PKG_DEST/usr install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/905-docbook-xml b/common/blfs-tool-deps/905-docbook-xml index ccd0a86..89c1f1a 100644 --- a/common/blfs-tool-deps/905-docbook-xml +++ b/common/blfs-tool-deps/905-docbook-xml @@ -8,100 +8,103 @@ cd /sources mkdir docbook-xml cd docbook-xml unzip ../docbook-xml-4.5.zip -install -v -d -m755 /usr/share/xml/docbook/xml-dtd-4.5 -install -v -d -m755 /etc/xml +install -v -d -m755 $PKG_DEST/usr/share/xml/docbook/xml-dtd-4.5 +install -v -d -m755 $PKG_DEST/etc/xml chown -R root:root . cp -v -af docbook.cat *.dtd ent/ *.mod \ - /usr/share/xml/docbook/xml-dtd-4.5 -if [ ! -e /etc/xml/docbook ]; then - xmlcatalog --noout --create /etc/xml/docbook + $PKG_DEST/usr/share/xml/docbook/xml-dtd-4.5 +if [ ! -e $PKG_DEST/etc/xml/docbook ]; then + xmlcatalog --noout --create $PKG_DEST/etc/xml/docbook fi xmlcatalog --noout --add "public" \ "-//OASIS//DTD DocBook XML V4.5//EN" \ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//DTD DocBook XML CALS Table Model V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/calstblx.dtd" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/soextblx.dtd" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/dbpoolx.mod" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/dbhierx.mod" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/htmltblx.mod" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//ENTITIES DocBook XML Notations V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/dbnotnx.mod" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//ENTITIES DocBook XML Character Entities V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/dbcentx.mod" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "public" \ "-//OASIS//ENTITIES DocBook XML Additional General Entities V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/dbgenent.mod" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "rewriteSystem" \ "http://www.oasis-open.org/docbook/xml/4.5" \ "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "rewriteURI" \ "http://www.oasis-open.org/docbook/xml/4.5" \ "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - /etc/xml/docbook -if [ ! -e /etc/xml/catalog ]; then - xmlcatalog --noout --create /etc/xml/catalog + $PKG_DEST/etc/xml/docbook +if [ ! -e $PKG_DEST/etc/xml/catalog ]; then + xmlcatalog --noout --create $PKG_DEST/etc/xml/catalog fi xmlcatalog --noout --add "delegatePublic" \ "-//OASIS//ENTITIES DocBook XML" \ "file:///etc/xml/docbook" \ - /etc/xml/catalog + $PKG_DEST/etc/xml/catalog xmlcatalog --noout --add "delegatePublic" \ "-//OASIS//DTD DocBook XML" \ "file:///etc/xml/docbook" \ - /etc/xml/catalog + $PKG_DEST/etc/xml/catalog xmlcatalog --noout --add "delegateSystem" \ "http://www.oasis-open.org/docbook/" \ "file:///etc/xml/docbook" \ - /etc/xml/catalog + $PKG_DEST/etc/xml/catalog xmlcatalog --noout --add "delegateURI" \ "http://www.oasis-open.org/docbook/" \ "file:///etc/xml/docbook" \ - /etc/xml/catalog + $PKG_DEST/etc/xml/catalog for DTDVERSION in 4.1.2 4.2 4.3 4.4 do xmlcatalog --noout --add "public" \ "-//OASIS//DTD DocBook XML V$DTDVERSION//EN" \ "http://www.oasis-open.org/docbook/xml/$DTDVERSION/docbookx.dtd" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "rewriteSystem" \ "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \ "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "rewriteURI" \ "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \ "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - /etc/xml/docbook + $PKG_DEST/etc/xml/docbook xmlcatalog --noout --add "delegateSystem" \ "http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \ "file:///etc/xml/docbook" \ - /etc/xml/catalog + $PKG_DEST/etc/xml/catalog xmlcatalog --noout --add "delegateURI" \ "http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \ "file:///etc/xml/docbook" \ - /etc/xml/catalog + $PKG_DEST/etc/xml/catalog done +export PKGDIR=/sources/docbook-xml +packInstall +rm -rf $PKG_DEST cd .. rm -rf docbook-xml diff --git a/common/blfs-tool-deps/907-gpm b/common/blfs-tool-deps/907-gpm index fa2ca01..08b4471 100644 --- a/common/blfs-tool-deps/907-gpm +++ b/common/blfs-tool-deps/907-gpm @@ -5,12 +5,38 @@ set -e cd $PKGDIR -patch -Np1 -i ../gpm-1.20.1-segfault-1.patch -patch -Np1 -i ../gpm-1.20.1-silent-1.patch ./configure --prefix=/usr --sysconfdir=/etc -LDFLAGS="$LDFLAGS -lm" make -make install -cp -v conf/gpm-root.conf /etc -ldconfig +make +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +ln -v -s libgpm.so.2.1.0 $PKG_DEST/usr/lib/libgpm.so +mkdir -pv $PKG_DEST/etc +install -v -m644 conf/gpm-root.conf $PKG_DEST/etc +install -v -m755 -d $PKG_DEST/usr/share/doc/gpm-1.20.6 +chmod -v 755 doc/{changes,support} +chmod -v 644 doc/{changes/*,support/*,FAQ,HACK_GPM,README*} +cp -v -R doc/{FAQ,HACK_GPM,README*,changes,support} \ + $PKG_DEST/usr/share/doc/gpm-1.20.6 +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/908-lynx b/common/blfs-tool-deps/908-lynx index 64e81c7..c6391eb 100644 --- a/common/blfs-tool-deps/908-lynx +++ b/common/blfs-tool-deps/908-lynx @@ -7,13 +7,35 @@ cd $PKGDIR ./configure --prefix=/usr \ --sysconfdir=/etc/lynx \ - --datadir=/usr/share/doc/lynx-2.8.6 \ + --datadir=/usr/share/doc/lynx-2.8.7rel.2 \ --with-zlib \ --with-bzlib \ --with-screen=ncursesw \ --enable-locale-charset make -make install-full -chgrp -v -R root /usr/share/doc/lynx-2.8.6/lynx_doc +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install-full +chgrp -v -R root $PKG_DEST/usr/share/doc/lynx-2.8.7rel.2/lynx_doc +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/909-sudo b/common/blfs-tool-deps/909-sudo index e906ed3..76129b6 100644 --- a/common/blfs-tool-deps/909-sudo +++ b/common/blfs-tool-deps/909-sudo @@ -5,11 +5,38 @@ set -e cd $PKGDIR -patch -Np1 -i ../sudo-1.6.8p12-envvar_fix-1.patch -./configure --prefix=/usr --libexecdir=/usr/lib \ - --enable-noargs-shell --with-ignore-dot --with-all-insults \ - --enable-shell-sets-home +./configure --prefix=/usr \ + --libexecdir=/usr/lib \ + --with-ignore-dot \ + --with-all-insults \ + --enable-shell-sets-home \ + --disable-root-sudo \ + --with-logfac=auth \ + --without-pam \ + --without-sendmail make -make install +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/910-wget b/common/blfs-tool-deps/910-wget index 70e577c..d123816 100644 --- a/common/blfs-tool-deps/910-wget +++ b/common/blfs-tool-deps/910-wget @@ -5,8 +5,32 @@ set -e cd $PKGDIR -./configure --prefix=/usr --sysconfdir=/etc +./configure --prefix=/usr \ + --sysconfdir=/etc \ + --without-ssl make -make install +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST exit diff --git a/common/blfs-tool-deps/911-sqlite b/common/blfs-tool-deps/911-sqlite new file mode 100644 index 0000000..55b63a1 --- /dev/null +++ b/common/blfs-tool-deps/911-sqlite @@ -0,0 +1,38 @@ +#!/bin/bash + +# $Id:$ + +set -e +cd $PKGDIR + +CFLAGS="-g -O2 -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY=1" \ + ./configure --prefix=/usr \ + --enable-threadsafe \ + --enable-readline \ + --enable-dynamic-extensions && +make +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST + +exit diff --git a/common/blfs-tool-deps/911-subversion b/common/blfs-tool-deps/911-subversion deleted file mode 100644 index 48a65dc..0000000 --- a/common/blfs-tool-deps/911-subversion +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr \ - --without-berkeley-db \ - --with-installbuilddir=/usr/lib/apr-0 -make -make install -rm doc/{Makefile,doxygen.conf} -find doc -type d -exec chmod 755 {} \; -find doc -type f -exec chmod 644 {} \; -install -v -m755 -d /usr/share/doc/subversion-1.3.1 -cp -v -R doc/* /usr/share/doc/subversion-1.3.1 - -exit diff --git a/common/blfs-tool-deps/912-apr b/common/blfs-tool-deps/912-apr new file mode 100644 index 0000000..d07bc12 --- /dev/null +++ b/common/blfs-tool-deps/912-apr @@ -0,0 +1,35 @@ +#!/bin/bash + +# $Id:$ + +set -e +cd $PKGDIR + +patch -Np1 -i ../apr-1.4.5-config.patch +./configure +make +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST + +exit diff --git a/common/blfs-tool-deps/913-apr-util b/common/blfs-tool-deps/913-apr-util new file mode 100644 index 0000000..867c3ab --- /dev/null +++ b/common/blfs-tool-deps/913-apr-util @@ -0,0 +1,35 @@ +#!/bin/bash + +# $Id:$ + +set -e +cd $PKGDIR + +patch -Np1 -i ../apr-util-1.4.1-config.patch +./configure --with-apr=/usr/bin/apr-1-config +make +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST + +exit diff --git a/common/blfs-tool-deps/914-subversion b/common/blfs-tool-deps/914-subversion new file mode 100644 index 0000000..f0ff1a6 --- /dev/null +++ b/common/blfs-tool-deps/914-subversion @@ -0,0 +1,36 @@ +#!/bin/bash + +# $Id: $ + +set -e +cd $PKGDIR + +./configure --prefix=/usr +make +if ! [ -z $PKG_DEST ]; then + mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} + ln -sv share/{man,doc,info} $PKG_DEST/usr + case $(uname -m) in + x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; + esac +fi +make DESTDIR=$PKG_DEST install +install -v -m755 -d $PKG_DEST/usr/share/doc/subversion-1.7.1 +cp -v -R doc/* $PKG_DEST/usr/share/doc/subversion-1.7.1 +if ! [ -z $PKG_DEST ]; then + rm -fv $PKG_DEST/{,usr/}lib64 + rm -fv $PKG_DEST/usr/{man,doc,info} + for dir in $PKG_DEST/usr/share/{doc,info,man}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/usr/{lib,share}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + for dir in $PKG_DEST/{lib,usr}; do + [[ -z $(ls $dir) ]] && rmdir -v $dir + done + packInstall +fi +rm -rf $PKG_DEST + +exit diff --git a/common/blfs-tool-deps/apr-1.4.5-config.patch b/common/blfs-tool-deps/apr-1.4.5-config.patch new file mode 100644 index 0000000..7668171 --- /dev/null +++ b/common/blfs-tool-deps/apr-1.4.5-config.patch @@ -0,0 +1,37 @@ +Submitted By: Pierre Labastie +Date: 2011-12-27 +Initial Package Version: 1.4.5 (taken from BLFS patch for httpd-2.2.0) +Upstream Status: Not submitted (jhalfs specific) +Origin: jhalfs +Description: Modify the layout for installing Apache Portable Runtime + +diff -Naur apr-1.4.5-orig/config.layout apr-1.4.5/config.layout +--- apr-1.4.5-orig/config.layout 2004-11-24 22:51:51.000000000 +0000 ++++ apr-1.4.5/config.layout 2005-12-14 21:06:37.000000000 +0000 +@@ -11,18 +11,18 @@ + + # Classical APR path layout designed for parallel installs. + +- prefix: /usr/local/apr ++ prefix: /usr + exec_prefix: ${prefix} + bindir: ${exec_prefix}/bin +- sbindir: ${exec_prefix}/bin ++ sbindir: ${exec_prefix}/sbin + libdir: ${exec_prefix}/lib +- libexecdir: ${exec_prefix}/modules +- mandir: ${prefix}/man +- sysconfdir: ${prefix}/conf +- datadir: ${prefix} +- installbuilddir: ${datadir}/build-${APR_MAJOR_VERSION} +- includedir: ${prefix}/include/apr-${APR_MAJOR_VERSION} +- localstatedir: ${prefix} ++ libexecdir: ${exec_prefix}/lib/apache ++ mandir: ${prefix}/share/man ++ sysconfdir: /etc/apache ++ datadir: /srv/www ++ installbuilddir: ${libexecdir}/build ++ includedir: ${prefix}/include/apache ++ localstatedir: ${datadir} + libsuffix: -${APR_MAJOR_VERSION} + diff --git a/common/blfs-tool-deps/apr-util-1.4.1-config.patch b/common/blfs-tool-deps/apr-util-1.4.1-config.patch new file mode 100644 index 0000000..7100932 --- /dev/null +++ b/common/blfs-tool-deps/apr-util-1.4.1-config.patch @@ -0,0 +1,31 @@ +diff -Naur apr-util-1.4.1.orig/config.layout apr-util-1.4.1/config.layout +--- apr-util-1.4.1.orig/config.layout 2005-02-09 13:18:43.000000000 +0100 ++++ apr-util-1.4.1/config.layout 2011-12-27 19:29:41.667841632 +0100 +@@ -11,18 +11,18 @@ + + # Classical APR-util path layout designed for parallel installs. + +- prefix: /usr/local/apr ++ prefix: /usr + exec_prefix: ${prefix} + bindir: ${exec_prefix}/bin +- sbindir: ${exec_prefix}/bin ++ sbindir: ${exec_prefix}/sbin + libdir: ${exec_prefix}/lib +- libexecdir: ${exec_prefix}/modules +- mandir: ${prefix}/man +- sysconfdir: ${prefix}/conf +- datadir: ${prefix} +- installbuilddir: ${datadir}/build +- includedir: ${prefix}/include/apr-${APRUTIL_MAJOR_VERSION} +- localstatedir: ${prefix} ++ libexecdir: ${exec_prefix}/lib/apache ++ mandir: ${prefix}/share/man ++ sysconfdir: /etc/apache ++ datadir: /srv/www ++ installbuilddir: ${libexecdir}/build ++ includedir: ${prefix}/include/apache ++ localstatedir: ${datadir} + libsuffix: -${APRUTIL_MAJOR_VERSION} + + diff --git a/common/common-functions b/common/common-functions index dc510d4..4f2b8e9 100644 --- a/common/common-functions +++ b/common/common-functions @@ -60,7 +60,7 @@ clean_builddir() { # # Clean the build directory echo -n "Cleaning $BUILDDIR ..." # First delete proc and sys directories, if exist. - # Both should be empty, if not be sure to exit. + # Both should be empty. If not, be sure to exit. if [ -d $BUILDDIR/proc ] ; then sudo rmdir $BUILDDIR/proc || exit 1 fi @@ -72,7 +72,7 @@ clean_builddir() { # echo -n "Cleaning $JHALFSDIR ..." sudo rm -rf $JHALFSDIR echo "done" - echo -n "Cleaning remainig extracted sources in $BUILDDIR/sources ..." + echo -n "Cleaning remaining extracted sources in $BUILDDIR/sources ..." sudo rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d` echo "done" fi diff --git a/common/libs/func_blfs_deps b/common/libs/func_blfs_deps index 33de8c0..2cde75e 100644 --- a/common/libs/func_blfs_deps +++ b/common/libs/func_blfs_deps @@ -22,7 +22,6 @@ add_blfs_deps_urls() { # No easy way to extract it. if [[ "${DEP_UNZIP}" = "y" ]] ; then echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst - echo "${UNZIP_PATCH_URL} ${BLFS_SERVER}unzip/${UNZIP_PATCH} ${UNZIP_PATCH_MD5}" >> urls.lst fi if [[ "${DEP_DBXML}" = "y" ]] ; then @@ -39,7 +38,6 @@ add_blfs_deps_urls() { # No easy way to extract it. if [[ "${DEP_SUDO}" = "y" ]] ; then echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_MD5}" >> urls.lst - echo "${SUDO_PATCH_URL} ${BLFS_SERVER}sudo/${SUDO_PATCH} ${SUDO_PATCH_MD5}" >> urls.lst fi if [[ "${DEP_WGET}" = "y" ]] ; then @@ -47,13 +45,20 @@ add_blfs_deps_urls() { # No easy way to extract it. fi if [[ "${DEP_SVN}" = "y" ]] ; then + echo "${SQLITE_URL} ${BLFS_SERVER}sqlite/${SQLITE_PKG} ${SQLITE_MD5}" >> urls.lst + echo "${APR_URL} ${BLFS_SERVER}apr/${APR_PKG} ${APR_MD5}" >> urls.lst +## Cannot use file:// with wget, so cannot download apr patches. +## They have been put directly in $BUILDDIR/sources +## The next line only for being able to check md5sum + echo "${APR_PATCH_1_URL} ${BLFS_SERVER}apr/${APR_PATCH_1} ${APR_PATCH_1_MD5}" >> urls.lst + + echo "${APR_U_URL} ${BLFS_SERVER}apr-util/${APR_U_PKG} ${APR_U_MD5}" >> urls.lst + echo "${APR_U_PATCH_1_URL} ${BLFS_SERVER}apr-util/${APR_U_PATCH_1} ${APR_U_PATCH_1_MD5}" >> urls.lst echo "${SVN_URL} ${BLFS_SERVER}subversion/${SVN_PKG} ${SVN_MD5}" >> urls.lst fi if [[ "${DEP_GPM}" = "y" ]] ; then echo "${GPM_URL} ${BLFS_SERVER}gpm/${GPM_PKG} ${GPM_MD5}" >> urls.lst - echo "${GPM_PATCH_1_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_1} ${GPM_PATCH_1_MD5}" >> urls.lst - echo "${GPM_PATCH_2_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_2} ${GPM_PATCH_2_MD5}" >> urls.lst fi } @@ -101,7 +106,10 @@ copy_blfs_deps_scripts() { # method avoid to place the test on all fi if [[ "${DEP_SVN}" = "y" ]] ; then - mv blfs-tool-deps/911-subversion ${PROGNAME}-commands/blfs-tool-deps + mv blfs-tool-deps/911-sqlite ${PROGNAME}-commands/blfs-tool-deps + mv blfs-tool-deps/912-apr ${PROGNAME}-commands/blfs-tool-deps + mv blfs-tool-deps/913-apr-util ${PROGNAME}-commands/blfs-tool-deps + mv blfs-tool-deps/914-subversion ${PROGNAME}-commands/blfs-tool-deps fi if [[ "${DEP_GPM}" = "y" ]] ; then @@ -156,7 +164,19 @@ wrt_blfs_tool_targets() { # if [ "$PROGNAME" = "clfs2" ]; then [[ ! "$name" = "docbook-xml" ]] && LUSER_wrt_unpack "$pkg_tarball" else - [[ ! "$name" = "docbook-xml" ]] && CHROOT_Unpack "$pkg_tarball" + case "$name" in + *docbook*) + ( + cat << EOF + @if [ "\$(PKGMNGT)" = "y" ]; then \\ + echo "export PKG_DEST=\$(SRC)/\$@" > envars; \\ + echo "source packInstall.sh" >> envars; \\ + echo "export -f packInstall" >> envars; \\ + fi; +EOF + ) >> $MKFILE.tmp ;; + *) CHROOT_Unpack "$pkg_tarball" ;; + esac fi # Run the script. @@ -176,9 +196,9 @@ wrt_blfs_tool_targets() { # # Touch the tracking file. case $name in docbook-xml ) pkg_ver=DocBook-4.5 ;; - lynx ) pkg_ver=lynx-2.8.6 ;; - tidy ) pkg_ver=html-tidy-cvs_20070326 ;; - unzip ) pkg_ver=unzip-5.52 ;; + lynx ) pkg_ver=lynx-2.8.7 ;; + tidy ) pkg_ver=html-tidy-cvs_20101110 ;; + unzip ) pkg_ver=unzip-6.0 ;; * ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;; esac if [ "$PROGNAME" = "clfs2" ]; then diff --git a/common/libs/func_book_parser b/common/libs/func_book_parser index 55a2212..d9add75 100644 --- a/common/libs/func_book_parser +++ b/common/libs/func_book_parser @@ -144,6 +144,7 @@ extract_commands() { # --stringparam timezone $TIMEZONE \ --stringparam page $PAGE \ --stringparam lang $LANG \ + --stringparam pkgmngt $PKGMNGT \ -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1 ;; *) echo -n " ${L_arrow}${BOLD}${PROGNAME}${R_arrow} book invalid, terminate build... " @@ -187,7 +188,9 @@ create_package_list() { # $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1 ;; lfs) - xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \ + xsltproc --nonet --xinclude \ + --stringparam pkgmngt $PKGMNGT \ + -o pkg_tarball_list packages.xsl \ $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1 ;; esac @@ -204,6 +207,9 @@ $DBXSL_PKG $LYNX_PKG $SUDO_PKG $WGET_PKG +$SQLITE_PKG +$APR_PKG +$APR_U_PKG $SVN_PKG $GPM_PKG EOF diff --git a/common/libs/func_check_version.sh b/common/libs/func_check_version.sh index 98ccf2a..c76bac6 100644 --- a/common/libs/func_check_version.sh +++ b/common/libs/func_check_version.sh @@ -24,6 +24,8 @@ inline_doc declare -i ref_major ref_minor ref_revision ref_change declare -r spaceSTR=" " + shopt -s extglob #needed for ${x##*(0)} below + ref_version=$1 tst_version=$2 TXT=$3 @@ -53,11 +55,14 @@ inline_doc # echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}" IFS=".-(pa" # Split up w.x.y.z as well as w.x.y-rc (catch release candidates) - set -- $ref_version # set postional parameters to minimum ver values + set -- $ref_version # set positional parameters to minimum ver values ref_major=$1; ref_minor=$2; ref_revision=$3 # - set -- $tst_version # Set postional parameters to test version values - major=$1; minor=$2; revision=$3 + set -- $tst_version # Set positional parameters to test version values + # Values beginning with zero are taken as octal, so that for example + # 2.07.08 gives an error because 08 cannot be octal. The ## stuff supresses + # leading sero's + major=${1##*(0)}; minor=${2##*(0)}; revision=${3##*(0)} # # Compare against minimum acceptable version.. (( major > ref_major )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return @@ -82,31 +87,31 @@ check_prerequisites() { # export LC_ALL # LFS/HLFS/CLFS prerequisites - check_version "2.6.2" "`uname -r`" "KERNEL" - check_version "3.0" "$BASH_VERSION" "BASH" - check_version "3.0.1" "`gcc -dumpversion`" "GCC" + check_version "2.6.25" "`uname -r`" "KERNEL" + check_version "3.2" "$BASH_VERSION" "BASH" + check_version "4.1.2" "`gcc -dumpversion`" "GCC" libcLib="`find /lib /lib64 -name libc.so.6 -print`" libcVer="`/${libcLib} | head -n1`" libcVer="${libcVer##*version }" - check_version "2.2.5" ${libcVer%%,*} "GLIBC" - check_version "2.12" "$(ld --version | head -n1 | awk '{print $NF}')" "BINUTILS" - check_version "1.15" "$(tar --version | head -n1 | cut -d" " -f4)" "TAR" + check_version "2.5.1" "${libcVer%%,*}" "GLIBC" + check_version "2.17" "$(ld --version | head -n1 | awk '{print $NF}')" "BINUTILS" + check_version "1.18" "$(tar --version | head -n1 | cut -d" " -f4)" "TAR" bzip2Ver="$(bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f8)" - check_version "1.0.2" "${bzip2Ver%%,*}" "BZIP2" - check_version "1.875" "$(bison --version | head -n1 | cut -d" " -f4)" "BISON" - check_version "5.2.1" "$(chown --version | head -n1 | cut -d")" -f2)" "COREUTILS" - check_version "2.8" "$(diff --version | head -n1 | cut -d" " -f4)" "DIFF" - check_version "4.1.20" "$(find --version | head -n1 | cut -d" " -f4)" "FIND" - check_version "3.0" "$(gawk --version | head -n1 | cut -d" " -f3)" "GAWK" - check_version "2.5" "$(grep --version | head -n1 | awk '{print $NF}')" "GREP" - check_version "1.2.4" "$(gzip --version 2>&1 | head -n1 | cut -d" " -f2)" "GZIP" - check_version "1.4" "$(m4 --version 2>&1 | head -n1 | awk '{print $NF}')" "M4" - check_version "3.79.1" "$(make --version | head -n1 | cut -d " " -f3 | cut -c1-4)" "MAKE" - check_version "2.5.4" "$(patch --version | head -n1 | cut -d" " -f2)" "PATCH" - check_version "5.6.0" "$(perl -V:version | cut -f2 -d\')" "PERL" - check_version "3.0.2" "$(sed --version | head -n1 | cut -d" " -f4)" "SED" - check_version "4.8" "$(makeinfo --version | head -n1 | awk '{ print$NF }')" "TEXINFO" - + check_version "1.0.4" "${bzip2Ver%%,*}" "BZIP2" + check_version "2.3" "$(bison --version | head -n1 | cut -d" " -f4)" "BISON" + check_version "6.9" "$(chown --version | head -n1 | cut -d")" -f2)" "COREUTILS" + check_version "2.8.1" "$(diff --version | head -n1 | cut -d" " -f4)" "DIFF" + check_version "4.2.31" "$(find --version | head -n1 | cut -d" " -f4)" "FIND" + check_version "3.1.5" "$(gawk --version | head -n1 | cut -d" " -f3)" "GAWK" + check_version "2.5.1a" "$(grep --version | head -n1 | awk '{print $NF}')" "GREP" + check_version "1.3.12" "$(gzip --version 2>&1 | head -n1 | cut -d" " -f2)" "GZIP" + check_version "1.4.10" "$(m4 --version 2>&1 | head -n1 | awk '{print $NF}')" "M4" + check_version "3.81" "$(make --version | head -n1 | cut -d " " -f3 | cut -c1-4)" "MAKE" + check_version "2.5.4" "$(patch --version | head -n1 | sed 's/.*patch //')" "PATCH" + check_version "5.8.8" "$(perl -V:version | cut -f2 -d\')" "PERL" + check_version "4.1.5" "$(sed --version | head -n1 | cut -d" " -f4)" "SED" + check_version "4.9" "$(makeinfo --version | head -n1 | awk '{ print$NF }')" "TEXINFO" + check_version "5.0.3" "$(xz --version | head -n1 | cut -d" " -f4)" "XZ" # Check for minimum sudo version SUDO_LOC="$(whereis -b sudo | cut -d" " -f2)" if [ -x $SUDO_LOC ]; then diff --git a/common/libs/func_download_pkgs b/common/libs/func_download_pkgs index 4e7cb0c..60c7f06 100644 --- a/common/libs/func_download_pkgs +++ b/common/libs/func_download_pkgs @@ -39,13 +39,13 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if # Skip some packages if they aren't needed case $line in - */tcl* | */expect* | */dejagnu* | */tree* | */gcc-testsuite* ) + */check* | */tcl* | */expect* | */dejagnu* | */tree* | */gcc-testsuite* ) [[ "$TEST" = "0" ]] && continue ;; - */vim-*-lang* ) + */vim-*-lang* ) [[ "$VIMLANG" = "0" ]] && continue ;; - *linux/linux-* ) + *linux/linux-* ) [[ -z "$CONFIG" ]] && [[ -z "$BOOT_CONFIG" ]] && \ [[ "$GETKERNEL" = "n" ]] && continue ;; @@ -75,16 +75,16 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if # If the file does not exist yet in /sources download a fresh one if [ ! -f $FILE ] ; then if [[ ! ("$SRC_ARCHIVE" = "") ]] ; then - echo "${BOLD}${YELLOW}$FILE: not found in ${SRC_ARCHIVE} or /sources${OFF}" + echo "${BOLD}${YELLOW}$FILE: not found in ${SRC_ARCHIVE} or ${BUILDDIR}/sources${OFF}" else - echo "${BOLD}${YELLOW}$FILE: not found in /sources${OFF}" + echo "${BOLD}${YELLOW}$FILE: not found in ${BUILDDIR}/sources${OFF}" fi if ! wget $URL1 $WGETPARAM && ! wget $URL2 $WGETPARAM ; then gs_wrt_message "$FILE not found in the SRC_ARCHIVE or on any server..SKIPPING" continue fi - else - echo "${BOLD}${YELLOW}$FILE: using cached file in /sources${OFF}" + else + echo "${BOLD}${YELLOW}$FILE: using cached file in ${BUILDDIR}/sources${OFF}" fi fi @@ -121,7 +121,7 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if fi # Good or bad we write the original md5sum to a file - echo "$MD5" >> MD5SUMS + echo "$MD5" >> MD5SUM # Copy the freshly downloaded file # to the source archive. @@ -192,6 +192,7 @@ create_urls() { # xsltproc --nonet --xinclude \ --stringparam server $SERVER \ --stringparam family lfs \ + --stringparam pkgmngt $PKGMNGT \ -o ../sources/urls.lst urls.xsl \ $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1 echo " ...OK" diff --git a/common/libs/func_validate_configs.sh b/common/libs/func_validate_configs.sh index e1e6d04..4f474a7 100644 --- a/common/libs/func_validate_configs.sh +++ b/common/libs/func_validate_configs.sh @@ -41,7 +41,7 @@ inline_doc local -r CLFS3_book="$BOOK_common $BOOK_clfsX PLATFORM MIPS_LEVEL" # Build Settings by book - local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common" + local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT" local -r HLFS_build="$BUILD_chroot $BUILD_common" local -r CLFS_build="$BUILD_chroot VIMLANG $BUILD_common" local -r CLFS2_build="STRIP VIMLANG $BUILD_common" diff --git a/common/libs/func_wrt_Makefile b/common/libs/func_wrt_Makefile index 432c8e5..a530928 100644 --- a/common/libs/func_wrt_Makefile +++ b/common/libs/func_wrt_Makefile @@ -44,6 +44,7 @@ PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lo ADD_REPORT = $REPORT ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS ADD_BLFS_TOOLS = $BLFS_TOOL +PKGMNGT = $PKGMNGT export PATH := \${PATH}:/usr/sbin @@ -92,7 +93,9 @@ get_package_tarball_name() { # ;; xz-utils) echo $(grep "^xz" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; - *) echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) + sqlite) echo $(grep "^sqlite" $JHALFSDIR/pkg_tarball_list | head -n1 ) + ;; + *) echo $(grep "^$script_name[_-][[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; esac diff --git a/common/makefile-functions b/common/makefile-functions index 626567b..4e554ca 100644 --- a/common/makefile-functions +++ b/common/makefile-functions @@ -27,7 +27,7 @@ endef define sh_echo_PHASE echo $(BOLD)--------------------------------------------------------------------------------;\ echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts; \ - echo $(BOLD)--------------------------------------------------------------------------------echo $(WHITE) + echo $(BOLD)--------------------------------------------------------------------------------$(WHITE) endef define echo_SU_request @@ -79,6 +79,9 @@ define remove_existing_dirs2 rm -rf $(SRC)/$$ROOT && \ rm -rf $(SRC)/$${ROOT%-*}-build; \ fi; + @if [ "$(PKGMNGT)" = "y" ] && [ -d $(SRC)/$@ ]; then \ + rm -rf $(SRC)/$@ && rm -f $(SRC)/*.deb; \ + fi; endef #==# @@ -107,7 +110,12 @@ endef define get_pkg_root2 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \ - echo "export PKGDIR=$(SRC)/$$ROOT" > envars + echo "export PKGDIR=$(SRC)/$$ROOT" > envars; \ + if [ "$(PKGMNGT)" = "y" ]; then \ + echo "export PKG_DEST=$(SRC)/$@" >> envars; \ + echo "source packInstall.sh" >> envars; \ + echo "export -f packInstall" >> envars; \ + fi; endef define get_pkg_root_LUSER diff --git a/common/packages.xsl b/common/packages.xsl index 5eab0a7..26d4e08 100644 --- a/common/packages.xsl +++ b/common/packages.xsl @@ -13,8 +13,15 @@ + + + + + + @@ -26,13 +33,12 @@ - - + @@ -44,9 +50,11 @@ + + diff --git a/common/progress_bar.sh b/common/progress_bar.sh index 41926fe..fdf3d65 100644 --- a/common/progress_bar.sh +++ b/common/progress_bar.sh @@ -59,7 +59,7 @@ while true ; do # Detect rollover of the seconds. (( PREV_SEC > SEC )) && write_or_exit "${RESET_LINE}" - (( PREV_SEC = SEC )) + PREV_SEC=$SEC # Display the accumulated time. div minutes.. modulo seconds. write_or_exit "${TS_POSITION}$(($SECONDS / 60)) min. $SEC sec" diff --git a/common/urls.xsl b/common/urls.xsl index 291526e..b2e04d1 100644 --- a/common/urls.xsl +++ b/common/urls.xsl @@ -19,12 +19,19 @@ + + + + + + - ..." source configuration -[[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1 +[[ $? > 0 ]] && echo "file: configuration did not load.." && exit 1 [[ $VERBOSITY > 0 ]] && echo "OK" # These are boolean vars generated from Config.in. -# ISSUE: If a boolean parameter is not set that -# variable is not defined by the menu app. This can -# cause a headache if you are not careful. -# The following parameters MUST be created and have a -# default value. +# ISSUE: If a boolean parameter is not set to y(es) there +# is no variable defined by the menu app. This can +# cause a headache if you are not aware. +# The following variables MUST exist. If they don't, the +# default value is n(o). RUNMAKE=${RUNMAKE:-n} GETPKG=${GETPKG:-n} GETKERNEL=${GETKERNEL:-n} COMPARE=${COMPARE:-n} RUN_FARCE=${RUN_FARCE:-n} RUN_ICA=${RUN_ICA:-n} +PKGMNGT=${PKGMNGT:-n} BOMB_TEST=${BOMB_TEST:-n} STRIP=${STRIP:=n} REPORT=${REPORT:=n} @@ -180,28 +181,24 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;; * ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;; esac - # Dependencies envars, more easy to update. + # Dependencies envars, easier to update. # Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets() # libxml2 - LIBXML_PKG="libxml2-2.6.29.tar.gz" + LIBXML_PKG="libxml2-2.7.8.tar.gz" LIBXML_URL="ftp://xmlsoft.org/libxml2/${LIBXML_PKG}" - LIBXML_MD5="8b99b6e8b08e838438d9e6b639d79ebd" + LIBXML_MD5="8127a65e8c3b08856093099b52599c86" # libxslt - LIBXSLT_PKG="libxslt-1.1.21.tar.gz" + LIBXSLT_PKG="libxslt-1.1.26.tar.gz" LIBXSLT_URL="ftp://xmlsoft.org/libxslt/${LIBXSLT_PKG}" - LIBXSLT_MD5="59fe34e85692f71df2a38c2ee291b3ca" + LIBXSLT_MD5="e61d0364a30146aaa3001296f853b2b9" # tidy - TIDY_PKG="tidy-cvs_20070326.tar.bz2" - TIDY_URL="http://anduin.linuxfromscratch.org/files/BLFS/sources/${TIDY_PKG}" - TIDY_MD5="468bfaa5cf917a8ecbe7834c13a61376" + TIDY_PKG="tidy-cvs_20101110.tar.bz2" + TIDY_URL="http://anduin.linuxfromscratch.org/sources/BLFS/svn/t/${TIDY_PKG}" + TIDY_MD5="dd1fe109b4259ad3f364b175787ad5e9" # unzip - UNZIP_PKG="unzip552.tar.gz" + UNZIP_PKG="unzip60.tar.gz" UNZIP_URL="http://downloads.sourceforge.net/infozip/${UNZIP_PKG}" - UNZIP_MD5="9d23919999d6eac9217d1f41472034a9" - # unzip security patch - UNZIP_PATCH="unzip-5.52-security_fix-1.patch" - UNZIP_PATCH_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${UNZIP_PATCH}" - UNZIP_PATCH_MD5="00ebf64fdda2ad54ddfc619f85f328bb" + UNZIP_MD5="62b490407489521db863b523a7f86375" # DocBook XML DTD DBXML_PKG="docbook-xml-4.5.zip" DBXML_URL="http://www.docbook.org/xml/4.5/${DBXML_PKG}" @@ -210,53 +207,64 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then # DBXSL_PKG="docbook-xsl-1.69.1.tar.bz2" # DBXSL_URL="http://prdownloads.sourceforge.net/docbook/${DBXSL_PKG}" # DBXSL_MD5="6ebd29a67f2dcc3f2220f475ee6f6552" - # Links - LYNX_PKG="lynx2.8.6.tar.bz2" - LYNX_URL="http://lynx.isc.org/release/${LYNX_PKG}" - LYNX_MD5="dc80497b7dda6a28fd80404684d27548" + # Lynx + LYNX_PKG="lynx2.8.7rel.2.tar.bz2" + LYNX_URL="http://lynx.isc.org/current/${LYNX_PKG}" + LYNX_MD5="cb936aef812e4e463ab86cbbe14d4db9" # sudo - SUDO_PKG="sudo-1.6.8p12.tar.gz" - SUDO_URL="http://anduin.linuxfromscratch.org/sources/BLFS/svn/s/${SUDO_PKG}" - SUDO_MD5="b29893c06192df6230dd5f340f3badf5" - # sudo envar fix patch - SUDO_PATCH="sudo-1.6.8p12-envvar_fix-1.patch" - SUDO_PATCH_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${SUDO_PATCH}" - SUDO_PATCH_MD5="454925aedfe054dff8fe0d03b209f986" + SUDO_PKG="sudo-1.8.2.tar.gz" + SUDO_URL="http://www.sudo.ws/sudo/dist/${SUDO_PKG}" + SUDO_MD5="000f458e7391be9fdf459a9ad6a4912a" # wget - WGET_PKG="wget-1.10.2.tar.gz" + WGET_PKG="wget-1.13.4.tar.xz" WGET_URL="ftp://ftp.gnu.org/gnu/wget/${WGET_PKG}" - WGET_MD5="795fefbb7099f93e2d346b026785c4b8" + WGET_MD5="7f518b3a71e9efd330e9a0c3714f8463" + # SQLite (for subversion) + SQLITE_PKG="sqlite-autoconf-3070800.tar.gz" + SQLITE_URL="http://sqlite.org/${SQLITE_PKG}" + SQLITE_MD5="6bfb46d73caaa1bbbcd2b52184b6c542" + # Apache Portable Runtime (for subversion) + APR_PKG="apr-1.4.5.tar.bz2" + APR_URL="http://mirror.speednetwork.de/apache/apr/$APR_PKG" + APR_MD5="8b53f5a5669d0597f2da889a2f576eb6" + # APR config patch + APR_PATCH_1="apr-1.4.5-config.patch" + APR_PATCH_1_URL="file:///sources/local-patches/${APR_PATCH_1}" + APR_PATCH_1_MD5="fff6eddf998f4e956915f8053c15e41e" + # Apache Portable Runtime Utilities (for subversion) + APR_U_PKG="apr-util-1.4.1.tar.bz2" + APR_U_URL="http://mirrors.ircam.fr/pub/apache/apr/$APR_U_PKG" + APR_U_MD5="52b31b33fb1aa16e65ddaefc76e41151" + # APR-util config patch + APR_U_PATCH_1="apr-util-1.4.1-config.patch" + APR_U_PATCH_1_URL="file:///sources/local-patches/${APR_U_PATCH_1}" + APR_U_PATCH_1_MD5="4c07cb0d298ae9ddc75cd2d5acdedb2b" # Subversion - SVN_PKG="subversion-1.3.1.tar.bz2" - SVN_URL="http://subversion.tigris.org/tarballs/${SVN_PKG}" - SVN_MD5="07b95963968ae345541ca99d0e7bf082" + SVN_PKG="subversion-1.7.1.tar.bz2" + SVN_URL="http://archive.apache.org/dist/subversion/${SVN_PKG}" + SVN_MD5="8a4fa74385df85a9702141b6b68b8307" # GPM - GPM_PKG="gpm-1.20.1.tar.bz2" - GPM_URL="ftp://ftp.linux.ee/pub/gentoo/distfiles/distfiles/${GPM_PKG}" - GPM_MD5="2c63e827d755527950d9d13fe3d87692" - # GPM segfaul patch - GPM_PATCH_1="gpm-1.20.1-segfault-1.patch" - GPM_PATCH_1_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${GPM_PATCH_1}" - GPM_PATCH_1_MD5="8c88f92990ba7613014fcd1db14ca7ac" - # GPM silent patch - GPM_PATCH_2="gpm-1.20.1-silent-1.patch" - GPM_PATCH_2_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${GPM_PATCH_2}" - GPM_PATCH_2_MD5="bf6cbefe20c6f15b587f19ebc1c8a37a" + GPM_PKG="gpm-1.20.6.tar.bz2" + GPM_URL="http://www.nico.schottelius.org/software/gpm/archives/$GPM_PKG" + GPM_MD5="6b534da16dc1b28ba828dea89e520f6f" fi #--- Envars not sourced from configuration case $PROGNAME in - clfs* ) declare -r SVN="http://svn.cross-lfs.org/svn/repos" ;; +# TODO: clfs is now on git +# clfs* ) declare -r SVN="http://svn.cross-lfs.org/svn/repos" ;; * ) declare -r SVN="svn://svn.linuxfromscratch.org" ;; esac declare -r LOG=000-masterscript.log - # Needed to can fetch BLFS book sources when building CLFS + # Needed for fetching BLFS book sources when building CLFS declare -r SVN_2="svn://svn.linuxfromscratch.org" # Set true internal variables COMMON_DIR="common" PACKAGE_DIR=$(echo $PROGNAME | tr '[a-z]' '[A-Z]') MODULE=$PACKAGE_DIR/master.sh +PKGMNGTDIR="pkgmngt" +# The name packageManager.xml is hardcoded in *.xsl, so no variable. [[ $VERBOSITY > 0 ]] && echo -n "Loading common-functions module..." source $COMMON_DIR/common-functions @@ -369,9 +377,18 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then export XSL=$JHALFSDIR/${XSL} # + # Copy packageManager.xml, if needed + [[ "$PKGMNGT" = "y" ]] && [[ "$PROGNAME" = "lfs" ]] && + cp $PKGMNGTDIR/packageManager.xml $JHALFSDIR/ && + cp $PKGMNGTDIR/packInstall.sh $JHALFSDIR/ + # # Copy urls.xsl, if needed [[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/ # + # Copy APR patches, if needed + [[ "$DEP_SVN" = "y" ]] && + cp $COMMON_DIR/blfs-tool-deps/apr*.patch $BUILDDIR/sources + # # Create the test-log directory, if needed [[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR # @@ -381,7 +398,7 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then # Prepare report creation, if needed if [[ "$REPORT" = "y" ]]; then cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/ - # After being sure that all looks sane, dump the settings to a file + # After making sure that all looks sane, dump the settings to a file # This file will be used to create the REPORT header validate_config > $JHALFSDIR/jhalfs.config fi diff --git a/optimize/opt_config b/optimize/opt_config index 78c07df..7a0df74 100644 --- a/optimize/opt_config +++ b/optimize/opt_config @@ -16,7 +16,7 @@ MAKEFLAGS="-j3" # This list may be different for you. # If your MAKEFLAGS don't contains a -jX option, you can set # a empty list here. -BLACK_LIST="autoconf dejagnu gettext groff man-db" +BLACK_LIST="autoconf dejagnu gettext groff man-db vim" #--- Default optimization mode # This mode is overridden by definitions in opt_override; @@ -26,7 +26,7 @@ BLACK_LIST="autoconf dejagnu gettext groff man-db" # # Not set here combined modes of form defOpt_myMode. # Combined modes of form modeA_modeB can be set here. -DEF_OPT_MODE=O3pipe +DEF_OPT_MODE=O2pipe #--- Active optimization variables diff --git a/optimize/opt_config.d/O2pipe b/optimize/opt_config.d/O2pipe new file mode 100644 index 0000000..5ef3784 --- /dev/null +++ b/optimize/opt_config.d/O2pipe @@ -0,0 +1,20 @@ +# +#$Id$ +# Pierre Labastie from O3pipe: 12/20/2011 +##### +# +# MODE O2pipe configuration +# +# Usage: - Apply optimization string to each variable +# - "unset" will cause the variable to be not set +# instead of just set to null. +# +##### + +CFLAGS_O2pipe="-O2 -pipe" +CXXFLAGS_O2pipe=$CFLAGS_O2pipe +LDFLAGS_O2pipe="unset" + +OTHER_CFLAGS_O2pipe=$CFLAGS_O2pipe +OTHER_CXXFLAGS_O2pipe=$CXXFLAGS_O2pipe +OTHER_LDFLAGS_O2pipe=$LDFLAGS_O2pipe diff --git a/optimize/opt_config.d/O3pipe_march b/optimize/opt_config.d/O3pipe_march index 7f0f50e..3e2728e 100644 --- a/optimize/opt_config.d/O3pipe_march +++ b/optimize/opt_config.d/O3pipe_march @@ -16,10 +16,10 @@ # Inherit optimizations from O3pipe source optimize/opt_config.d/O3pipe -CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4" -CXXFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4" +CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=native" +CXXFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=native" LDFLAGS_O3pipe_march=$LDFLAGS_O3pipe -OTHER_CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4" -OTHER_CXXFLAGS_O3pipe_march=$CXXFLAGS_O3pipe" -march=pentium4" +OTHER_CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=native" +OTHER_CXXFLAGS_O3pipe_march=$CXXFLAGS_O3pipe" -march=native" OTHER_LDFLAGS_O3pipe_march=$LDFLAGS_O3pipe diff --git a/pkgmngt/packInstall.sh b/pkgmngt/packInstall.sh new file mode 100644 index 0000000..3a0fc3c --- /dev/null +++ b/pkgmngt/packInstall.sh @@ -0,0 +1,38 @@ +# $Id:$ +# function for packing and installing a tree. We only have access +# to variables PKGDIR and PKG_DEST + +packInstall() { + +local PCKGVRS=$(basename $PKGDIR) +local TGTPKG=$(basename $PKG_DEST) +local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' | + sed 's/^[0-9]\{1\}-//') +case $PCKGVRS in + expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;; + vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;; + tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;; + docbook-xml) local VERSION=4.5 ;; + *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*-\([0-9]\)/\1/');; +esac +local ARCHIVE_NAME=$(dirname ${PKGDIR})/${PACKAGE}_${VERSION}.deb +case $(uname -m) in + x86_64) local ARCH=amd64 ;; + *) local ARCH=i386 ;; +esac + +pushd $PKG_DEST +rm -fv ./usr/share/info/dir +mkdir DEBIAN +cat > DEBIAN/control < +Description: $PACKAGE +Architecture: $ARCH +EOF +dpkg-deb -b . $ARCHIVE_NAME +dpkg -i $ARCHIVE_NAME +mv -v $ARCHIVE_NAME /var/lib/packages +popd +} diff --git a/pkgmngt/packInstall.sh.template b/pkgmngt/packInstall.sh.template new file mode 100644 index 0000000..0bc460f --- /dev/null +++ b/pkgmngt/packInstall.sh.template @@ -0,0 +1,50 @@ +# $Id:$ +# function for packing and installing a tree. We only have access +# to variables PKGDIR and PKG_DEST +# Other variables can be passed on the command line, or in the environment + +packInstall() { + +# A proposed implementation for versions and package names. +local PCKGVRS=$(basename $PKGDIR) +local TGTPKG=$(basename $PKG_DEST) +local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' | + sed 's/^[0-9]\{1\}-//') +# version is only accessible from PKGDIR name. Since the format of the +# name is not normalized, several hacks are necessary... +case $PCKGVRS in + expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;; + vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;; + tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;; + docbook-xml) local VERSION=4.5 ;; + *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/');; +esac +local ARCHIVE_NAME=$(dirname ${PKGDIR})/${PACKAGE}_${VERSION}.deb +case $(uname -m) in + x86_64) local ARCH=amd64 ;; + *) local ARCH=i386 ;; +esac + +pushd $PKG_DEST +rm -fv ./usr/share/info/dir # recommended since this directory is already there + # on the system +# The next lines are specific to dpkg, but usually all pacakge managers +# need some information on the version and the package. +mkdir DEBIAN +cat > DEBIAN/control < +Description: $PACKAGE +Architecture: $ARCH +EOF +# Building the binary package +dpkg-deb -b . $ARCHIVE_NAME +# Installing it on LFS +dpkg -i $ARCHIVE_NAME +# Storing the package (recommended). +mv -v $ARCHIVE_NAME /var/lib/packages +popd # Since the $PKG_DEST directory is destroyed + # immediately after the return of the function, + # getting back to $PKGDIR is important... +} diff --git a/pkgmngt/packageManager.xml b/pkgmngt/packageManager.xml new file mode 100644 index 0000000..d971107 --- /dev/null +++ b/pkgmngt/packageManager.xml @@ -0,0 +1,341 @@ + + + + + + + + + + + + + + + + + +]> +
+ + + + + All Packages + + Download or otherwise obtain the following packages: + + + + + Dpkg (&dpkg-version;) - &dpkg-size;: + + Home page: + Download: + MD5 sum: &dpkg-md5; + + + + + + + + + + + + + dpkg + &dpkg-version; +
&dpkg-url;
+
+ + Dpkg-&dpkg-version; + + + + + <para>This is my choice of package manager. Dpkg is the basic package + manager of Debian. It can be complemented by deselect (in the same + package), apt or aptitude. We use it in a very crude way.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&dpkg-ch5-sbu;</seg> + <seg>&dpkg-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Dpkg + + Since Debian is shipping its own package, all patches have already + been applied. However, the configure script calls + dpkg itself, which is found only on Debian hosts. The + following sed command prevents that call: + + sed '/\$v[{]DEB_BUILD/d' \ + -i scripts/dpkg-architecture.pl + + Configure the package: + + ./configure --prefix=/tools \ + --disable-nls --without-dselect \ + --without-start-stop-daemon \ + --without-update-alternatives \ + --without-install-info \ + --without-zlib --with-bz2=static --without-selinux + + + The meaning of the configure options: + + + --without-dselect + + Avoids building dselect, an + awful thing! + + + + + --without-start-stop-daemon + + The utility start-stop-daemon + is not needed here. + + + + + --without-update-alternatives + + Same for update-alternatives. + + + + + --without-install-info + + Debian install-info is a wrapper to + install-info installed by Texinfo. Not + needed either. + + + + + + Compile the package: + + (cd lib && make) +(cd src && make) +(cd dpkg-deb && make) +(cd dpkg-split && make) + + This package does not come with a test suite. + + Install only the needed files: + + cp src/dpkg src/dpkg-* /tools/bin +cp dpkg-deb/dpkg-deb /tools/bin +cp dpkg-split/dpkg-split /tools/bin +mkdir -pv /tools/etc/dpkg/{,dpkg.cfg.d} +cp debian/dpkg.cfg /tools/etc/dpkg + + Add a line in dpkg.cfg to + tell where to put administration files + + cat >> /tools/etc/dpkg/dpkg.cfg << EOF +# admindir on LFS system +admindir /var/lib/dpkg +EOF + + On a Debian system, dpkg relies on two other + files to be present. Since we do not install them, issue: + + cat >> /tools/etc/dpkg/dpkg.cfg << EOF +# disable fatal error on path checking +force-bad-path +EOF + + + +
+ + + + + Adding Directories for package management + + Those directories should be added to the system. + /var/lib/dpkg and subdirectories are + adminitrative directories of dpkg. + /var/log is the log directory for + dpkg. /var/lib/packages + will be used to store our packages.deb files. + + mkdir -pv /var/{log,lib/dpkg/{info,updates}} +mkdir -pv /var/lib/packages + + + + + + + Adding administrative files for Dpkg + dpkg needs that some files exist to run + for the first time. The log file must exist in order to be + used. + + touch /var/lib/dpkg/{available,status} +touch /var/log/dpkg.log + + + + + + + + dpkg + &dpkg-version; +
&dpkg-url;
+
+ + Dpkg-&dpkg-version; + + + + + <para>This is my choice of package manager. Dpkg is the basic package + manager of Debian. It can be complemented by deselect (in the same + package), apt or aptitude. We use it in a very crude way.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&dpkg-ch6-sbu;</seg> + <seg>&dpkg-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Dpkg + + Since Debian is shipping its own package, all patches have already + been applied. We can go directly to configuring it: + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --without-dselect \ + --without-start-stop-daemon \ + --without-update-alternatives \ + --without-install-info \ + --without-selinux + + + The meaning of the configure options: + + + --without-dselect + + Avoids building dselect, an + awful thing! + + + + + --without-start-stop-daemon + + The utility start-stop-daemon + is not needed here. + + + + + --without-update-alternatives + + Same for update-alternatives. + + + + + --without-install-info + + Debian install-info is a wrapper to + install-info installed by Texinfo. Not + needed either. + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +mkdir -pv $PKG_DEST +make DESTDIR=$PKG_DEST install +mkdir -pv $PKG_DEST/etc/dpkg/{,dpkg.cfg.d} +cp debian/dpkg.cfg $PKG_DEST/etc/dpkg + + Add a line in dpkg.cfg to + tell where to put administration files + +cat >> $PKG_DEST/etc/dpkg/dpkg.cfg << EOF +# admindir on LFS system +admindir /var/lib/dpkg +EOF + + + On a Debian system, dpkg relies on two other + files (ldconfig and maybe update-rc.d) + to be present. Since we do not install them, issue: + +cat >> /etc/dpkg/dpkg.cfg << EOF +# disable fatal error on path checking +force-bad-path +EOF + + + +
+
diff --git a/pkgmngt/packageManager.xml.template b/pkgmngt/packageManager.xml.template new file mode 100644 index 0000000..c3618aa --- /dev/null +++ b/pkgmngt/packageManager.xml.template @@ -0,0 +1,143 @@ + + + + + + +
+ + + + Download: + MD5 sum: package-md5-checksum + + + + + + + + + + +./configure --prefix=/tools \ + --disable-nls --without-dselect \ + --without-start-stop-daemon \ + --without-update-alternatives \ + --without-install-info \ + --without-zlib --with-bz2=static --without-selinux + +(cd lib && make) +(cd src && make) +(cd dpkg-deb && make) +(cd dpkg-split && make) + +cp src/dpkg src/dpkg-* /tools/bin +cp dpkg-deb/dpkg-deb /tools/bin +cp dpkg-split/dpkg-split /tools/bin +mkdir -pv /tools/etc/dpkg/{,dpkg.cfg.d} +cp debian/dpkg.cfg /tools/etc/dpkg + +cat >> /tools/etc/dpkg/dpkg.cfg << EOF +# admindir on LFS system +admindir /var/lib/dpkg +EOF + +cat >> /tools/etc/dpkg/dpkg.cfg << EOF +# disable fatal error on path checking +force-bad-path +EOF + + + + + + + + + +mkdir -pv /var/{log,lib/dpkg/{info,updates}} +mkdir -pv /var/lib/packages + + + + + +touch /var/lib/dpkg/{available,status} +touch /var/log/dpkg.log + + + + + + + + + +./configure --prefix=/usr \ + --without-dselect \ + --without-start-stop-daemon \ + --without-update-alternatives \ + --without-install-info \ + --without-selinux + +make + + +mkdir -pv $PKG_DEST +make DESTDIR=$PKG_DEST install +mkdir -pv $PKG_DEST/etc/dpkg/{,dpkg.cfg.d} +cp debian/dpkg.cfg $PKG_DEST/etc/dpkg + +cat >> $PKG_DEST/etc/dpkg/dpkg.cfg << EOF +# admindir on LFS system +admindir /var/lib/dpkg +EOF + +cat >> $PKG_DEST/etc/dpkg/dpkg.cfg << EOF +# disable fatal error on path checking +force-bad-path +EOF + + + + +