Browse Source

Updated prompt

clanker 1 tháng trước cách đây
mục cha
commit
c75a82ec0a

+ 63 - 0
prompt-enhanced.md

@@ -0,0 +1,63 @@
+
+You are an expert package maintainer for Astrologue OS, which uses USM as its source-based package manager. Create a complete, production-ready package following Astrologue's exact specifications.
+
+**FIRST, STUDY THESE RESOURCES:**
+
+USM Documentation:
+- slopdocs://structure.usm.manifest.md
+- slopdocs://structure.usm.manifest.packaging.md
+- slopdocs://structure.usm.manifest.resource-types.md
+- slopdocs://structure.usm.manifest.executable-scripts.md
+- slopdocs://structure.usm.manifest.dependency-management.md
+- slopdocs://utility.usm.manifest.autoprovides.md
+
+LFS References:
+- https://www.linuxfromscratch.org/lfs/view/stable-systemd/chapter03/packages.html
+- https://www.linuxfromscratch.org/lfs/view/stable-systemd/chapter03/patches.html
+- Package-specific URL at the end of this prompt
+
+**PACKAGE STRUCTURE:**
+
+```
+{name}-{version}/
+├── MANIFEST.usm          # Complete, with simpleBuildEnvironment flag
+├── PACKAGE.md            # User-focused description
+└── usm-scripts/
+    ├── acquire.sh        # REQUIRED: Download/extract source
+    ├── build.sh          # REQUIRED: Configure and build
+    ├── install.sh        # REQUIRED: Install with variables
+    ├── postInstall.sh    # If needed for LFS steps
+    └── test.sh           # Only if LFS indicates critical tests
+```
+
+**CRITICAL REQUIREMENTS:**
+
+1. Path Variables:
+   - Replace ALL hardcoded paths: `/usr` → `${PREFIX}`, `/lib` → `${LIBDIR}`, etc.
+
+2. Scripts:
+   - All must have `.sh` extension and execute permissions
+   - Use relative paths from `{name}-{version}` root
+   - Include proper error handling
+   - `acquire.sh` must download via HTTPS only, extract to `sources/{name}`, clean up
+
+3. Manifest:
+   - Include ALL required fields
+   - Set `simpleBuildEnvironment` flag for LFS packages
+   - Point `md` property to `PACKAGE.md`
+   - Leave `provides` section empty
+
+**VALIDATION:**
+
+1. Create complete package structure
+2. Execute `usm manifest acquire` in package directory
+3. Fix any errors
+4. Verify compliance with Astrologue standards
+
+**PACKAGE SPECIFICATION:**
+
+**Name:** (package name)
+**Version:** (package version)
+**URL:** (url)
+
+Create a production-ready package following all requirements precisely.

+ 3 - 1
prompt.md

@@ -16,6 +16,8 @@ Astrologue packages are informed by the Linux From Scratch (LFS) project. Read t
 Astrologue packaging guidelines specify:
 - Each package in it's own directory, in the format `{name}-{version}` which should contain:
     - A complete `MANIFEST.usm` file with all required fields present including all `depends` sections, leave the `provides` secion empty.
+    - LFS packages should be made with the `simpleBuildEnvironment` flag set. This allows you to act as though you are only dealing with a source directory (which is a copy  of the root package directory) from the scripts. This will reduce cognative load needing to juggle only a source tree which gets built inside of, and a destination directory.
+    - When LFS hardcodes a prefix (such as `/usr`) replace this with the prefix environment variable `${PREFIX}` instead. Same goes for `/lib` which should become `${LIBDIR}`, `/bin` would become `${BINDIR}`, etc.
     - A `PACKAGE.md` file should be generated with a summary of the package for end users. It should describe the package, not how to install the package. The manifest should point to this file (`md` property).
     - A `usm-scripts` directory for all generated scripts (DO NOT name it `scripts`). All scripts within this directory MUST have a `.sh` extension.
 - A `usm-scripts/acquire.sh` script is REQUIRED and should:
@@ -27,7 +29,7 @@ Astrologue packaging guidelines specify:
     6. Download any patches to the `sources` directory.
 
 
-Once all of that is read and understood, generate the directory structure, manifest, description, and scripts for the package. If there are specific installation instructions from LFS these should be included in the `install` or `postInstall` exec so that the user does not need to understand LFS. In cases where LFS specified that tests are critical make a `test` script as well. Be sure to adapt any command to work with the correct directory structure. E.g. when running a `./configure` script from the source directory, you would need to run `{source_dir}/sources/{extracted-package-dir}/configure`, or change to that directory.
+Once all of that is read and understood, generate the directory structure, manifest, description, and scripts for the package. If there are specific installation instructions from LFS these should be included in the `install` or `postInstall` exec so that the user does not need to understand LFS. In cases where LFS specified that tests are critical make a `test` script as well. Remember that scripts work as if they are run from the root `{name}-{version}` directory, so make all paths in your script relative to that anchor point (unless of course you change directory)
 
 Once the basic structure has been created, call `usm manifest acquire` in the `{name}-{version}` directory to download the package, fixing any errors if this fails.
 

+ 6 - 6
zlib-1.3.1/MANIFEST.usm

@@ -6,8 +6,10 @@
     "man:man3/zlib.3" : "as-expected",
     "rootpath:usr/lib/libz.a" : "as-expected"
   },
-  "flags" : [],
-  "summary" : "Compression library implementing the deflate compression method found in gzip and PKZIP",
+  "flags" : [
+    "simpleBuildEnvironment"
+  ],
+  "summary" : "Compression library implementing the deflate compression method",
   "name" : "zlib",
   "md" : "PACKAGE.md",
   "depends" : {
@@ -15,15 +17,13 @@
       "bin:gcc",
       "bin:make"
     ],
-    "runtime" : [
-      "lib:libc.so.6"
-    ],
+    "runtime" : [],
     "manage" : [
       "bin:wget",
       "bin:tar"
     ]
   },
-  "url" : "https://www.zlib.net/",
+  "url" : "https://zlib.net/",
   "version" : "1.3.1",
   "execs" : {
     "build" : "usm-scripts/build.sh",

+ 22 - 19
zlib-1.3.1/PACKAGE.md

@@ -1,28 +1,31 @@
-# Zlib 1.3.1
+# Zlib
 
-Zlib is a massively used software library written in C that implements the deflate compression method found in gzip and PKZIP. It is designed to be a free, general-purpose, legally unencumbered lossless data-compression library for use on virtually any computer hardware and operating system.
+Zlib is a massively spiffy yet delicately unobtrusive compression library. This package provides the compression and decompression functions used by many programs throughout the system.
 
 ## Features
 
-- Provides in-memory compression and decompression functions
-- Implements the deflate compression algorithm used in gzip and PKZIP
-- Includes integrity checking of the uncompressed data
-- Portable across different platforms and architectures
-- Thread-safe when used with appropriate precautions
-- Designed for minimal memory footprint
+- Implements the deflate compression method used in gzip and PNG
+- Provides lossless data compression
+- Stream-based API for easy integration
+- Thread-safe implementation
+- Portable across different platforms
 
-## Common Applications
+## Description
 
-Zlib is used by numerous software applications and systems including:
-- File compression utilities
-- Network protocols (HTTP compression)
-- Database systems
-- Graphics file formats (PNG)
-- Software distribution systems
-- Virtualization platforms
+Zlib is designed to be a free, general-purpose, legally unencumbered lossless data-compression library for use on virtually any computer hardware and operating system. The zlib data format is itself portable across platforms.
 
-## Technical Details
+This library provides the compression and decompression functions that are essential for many system utilities and applications, including:
 
-This package provides the shared library `libz.so` which contains the compression and decompression functions. The library follows the standard C calling conventions and provides a simple API for integrating compression capabilities into applications.
+- Archive managers
+- Network protocols
+- Image processing
+- Data backup tools
+- Document formats
 
-The zlib library is distributed under a permissive license that allows its use in both open-source and proprietary software without licensing restrictions.
+## Installation
+
+This package installs the shared compression library (libz.so) that provides the core compression and decompression functionality. The static library is removed during installation as it's not needed for most use cases and helps reduce the system footprint.
+
+## License
+
+Zlib is released under the zlib License, which is a permissive free software license that allows for use in proprietary software.

+ 16 - 10
zlib-1.3.1/usm-scripts/acquire.sh

@@ -1,17 +1,23 @@
 #!/bin/bash
 set -e
 
-# Create sources directory
-mkdir -p sources
+# Zlib source acquisition script
+# Downloads zlib-1.3.1 source code and extracts it
 
-# Download zlib source archive
-cd sources
-wget -O zlib-1.3.1.tar.gz https://www.zlib.net/zlib-1.3.1.tar.gz
+ARCHIVE_URL="https://zlib.net/zlib-1.3.1.tar.gz"
+ARCHIVE_NAME="zlib-1.3.1.tar.gz"
+EXTRACT_DIR="sources/zlib"
 
-# Extract the source archive
-tar -xzf zlib-1.3.1.tar.gz
+echo "Downloading zlib source..."
+wget -O ${ARCHIVE_NAME} ${ARCHIVE_URL}
 
-# Clean up the archive
-rm zlib-1.3.1.tar.gz
+echo "Creating source directory..."
+mkdir -p ${EXTRACT_DIR}
 
-echo "Source acquisition complete"
+echo "Extracting archive..."
+tar -xzf ${ARCHIVE_NAME} -C ${EXTRACT_DIR} --strip-components=1
+
+echo "Cleaning up..."
+rm ${ARCHIVE_NAME}
+
+echo "Source acquisition complete."

+ 9 - 10
zlib-1.3.1/usm-scripts/build.sh

@@ -1,19 +1,18 @@
 #!/bin/bash
 set -e
 
-build_dir=$1
-src_dir=$(pwd)/sources/zlib-1.3.1
+# Zlib build script
+# Configures and builds zlib from source
 
-# Create build directory
-mkdir -p ${build_dir}
+build_dir=$1
 
-# Change to source directory
-cd ${src_dir}
+# With simpleBuildEnvironment flag, we're already in build directory
+# Source is available in sources/zlib relative to build directory
 
-# Configure zlib for compilation
-./configure --prefix=${PREFIX}
+echo "Configuring zlib..."
+./sources/zlib/configure --prefix=${PREFIX}
 
-# Compile the package
+echo "Building zlib..."
 make
 
-echo "Build complete"
+echo "Build complete."

+ 8 - 9
zlib-1.3.1/usm-scripts/install.sh

@@ -1,18 +1,17 @@
 #!/bin/bash
 set -e
 
+# Zlib install script
+# Installs zlib to the destination directory
+
 build_dir=$1
 install_dir=$2
 install_type=$3
-src_dir=$(pwd)/sources/zlib-1.3.1
-
-# Change to source directory
-cd ${src_dir}
 
-# Install the package to the specified directory
-make DESTDIR=${install_dir} PREFIX=${PREFIX} install
+# With simpleBuildEnvironment flag, we're already in build directory
+echo "Installing zlib to ${install_dir}..."
 
-# Remove the useless static library as specified in LFS instructions
-rm -fv ${install_dir}${LIBDIR}/libz.a
+# Install to the destination directory
+make DESTDIR=${install_dir} install
 
-echo "Installation complete"
+echo "Installation complete."

+ 7 - 5
zlib-1.3.1/usm-scripts/test.sh

@@ -1,13 +1,15 @@
 #!/bin/bash
 set -e
 
+# Zlib test script
+# Runs the test suite as specified in LFS
+
 build_dir=$1
-src_dir=$(pwd)/sources/zlib-1.3.1
 
-# Change to source directory
-cd ${src_dir}
+# With simpleBuildEnvironment flag, we're already in build directory
+echo "Running zlib test suite..."
 
-# Run the test suite
+# Run tests as specified in LFS
 make check
 
-echo "All tests passed"
+echo "All tests passed successfully."