[AG-TECH] question about gpt RPM installation
Joseph
joseph at cs.usyd.edu.au
Tue May 18 19:51:00 CDT 2004
Hi Doug
> The %{buildroot} directory is just a temporary location during an
> rpmbuild for storing files which will end up in the final RPM.
>
> It's the %files step which indicates which files are included in the RPM
> and
> where they will be installed to.
Ok, but in this case how is it possible to know what will be installed
where ? Moreover, since I use the sources RPM of GPT, I think there should
be somewhere something which tells the system what to do to install the
software. It's not a "simple copy and paste".
> You might want to see the RPM-Howto to see which sections of a RPM SPEC
> file have an impact on the RPM building process and which have an impact
> on
> the final RPM when it is actually installed, see:
>
> http://www.rpm.org/RPM-HOWTO/
Thanks a lot for the link. I was working using quite the same
( http://www.fedora.redhat.com/participate/developers-guide/ch-rpm-building.html
) but I still don't understand exactly how the RPM knows what to do when
asked to install. Does RPM automatically copy everything from %{buildroot}
to the files in the %files part ?
For my first installation of AccessGrid I have just installed everything
in the directory told by %files but I would like to understand RPM better
to be sure the script I'm working on will work on every PC.
> I don't know much about Debian's alien, perhaps it was designed mostly
> for binary RPMs rather than SRC-RPMs?
In fact I use it just as a way to open the file.src.rpm and then get a
file.tgz and a file.spec.
Just to be clear, let's see an example (I hope you don't mind it...). The
lines concerning the installation in gpt.spc are :
%define name gpt
%define version 1.0
%define prefix /usr/lib/%{name}
%define buildroot /var/tmp/%{name}-%{version}
%prep
%setup
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}
%build
export GPT_LOCATION=%{buildroot}%{prefix}
./build_gpt
%files
%defattr(-,root,root)
/usr/lib/gpt
%post
cat <<EOF > /etc/profile.d/gpt.sh
#!/bin/sh
GPT_LOCATION=%{prefix}
export GPT_LOCATION
EOF
cat <<EOF > /etc/profile.d/gpt.csh
#!/bin/csh
setenv GPT_LOCATION %{prefix}
EOF
chmod 0755 /etc/profile.d/gpt.*
I see nothing which says or does install GPT in the prefix location... And
this is what I'm would like to understand !
I have read the how-to but I still don't understand... :$
Thanks a lot for your help !
Cheers,
Joseph
More information about the ag-tech
mailing list