rpm打包咱們常常會遇到,經過直接拷貝的方式達來打包的狀況。可是發現打包的時候並非想象中的那麼順利,好比你會遇到這種狀況:mysql
一般趕上上面的警告以後,你仍是能打包完成的。可是你會發現打包完成的rpm包很不正常的,不管從大小和安裝方面都不行。holy shit!,我只是簡單的拷貝啊。咱們的rpmbuild代碼也很簡單:sql
# 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
爲這個問題我夜裏睡不着,吃飯也不香。此問題不解決,遲早有一天也會再次困擾我。終於仍是找到了。shell
AutoReqProv: no
是的,就是這個參數。bash
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.