rpm - Why is rpmbuild shown in the macros twice -
i writing simple spec file install text file (a .repo file actually). here spec file
name: dm_rpm_repos version: 1.0 release: 0 summary: custom repository file group: system environment/base license: gpl url: http://internal source0: dm_rpm_repos-1.0.tar.gz buildarch: noarch buildroot: %{_tmppath}/%{name}-buildroot %description internal use repository internal rpms %prep tar -zxvf %{_sourcedir}/dm_rpm_repos-1.0.tar.gz %install mkdir -p %{buildroot} cp -r * %{buildroot} %clean rm -rf "$rpm_build_root" %files %defattr(-,root,root,-) /etc/yum.repos.d/dm_rpm_repos.repo
using this handy command here expanded file contents
name: dm_rpm_repos version: 1.0 release: 0 summary: custom repository file group: system environment/base license: gpl url: http://internal source0: dm_rpm_repos-1.0.tar.gz buildarch: noarch buildroot: /var/tmp/dm_rpm_repos-buildroot %description internal use repository internal rpms %prep tar -zxvf /home/rpmbuild/rpmbuild/sources/dm_rpm_repos-1.0.tar.gz %install mkdir -p /home/rpmbuild/rpmbuild/buildroot/dm_rpm_repos-1.0-0.x86_64 cp -r * /home/rpmbuild/rpmbuild/buildroot/dm_rpm_repos-1.0-0.x86_64 %clean rm -rf "$rpm_build_root" %files %defattr(-,root,root,-) /etc/yum.repos.d/dm_rpm_repos.repo
why directory rpmbuild
showing twice? should not be. directly ~/rpmbuild/...
. .tar.gz
file it's looking in ~/rpmbuild/sources/
. made user's rpm environment using rpmdev-setuptree
. originally, section %prep
used macro %setup -p
. in case it's important, contents of user's .rpmmacros
file
%_topdir %(echo $home)/rpmbuild %_smp_mflags %( \ [ -z "$rpm_build_ncpus" ] \\\ && rpm_build_ncpus="`/usr/bin/nproc 2>/dev/null || \\\ /usr/bin/getconf _nprocessors_onln`"; \\\ if [ "$rpm_build_ncpus" -gt 16 ]; \\\ echo "-j16"; \\\ elif [ "$rpm_build_ncpus" -gt 3 ]; \\\ echo "-j$rpm_build_ncpus"; \\\ else \\\ echo "-j3"; \\\ fi ) %__arch_install_post \ [ "%{buildarch}" = "noarch" ] || qa_check_rpaths=1 ; \ case "${qa_check_rpaths:-}" in [1yy]*) /usr/lib/rpm/check-rpaths ;; esac \ /usr/lib/rpm/check-buildroot
Comments
Post a Comment