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 7496429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:36:33+00:00 2026-05-29T18:36:33+00:00

I am trying to build RPM for my java code.RPM build and install sections

  • 0

I am trying to build RPM for my java code.RPM build and install sections works fine.But,later i have added a shell script in %post section to run shell script file that creates some files and starts the java application.The file gets copied fine.But, in %post section I get the failed dependencies bin/sh error.I am building the rpm on linux machine and target machines are centOS.I have also tried AutoReqProv: no in spec file.I am not running the install as a root user.also,target machines are not expected to have ANT(iam using it to build the java code-this might be not related to the problem) on them.I am attaching the code below.Default location of installation is in tmp folder.( for testing).

Summary: test           Summary: test
        Name: test
        Version: 1
        Release: 1
        License: Restricted
        Group: Applications/System
        BuildRoot: ~/rpm/BUILD/helloworld-root 
        URL: http://mycompany.net/helloworld.tar
        Vendor: Mycompany
        Packager: Mycompany  
        Prefix: /tmp
        BuildArchitectures: x86_64 

        %description
         Hello World

        %prep
        pwd
        %build
        pwd
        echo "changing directory"
        echo $RPM_BUILD_ROOT
        cd %{_sourcedir}
        pwd
        ant -f testbuild.xml
        %install
        pwd
        echo "in install"
        echo $RPM_BUILD_ROOT
        rm -rf $RPM_BUILD_ROOT
        mkdir -p $RPM_BUILD_ROOT/tmp/test/
        cd $RPM_BUILD_ROOT/tmp/test/
        tar -xf %{_builddir}/test.tar

        %post
        sh /tmp/test/createdb.sh
        %clean
        %files 
        /tmp/test
        %changelog

i have also searched on google but couldn’t find how to run shell script from spec.with oust post section, I have tried to run through command line it executes fine.I appreciate the help if somebody can point where the problem is?

  • 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-29T18:36:35+00:00Added an answer on May 29, 2026 at 6:36 pm
    %post -p /bin/bash
    

    That will give your post script a terminal to run bash commands and all that you are doing into it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build an RPM that will install file dependencies if they don't
I'm trying to build a RPM for barnyard2-1.9, but when I attempt it I
I am trying to build a rpm but unfortunately in my build machine I
Im trying to build a 'last user login' script but im not sure how
I'm trying to build my own rpm package and have a couple of doubts.
I'm a newbie and I'm trying to write a python script to build rpm
Trying to build a GUI application in Java/Swing. I'm mainly used to painting GUIs
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
I trying to build a script in linux - bash, being new to it.
Trying to build a linq query based on parameters a user selects (reporting) but

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.