Cannot include sub directories and files in rpm package

Orcan Ogetbil oget.fedora at gmail.com
Thu Sep 10 07:17:29 UTC 2009


On Thu, Sep 10, 2009 at 2:55 AM, ram s wrote:
> Hello,
>

Hi! I see that you are new to packaging. I advise you to read a bash
tutorial first. It will help.

> I am creating one rpm for my package.
>
> WHen I try to run spec file, it shows the sub directories can't be fine.
>
> Error:
>
> install: cannot stat `/mine/derot.txt': No such file or directory
> error: Bad exit status from /home/user/rpmbuild/tmp/rpm-
> tmp.XgsNY2 (%install)
>

This means what it says: "No such file or directory". Let's see:

>
> Actually in SOURCE, I have Script directory. Inside the ShellScript dir, I
> have mine directory and its files.
>
> my spec %install part is,
> %install
>
> mkdir -p $RPM_BUILD_ROOT/home/dictator/
> mkdir -p $RPM_BUILD_ROOT/home/dictator/supplies
> mkdir -p $RPM_BUILD_ROOT/home/dictator/supplies/ShellScripts
> mkdir -p $RPM_BUILD_ROOT/home/dictator/supplies/ShellScripts/mine
>

The above can be simplified to (1 line only)
mkdir -p $RPM_BUILD_ROOT/home/dictator/supplies/ShellScripts/mine

> install -d ShellScripts $RPM_BUILD_ROOT/home/dictator/supplies/ShellScripts
> install -p Scripts/dir_check.sh
> $RPM_BUILD_ROOT/home/dictator/supplies/ShellScripts/dir_check.sh
> install -d ShellScripts/mine
> $RPM_BUILD_ROOT/home/dictator/supplies/ShellScripts/mine
> install -p /mine/derot.txt
> $RPM_BUILD_ROOT/home/dictator/supplies/ShellScripts/mine/derot.txt

Okay. Here is your problem. You are trying to install derot.txt from
the root (/) of your system. Most likely, you don't have a /mine
directory in your root, do you?

I guess the line should be starting via
install -d ShellScripts/mine/derot.txt ...

When you start a file location via / the computer will always look to
the root of your system. In SPEC files, we usually use relative paths
(that do not begin with a /) to denote files from our source tree.

Good luck and have fun!
Orcan




More information about the fedora-devel-list mailing list