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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:53:03+00:00 2026-05-25T12:53:03+00:00

I have a spec file which is similar to: BuildRoot: /tmp/build_%{name}-%{version}-%{release} %prep … …

  • 0

I have a spec file which is similar to:

BuildRoot: /tmp/build_%{name}-%{version}-%{release}

%prep
...
...

%install
# Directories
install -m 755 -d %{buildroot}/usr/app/mypackage/config
install -m 755 -d %{buildroot}/usr/app/mypackage/src
....

# Bash script
install -m 755 script/script1.sh %{buildroot}/usr/app/mypackage/config/script1.sh
install -m 755 script/script2.sh %{buildroot}/usr/app/mypackage/config/script2.sh
install -m 755 script/myapp-log %{buildroot}/etc/logrotate.d/myapp-log

When I run the rpmbuild I get the error:

install: cannot create regular file `/tmp/build_my_app-1.0-2/etc/logrotate.d/myapp-log'

I can get around this by manually creating the /etc/ and then /etc/logrotate.d directories in the /tmp/build_my_app-1.0-2/ directory.

When I re-reun the rpmbuild it will work.

I guess this is because I am not creating this directory in my install section but as its not directly related to my application I don’t want to put that in.

My guess is that there is some clever tag I can use to fix this so that the build will work without any manual intervention.

My Question:
Could someone please suggest a way for me to achieve this (assuming its possible) or whether I need to write a script around the rpmbuild to set this up first.

  • 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-25T12:53:03+00:00Added an answer on May 25, 2026 at 12:53 pm

    You are missing the step to create the installation directories in your %install section. Remember that since you can build in “different” roots, you cannot expect certain directories (like ${buildroot}/etc) to be present.

    Try adding

     mkdir -p ${buildroot}/etc/logrotate.d
    

    just before the install command that copies the file into ${buildroot}/etc/logrotate.d.

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

Sidebar

Related Questions

Hi I have a file try.SPEC. This file contains a word Version: 1.0.0.1 .
I have an XML file which contains some data as given. <?xml version=1.0 encoding=UTF-8
Hi I am using Fedora 10 linux. I have created a .spec file now
I believe I have some problem with scoping. I have a controller spec file
I have a Rails RSpec file which looks something like require 'spec_helper' describe Something
I have following xml file: <doc_xml> <nodes> <node id='1' spec={spec_a=0.9, spec_b=0.1} /> <node id='2'
I have a spec in my current project that requires us to advise the
I have almost the worst spec in the world. An application that exists and
In a branch spec, I have the following view: //depot/dev/t/a/g/... //depot/dev/t/r/g/... -//depot/dev/t/a/g/p/o*/... //depot/dev/t/r/g/p/... Perforce
The JDBC 3.0 spec talks about Connection (and Prepared Statement) pooling. We have several

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.