Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:09:24+00:00 2026-05-28T06:09:24+00:00

I have to perform multiple elaborate sanity checks on target system before an RPM

  • 0

I have to perform multiple elaborate “sanity” checks on target system before an RPM package installs/upgrades. I want to contain the procedure in a script (bash/python/php or otherwise) alongside other accessory files (such as SQL scripts) which wouldn’t be installed with other files but only used during pre(install|upgrade).

Where do I put these files for rpmbuild and how do I call/reference them (paths, etc.) inside %pre section and inside main script? How do I reference then-to-be-installed data files (said SQL scripts)?

Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:09:25+00:00Added an answer on May 28, 2026 at 6:09 am

    This is possible if you put the scripts in a self-extracting archive, and make it the rpm script. This is possible with Makeself (direct link to download).

    Using footest as an example name, run this:

    makeself.sh --base64 /path/to/footest \
        /path/to/rpm/sources/footest.sh "My foo test" ./run.sh
    

    The /path/to/footest is a directory with your scripts to run, and ./run.sh is the script inside the footest directory, which is ran upon extraction.

    In your .spec file, add footest.sh as a source, and put this as the script:

    %pre -f footest.sh
    

    When you query your rpm for scripts, it’ll show the contents of footest.sh, which is a makeself followed by the base64 encoding of your test suite to run.

    NOTE: in order for this to work, you have to apply a patch to makeself to use the base64 encoding (the current release does not have this feature), and rpm doesn’t like binary data in its scripts:

    makeself-2.1.5-base64.patch:

    diff -ruNp makeself-2.1.5/makeself.sh makeself-2.1.5-base64/makeself.sh
    --- makeself-2.1.5/makeself.sh  2008-01-04 16:53:49.000000000 -0700
    +++ makeself-2.1.5-base64/makeself.sh   2012-01-17 06:01:42.000000000 -0700
    @@ -91,6 +91,7 @@ MS_Usage()
         echo "    --gzip          : Compress using gzip (default if detected)"
         echo "    --bzip2         : Compress using bzip2 instead of gzip"
         echo "    --compress      : Compress using the UNIX 'compress' command"
    +    echo "    --base64        : Instead of compressing, encode the data using base64"
         echo "    --nocomp        : Do not compress the data"
         echo "    --notemp        : The archive will create archive_dir in the"
         echo "                      current directory and uncompress in ./archive_dir"
    @@ -150,6 +151,10 @@ do
        COMPRESS=Unix
        shift
        ;;
    +    --base64)
    +   COMPRESS=base64
    +   shift
    +   ;;
         --encrypt)
        COMPRESS=gpg
        shift
    @@ -278,6 +283,10 @@ bzip2)
         GZIP_CMD="bzip2 -9"
         GUNZIP_CMD="bzip2 -d"
         ;;
    +base64)
    +    GZIP_CMD="base64"
    +    GUNZIP_CMD="base64 -d -i"
    +    ;;
     gpg)
         GZIP_CMD="gpg -ac -z9"
         GUNZIP_CMD="gpg -d"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple textboxes which I want them to perform the same thing upon
Basically, I have a list and I want to perform multiple functions on it
i am implementing the Zend Regex Routing, and i have to perform multiple checks
I have a Django app and I am trying to perform transactions over multiple
I have a web application with multiple WARS. These WARS all perform different functions
I have a client-side interface that allows the user to perform multiple edits against
In my code I have a method with multiple catch statements, which perform all
I have the problem that I will have multiple servers that perform jobs. They
I have multiple classes that all contain the same property along with a whole
I have 2 submit buttons and want to perform different actions for each submit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.