Adrián Márques wrote:
Hi there,
I'm an absolute newbie trying to package an application with RPM for the
first time and would like to mark some files as config files.
The top directory of this aplication has several files and directories,
only two of which hold config files. Thus, I'm doing something like this
in my spec file:
%files
/usr/local/myAppTopDir/
Just a question - any reason in particular why you are using /usr/local
instead of /opt ?
/usr/local is suppose to be for applications compiled from source on the
machine, /opt is for third party vendor packages (be they rpm or tarball
or whatever)
%config /usr/local/myAppTopDir/configDir1/*
%config /usr/local/myAppTopDir/configDir2/*
Obviously, this generates several 'file listed twice' warnings. However,
I queried the generated rpm and didn't find anything wrong with it. All
config files where included and correctly marked as config files.
So my questions are: can I safely ignore these warnings or listing files
twice like I have causes a problem I'm not seeing now? is there a better
way to do what I want?
I usually do something like this -
echo "%%defattr(-,root,root,-)" > custom.list
for dir in `find $RPM_BUILD_ROOT/usr/local -type d`; do
fixed="`echo ${dir} |sed s?"$RPM_BUILD_ROOT"?""?`"
if [ `echo $fixed |grep -c "configDir"` -eq 0 ]; then
echo "%%dir $fixed" >> custom.list
fi
done
for file in `find RPM_BUILD_ROOT/usr/local -type f`; do
etc.
then
%files -f custome.list
%defattr(-,root,root.-)
%config /usr/local/myAppTopDir/configDir1/*
%config /usr/local/myAppTopDir/configDir2/*
If the config files are something the sysadmin is to edit, it's
generally a good idea to do
%config(noreplace) instead of just %config
I have been looking through the list archives so I know many of you
would advice me to explicitly list all files. I know this would take
care of this particular problem, but I don't want to do that unless I
really have to, since I find globbing significantly more practical in
this case.
I thank you already for taking the time to read this.
Regards.
Adrián.
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list