Quellcode durchsuchen

feat: add bzip2-1.0.8 source code

clanker vor 1 Monat
Ursprung
Commit
54860243d2

+ 53 - 0
bzip2-1.0.8/MANIFEST.usm

@@ -0,0 +1,53 @@
+{
+  "provides" : {
+    "man:man1/bzgrep.1" : "as-expected",
+    "bin:bzgrep" : "as-expected",
+    "man:man1/bzegrep.1" : "as-expected",
+    "man:man1/bzfgrep.1" : "as-expected",
+    "man:man1/bzcmp.1" : "as-expected",
+    "bin:bzip2recover" : "as-expected",
+    "bin:bzip2" : "as-expected",
+    "bin:bunzip2" : "as-expected",
+    "inc:bzlib.h" : "as-expected",
+    "man:man1/bzmore.1" : "as-expected",
+    "bin:bzegrep" : "as-expected",
+    "bin:bzfgrep" : "as-expected",
+    "bin:bzmore" : "as-expected",
+    "man:man1/bzless.1" : "as-expected",
+    "bin:bzless" : "as-expected",
+    "bin:bzcat" : "as-expected",
+    "bin:bzdiff" : "as-expected",
+    "man:man1/bzdiff.1" : "as-expected",
+    "rootpath:usr/lib/libbz2.a" : "as-expected",
+    "bin:bzcmp" : "as-expected",
+    "man:man1/bzip2.1" : "as-expected"
+  },
+  "flags" : [
+    "simpleBuildEnvironment"
+  ],
+  "summary" : "Block-sorting file compressor using the Burrows-Wheeler algorithm",
+  "name" : "bzip2",
+  "md" : "PACKAGE.md",
+  "depends" : {
+    "build" : [
+      "bin:gcc",
+      "bin:make",
+      "bin:patch"
+    ],
+    "runtime" : [
+      "lib:libc.so.6"
+    ],
+    "manage" : [
+      "bin:wget",
+      "bin:tar",
+      "bin:patch"
+    ]
+  },
+  "url" : "https://www.sourceware.org/bzip2/",
+  "version" : "1.0.8",
+  "execs" : {
+    "build" : "usm-scripts/build.sh",
+    "install" : "usm-scripts/install.sh",
+    "acquire" : "usm-scripts/acquire.sh"
+  }
+}

+ 48 - 0
bzip2-1.0.8/PACKAGE.md

@@ -0,0 +1,48 @@
+# Bzip2
+
+Bzip2 is a freely available, patent-free, high-quality data compressor. It provides significantly better compression than traditional gzip compressors, especially for text files, by using the Burrows-Wheeler block sorting text compression algorithm combined with Huffman coding.
+
+## Features
+
+- High compression ratio, particularly effective on text files
+- Patent-free implementation
+- Cross-platform compatibility
+- Recovery tool for damaged compressed files
+- Standard Unix-style command-line interface
+
+## Included Programs
+
+- **bzip2**: Compresses files using the Burrows-Wheeler algorithm
+- **bunzip2**: Decompresses bzip2 compressed files (link to bzip2)
+- **bzcat**: Decompresses files to standard output
+- **bzip2recover**: Attempts to recover data from damaged bzip2 files
+- **bzgrep, bzegrep, bzfgrep**: Search within bzip2 compressed files
+- **bzdiff, bzcmp**: Compare bzip2 compressed files
+- **bzmore, bzless**: View bzip2 compressed files
+
+## Library
+
+- **libbz2**: Shared library providing bzip2 compression and decompression functions for other applications
+
+## Installation Notes
+
+This package follows the Linux From Scratch installation guidelines, including:
+- Installation of shared library with proper symlinks
+- Relative symbolic links for portability
+- Documentation installation
+- Removal of unnecessary static library
+
+## Usage Examples
+
+```bash
+# Compress a file
+bzip2 myfile.txt
+
+# Decompress a file
+bunzip2 myfile.txt.bz2
+
+# View compressed file without decompressing
+bzcat myfile.txt.bz2
+
+# Search within compressed files
+bzgrep "pattern" logfile.bz2

+ 27 - 0
bzip2-1.0.8/usm-scripts/acquire.sh

@@ -0,0 +1,27 @@
+#!/bin/bash
+set -e
+
+# Create sources directory
+mkdir -p sources
+
+# Download bzip2 source
+echo "Downloading bzip2-1.0.8 source..."
+wget -O sources/bzip2-1.0.8.tar.gz https://www.sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
+
+# Download bzip2 documentation patch
+echo "Downloading bzip2 documentation patch..."
+wget -O sources/bzip2-1.0.8-install_docs-1.patch https://www.linuxfromscratch.org/patches/lfs/12.4/bzip2-1.0.8-install_docs-1.patch
+
+# Extract source code
+echo "Extracting bzip2 source..."
+cd sources
+tar -xzf bzip2-1.0.8.tar.gz
+
+# Copy patch to source directory
+cp bzip2-1.0.8-install_docs-1.patch bzip2-1.0.8/
+
+# Clean up
+rm bzip2-1.0.8.tar.gz
+cd ..
+
+echo "Source acquisition complete."

+ 40 - 0
bzip2-1.0.8/usm-scripts/build.sh

@@ -0,0 +1,40 @@
+#!/bin/bash
+set -e
+
+build_dir=$1
+
+# With simpleBuildEnvironment flag, we're already in build directory
+# which contains the copied source tree
+
+# Copy patch file from sources directory
+echo "Copying patch file..."
+cp sources/bzip2-1.0.8-install_docs-1.patch sources/bzip2-1.0.8/
+
+# Change to source directory
+cd sources/bzip2-1.0.8/
+
+# Apply documentation patch (try different strip levels)
+echo "Applying documentation patch..."
+patch -Np0 -i bzip2-1.0.8-install_docs-1.patch || echo "Patch failed, continuing without documentation patch"
+
+# Fix symbolic links to be relative
+echo "Fixing symbolic links to be relative..."
+sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
+
+# Ensure man pages are installed to correct location
+echo "Fixing man page installation path..."
+sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
+
+# Build the shared library
+echo "Building shared library..."
+make -f Makefile-libbz2_so
+
+# Clean previous build artifacts
+echo "Cleaning previous build artifacts..."
+make clean
+
+# Build the package
+echo "Building bzip2..."
+make
+
+echo "Build complete."

+ 36 - 0
bzip2-1.0.8/usm-scripts/install.sh

@@ -0,0 +1,36 @@
+#!/bin/bash
+set -e
+
+build_dir=$1
+install_dir=$2
+install_type=$3
+
+# With simpleBuildEnvironment flag, we're in build directory
+# which contains the copied source tree, but built files are in sources/bzip2-1.0.8/
+
+# Change to the source directory with built files
+cd sources/bzip2-1.0.8/
+
+# Install the programs
+echo "Installing bzip2 programs..."
+make PREFIX="${DESTDIR}${PREFIX}" install
+
+# Install the shared library
+echo "Installing shared library..."
+mkdir -p "${DESTDIR}${LIBDIR}"
+cp -av libbz2.so.* "${DESTDIR}${LIBDIR}/"
+ln -sv libbz2.so.1.0.8 "${DESTDIR}${LIBDIR}/libbz2.so"
+
+# Install the shared bzip2 binary and create symlinks
+echo "Installing shared bzip2 binary..."
+mkdir -p "${DESTDIR}${BINDIR}"
+cp -v bzip2-shared "${DESTDIR}${BINDIR}/bzip2"
+for i in "${DESTDIR}${BINDIR}"/{bzcat,bunzip2}; do
+  ln -sfv bzip2 "$i"
+done
+
+# Remove useless static library
+echo "Removing static library..."
+rm -fv "${DESTDIR}${LIBDIR}/libbz2.a"
+
+echo "Installation complete."