PDA

View Full Version : Rpm building



ihavenoname
6th September 2006, 03:42 AM
Hello, I am trying to learn how to make an rpm package, I was reading one of the redhat how-tos and it stated that I had to list the packages in that would be installed, does this mean that I would have to manually look through the packages and list the files or is there some sort of script that lists them for me?

daneel971
6th September 2006, 07:36 AM
Sorry, not sure to understand your question - are you trying to write the %files section of your specfile and do you want to know how to find out which files are installed?

ihavenoname
7th September 2006, 05:31 AM
Sorry, not sure to understand your question - are you trying to write the %files section of your specfile and do you want to know how to find out which files are installed?
yes, that is the section and that is what I wanted to know. (See you did understand it! Give yourself credit! :D )

daneel971
7th September 2006, 05:48 AM
For simple rpms (no sub packages), I use a "trick" like this, after the %install section:

# Grab a list of all of the files that we just installed
cd %{buildroot}
find . -type d | sed '1,2d;s/^\.//' > $RPM_BUILD_DIR/file.list.%{name}

%clean
[ %{buildroot} != "/" ] && rm -rf %{buildroot}
rm -f $RPM_BUILD_DIR/file.list.%{name}

%files -f ../file.list.%{name}
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING INSTALL NEWS README TODO
For something more elegant, you have to specify manually the files, even using wildcards - anyway, the method above gives you the list, and that's the starting point.

Jman
10th September 2006, 12:37 AM
In most cases I prefer to manually specify them. That way I am aware of any file changes within the package. * wildcards are allowed. And Fedora Extras wants them macro-ized, so it ends up looking something like this:



%files
%defattr(-,root,root,-)
%{_bindir}/something
%{_datadir}/something/