找不到构建RPM的文件错误

时间:2017-06-26 19:50:20

标签: python-2.7 centos6 rpmbuild rpm-spec

我最近继承了一个运行良好的构建服务器,直到上周,现在我得到了一些"文件未找到"错误。我正在使用" rpmbuilder"作为我的非root用户。当我运行构建命令时,我收到以下错误:

$ rpmbuild -bb -v rpmbuild/SPECS/mist.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.fUrkkG
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.edkQrN
Processing files: mist-2.0.2-1.x86_64
error: File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist
error: File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist/database/config.pyc
error: File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist/database/mist_db.sql
error: File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist/database/.password_complexity.conf


RPM build errors:
    File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist
    File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist/database/config.pyc
    File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist/database/mist_db.sql
    File not found: /home/rpmbuilder/rpmbuild/BUILDROOT/mist-2.0.2-1.x86_64/opt/mist/database/.password_complexity.conf

我过去常常在%prep下获得大量输出,但现在什么都没有。我尝试使用%setup而不使用-q并仍然获得相同的输出。

据我所知,我的源文件仍然应该是:

[rpmbuilder@coams-db SOURCES]$ pwd
/home/rpmbuilder/rpmbuild/SOURCES
[rpmbuilder@coams-db SOURCES]$ ls -la
total 66124
drwxr-xr-x. 3 rpmbuilder rpmbuilder     4096 Jun 23 10:08 .
drwxr-xr-x. 8 rpmbuilder rpmbuilder     4096 Feb 25  2016 ..
drwxrwxr-x. 8 rpmbuilder rpmbuilder     4096 Jun 23 10:08 mist-2.0.2
-rw-rw-r--. 1 rpmbuilder rpmbuilder 67681925 Jun 23 10:09 mist-2.0.2.tar.gz

以前有人见过这个问题吗?有什么挑剔的东西我不知道要检查吗?就像我说的,我不记得改变任何东西,但谁知道......

我的spec文件如下:

Name:   mist
Version: 2.0.2
Release: 1
Summary: <snip>

Group:  <snip>
License: GPL
URL: http://<snip>
Source0: mist-2.0.2.tar.gz
BuildArch: x86_64
BuildRoot: /home/rpmbuilder/rpmbuild/%{name}-%{version}

Requires(pre): shadow-utils

Requires: python, mysql-server, python-sqlalchemy, MySQL-python, python-requests, python-lxml, pytz, python-jsonschema

%description
Installs the MIST application.

%pre
if [ $1 = 1 ]; then
    getent group mist > /dev/null || groupadd -r mist
    getent passwd mist > /dev/null || useradd -r -g mist -d /opt/mist -c "MIST Console User" mist -p '<snip>'

   # echo "Starting Cron Setup........."

    #echo "Create temp file to hold cron currnet data"
    #%define tempFile `mktemp`

    #store temp file name
    #TEMP_FILE_NAME=%{tempFile}

    #echo "Storing crontab current data in temp file %{tempFile}"
    #CRON_OUT_FILE=`crontab -l > $TEMP_FILE_NAME`

    #echo "Add required cron detalis in cron temp file"
    #ADD_TO_CRON=`echo "#Schedule the following cron job to <snip>:" >> $TEMP_FILE_NAME`
    #Replace the http://servername.com/file.php with file path or link
    #ADD_TO_CRON=`echo "*/30 * * * * python /opt/mist/assets/pull_assets.py > /dev/null 2>&1" >> $TEMP_FILE_NAME`

    #echo "Storing temp cron to the crontab"
    #ADD_TEMP_TO_CRON=`crontab $TEMP_FILE_NAME`

    #echo "Remove %{tempFile} temp file"
    #rm -r -f $TEMP_FILE_NAME

    #get current crontab list for email
    #%define cornDataNow `crontab -l`

    #exit 0
fi

if [ $1 = 2 ]; then
    /sbin/service mist stop
    #cp -r /opt/mist/frontend/server/conf /opt
    #rm -rf /opt/mist/frontend/server/work
fi

%preun
if [ $1 = 0 ]; then
    /sbin/service mist stop
fi

%prep
%setup -q

%install
# rm -rf "$RPM_BUILD_ROOT"
echo $RPM_BUILD_ROOT
mkdir -p "$RPM_BUILD_ROOT/opt/mist"
cp -R . "$RPM_BUILD_ROOT/opt/mist"
mkdir -p "$RPM_BUILD_ROOT/var/log/MIST"
exit 0

%files
%attr(750,mist,mist) /opt/mist
%attr(400,mist,mist) /opt/mist/database/config.pyc
%attr(640,mist,mist) /opt/mist/database/mist_db.sql
%attr(640,mist,mist) /opt/mist/database/.password_complexity.conf
#/opt/mist
%doc

%post
if [ $1 = 1 ]; then 
    mv /opt/mist/mist_base/mist /etc/init.d
    chmod 755 /etc/init.d/mist
    chkconfig mist on --level 345
    mv /opt/mist/database/my.cnf /etc
    /usr/sbin/usermod -a -G mist mysql
    /usr/sbin/setsebool allow_user_mysql_connect 1
    /bin/mkdir -p /var/log/MIST/frontend
    chown -R root.mist /var/log/MIST
    chmod -R 775 /var/log/MIST
fi

if [ $1 = 2 ]; then
    #cp -r /opt/conf /opt/mist/frontend/server
    #rm -r /opt/conf
    #rm /opt/mist/frontend/mist
    if [ -d /opt/mist/frontend ]; then
        rm -rf /opt/mist/frontend
    fi
    mv /opt/mist/mist_base/mist /etc/init.d
    rm /opt/mist/database/my.cnf
    /sbin/service mist start
fi

mv /opt/mist/mist_logging.py /usr/lib/python2.6/site-packages
chmod 644 /usr/lib/python2.6/site-packages/mist_logging.py

%postun
if [ $1 = 0 ]; then
    /bin/rm -r /opt/mist
    chkconfig --del mist
    /bin/rm /etc/init.d/mist
    /bin/rm /etc/my.cnf
    /bin/rm /usr/lib/python2.6/site-packages/mist_logging.py
    /bin/rm -r /var/log/MIST
    /usr/sbin/userdel --force mist 2> /dev/null; true
    /usr/sbin/groupdel mist
    /sbin/service mysqld stop
    /bin/rm -r /var/lib/mysql
    /bin/sed -i '/mistDB/d' /etc/hosts
    #/usr/bin/crontab -l | grep -v "#Schedule the following cron job to <snip>:" | /usr/bin/crontab -
    #/usr/bin/crontab -l | grep -v "python /opt/mist/assets/pull_assets.py" | /usr/bin/crontab -
fi

%changelog

0 个答案:

没有答案