📄 notes
字号:
Here's a useful usenet article that shows how to build a filelistinstead of having to specify each one. -----------------------------------------------------------------From: John Ross Hunt (bigboote@mediaone.net)Subject: RE: Newbie to build spec files Newsgroups: linux.redhat.rpmDate: 2000/07/27 > So, is there a better way, in RPM 3, to populate %files?> Because I know> 'buildroot' and it has nothing to do with %files.I found this bit of code in a .spec file to build a %files list on the flyand have been using it ever since. I've always thought RPM should be ableto provide a default %files list in the event one isn't present in the .specfile.--John Ross Huntbigboote@mediaone.net <mailto:bigboote@mediaone.net>%define pkg_name foo%installrm -rf $RPM_BUILD_ROOTmake install DESTDIR=$RPM_BUILD_ROOTcd $RPM_BUILD_ROOTfind . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > \ $RPM_BUILD_DIR/file.list.%{pkg_name}find . -type f | sed -e 's,^\.,\%attr(-\,root\,root) ,' \ -e '/\/etc\//s|^|%config|' >> \ $RPM_BUILD_DIR/file.list.%{pkg_name}find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> \ $RPM_BUILD_DIR/file.list.%{pkg_name}%cleanrm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/file.list.%{pkg_name}%files -f ../file.list.%{pkg_name}%doc README TODO example-----------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -