Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Packaging (http://www.linux-archive.org/fedora-packaging/)
-   -   Cannot cd to %{name}-%{version} (http://www.linux-archive.org/fedora-packaging/655309-cannot-cd-name-version.html)

Kamal Ahmed 04-12-2012 02:39 PM

Cannot cd to %{name}-%{version}
 
I have the following spec file:

Summary: pcore binary
Name: pcore
Version: 0.1
Release: Beta
Epoch: 0
License: Commercial
Group: Applications/Telecommunications
Packager: Kamal Ahmed <kamal.ahmed@unleashbts.com>
URL: http://pcore.bts.md/
Source: pcore-0.1.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
ElementalCORE

%prep
mkdir %{name}-%{version}
%setup -q


%build
#%configure
make

%install
rm -rf "$RPM_BUILD_ROOT"
%makeinstall
rm -f $RPM_BUILD_ROOT%{_infodir}/dir


%clean
rm -rf "$RPM_BUILD_ROOT"


%files
%defattr(-,root,root)
%doc NEWS

but when i do an rpmbuild -bb pcore.spec, i get:



rpmbuild -bb pcore.spec
Executing(%prep): /bin/sh -e
/var/tmp/rpm-tmp.66518
+ umask 022
+ cd /home/kahmed/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ mkdir pcore-0.1
+ cd /home/kahmed/rpmbuild/BUILD
+ rm -rf pcore-0.1
+ /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd pcore-0.1
/var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or directory

--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Jon Ciesla 04-12-2012 02:42 PM

Cannot cd to %{name}-%{version}
 
2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
> I have the following spec file:
>
> Summary: pcore binary
> Name: pcore
> Version: 0.1
> Release: Beta
> Epoch: 0
> License: Commercial
> Group: Applications/Telecommunications
> Packager: Kamal Ahmed <kamal.ahmed@unleashbts.com>
> URL: http://pcore.bts.md/
> Source: pcore-0.1.tar.gz
> BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
>
> %description
> ElementalCORE
>
> %prep
> mkdir %{name}-%{version}

Find out what the directory is really called after extraction, i.e.
foo-somethingelse and change

> %setup -q
>
to

%setup -qn foo-somethingelse


-J

>
> %build
> #%configure
> make
>
> %install
> rm -rf "$RPM_BUILD_ROOT"
> %makeinstall
> rm -f $RPM_BUILD_ROOT%{_infodir}/dir
>
>
> %clean
> rm -rf "$RPM_BUILD_ROOT"
>
>
> %files
> %defattr(-,root,root)
> %doc NEWS
>
> but when i do an rpmbuild -bb pcore.spec, i get:
>
>
>
> rpmbuild -bb pcore.spec
> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.66518
> + umask 022
> + cd /home/kahmed/rpmbuild/BUILD
> + LANG=C
> + export LANG
> + unset DISPLAY
> + mkdir pcore-0.1
> + cd /home/kahmed/rpmbuild/BUILD
> + rm -rf pcore-0.1
> + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
> + tar -xf -
> + STATUS=0
> + '[' 0 -ne 0 ']'
> + cd pcore-0.1
> /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or directory
>
>
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging



--
in your fear, seek only peace
in your fear, seek only love

-d. bowie
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

zxq9 04-12-2012 03:00 PM

Cannot cd to %{name}-%{version}
 
>2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
>>
>> %prep
>> mkdir %{name}-%{version}
>
>Find out what the directory is really called after extraction, i.e.
>foo-somethingelse and change
>
>> %setup -q
>
>to
>
>%setup -qn foo-somethingelse

Whatever the extraction directory is gets removed prior to the build to keep
the space clean. So what he's saying is that your problem (isolated below)
will stop happening if you name the build one something else.

>> rpmbuild -bb pcore.spec

Everything is fine here...

>> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.66518
>> + umask 022
>> + cd /home/kahmed/rpmbuild/BUILD
>> + LANG=C
>> + export LANG
>> + unset DISPLAY
>> + mkdir pcore-0.1

And here the working directory is made based on the default extraction
directory (that is, {% name %}-{% version %}).

>> + cd /home/kahmed/rpmbuild/BUILD
>> + rm -rf pcore-0.1

And here it gets removed! So you need to name the one you really want to use
something different, which is what Jon is saying about "setup -qn something-else".

>> + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
>> + tar -xf -
>> + STATUS=0
>> + '[' 0 -ne 0 ']'
>> + cd pcore-0.1

And of course this step doesn't work because pcore-0.1 has already been
"rm -rf"d

>> /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or directory

Hope this makes more sense now. Packaging is a little mysterious until you
play with it a bit on your own. And once you do, you'll find that Fedora
has the best all-around guidelines for it, all told. They are strict and a
little difficult to understand "why" at first, but there is a *lot* of
experience expressed in the packaging guidelines, tutorials, rpm itself and
this list (most of the time...).
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Kamal Ahmed 04-12-2012 06:57 PM

Cannot cd to %{name}-%{version}
 
i found out the directory name "pcore" but outside of* rpm/specI wish there was a way inside the rpm , that i could find out the name of the directory that got created as a result of makein any case.

now i AM able to od a make, but when trying to copy the binaries ( lets say one of the binaries "ggsnc" in /usr/bin) i get error message on permission
ibcm_td.a ./libmt_td.a** -lpthread -lnsl -lrt -o ./hnbgw
make[1]: Leaving directory `/home/kahmed/rpmbuild/BUILD/pcore/obj/hnbgw'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.32400
+ umask 022
+ cd /home/kahmed/rpmbuild/BUILD
+ cd pcore
+ LANG=C
+ export LANG
+ unset
DISPLAY
+ cp obj/ggsnc/ggsnc /usr/bin
cp: cannot create regular file `/usr/bin/ggsnc': Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.32400 (%install)


RPM build errors:
*** Bad exit status from /var/tmp/rpm-tmp.32400 (%install)
1. Am i doing the right thing which is to copy the binaries ( since we do NOT have a make install ) to /usr/binor this should be done in chroot
2. i am copying binaries in %install section, is this ok ?
%install
cp obj/ggsnc/ggsnc %{_bindir}

Thanks,-Kamal.

From: zxq9 <zxq9@zxq9.com>
To: packaging@lists.fedoraproject.org
Sent: Thursday, April 12, 2012 11:00 AM
Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}


>2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
>>
>> %prep
>> mkdir %{name}-%{version}
>
>Find out what the directory is really called after extraction, i.e.
>foo-somethingelse and change
>
>> %setup -q
>
>to
>
>%setup -qn foo-somethingelse

Whatever the extraction directory is gets removed prior to the build to keep
the space clean. So what he's saying is that your problem (isolated below)
will stop happening if you name the build one something else.

>> rpmbuild -bb pcore.spec

Everything is fine here...

>> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.66518
>> + umask 022
>> + cd /home/kahmed/rpmbuild/BUILD
>> + LANG=C
>> + export LANG
>> + unset DISPLAY
>> + mkdir
pcore-0.1

And here the working directory is made based on the default extraction
directory (that is, {% name %}-{% version %}).

>> + cd /home/kahmed/rpmbuild/BUILD
>> + rm -rf pcore-0.1

And here it gets removed! So you need to name the one you really want to use
something different, which is what Jon is saying about "setup -qn something-else".

>> + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
>> + tar -xf -
>> + STATUS=0
>> + '[' 0 -ne 0 ']'
>> + cd pcore-0.1

And of course this step doesn't work because pcore-0.1 has already been
"rm -rf"d

>> /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or directory

Hope this makes more sense now. Packaging is a little mysterious until you
play with it a bit on your own. And once you do, you'll find that Fedora
has the best all-around guidelines for it, all told.
They are strict and a
little difficult to understand "why" at first, but there is a *lot* of
experience expressed in the packaging guidelines, tutorials, rpm itself and
this list (most of the time...).
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Jon Ciesla 04-12-2012 07:01 PM

Cannot cd to %{name}-%{version}
 
2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
> i found out the directory name "pcore" but outside of* rpm/spec
> I wish there was a way inside the rpm , that i could find out the name of
> the directory that got created as a result of make
> in any case.
>
> now i AM able to od a make, but when trying to copy the binaries ( lets say
> one of the binaries "ggsnc" in /usr/bin) i get error message on permission
>
> ibcm_td.a ./libmt_td.a** -lpthread -lnsl -lrt -o ./hnbgw
> make[1]: Leaving directory `/home/kahmed/rpmbuild/BUILD/pcore/obj/hnbgw'
> + exit 0
> Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.32400
> + umask 022
> + cd /home/kahmed/rpmbuild/BUILD
> + cd pcore
> + LANG=C
> + export LANG
> + unset DISPLAY
> + cp obj/ggsnc/ggsnc /usr/bin
> cp: cannot create regular file `/usr/bin/ggsnc': Permission denied
> error: Bad exit status from /var/tmp/rpm-tmp.32400 (%install)

You need to copy it to the buildroot, rather than the running system,
so it should be:

cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/

Or the like.

-J

>
> RPM build errors:
> *** Bad exit status from /var/tmp/rpm-tmp.32400 (%install)
> 1. Am i doing the right thing which is to copy the binaries ( since we do
> NOT have a make install ) to /usr/bin
> or this should be done in chroot
> 2. i am copying binaries in %install section, is this ok ?
>
> %install
> cp obj/ggsnc/ggsnc %{_bindir}
>
> Thanks,
> -Kamal.
>
> ________________________________
> From: zxq9 <zxq9@zxq9.com>
> To: packaging@lists.fedoraproject.org
> Sent: Thursday, April 12, 2012 11:00 AM
> Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}
>
>>2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
>>>
>>> %prep
>>> mkdir %{name}-%{version}
>>
>>Find out what the directory is really called after extraction, i.e.
>>foo-somethingelse and change
>>
>>> %setup -q
>>
>>to
>>
>>%setup -qn foo-somethingelse
>
> Whatever the extraction directory is gets removed prior to the build to keep
> the space clean. So what he's saying is that your problem (isolated below)
> will stop happening if you name the build one something else.
>
>>> rpmbuild -bb pcore.spec
>
> Everything is fine here...
>
>>> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.66518
>>> + umask 022
>>> + cd /home/kahmed/rpmbuild/BUILD
>>> + LANG=C
>>> + export LANG
>>> + unset DISPLAY
>>> + mkdir pcore-0.1
>
> And here the working directory is made based on the default extraction
> directory (that is, {% name %}-{% version %}).
>
>>> + cd /home/kahmed/rpmbuild/BUILD
>>> + rm -rf pcore-0.1
>
> And here it gets removed! So you need to name the one you really want to use
> something different, which is what Jon is saying about "setup -qn
> something-else".
>
>>> + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
>>> + tar -xf -
>>> + STATUS=0
>>> + '[' 0 -ne 0 ']'
>>> + cd pcore-0.1
>
> And of course this step doesn't work because pcore-0.1 has already been
> "rm -rf"d
>
>>> /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or directory
>
> Hope this makes more sense now. Packaging is a little mysterious until you
> play with it a bit on your own. And once you do, you'll find that Fedora
> has the best all-around guidelines for it, all told. They are strict and a
> little difficult to understand "why" at first, but there is a *lot* of
> experience expressed in the packaging guidelines, tutorials, rpm itself and
> this list (most of the time...).
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging
>
>
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging



--
in your fear, seek only peace
in your fear, seek only love

-d. bowie
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Kamal Ahmed 04-12-2012 07:43 PM

Cannot cd to %{name}-%{version}
 
Jon,
with:
cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/

i get:

+ cp obj/ggsnc/ggsnc /pcore-0.1/usr/bin/
cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.93551 (%install)

The problem being that even though my Version is 0.1 , but when i untar , the directory gets created is pcore and not pcore-0.1.Any solution for this ?
-Kamal.

From: Jon Ciesla <limburgher@gmail.com>
To: Kamal Ahmed <kamal2222ahmed@yahoo.com>; Discussion of RPM packaging standards and practices for Fedora <packaging@lists.fedoraproject.org>
Sent: Thursday, April 12, 2012 3:01 PM
Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}


2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
> i found out the directory name "pcore" but outside of* rpm/spec
> I wish there was a way inside the rpm , that i could find out the name of
> the directory that got created as a result of make
> in any case.
>
> now i AM able to od a make, but when trying to copy the binaries ( lets say
> one of the binaries "ggsnc" in /usr/bin) i get error message on permission
>
> ibcm_td.a ./libmt_td.a** -lpthread -lnsl -lrt -o ./hnbgw
> make[1]: Leaving directory `/home/kahmed/rpmbuild/BUILD/pcore/obj/hnbgw'
> + exit 0
> Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.32400
> + umask 022
> + cd /home/kahmed/rpmbuild/BUILD
> + cd pcore
> + LANG=C
> + export LANG
> + unset DISPLAY
> + cp
obj/ggsnc/ggsnc /usr/bin
> cp: cannot create regular file `/usr/bin/ggsnc': Permission denied
> error: Bad exit status from /var/tmp/rpm-tmp.32400 (%install)

You need to copy it to the buildroot, rather than the running system,
so it should be:

cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/

Or the like.

-J

>
> RPM build errors:
> *** Bad exit status from /var/tmp/rpm-tmp.32400 (%install)
> 1. Am i doing the right thing which is to copy the binaries ( since we do
> NOT have a make install ) to /usr/bin
> or this should be done in chroot
> 2. i am copying binaries in %install section, is this ok ?
>
> %install
> cp obj/ggsnc/ggsnc %{_bindir}
>
> Thanks,
> -Kamal.
>
> ________________________________
> From: zxq9 <zxq9@zxq9.com>
> To: packaging@lists.fedoraproject.org
> Sent: Thursday, April 12, 2012 11:00 AM
> Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}
>
>>2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
>>>
>>> %prep
>>> mkdir %{name}-%{version}
>>
>>Find out what the directory is really called after extraction, i.e.
>>foo-somethingelse and change
>>
>>> %setup -q
>>
>>to
>>
>>%setup -qn foo-somethingelse
>
> Whatever the extraction directory is gets removed prior to the build to keep
> the space clean. So what he's saying is that your
problem (isolated below)
> will stop happening if you name the build one something else.
>
>>> rpmbuild -bb pcore.spec
>
> Everything is fine here...
>
>>> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.66518
>>> + umask 022
>>> + cd /home/kahmed/rpmbuild/BUILD
>>> + LANG=C
>>> + export LANG
>>> + unset DISPLAY
>>> + mkdir pcore-0.1
>
> And here the working directory is made based on the default extraction
> directory (that is, {% name %}-{% version %}).
>
>>> + cd /home/kahmed/rpmbuild/BUILD
>>> + rm -rf pcore-0.1
>
> And here it gets removed! So you need to name the one you really want to use
> something different, which is what Jon is saying about "setup -qn
> something-else".
>
>>> + /bin/gzip -dc
/home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
>>> + tar -xf -
>>> + STATUS=0
>>> + '[' 0 -ne 0 ']'
>>> + cd pcore-0.1
>
> And of course this step doesn't work because pcore-0.1 has already been
> "rm -rf"d
>
>>> /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or directory
>
> Hope this makes more sense now. Packaging is a little mysterious until you
> play with it a bit on your own. And once you do, you'll find that Fedora
> has the best all-around guidelines for it, all told. They are strict and a
> little difficult to understand "why" at first, but there is a *lot* of
> experience expressed in the packaging guidelines, tutorials, rpm itself and
> this list (most of the time...).
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging
>
>
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging



--
in your fear, seek only peace
in your fear, seek only love

-d. bowie


--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Jon Ciesla 04-12-2012 07:48 PM

Cannot cd to %{name}-%{version}
 
2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
> Jon,
>
> with:
> cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/
>
> i get:
>
> + cp obj/ggsnc/ggsnc /pcore-0.1/usr/bin/
> cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file or
> directory
> error: Bad exit status from /var/tmp/rpm-tmp.93551 (%install)
>
> The problem being that even though my Version is 0.1 , but when i untar ,
> the directory gets created is pcore and not pcore-0.1.
> Any solution for this ?

use: %setup -qn pcore

> -Kamal.
>
> ________________________________
> From: Jon Ciesla <limburgher@gmail.com>
> To: Kamal Ahmed <kamal2222ahmed@yahoo.com>; Discussion of RPM packaging
> standards and practices for Fedora <packaging@lists.fedoraproject.org>
> Sent: Thursday, April 12, 2012 3:01 PM
> Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}
>
> 2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
>> i found out the directory name "pcore" but outside of* rpm/spec
>> I wish there was a way inside the rpm , that i could find out the name of
>> the directory that got created as a result of make
>> in any case.
>>
>> now i AM able to od a make, but when trying to copy the binaries ( lets
>> say
>> one of the binaries "ggsnc" in /usr/bin) i get error message on permission
>>
>> ibcm_td.a ./libmt_td.a** -lpthread -lnsl -lrt -o ./hnbgw
>> make[1]: Leaving directory `/home/kahmed/rpmbuild/BUILD/pcore/obj/hnbgw'
>> + exit 0
>> Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.32400
>> + umask 022
>> + cd /home/kahmed/rpmbuild/BUILD
>> + cd pcore
>> + LANG=C
>> + export LANG
>> + unset DISPLAY
>> + cp obj/ggsnc/ggsnc /usr/bin
>> cp: cannot create regular file `/usr/bin/ggsnc': Permission denied
>> error: Bad exit status from /var/tmp/rpm-tmp.32400 (%install)
>
> You need to copy it to the buildroot, rather than the running system,
> so it should be:
>
> cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/
>
> Or the like.
>
> -J
>
>>
>> RPM build errors:
>> *** Bad exit status from /var/tmp/rpm-tmp.32400 (%install)
>> 1. Am i doing the right thing which is to copy the binaries ( since we do
>> NOT have a make install ) to /usr/bin
>> or this should be done in chroot
>> 2. i am copying binaries in %install section, is this ok ?
>>
>> %install
>> cp obj/ggsnc/ggsnc %{_bindir}
>>
>> Thanks,
>> -Kamal.
>>
>> ________________________________
>> From: zxq9 <zxq9@zxq9.com>
>> To: packaging@lists.fedoraproject.org
>> Sent: Thursday, April 12, 2012 11:00 AM
>> Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}
>>
>>>2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
>>>>
>>>> %prep
>>>> mkdir %{name}-%{version}
>>>
>>>Find out what the directory is really called after extraction, i.e.
>>>foo-somethingelse and change
>>>
>>>> %setup -q
>>>
>>>to
>>>
>>>%setup -qn foo-somethingelse
>>
>> Whatever the extraction directory is gets removed prior to the build to
>> keep
>> the space clean. So what he's saying is that your problem (isolated below)
>> will stop happening if you name the build one something else.
>>
>>>> rpmbuild -bb pcore.spec
>>
>> Everything is fine here...
>>
>>>> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.66518
>>>> + umask 022
>>>> + cd /home/kahmed/rpmbuild/BUILD
>>>> + LANG=C
>>>> + export LANG
>>>> + unset DISPLAY
>>>> + mkdir pcore-0.1
>>
>> And here the working directory is made based on the default extraction
>> directory (that is, {% name %}-{% version %}).
>>
>>>> + cd /home/kahmed/rpmbuild/BUILD
>>>> + rm -rf pcore-0.1
>>
>> And here it gets removed! So you need to name the one you really want to
>> use
>> something different, which is what Jon is saying about "setup -qn
>> something-else".
>>
>>>> + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
>>>> + tar -xf -
>>>> + STATUS=0
>>>> + '[' 0 -ne 0 ']'
>>>> + cd pcore-0.1
>>
>> And of course this step doesn't work because pcore-0.1 has already been
>> "rm -rf"d
>>
>>>> /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or
>>>> directory
>>
>> Hope this makes more sense now. Packaging is a little mysterious until you
>> play with it a bit on your own. And once you do, you'll find that Fedora
>> has the best all-around guidelines for it, all told. They are strict and a
>> little difficult to understand "why" at first, but there is a *lot* of
>> experience expressed in the packaging guidelines, tutorials, rpm itself
>> and
>> this list (most of the time...).
>> --
>> packaging mailing list
>> packaging@lists.fedoraproject.org
>> https://admin.fedoraproject.org/mailman/listinfo/packaging
>>
>>
>> --
>> packaging mailing list
>> packaging@lists.fedoraproject.org
>> https://admin.fedoraproject.org/mailman/listinfo/packaging
>
>
>
> --
> in your fear, seek only peace
> in your fear, seek only love
>
> -d. bowie
>
>
>
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging



--
in your fear, seek only peace
in your fear, seek only love

-d. bowie
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Michael Schwendt 04-12-2012 07:49 PM

Cannot cd to %{name}-%{version}
 
On Thu, 12 Apr 2012 12:43:17 -0700 (PDT), KA (Kamal) wrote:

> Jon,
>
> with:
> cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/
>
> i get:
>
> + cp obj/ggsnc/ggsnc /pcore-0.1/usr/bin/
> cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file or directory
> error: Bad exit status from /var/tmp/rpm-tmp.93551 (%install)

That makes no sense, because $RPM_BUILD_ROOT should evaluate to the
value defined in the "BuildRoot:" tag. It seems you inserted a mistake
somewhere.

> The problem being that even though my Version is 0.1 , but when i untar , the directory gets created is pcore and not pcore-0.1.
> Any solution for this ?

Read up on the %setup macro's options. It seems you want to add -n %{name}
so it enters the existing "pcore" directory instead of the default (which
is %{name}-%{version}).
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Kamal Ahmed 04-12-2012 07:59 PM

Cannot cd to %{name}-%{version}
 
i did%prep
%setup -qn pcore

that is how i got make to run.
but i get : cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file

as a result of :%install
cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/
What i want to know id that ( as far as i think )*that %install
happens in a chrootand if i give the correct folder, the copy should happen ?plus i WANT to copy the binary executable in /usr/binnot sure HOW to do that
Thanks,-Kamal.
From: Jon Ciesla <limburgher@gmail.com>
To: Kamal Ahmed <kamal2222ahmed@yahoo.com>; Discussion of RPM packaging standards and practices for Fedora <packaging@lists.fedoraproject.org>
Sent: Thursday, April 12, 2012 3:48 PM
Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}


2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
> Jon,
>
> with:
> cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/
>
> i get:
>
> + cp obj/ggsnc/ggsnc /pcore-0.1/usr/bin/
> cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file or
> directory
> error: Bad exit status from /var/tmp/rpm-tmp.93551 (%install)
>
> The problem being that even though my Version is 0.1 , but when i untar ,
> the directory gets created is pcore and not pcore-0.1.
> Any solution for this ?

use: %setup -qn pcore

> -Kamal.
>
> ________________________________
> From: Jon Ciesla <limburgher@gmail.com>
> To: Kamal Ahmed <kamal2222ahmed@yahoo.com>; Discussion of RPM packaging
> standards and practices for Fedora <packaging@lists.fedoraproject.org>
> Sent: Thursday, April 12, 2012 3:01 PM
> Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}
>
> 2012/4/12 Kamal Ahmed <kamal2222ahmed@yahoo.com>:
>> i found out the directory name "pcore" but outside of* rpm/spec
>> I wish there was a way inside the rpm , that i could find out the name of
>> the directory that got created as a result of make
>> in any case.
>>
>> now i AM able to od a make, but when trying to copy the binaries ( lets
>> say
>> one of the
binaries "ggsnc" in /usr/bin) i get error message on permission
>>
>> ibcm_td.a ./libmt_td.a** -lpthread -lnsl -lrt -o ./hnbgw
>> make[1]: Leaving directory `/home/kahmed/rpmbuild/BUILD/pcore/obj/hnbgw'
>> + exit 0
>> Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.32400
>> + umask 022
>> + cd /home/kahmed/rpmbuild/BUILD
>> + cd pcore
>> + LANG=C
>> + export LANG
>> + unset DISPLAY
>> + cp obj/ggsnc/ggsnc /usr/bin
>> cp: cannot create regular file `/usr/bin/ggsnc': Permission denied
>> error: Bad exit status from /var/tmp/rpm-tmp.32400 (%install)
>
> You need to copy it to the buildroot, rather than the running system,
> so it should be:
>
> cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/
>
> Or the like.
>
> -J
>
>>
>> RPM build
errors:
>> *** Bad exit status from /var/tmp/rpm-tmp.32400 (%install)
>> 1. Am i doing the right thing which is to copy the binaries ( since we do
>> NOT have a make install ) to /usr/bin
>> or this should be done in chroot
>> 2. i am copying binaries in %install section, is this ok ?
>>
>> %install
>> cp obj/ggsnc/ggsnc %{_bindir}
>>
>> Thanks,
>> -Kamal.
>>
>> ________________________________
>> From: zxq9 <zxq9@zxq9.com>
>> To: packaging@lists.fedoraproject.org
>> Sent: Thursday, April 12, 2012 11:00 AM
>> Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}
>>
>>>2012/4/12 Kamal
Ahmed <kamal2222ahmed@yahoo.com>:
>>>>
>>>> %prep
>>>> mkdir %{name}-%{version}
>>>
>>>Find out what the directory is really called after extraction, i.e.
>>>foo-somethingelse and change
>>>
>>>> %setup -q
>>>
>>>to
>>>
>>>%setup -qn foo-somethingelse
>>
>> Whatever the extraction directory is gets removed prior to the build to
>> keep
>> the space clean. So what he's saying is that your problem (isolated below)
>> will stop happening if you name the build one something else.
>>
>>>> rpmbuild -bb pcore.spec
>>
>> Everything is fine here...
>>
>>>> Executing(%prep): /bin/sh -e
/var/tmp/rpm-tmp.66518
>>>> + umask 022
>>>> + cd /home/kahmed/rpmbuild/BUILD
>>>> + LANG=C
>>>> + export LANG
>>>> + unset DISPLAY
>>>> + mkdir pcore-0.1
>>
>> And here the working directory is made based on the default extraction
>> directory (that is, {% name %}-{% version %}).
>>
>>>> + cd /home/kahmed/rpmbuild/BUILD
>>>> + rm -rf pcore-0.1
>>
>> And here it gets removed! So you need to name the one you really want to
>> use
>> something different, which is what Jon is saying about "setup -qn
>> something-else".
>>
>>>> + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz
>>>> + tar -xf -
>>>> + STATUS=0
>>>> + '[' 0 -ne 0 ']'
>>>> + cd
pcore-0.1
>>
>> And of course this step doesn't work because pcore-0.1 has already been
>> "rm -rf"d
>>
>>>> /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or
>>>> directory
>>
>> Hope this makes more sense now. Packaging is a little mysterious until you
>> play with it a bit on your own. And once you do, you'll find that Fedora
>> has the best all-around guidelines for it, all told. They are strict and a
>> little difficult to understand "why" at first, but there is a *lot* of
>> experience expressed in the packaging guidelines, tutorials, rpm itself
>> and
>> this list (most of the time...).
>> --
>> packaging mailing list
>> packaging@lists.fedoraproject.org
>>
https://admin.fedoraproject.org/mailman/listinfo/packaging
>>
>>
>> --
>> packaging mailing list
>> packaging@lists.fedoraproject.org
>> https://admin.fedoraproject.org/mailman/listinfo/packaging
>
>
>
> --
> in your fear, seek only peace
> in your fear, seek only love
>
> -d. bowie
>
>
>
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging



--
in your fear, seek only peace
in your fear, seek only love

-d. bowie


--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Kamal Ahmed 04-12-2012 09:18 PM

Cannot cd to %{name}-%{version}
 
resolved by using :%setup -qn pcoreThanks,-Kamal.
From: Michael Schwendt <mschwendt@gmail.com>
To: packaging@lists.fedoraproject.org
Sent: Thursday, April 12, 2012 3:49 PM
Subject: Re:
[Fedora-packaging] Cannot cd to %{name}-%{version}


On Thu, 12 Apr 2012 12:43:17 -0700 (PDT), KA (Kamal) wrote:

> Jon,
>
> with:
> cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/
>
> i get:
>
> + cp obj/ggsnc/ggsnc /pcore-0.1/usr/bin/
> cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file or directory
> error: Bad exit status from /var/tmp/rpm-tmp.93551 (%install)

That makes no sense, because $RPM_BUILD_ROOT should evaluate to the
value defined in the "BuildRoot:" tag. It seems you inserted a mistake
somewhere.

> The problem being that even though my Version is 0.1 , but when i untar , the directory gets created is pcore and not pcore-0.1.
> Any solution for this ?

Read up on the %setup macro's options. It seems you want to add -n %{name}
so it enters the existing "pcore" directory instead of the default (which
is %{name}-%{version}).
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging


All times are GMT. The time now is 05:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.