- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
在过去的 6 个月里,我一直在努力弄清楚如何构建一个 rpm,但我仍在努力理解我在构建过程中遗漏了什么。我的目标是让我的 rpm 安装一个 tar.gz 文件。
这是我的 .rpmmacros 文件
%_topdir %(echo $HOME)/rpmbuild
%_smp_mflags -j3
%__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
%_tmppath %{_topdir}/tmp
这是我的规范文件
Summary: Appadm Monitoring
Name: AppadmQ
Version: 1
Release: 1
Source0: AppadmQ-1-1.tar.gz
License: GPL
Group:
BuildArch: noarch
BuildRoot: %{_builddir}/%{name}_%{version}.%{release}-root/
%description
%prep
%setup -n AppadmQ-1
%build
%install
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
mkdir $RPM_BUILD_ROOT
if [ -d $RPM_BUILD_ROOT ]; then
mkdir $RPM_BUILD_ROOT/tmp
cp -af AppadmQ-1-1.tar.gz $RPM_BUILD_ROOT/tmp
tar -xvzf $RPM_BUILD_ROOT/tmp/AppadmQ-1-1.tar.gz
else
echo "NO BUILD ROOT... nothing built."
exit 1
fi;
%clean
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%post
echo " "
echo "SUCCESS!"
%files
这是我尝试构建 rpm 时发生的情况
Executing(%prep): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.sC0xn6
+ umask 022
+ cd /root/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /root/rpmbuild/BUILD
+ rm -rf AppadmQ-1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/AppadmQ-1-1.tar.gz
+ /bin/tar -xvvf -
drwxr-xr-x appadm/appadm 0 2013-11-11 15:35 home/appadm/
-rw-r--r-- appadm/users 121 2011-10-11 03:25 home/appadm/.kshrc
drwxr-xr-x appadm/appadm 0 2013-07-17 18:07 home/appadm/orwell/
-r--r--r-- appadm/users 1837 2009-12-01 16:07 home/appadm/orwell/irco_orwell_20004.stub
-r--r--r-- appadm/users 1892 2010-10-22 15:07 home/appadm/orwell/irco_orwell_20052.stub
-r--r--r-- appadm/users 1841 2009-12-01 16:07 home/appadm/orwell/irco_orwell_20003.stub
-r--r--r-- appadm/users 1975 2010-11-04 22:52 home/appadm/orwell/irco_orwell_20053.stub
-rw-r--r-- appadm/users 996 2011-03-29 16:07 home/appadm/orwell/sys_orwell_00409.stub
-r--r--r-- appadm/users 3087 2011-12-30 14:06 home/appadm/orwell/irco_orwell_20032.stub
-rw-r--r-- appadm/users 1098 2011-06-02 12:52 home/appadm/orwell/sys_orwell_00413.stub
-rw-r--r-- appadm/users 994 2011-03-29 16:07 home/appadm/orwell/sys_orwell_00410.stub
-r--r--r-- appadm/users 1159 2013-07-17 18:07 home/appadm/orwell/irco_orwell_20037.stub
-rw-r--r-- appadm/users 994 2011-03-29 16:07 home/appadm/orwell/sys_orwell_00411.stub
-r--r--r-- appadm/users 1535 2009-12-01 16:07 home/appadm/orwell/irco_orwell_20002.stub
-r--r--r-- appadm/users 11 2013-07-02 18:31 home/appadm/lanetypeCksum_baseline
drwxrwxr-x appadm/appadm 0 2013-11-11 15:19 home/appadm/rat/
-rwxr-xr-x appadm/users 406 2008-08-24 21:00 home/appadm/j7.sh
-rw------- appadm/users 51 2013-01-30 17:24 home/appadm/.lesshst
-rw-r----- appadm/users 276 2011-10-11 03:25 home/appadm/.profile
-rwxr-xr-x appadm/users 53 2008-10-06 22:28 home/appadm/to2.sh
-rwxr-xr-x appadm/users 229 2008-11-03 17:27 home/appadm/ipl.sh
-rwxr-xr-x appadm/users 263 2008-10-16 16:26 home/appadm/longsql.sh
-rwxr-xr-x appadm/users 162 2008-10-06 21:51 home/appadm/to.sh
drwxr-xr-x appadm/appadm 0 2013-11-11 15:10 home/appadm/logs/
-rwxr-xr-x appadm/users 160 2012-01-21 13:55 home/appadm/j.sh
drwxr-xr-x appadm/appadm 0 2013-11-11 15:09 home/appadm/copient/
-rwxr-xr-x appadm/users 514 2013-10-30 18:45 home/appadm/copient/ops_coptidy.pl
-rw-r--r-- appadm/users 20 2011-12-22 09:50 home/appadm/copient/co_monitor2.txt
-rwxr-xr-x appadm/users 170 2005-09-28 10:53 home/appadm/copient/ops_chklog.sh
-rwxr-xr-x appadm/users 23290 2013-10-30 18:45 home/appadm/copient/ops_copiphourly.pl
-rwxr-xr-x appadm/users 610 2009-08-19 17:42 home/appadm/copient/ops_coptidy.sh
-rwxr-xr-x appadm/users 65 2013-11-11 15:08 home/appadm/copient/copient_phpver.php
-rwxr-xr-x appadm/users 538 2008-12-10 17:00 home/appadm/copient/ops_appadm.exp
-rwxr-xr-x appadm/users 866 2010-01-21 14:17 home/appadm/copient/copIP.sh
-rwxr-xr-x appadm/users 706 2010-06-04 17:18 home/appadm/copient/ops_coproid.sh
-rwxr-xr-x appadm/users 6413 2013-10-30 18:45 home/appadm/copient/ops_copdiscount.pl
-rwxr-xr-x appadm/users 642 2009-06-09 11:09 home/appadm/copient/ops_copiphourly.sh
-rwxr-xr-x appadm/users 293 2008-11-18 17:16 home/appadm/copient/ops_cksum.sh
-rwxr-xr-- appadm/users 688 2012-08-19 19:12 home/appadm/copient/dbCurebkup.sh
-rwxr-xr-x appadm/users 21993 2013-10-30 18:45 home/appadm/copient/ops_copresponse.pl
-rwxr-xr-x appadm/users 259 2006-01-09 19:58 home/appadm/copient/ops_appadm_survey.sh
-rwxr-xr-x appadm/users 3553 2013-10-30 18:45 home/appadm/copient/ops_copcard.pl
-rwxr-xr-x appadm/users 704 2010-02-12 09:46 home/appadm/copient/ops_copresponse.sh
-rwxr-xr-x appadm/users 670 2011-04-17 23:19 home/appadm/copient/ops_corpBrand.sh
-rwxr--r-- appadm/users 111 2013-06-11 21:59 home/appadm/copient/c96766_EOC_fix.sh
-rwxr--r-- appadm/users 73 2013-06-18 18:14 home/appadm/copient/IncentiveFetch_fix.sh
-rwxr-xr-x appadm/users 2486 2012-10-08 14:21 home/appadm/copient/cop_cksum.sh
-rwxr-xr-x appadm/users 681 2010-08-13 14:35 home/appadm/copient/cop_incentiveFetch.sh
-rwxr-xr-x appadm/users 13119 2012-10-08 14:21 home/appadm/copient/cksumList
-rwxr-xr-x appadm/users 2571 2012-02-21 16:13 home/appadm/copient/toastClipStore.pl
-rwxr-xr-x appadm/users 357 2008-11-12 14:36 home/appadm/copient/ops_conf1.sh
-rwxr-xr-x appadm/users 3865 2013-10-30 18:45 home/appadm/copient/ops_cop_avg_roids_per_cust.pl
-rwxr-xr-x appadm/users 109 2006-04-17 11:40 home/appadm/copient/copient_ver.php
-rwxr-xr-x appadm/users 323 2008-11-11 16:28 home/appadm/copient/ops_pgsql_cksum.sh
-rwxr-xr-x appadm/users 39326 2013-10-30 18:45 home/appadm/copient/ops_corpBrands.pl
-rwxr-xr-x appadm/users 647 2010-08-19 16:18 home/appadm/copient/ops_copcard.sh
-rwxr-xr-x appadm/users 663 2005-05-31 15:53 home/appadm/copient/ops_copient.exp
-rwxr-x--- appadm/users 691 2006-03-24 12:40 home/appadm/copient/terminals.pl
-rwxr-xr-x appadm/users 6847 2013-08-23 15:42 home/appadm/copient/co_monitor2.sh
-rw-r--r-- appadm/users 1310 2008-09-21 13:45 home/appadm/tidy.pl
drwx------ appadm/appadm 0 2013-11-11 15:19 home/appadm/.ssh/
drwxr----- appadm/appadm 0 2012-04-30 14:42 home/appadm/.pki/
drwxr----- appadm/appadm 0 2012-04-30 14:42 home/appadm/.pki/nssdb/
-rw------- appadm/users 9703 2013-10-21 14:29 home/appadm/.viminfo
-rwxr-xr-x appadm/users 1955 2008-10-06 21:51 home/appadm/to.pl
-rw------- appadm/users 30 2012-10-19 17:16 home/appadm/.php_history
drwxr-xr-x appadm/appadm 0 2013-11-11 15:05 home/appadm/bin/
-rwxr-xr-x appadm/users 172 2007-07-16 18:30 home/appadm/bin/ops_chklog.sh
-rwxr-xr-x appadm/users 190 2013-10-30 18:45 home/appadm/bin/ops_copPhonehome.sh
-rwxr-xr-x appadm/users 229 2013-10-30 18:45 home/appadm/bin/ops_Q_coproid.sh
-rwxr-xr-x appadm/users 362 2013-10-30 18:45 home/appadm/bin/ops_Q_copOld_customer_data.sh
-rwxr-xr-x appadm/users 292 2011-07-26 09:14 home/appadm/bin/ops_appadm.exp
-rwxr-xr-x appadm/users 167 2013-10-30 18:45 home/appadm/bin/ops_copSanity.sh
-rwxr-xr-x appadm/users 4483 2013-10-30 18:45 home/appadm/bin/qtySCO.pl
-rwxr-xr-x appadm/users 607 2013-10-30 18:45 home/appadm/bin/ops_Q_copLook_for_coupon_time_outs.sh
-rwxr-xr-x appadm/users 426 2011-08-12 18:20 home/appadm/bin/ops_appadm_ssh.exp
-rwxr-xr-x appadm/users 261 2007-07-16 18:30 home/appadm/bin/ops_appadm_survey.sh
-rwxr-xr-x appadm/users 215 2013-10-30 18:45 home/appadm/bin/ops_Q_copBrand.sh
-rwxr-xr-x appadm/users 1811 2013-10-30 18:45 home/appadm/bin/ops_copCksum.sh
-rwxr-xr-x appadm/users 237 2013-10-30 18:45 home/appadm/bin/ops_Q_coptidy.sh
-rwxr-xr-x appadm/users 39646 2013-10-30 18:45 home/appadm/bin/ops_Q.sh
-rwxr-xr-x appadm/users 1238 2007-12-20 09:27 home/appadm/bin/ops_remote.pl
-rwxr-xr-x appadm/users 222 2013-10-30 18:45 home/appadm/bin/ops_Q_copresponse.sh
-rwxr-xr-x appadm/users 1297 2012-02-17 18:44 home/appadm/bin/cop_daily_IPL_time.sh
-rwxr-xr-x appadm/users 602 2011-07-27 18:09 home/appadm/bin/ops_appadm_scp.exp
-rwxr-xr-x appadm/users 206 2013-10-30 18:45 home/appadm/bin/ops_Q_copcard.sh
-rwxr-xr-x appadm/users 665 2007-07-16 18:30 home/appadm/bin/ops_copient.exp
-rwxr-xr-x appadm/users 694 2007-07-16 18:30 home/appadm/bin/terminals.pl
-rwxr-xr-x appadm/users 2736 2007-07-16 18:30 home/appadm/bin/co_monitor2.sh
-rwxr-xr-x appadm/users 6305 2006-06-02 14:21 home/appadm/bin/ccp
-rwxr-xr-x appadm/users 217 2013-10-30 18:45 home/appadm/bin/ops_Q_copiphourly.sh
-rwxr-xr-x appadm/users 501 2012-06-06 15:25 home/appadm/bin/ops_appadm_bb.exp
-rwxr-xr-x appadm/users 785 2009-01-16 15:53 home/appadm/ops_emer.sh
-rw-r----- appadm/users 281 2011-10-11 03:25 home/appadm/.bashrc
-rw-r--r-- appadm/users 2535 2008-10-06 22:28 home/appadm/to2.pl
-rw-r--r-- appadm/users 176 2011-10-11 03:25 home/appadm/.bash_profile
-rw-r--r-- appadm/users 3205 2012-02-01 11:25 home/appadm/ipsort.pl
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd AppadmQ-1
/root/rpmbuild/tmp/rpm-tmp.sC0xn6: line 38: cd: AppadmQ-1: No such file or directory
error: Bad exit status from /root/rpmbuild/tmp/rpm-tmp.sC0xn6 (%prep)
RPM build errors:
Bad exit status from /root/rpmbuild/tmp/rpm-tmp.sC0xn6 (%prep)
这是tmp文件的内容
#!/bin/sh
RPM_SOURCE_DIR="/root/rpmbuild/SOURCES"
RPM_BUILD_DIR="/root/rpmbuild/BUILD"
RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic"
RPM_ARCH="x86_64"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="AppadmQ"
RPM_PACKAGE_VERSION="1"
RPM_PACKAGE_RELEASE="1"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64"
export RPM_BUILD_ROOT
PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH
set -x
umask 022
cd "/root/rpmbuild/BUILD"
LANG=C
export LANG
unset DISPLAY
cd '/root/rpmbuild/BUILD'
rm -rf 'AppadmQ-1'
/usr/bin/gzip -dc '/root/rpmbuild/SOURCES/AppadmQ-1-1.tar.gz' | /bin/tar -xvvf -
STATUS=$?
if [ $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'AppadmQ-1'
命令失败,因为它无法进入 AppadmQ-1。当我压缩我想要安装的目录时,我是否需要手动构建我感到困惑。我认为它是根据规范文件中的名称、版本和发行版构建的。我在另一个线程上读到您需要在设置中创建它。我试过了,但还是失败了。我的 tar.gz 文件源是根据/home/appadm 目录的所有内容创建的。当我安装 rpm 时,我希望该 rpm 解压缩该源代码并将其覆盖到我的目标服务器/home/appadm 目录中,以便我可以维护该目录中所有文件和文件夹的版本控制。任何帮助是极大的赞赏。如果这个问题已经在另一个线程中得到回答,非常感谢重定向到该线程,或者甚至我可以阅读一本书以更好地理解这一切是如何工作的,这将有很大的帮助。
#@glglgl 感谢您的反馈,我真的很感激。我在下面做了您建议的更改。我修改了我的规范文件,所以该行现在显示为
%setup -c -n AppadmQ-1
这是我运行命令后的输出
Executing(%prep): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.Hl0evU
+ umask 022
+ cd /root/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /root/rpmbuild/BUILD
+ rm -rf AppadmQ-1
+ /bin/mkdir -p AppadmQ-1
+ cd AppadmQ-1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/AppadmQ-1-1.tar.gz
+ /bin/tar -xvvf -
drwxr-xr-x appadm/appadm 0 2013-11-11 15:35 home/appadm/
drwxr-xr-x Creating directory: home
-rw-r--r-- appadm/users 121 2011-10-11 03:25 home/appadm/.kshrc
drwxr-xr-x appadm/appadm 0 2013-07-17 18:07 home/appadm/orwell/
-r--r--r-- appadm/users 1837 2009-12-01 16:07 home/appadm/orwell/irco_orwell_20004.stub
-r--r--r-- appadm/users 1892 2010-10-22 15:07 home/appadm/orwell/irco_orwell_20052.stub
-r--r--r-- appadm/users 1841 2009-12-01 16:07 home/appadm/orwell/irco_orwell_20003.stub
-r--r--r-- appadm/users 1975 2010-11-04 22:52 home/appadm/orwell/irco_orwell_20053.stub
-rw-r--r-- appadm/users 996 2011-03-29 16:07 home/appadm/orwell/sys_orwell_00409.stub
-r--r--r-- appadm/users 3087 2011-12-30 14:06 home/appadm/orwell/irco_orwell_20032.stub
-rw-r--r-- appadm/users 1098 2011-06-02 12:52 home/appadm/orwell/sys_orwell_00413.stub
-rw-r--r-- appadm/users 994 2011-03-29 16:07 home/appadm/orwell/sys_orwell_00410.stub
-r--r--r-- appadm/users 1159 2013-07-17 18:07 home/appadm/orwell/irco_orwell_20037.stub
-rw-r--r-- appadm/users 994 2011-03-29 16:07 home/appadm/orwell/sys_orwell_00411.stub
-r--r--r-- appadm/users 1535 2009-12-01 16:07 home/appadm/orwell/irco_orwell_20002.stub
-r--r--r-- appadm/users 11 2013-07-02 18:31 home/appadm/lanetypeCksum_baseline
drwxrwxr-x appadm/appadm 0 2013-11-11 15:19 home/appadm/rat/
-rwxr-xr-x appadm/users 406 2008-08-24 21:00 home/appadm/j7.sh
-rw------- appadm/users 51 2013-01-30 17:24 home/appadm/.lesshst
-rw-r----- appadm/users 276 2011-10-11 03:25 home/appadm/.profile
-rwxr-xr-x appadm/users 53 2008-10-06 22:28 home/appadm/to2.sh
-rwxr-xr-x appadm/users 229 2008-11-03 17:27 home/appadm/ipl.sh
-rwxr-xr-x appadm/users 263 2008-10-16 16:26 home/appadm/longsql.sh
-rwxr-xr-x appadm/users 162 2008-10-06 21:51 home/appadm/to.sh
drwxr-xr-x appadm/appadm 0 2013-11-11 15:10 home/appadm/logs/
-rwxr-xr-x appadm/users 160 2012-01-21 13:55 home/appadm/j.sh
drwxr-xr-x appadm/appadm 0 2013-11-11 15:09 home/appadm/copient/
-rwxr-xr-x appadm/users 514 2013-10-30 18:45 home/appadm/copient/ops_coptidy.pl
-rw-r--r-- appadm/users 20 2011-12-22 09:50 home/appadm/copient/co_monitor2.txt
-rwxr-xr-x appadm/users 170 2005-09-28 10:53 home/appadm/copient/ops_chklog.sh
-rwxr-xr-x appadm/users 23290 2013-10-30 18:45 home/appadm/copient/ops_copiphourly.pl
-rwxr-xr-x appadm/users 610 2009-08-19 17:42 home/appadm/copient/ops_coptidy.sh
-rwxr-xr-x appadm/users 65 2013-11-11 15:08 home/appadm/copient/copient_phpver.php
-rwxr-xr-x appadm/users 538 2008-12-10 17:00 home/appadm/copient/ops_appadm.exp
-rwxr-xr-x appadm/users 866 2010-01-21 14:17 home/appadm/copient/copIP.sh
-rwxr-xr-x appadm/users 706 2010-06-04 17:18 home/appadm/copient/ops_coproid.sh
-rwxr-xr-x appadm/users 6413 2013-10-30 18:45 home/appadm/copient/ops_copdiscount.pl
-rwxr-xr-x appadm/users 642 2009-06-09 11:09 home/appadm/copient/ops_copiphourly.sh
-rwxr-xr-x appadm/users 293 2008-11-18 17:16 home/appadm/copient/ops_cksum.sh
-rwxr-xr-- appadm/users 688 2012-08-19 19:12 home/appadm/copient/dbCurebkup.sh
-rwxr-xr-x appadm/users 21993 2013-10-30 18:45 home/appadm/copient/ops_copresponse.pl
-rwxr-xr-x appadm/users 259 2006-01-09 19:58 home/appadm/copient/ops_appadm_survey.sh
-rwxr-xr-x appadm/users 3553 2013-10-30 18:45 home/appadm/copient/ops_copcard.pl
-rwxr-xr-x appadm/users 704 2010-02-12 09:46 home/appadm/copient/ops_copresponse.sh
-rwxr-xr-x appadm/users 670 2011-04-17 23:19 home/appadm/copient/ops_corpBrand.sh
-rwxr--r-- appadm/users 111 2013-06-11 21:59 home/appadm/copient/c96766_EOC_fix.sh
-rwxr--r-- appadm/users 73 2013-06-18 18:14 home/appadm/copient/IncentiveFetch_fix.sh
-rwxr-xr-x appadm/users 2486 2012-10-08 14:21 home/appadm/copient/cop_cksum.sh
-rwxr-xr-x appadm/users 681 2010-08-13 14:35 home/appadm/copient/cop_incentiveFetch.sh
-rwxr-xr-x appadm/users 13119 2012-10-08 14:21 home/appadm/copient/cksumList
-rwxr-xr-x appadm/users 2571 2012-02-21 16:13 home/appadm/copient/toastClipStore.pl
-rwxr-xr-x appadm/users 357 2008-11-12 14:36 home/appadm/copient/ops_conf1.sh
-rwxr-xr-x appadm/users 3865 2013-10-30 18:45 home/appadm/copient/ops_cop_avg_roids_per_cust.pl
-rwxr-xr-x appadm/users 109 2006-04-17 11:40 home/appadm/copient/copient_ver.php
-rwxr-xr-x appadm/users 323 2008-11-11 16:28 home/appadm/copient/ops_pgsql_cksum.sh
-rwxr-xr-x appadm/users 39326 2013-10-30 18:45 home/appadm/copient/ops_corpBrands.pl
-rwxr-xr-x appadm/users 647 2010-08-19 16:18 home/appadm/copient/ops_copcard.sh
-rwxr-xr-x appadm/users 663 2005-05-31 15:53 home/appadm/copient/ops_copient.exp
-rwxr-x--- appadm/users 691 2006-03-24 12:40 home/appadm/copient/terminals.pl
-rwxr-xr-x appadm/users 6847 2013-08-23 15:42 home/appadm/copient/co_monitor2.sh
-rw-r--r-- appadm/users 1310 2008-09-21 13:45 home/appadm/tidy.pl
drwx------ appadm/appadm 0 2013-11-11 15:19 home/appadm/.ssh/
drwxr----- appadm/appadm 0 2012-04-30 14:42 home/appadm/.pki/
drwxr----- appadm/appadm 0 2012-04-30 14:42 home/appadm/.pki/nssdb/
-rw------- appadm/users 9703 2013-10-21 14:29 home/appadm/.viminfo
-rwxr-xr-x appadm/users 1955 2008-10-06 21:51 home/appadm/to.pl
-rw------- appadm/users 30 2012-10-19 17:16 home/appadm/.php_history
drwxr-xr-x appadm/appadm 0 2013-11-11 15:05 home/appadm/bin/
-rwxr-xr-x appadm/users 172 2007-07-16 18:30 home/appadm/bin/ops_chklog.sh
-rwxr-xr-x appadm/users 190 2013-10-30 18:45 home/appadm/bin/ops_copPhonehome.sh
-rwxr-xr-x appadm/users 229 2013-10-30 18:45 home/appadm/bin/ops_Q_coproid.sh
-rwxr-xr-x appadm/users 362 2013-10-30 18:45 home/appadm/bin/ops_Q_copOld_customer_data.sh
-rwxr-xr-x appadm/users 292 2011-07-26 09:14 home/appadm/bin/ops_appadm.exp
-rwxr-xr-x appadm/users 167 2013-10-30 18:45 home/appadm/bin/ops_copSanity.sh
-rwxr-xr-x appadm/users 4483 2013-10-30 18:45 home/appadm/bin/qtySCO.pl
-rwxr-xr-x appadm/users 607 2013-10-30 18:45 home/appadm/bin/ops_Q_copLook_for_coupon_time_outs.sh
-rwxr-xr-x appadm/users 426 2011-08-12 18:20 home/appadm/bin/ops_appadm_ssh.exp
-rwxr-xr-x appadm/users 261 2007-07-16 18:30 home/appadm/bin/ops_appadm_survey.sh
-rwxr-xr-x appadm/users 215 2013-10-30 18:45 home/appadm/bin/ops_Q_copBrand.sh
-rwxr-xr-x appadm/users 1811 2013-10-30 18:45 home/appadm/bin/ops_copCksum.sh
-rwxr-xr-x appadm/users 237 2013-10-30 18:45 home/appadm/bin/ops_Q_coptidy.sh
-rwxr-xr-x appadm/users 39646 2013-10-30 18:45 home/appadm/bin/ops_Q.sh
-rwxr-xr-x appadm/users 1238 2007-12-20 09:27 home/appadm/bin/ops_remote.pl
-rwxr-xr-x appadm/users 222 2013-10-30 18:45 home/appadm/bin/ops_Q_copresponse.sh
-rwxr-xr-x appadm/users 1297 2012-02-17 18:44 home/appadm/bin/cop_daily_IPL_time.sh
-rwxr-xr-x appadm/users 602 2011-07-27 18:09 home/appadm/bin/ops_appadm_scp.exp
-rwxr-xr-x appadm/users 206 2013-10-30 18:45 home/appadm/bin/ops_Q_copcard.sh
-rwxr-xr-x appadm/users 665 2007-07-16 18:30 home/appadm/bin/ops_copient.exp
-rwxr-xr-x appadm/users 694 2007-07-16 18:30 home/appadm/bin/terminals.pl
-rwxr-xr-x appadm/users 2736 2007-07-16 18:30 home/appadm/bin/co_monitor2.sh
-rwxr-xr-x appadm/users 6305 2006-06-02 14:21 home/appadm/bin/ccp
-rwxr-xr-x appadm/users 217 2013-10-30 18:45 home/appadm/bin/ops_Q_copiphourly.sh
-rwxr-xr-x appadm/users 501 2012-06-06 15:25 home/appadm/bin/ops_appadm_bb.exp
-rwxr-xr-x appadm/users 785 2009-01-16 15:53 home/appadm/ops_emer.sh
-rw-r----- appadm/users 281 2011-10-11 03:25 home/appadm/.bashrc
-rw-r--r-- appadm/users 2535 2008-10-06 22:28 home/appadm/to2.pl
-rw-r--r-- appadm/users 176 2011-10-11 03:25 home/appadm/.bash_profile
-rw-r--r-- appadm/users 3205 2012-02-01 11:25 home/appadm/ipsort.pl
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.5UPBZD
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd AppadmQ-1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ exit 0
Executing(%install): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.7AYovn
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64
++ dirname /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64
+ cd AppadmQ-1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ '[' /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64
+ mkdir /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64
+ '[' -d /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64 ']'
+ mkdir /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64/tmp
+ cp -af AppadmQ-1-1.tar.gz /root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64/tmp
cp: cannot stat `AppadmQ-1-1.tar.gz': No such file or directory
error: Bad exit status from /root/rpmbuild/tmp/rpm-tmp.7AYovn (%install)
RPM build errors:
Bad exit status from /root/rpmbuild/tmp/rpm-tmp.7AYovn (%install)
我可以看到目录是在我的服务器上创建的
[root@ tmp]#pwd
/root/rpmbuild/BUILDROOT/AppadmQ-1-1.x86_64/tmp
[root@ tmp]#ls
源文件位于 SOURCES 目录中。我假设 rpmbuild 命令会将该文件从 SOURCES 目录复制到它的临时工作目录中。
[root@j299848 SOURCES]#ls -la Ap*
-rw-r----- 1 root root 51158 Nov 11 15:54 AppadmQ-1-1.tar.gz
我想令我困惑的是临时目录是如何在构建过程中创建和使用的,所以我有点迷失了弄清楚我的 tar.gz 应该去哪里以及我应该用宏在我的规范中命名什么.
最佳答案
The command is failing because it can't cd into AppadmQ-1.
没错。那是因为你指定了
%setup -n AppadmQ-1
告诉 %setup
script那,嗯,它应该是cd AppadmQ-1
.
如果您不想要,请不要告诉它这样做。
如果你想设置为 mkdir AppadmQ-1
在打开包装之前,做
%setup -c -n AppadmQ-1
你的目录树来自 .tar.gz
进入给定的子目录 - 这也将是您的工作目录。
因此,如您所见,.tar.gz
文件在 %prep
期间解压通过 %setup
登场脚本。
通常,这之后会进行一些构建过程,但似乎并非如此。
相反,现在跟随的是 %install
过程。它包括将所有应该在目标系统上的文件放入构建根目录。
这可以用 cp
来完成命令。但是,当然不是 .tar.gz
文件,但解压后的目录树:
cp -af . "$RPM_BUILD_ROOT" # I omit the tmp/ part because I think it is not the ight way to go.
现在你有一个结构 $RPM_BUILD_ROOT/home/...
这将被放入 /home/...
安装该 RPM 后。
请注意,您必须提及 %files
下的文件指令以便将它们包括在内。在这里,您有机会为文件提供一些用户、组甚至模式。
但请进一步注意,在 /home/...
下安装文件肯定不是要走的路。
通常,将具有完全自己的目录的包放在/opt/myapp/
下,或在 /usr/
下分发, /var/
, /srv
或任何适合的地方。
并且,进一步建议:绝对不建议运行 rpmbuild
作为根。这是整个要点的一部分:您准备好文件,并将它们打包在一起。只有安装过程.rpm
文件需要 root 权限。
关于linux - rpmbuild 无法更改为目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19941257/
是否可以将参数传递给 rpmbuild 以填充在规范文件中调用的用户定义变量? 例子: 在 .spec 文件(但为空)中调用的用户定义变量 %{foobar} 应填充执行 rpmbuild 命令时传递
我正在从单一来源构建一系列 rpm,并且只想构建子包;即我不想创建一个空的主包,只想创建子包。 我该怎么做呢?它是 rpmbuild 开关还是我放入规范文件的东西? 谢谢 最佳答案 通常,您通过没有
我正在尝试构建我的第一个 RPM,但出现错误。我的 .rpmmarcos 文件如下所示: %packager Your Name %_topdir /home/snort/test %_tmppa
我正在尝试从 source-1.4.3-linux.tgz(已下载,因此我无法控制名称)构建 rpm,并将文件解压到目录 source-1.4.3-linux 中。在我的 source.spec 文件
我正在尝试制定 RPM 的构建流程。 当我生成源 RPM 时,它在文件名中包含 %{dist}。我希望它只对二进制 RPM 执行此操作,因为源 RPM 不是特定于发行版的。 dist 宏在 /etc/
我正在尝试创建一个仅更新系统上文件的包,但运行 rpmbuild 时不断出现错误。该错误表明文件丢失。 我已在 CentOS 5 和 6 上尝试过此操作,结果相同。 我使用rpmdev-setuptr
寻找某人在仅放置文件时澄清 %install 宏。我创建了一个没有错误的 RPM,它应该只是从 buildroot 中获取文件并将它们 cp 到/usr/lib。我在 %install 的 SPEC
我正在尝试构建一个 RPM(rpmbuild -bb 规范文件)。安装 rpm 时,一些可执行的 tcl 文件已损坏,并且所有文件的大小都相同。 最佳答案 在规范文件中声明“%global __os_
我想构建 RPM 文件,我希望它们被普遍使用,并且不依赖于安装的发行版。现在我发现了一个在 RHEL 和 SLES 上名称不同的需求。我发现这是可能的解决方案: %if 0%{?suse_versio
我在构建日志中收到以下信息: Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.CgE2Qn + umask 022 + cd /export/home/s
rpmbuild 可以通过查找包中包含的二进制文件所需的共享库来自动检测依赖关系,虽然这几乎每次都是一个很好的想法,但有时它是不可取的,但仅限于某些特定的库。我指的是某些二进制文件需要的库不是通过 r
我是 rpm 打包的初学者,据我所知,由于 cpio 限制,rpm-build 存在文件大小>4GB 的问题。因此,我将包中的大文件与 gnu 拆分为 512MB 的文件 [这是作为 rpmbuild
我正在使用 rpmbuild在AWS Lambda其存储限制为 512MB,磁盘空间即将用完。 我想删除原始文件/ Assets 以释放文件 /tmp/rpm-tmp.XXXX 之后的空间已创建且在最
我在/opt/MyApp 中有一个应用程序,我需要使用 FPM 将其打包到 RPM 包中如下: fpm -e -s dir -t rpm --name 'MyApp' --version '1.0'
我正在尝试为我制作的应用程序构建 rpm。我已经编写了spec文件并制作了一个额外的bash脚本来自动将所有必需的文件复制到rpmbuild目录结构中,即{BUILD,BUILDROOT,RPMS,S
我只是在学习为一些从源代码编译的自定义构建的软件制作 rpm 包(一些遗留的东西需要这个,所以我正在努力学习,因为一些包不能使用最新版本),但是遇到错误(我在 Vagrant 中以 root 身份执行
在过去的 6 个月里,我一直在努力弄清楚如何构建一个 rpm,但我仍在努力理解我在构建过程中遗漏了什么。我的目标是让我的 rpm 安装一个 tar.gz 文件。 这是我的 .rpmmacros 文件
在我正在处理的项目中,我需要使用私钥从我的输出可执行文件 (elf) 之一生成签名(签名形成 rpm 中的文件之一,私钥永远不会执行此操作离开构建机器)。目前,这是在我的 makefile 中完成的,
rpmbuild 在哪个目录下生成RPM? 我检查了 RPMS 目录:- [root@tom adil]# ls /usr/src/redhat/ BUILD RPMS SOURCES SPEC
假设我为 myprog1 和 myprog2 构建的包要安装在/usr/lib/mysystem/myprog1/和/usr/lib/mysystem/myprog2/中 根据一些发行版的文档,例如
我是一名优秀的程序员,十分优秀!