[Rpm-maint] Error during rpmbuild
Tom "spot" Callaway
tcallawa at redhat.com
Sat Nov 10 13:02:31 UTC 2007
On Fri, 2007-11-09 at 12:25 +0100, guillaume wrote:
> Hello,
>
> I've made a software to retrace network activies. I want to create RPM
> of my project in order to put all my files scripts in a same document.
> Moreover, rpm permit me to check requires dependances of my project.
>
> I've installed on my computer rpmbuild, then I've create directories
> for building my own rpm. After that, I've built specs file like that:
A few comments:
> %define name metronet
> %define version 0.6
> %define release rc22%{?dist}
You really, really don't need to do this. If you fill in the "Name:"
"Version:" and "Release:" fields with these same values, rpm will
automatically set %{name}, %{version}, and %{release} for you.
> Summary: A complete network monitoring solution
> Name: %{name}
> Version: %{version}
> Release: %{release}
> License: GPL
> Group: Utilities/System
> Packager: Guillaume BERNARD <bernardg at enseirb.fr>
> URL: http://www.cri.u-bordeaux2.fr/
> Source0: %{name}_SCRIPTS.tar.gz
> Source1: %{name}_WEB.tar.gz
>
> BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root-buildroot
> Requires: postgresql >= 8.0 postgresql-devel postgresql-contrib
> postgresql-libs perl >= 5.8 httpd >= 2.0 php >= 5 php-pgsql
>
> %description
> metronet is a complete solution which can monitor big network like
> University Bordeaux2.
>
> %prep
> # Pour decompresser egalement archive secondaire
> %setup -q -a 1 -n "metronet"
You almost certainly want a %build and %install section here, even if
they're empty.
Just put:
%build
# Nothing here.
%install
rm -rf $RPM_BUILD_ROOT
#si le makefile installe rien
mkdir -p $RPM_BUILD_ROOT/%{_bindir}/
Also, you're not copying any files into %{_bindir}. You need to actually
tell it to do this. Something like:
install -m0755 foo $RPM_BUILD_ROOT/%{_bindir}/
> %files
> %defattr(-,root,root,755)
> /*
> %defattr(-,root,root,755)
You only need one %defattr line, at the top of the files list.
Also, you really shouldn't use "/*", as that will cause your rpm to own
every directory in the $RPM_BUILD_ROOT (including /usr/bin), when you
only want to own the files you've copied (and the new directories that
your rpm creates).
Instead, use a %files like this:
%files
%defattr(-,root,root,755)
%{_bindir}/foo
>
> %post
> mkdir /opt/metronet/
> #cp /%{name}-%{version}/* /opt/test/
Also, please never ever do this. You should never create directories or
files in %post, because the rpm database won't know that these files
belong to this package, and will not remove them when the package is
removed. Do all your file copying during %install, from the sources
provided, not from system files.
Hope that helps,
~spot
More information about the Rpm-maint
mailing list