Discussion:
rpmbuild -bb ./test.spec error: File /home/powah/rpmbuild/SOURCES/test-2.3.0.tar.gz: No such file or directory
(too old to reply)
w***@yahoo.ca
2007-12-20 15:32:13 UTC
Permalink
$ rpmbuild -bb ./test.spec
error: File /home/powah/rpmbuild/SOURCES/test-2.3.0.tar.gz: No such
file or directory

test.spec is as follows:
%define sourced_version %(cat ../../../distribution/VERSION)

Release: %(cat ../../../distribution/RELEASE)

# Override target directory for binary rpms
%define _rpmdir ../../../distribution/packages/linux
%define _prefix /usr/local

Summary: SNMP Agent
Name: test
Vendor: pwwong, Inc.
#Version: %{libmaj}.%{libmin}.%{librel}
Version: %{sourced_version}
License: Commercial
Group: Applications/Cryptography
Source: %{name}-%{version}.tar.gz
Packager: Pwwong Support ***@pwwong-inc.com
BuildRoot: /var/tmp/%{name}-%{version}-root
AutoReqProv: no

%description
SNMP Agent

%prep
%setup

%build

%install
%define RPM_BUILD_DIR /usr/src/redhat/BUILD/%{name}-%{version}

mkdir -p $RPM_BUILD_ROOT/%{_prefix}/
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib/
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/bin/
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/sbin/
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/share/test/
mkdir -p $RPM_BUILD_ROOT//var/net-test/
mkdir -p $RPM_BUILD_ROOT//etc/init.d/

install $RPM_BUILD_DIR/%{name}-%{sourced_version}/testtrap
$RPM_BUILD_ROOT/%{_prefix}/bin/testtrap
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/testd
$RPM_BUILD_ROOT/%{_prefix}/sbin/testd
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/libnettest.so.15
$RPM_BUILD_ROOT/%{_prefix}/lib/libnettest.so.15
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/libnettestagent.so.
15 $RPM_BUILD_ROOT/%{_prefix}/lib/libnettestagent.so.15
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/libnettesthelpers.so.
15 $RPM_BUILD_ROOT/%{_prefix}/lib/libnettesthelpers.so.15
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/libnettestmibs.so.15
$RPM_BUILD_ROOT/%{_prefix}/lib/libnettestmibs.so.15
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/ctestd.conf
$RPM_BUILD_ROOT/%{_prefix}/share/test/testd.conf
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/ltestd.conf
$RPM_BUILD_ROOT/var/net-test/testd.conf
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/testd.init
$RPM_BUILD_ROOT/etc/init.d/testd

%post
if ! grep "/usr/local/lib" -q /etc/ld.so.conf ; then
echo "/usr/local/lib" >> /etc/ld.so.conf
/sbin/ldconfig
fi

chkconfig --add testd
chkconfig --level 0123456 testd off

%preun
chkconfig --del testd

%files
%defattr(-, root, root)
%dir /usr/local
%dir /usr/local/lib
%dir /usr/local/bin
%dir /usr/local/sbin
%attr(0544,root,root) /usr/local/bin/testtrap
%attr(0544,root,root) /usr/local/sbin/testd
%attr(0444,root,root) /usr/local/lib/libnettest.so.15
%attr(0444,root,root) /usr/local/lib/libnettestagent.so.15
%attr(0444,root,root) /usr/local/lib/libnettesthelpers.so.15
%attr(0444,root,root) /usr/local/lib/libnettestmibs.so.15
%attr(0544,root,root) /etc/init.d/testd
%config(noreplace) %attr(0444,root,root) /usr/local/share/test/
testd.conf
%config(noreplace) %attr(0444,root,root) /var/net-test/testd.conf
Michal Jaegermann
2007-12-21 00:15:23 UTC
Permalink
Post by w***@yahoo.ca
$ rpmbuild -bb ./test.spec
error: File /home/powah/rpmbuild/SOURCES/test-2.3.0.tar.gz: No such
file or directory
%define sourced_version %(cat ../../../distribution/VERSION)
Release: %(cat ../../../distribution/RELEASE)
These two are clearly broken. If your spec file requires execution from
a specific directory then it is broken by a definition. If you need
some specific defines of that sort then put them into your own
~/.rpmmacros or pass them as defines; possibly in a wrapper script.
Like that

rpmbuild --define="myrel <whatever fixed or shell produced string here>" .....

and in that spec file

Release: %{myrel}

BTW - why you are using '-bb'? You already have source rpm? On
http://www.jpackage.org/ you can find various "nosrc.rpm" files. Have a
look how they are constructed and what is in specs. Apparently you are
trying to acomplish something of that sort.
Post by w***@yahoo.ca
# Override target directory for binary rpms
%define _rpmdir ../../../distribution/packages/linux
What for? Even if does work then it does not affect a location of your
sources and an error you qoute was about that. Obviously you have
%_topdir and/or %_sourcedir defined somewhere. Just make your own
definition of %_topdir in ~/.rpmmacros and copy there a tree of
directories from /usr/src/redhat/ (or whatever your original %_topdir
happened to be). That is about it. Do not try to override
anything else unless you really know what you are doing.
Post by w***@yahoo.ca
%define _prefix /usr/local
Hm ...
Post by w***@yahoo.ca
%define RPM_BUILD_DIR /usr/src/redhat/BUILD/%{name}-%{version}
This is really broken. If you have to be root to use your spec file
then it is hard for a more serious deficiency. Besides that is totally
unnecessary.

Michal

Loading...