diff --git a/.gitignore b/.gitignore index 486de19..5544792 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -configuration* +# configuration* custom/config/ menu/__pycache__/ -pkgmngt/packInstall.sh -pkgmngt/packageManager.xml +# pkgmngt/packInstall.sh +# pkgmngt/packageManager.xml diff --git a/pkgmngt/packInstall.sh b/pkgmngt/packInstall.sh new file mode 100644 index 0000000..4cc73d2 --- /dev/null +++ b/pkgmngt/packInstall.sh @@ -0,0 +1,39 @@ +# 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,4\}-//' | + sed 's/^[0-9]\{2\}-//') +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/' | + sed 's/_/./g');; +# the last sed above is because dpkg does not want a '_' in version. +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 -z9 -b . $ARCHIVE_NAME +dpkg -i $ARCHIVE_NAME +mv -v $ARCHIVE_NAME /var/lib/packages +popd +} diff --git a/pkgmngt/packageManager.xml b/pkgmngt/packageManager.xml new file mode 100644 index 0000000..4c6f544 --- /dev/null +++ b/pkgmngt/packageManager.xml @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + +]> +
+ + + + + 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. + + Configure the package: + + ./configure --prefix=/tools \ + --disable-nls --disable-dselect \ + --disable-start-stop-daemon \ + --disable-update-alternatives \ + --without-zlib --with-liblzma=static --without-libselinux + + + The meaning of the configure options: + + + --disable-dselect + + Avoids building dselect, an + awful thing! + + + + + --disable-start-stop-daemon + + The utility start-stop-daemon + is not needed here. + + + + + --disable-update-alternatives + + Same for update-alternatives. + + + + + --without-zlib + + Use gzip for compression of binary + packages instead of the zlib library, which is not installed + in chapter 5. + + + + + --with-liblzma=static + + Use statically linked liblzma for compression + of binary packages. + + + + + --without-libselinux + + Disable building for selinux, which + is not used with LFS/BLFS. + + + + + + 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 do not need more in chapter 6. Configure it: + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-dselect \ + --disable-start-stop-daemon \ + --disable-update-alternatives \ + --without-libselinux + + + The meaning of the configure options: + + + --disable-dselect + + Avoids building dselect, an + awful thing! + + + + + --disable-start-stop-daemon + + The utility start-stop-daemon + is not needed here. + + + + + --disable-update-alternatives + + Same for update-alternatives. + + + + + --without-libselinux + + Selinux is not used in LFS. + + + + + + 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 + + + +
+