rpm打包我们经常会遇到,通过直接拷贝的方式达来打包的情况。但是发现打包的时候并不是想象中的那么顺利,比如你会遇到这种情况:
通常遇上上面的警告之后,你还是能打包完成的。但是你会发现打包完成的rpm包很不正常的,无论从大小和安装方面都不行。holy shit!,我只是简单的拷贝啊。我们的rpmbuild代码也很简单:
# Disable the stupid stuff rpm distros include in the build process by default: # Disable any prep shell actions. replace them with simply ‘true‘ #%define __spec_prep_post true #%define __spec_prep_pre true # Disable any build shell actions. replace them with simply ‘true‘ #%define __spec_build_post true #%define __spec_build_pre true # Disable any install shell actions. replace them with simply ‘true‘ #%define __spec_install_post true #%define __spec_install_pre true # Disable any clean shell actions. replace them with simply ‘true‘ #%define __spec_clean_post true #%define __spec_clean_pre true # Disable checking for unpackaged files ? #%undefine __check_files # Use md5 file digest method #%define _binary_filedigest_algorithm 1 # Use gzip payload compression #%define _binary_payload w9.gzdio %preq # noop %setup -q %build # noop %install # noop %{__mkdir_p} %{buildroot}%{_usr}/local/resin1414 %{__mkdir_p} %{buildroot}/tmp/mysql %{__cp} -r %{_builddir}/%{name}-%{version}/* %{buildroot}/tmp/mysql/. #%{__cp} -r $RPM_BUILD_DIR/%{name}-%{version}/* %{buildroot}/tmp/. #%{__cp} -r /root/rpmbuild/BUILD/%{name}-%{version}/* %{buildroot}/tmp/mysql/. %clean # noop %files %defattr(-,root,root,-) # Reject config files already listed or parent directories, then prefix files # with "/", then make sure paths with spaces are quoted. I hate rpm so much. /tmp/mysql/ /usr/local/resin1414
为这个问题我夜里睡不着,吃饭也不香。此问题不解决,早晚有一天也会再次困扰我。终于还是找到了。
AutoReqProv: no
是的,就是这个参数。
The autoreqprov, autoreq, and autoprov Tags — Disable Automatic Dependency Processing There may be times when RPM‘s automatic dependency processing is not desired. In these cases, the autoreqprov, autoreq, and autoprov tags may be used to disable it. This tag takes a yes/no or 0/1 value. For example, to disable automatic dependency processing, the following line may be used: AutoReqProv: no The autoreq and autoprov tags can be used to disable automatic processing of requirementsor "provides" only, respectively.
时间: 2024-10-23 03:40:14