关闭

DKMS and rpm package

959人阅读 评论(0) 收藏 举报
分类:

yum install gcc gcc-c++ rpm

yum install rpm* rpm-build rpmdev*


阶段 动作
%prep 将%_sourcedir目录下的源代码解压到%_builddir目录下。如果有补丁的需要在这个阶段进行打补丁的操作
%build 在%_builddir目录下执行源码包的编译。一般是执行./configure和make指令
%install 将需要打包到rpm软件包里的文件从%_builddir下拷贝%_buildrootdir目录下。当用户最终用rpm -ivh name-version.rpm安装软件包时,这些文件会安装到用户系统中相应的目录里
制作rpm包 这个阶段是自动完成的,所以在SPEC文件里面是看不到的,这个阶段会%_buildroot目录的相关文件制作成rpm软件包最终放到%_rpmdir目录里
%clean 编译后的清理工作,这里可以执行make clean以及清空%_buildroot目录等


#rpmdev-setuptree 


rpmdev-newspec -o libmad-0.15.1b.spec,会在当前目录下生成名为libmad-0.15.1b.spec的模板文件


[root@localhost SPECS]# vim  libmad-0.15.1b.spec 

Name:           libmad
Version:        0.15.1b
Release:        1%{?dist}
Summary:        This is a free Mp3 Codec

Group:          System Environment/Libraries
License:        GPL
URL:             http://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz
Source0:        %{name}-%{version}.tar.gz

#BuildRequires:  
#Requires:       

%description


%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%setup -q


%build
sed -i '/-fforce-mem/d' configure
%configure --enable-shared
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
#find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'


%clean
rm -rf $RPM_BUILD_ROOT


#%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc
#%{_libdir}/*.so.*
%{_libdir}/*
%{_includedir}/*


%files devel
%defattr(-,root,root,-)
%doc
%{_includedir}/*
%{_libdir}/*.so


%changelog




dell@localhost rpmbuild]$ rpmbuild  -bb SPECS/libmad-0.15.1b.spec 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ytaUIC
+ umask 022
+ cd /home/dell/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/dell/rpmbuild/BUILD
+ rm -rf libmad-0.15.1b
+ /usr/bin/gzip -dc /home/dell/rpmbuild/SOURCES/libmad-0.15.1b.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd libmad-0.15.1b
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.gGzaxW
+ umask 022
+ cd /home/dell/rpmbuild/BUILD
+ cd libmad-0.15.1b
+ LANG=C
+ export LANG
+ unset DISPLAY
+ sed -i /-fforce-mem/d configure
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking for x86_64-redhat-linux-gnu-gcc... no
checking for gcc... no
checking for x86_64-redhat-linux-gnu-cc... no
checking for cc... no
checking for cc... no
checking for x86_64-redhat-linux-gnu-cl... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
error: Bad exit status from /var/tmp/rpm-tmp.gGzaxW (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.gGzaxW (%build)
[dell@localhost rpmbuild]$ yum install gcc gcc-c++
Loaded plugins: fastestmirror
You need to be root to perform this command.
[dell@localhost rpmbuild]$ rpmbuild  -bb SPECS/libmad-0.15.1b.spec 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ASSfrK
+ umask 022
+ cd /home/dell/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/dell/rpmbuild/BUILD
+ rm -rf libmad-0.15.1b
+ /usr/bin/gzip -dc /home/dell/rpmbuild/SOURCES/libmad-0.15.1b.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd libmad-0.15.1b
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.cmO8Ug
+ umask 022
+ cd /home/dell/rpmbuild/BUILD
+ cd libmad-0.15.1b
+ LANG=C
+ export LANG
+ unset DISPLAY
+ sed -i /-fforce-mem/d configure
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking for x86_64-redhat-linux-gnu-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for x86_64-redhat-linux-gnu-g++... no
checking for x86_64-redhat-linux-gnu-c++... no
checking for x86_64-redhat-linux-gnu-gpp... no
checking for x86_64-redhat-linux-gnu-aCC... no
checking for x86_64-redhat-linux-gnu-CC... no
checking for x86_64-redhat-linux-gnu-cxx... no
checking for x86_64-redhat-linux-gnu-cc++... no
checking for x86_64-redhat-linux-gnu-cl... no
checking for x86_64-redhat-linux-gnu-FCC... no
checking for x86_64-redhat-linux-gnu-KCC... no
checking for x86_64-redhat-linux-gnu-RCC... no
checking for x86_64-redhat-linux-gnu-xlC_r... no
checking for x86_64-redhat-linux-gnu-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for x86_64-redhat-linux-gnu-g77... no
checking for x86_64-redhat-linux-gnu-f77... no
checking for x86_64-redhat-linux-gnu-xlf... no
checking for x86_64-redhat-linux-gnu-frt... no
checking for x86_64-redhat-linux-gnu-pgf77... no
checking for x86_64-redhat-linux-gnu-fort77... no
checking for x86_64-redhat-linux-gnu-fl32... no
checking for x86_64-redhat-linux-gnu-af77... no
checking for x86_64-redhat-linux-gnu-f90... no
checking for x86_64-redhat-linux-gnu-xlf90... no
checking for x86_64-redhat-linux-gnu-pgf90... no
checking for x86_64-redhat-linux-gnu-epcf90... no
checking for x86_64-redhat-linux-gnu-f95... no
checking for x86_64-redhat-linux-gnu-fort... no
checking for x86_64-redhat-linux-gnu-xlf95... no
checking for x86_64-redhat-linux-gnu-ifc... no
checking for x86_64-redhat-linux-gnu-efc... no
checking for x86_64-redhat-linux-gnu-pgf95... no
checking for x86_64-redhat-linux-gnu-lf95... no
checking for x86_64-redhat-linux-gnu-gfortran... no
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse nm output from gcc object... ok
checking for objdir... .libs
checking for x86_64-redhat-linux-gnu-ar... no
checking for ar... ar
checking for x86_64-redhat-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for x86_64-redhat-linux-gnu-strip... no
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for unistd.h... (cached) yes
checking for sys/types.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for pid_t... yes
checking for int... yes
checking size of int... 4
checking for long... yes
checking size of long... 8
checking for long long... yes
checking size of long long... 8
checking for waitpid... yes
checking for fcntl... yes
checking for pipe... yes
checking for fork... yes
checking whether to optimize for speed or for accuracy... default
checking for architecture-specific fixed-point math routines... DEFAULT
configure: WARNING: default fixed-point math will yield limited accuracy
checking for ISO/IEC interpretation... best accepted practices
checking whether to enable profiling... no
checking whether to enable debugging... default
checking whether to enable experimental code... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating msvc++/Makefile
config.status: creating libmad.list
config.status: creating config.h
config.status: executing depfiles commands
+ make -j3
(sed -e '1s|.*|/*|' -e '1b' -e '$s|.*| */|' -e '$b'  \
		-e 's/^.*/ *&/' ./COPYRIGHT; echo;  \
	echo "# ifdef __cplusplus";  \
	echo 'extern "C" {';  \
	echo "# endif"; echo;  \
	if [ ".-DFPM_DEFAULT" != "." ]; then  \
		echo ".-DFPM_DEFAULT" | sed -e 's|^\.-D|# define |'; echo;  \
	fi;  \
	sed -ne 's/^# *define  *\(HAVE_.*_ASM\).*/# define \1/p'  \
		config.h; echo;  \
	sed -ne 's/^# *define  *OPT_\(SPEED\|ACCURACY\).*/# define OPT_\1/p'  \
		config.h; echo;  \
	sed -ne 's/^# *define  *\(SIZEOF_.*\)/# define \1/p'  \
		config.h; echo;  \
	for header in version.h fixed.h bit.h timer.h stream.h frame.h synth.h decoder.h; do  \
		echo;  \
		sed -n -f ./mad.h.sed ./$header;  \
	done; echo;  \
	echo "# ifdef __cplusplus";  \
	echo '}';  \
	echo "# endif") >mad.h
make  all-recursive
make[1]: Entering directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
make[2]: Entering directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT version.lo -MD -MP -MF ".deps/version.Tpo" -c -o version.lo version.c; \
	then mv -f ".deps/version.Tpo" ".deps/version.Plo"; else rm -f ".deps/version.Tpo"; exit 1; fi
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT fixed.lo -MD -MP -MF ".deps/fixed.Tpo" -c -o fixed.lo fixed.c; \
	then mv -f ".deps/fixed.Tpo" ".deps/fixed.Plo"; else rm -f ".deps/fixed.Tpo"; exit 1; fi
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT bit.lo -MD -MP -MF ".deps/bit.Tpo" -c -o bit.lo bit.c; \
	then mv -f ".deps/bit.Tpo" ".deps/bit.Plo"; else rm -f ".deps/bit.Tpo"; exit 1; fi
mkdir .libs
mkdir .libs
mkdir .libs
mkdir: mkdir: cannot create directory `.libs'cannot create directory `.libs': File exists
: File exists
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT fixed.lo -MD -MP -MF .deps/fixed.Tpo -c fixed.c  -fPIC -DPIC -o .libs/fixed.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT bit.lo -MD -MP -MF .deps/bit.Tpo -c bit.c  -fPIC -DPIC -o .libs/bit.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT version.lo -MD -MP -MF .deps/version.Tpo -c version.c  -fPIC -DPIC -o .libs/version.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT version.lo -MD -MP -MF .deps/version.Tpo -c version.c -o version.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT fixed.lo -MD -MP -MF .deps/fixed.Tpo -c fixed.c -o fixed.o >/dev/null 2>&1
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT timer.lo -MD -MP -MF ".deps/timer.Tpo" -c -o timer.lo timer.c; \
	then mv -f ".deps/timer.Tpo" ".deps/timer.Plo"; else rm -f ".deps/timer.Tpo"; exit 1; fi
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT stream.lo -MD -MP -MF ".deps/stream.Tpo" -c -o stream.lo stream.c; \
	then mv -f ".deps/stream.Tpo" ".deps/stream.Plo"; else rm -f ".deps/stream.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT bit.lo -MD -MP -MF .deps/bit.Tpo -c bit.c -o bit.o >/dev/null 2>&1
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT frame.lo -MD -MP -MF ".deps/frame.Tpo" -c -o frame.lo frame.c; \
	then mv -f ".deps/frame.Tpo" ".deps/frame.Plo"; else rm -f ".deps/frame.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c timer.c  -fPIC -DPIC -o .libs/timer.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT stream.lo -MD -MP -MF .deps/stream.Tpo -c stream.c  -fPIC -DPIC -o .libs/stream.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT stream.lo -MD -MP -MF .deps/stream.Tpo -c stream.c -o stream.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT frame.lo -MD -MP -MF .deps/frame.Tpo -c frame.c  -fPIC -DPIC -o .libs/frame.o
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT synth.lo -MD -MP -MF ".deps/synth.Tpo" -c -o synth.lo synth.c; \
	then mv -f ".deps/synth.Tpo" ".deps/synth.Plo"; else rm -f ".deps/synth.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c timer.c -o timer.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT frame.lo -MD -MP -MF .deps/frame.Tpo -c frame.c -o frame.o >/dev/null 2>&1
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT decoder.lo -MD -MP -MF ".deps/decoder.Tpo" -c -o decoder.lo decoder.c; \
	then mv -f ".deps/decoder.Tpo" ".deps/decoder.Plo"; else rm -f ".deps/decoder.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT synth.lo -MD -MP -MF .deps/synth.Tpo -c synth.c  -fPIC -DPIC -o .libs/synth.o
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT layer12.lo -MD -MP -MF ".deps/layer12.Tpo" -c -o layer12.lo layer12.c; \
	then mv -f ".deps/layer12.Tpo" ".deps/layer12.Plo"; else rm -f ".deps/layer12.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT decoder.lo -MD -MP -MF .deps/decoder.Tpo -c decoder.c  -fPIC -DPIC -o .libs/decoder.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT layer12.lo -MD -MP -MF .deps/layer12.Tpo -c layer12.c  -fPIC -DPIC -o .libs/layer12.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT decoder.lo -MD -MP -MF .deps/decoder.Tpo -c decoder.c -o decoder.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT synth.lo -MD -MP -MF .deps/synth.Tpo -c synth.c -o synth.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT layer12.lo -MD -MP -MF .deps/layer12.Tpo -c layer12.c -o layer12.o >/dev/null 2>&1
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT layer3.lo -MD -MP -MF ".deps/layer3.Tpo" -c -o layer3.lo layer3.c; \
	then mv -f ".deps/layer3.Tpo" ".deps/layer3.Plo"; else rm -f ".deps/layer3.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT layer3.lo -MD -MP -MF .deps/layer3.Tpo -c layer3.c  -fPIC -DPIC -o .libs/layer3.o
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT huffman.lo -MD -MP -MF ".deps/huffman.Tpo" -c -o huffman.lo huffman.c; \
	then mv -f ".deps/huffman.Tpo" ".deps/huffman.Plo"; else rm -f ".deps/huffman.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT huffman.lo -MD -MP -MF .deps/huffman.Tpo -c huffman.c  -fPIC -DPIC -o .libs/huffman.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT huffman.lo -MD -MP -MF .deps/huffman.Tpo -c huffman.c -o huffman.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT layer3.lo -MD -MP -MF .deps/layer3.Tpo -c layer3.c -o layer3.o >/dev/null 2>&1
/bin/sh ./libtool --mode=link gcc  -Wall -pipe -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4  -m64 -mtune=generic -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2   -o libmad.la -rpath /usr/lib64 -version-info 2:1:2 version.lo fixed.lo bit.lo timer.lo stream.lo frame.lo synth.lo decoder.lo layer12.lo layer3.lo huffman.lo    
gcc -shared  .libs/version.o .libs/fixed.o .libs/bit.o .libs/timer.o .libs/stream.o .libs/frame.o .libs/synth.o .libs/decoder.o .libs/layer12.o .libs/layer3.o .libs/huffman.o   -m64 -mtune=generic -Wl,-soname -Wl,libmad.so.0 -o .libs/libmad.so.0.2.1
(cd .libs && rm -f libmad.so.0 && ln -s libmad.so.0.2.1 libmad.so.0)
(cd .libs && rm -f libmad.so && ln -s libmad.so.0.2.1 libmad.so)
ar cru .libs/libmad.a  version.o fixed.o bit.o timer.o stream.o frame.o synth.o decoder.o layer12.o layer3.o huffman.o
ranlib .libs/libmad.a
creating libmad.la
(cd .libs && rm -f libmad.la && ln -s ../libmad.la libmad.la)
make[2]: Leaving directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
make[1]: Leaving directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.8pkvnd
+ umask 022
+ cd /home/dell/rpmbuild/BUILD
+ '[' /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64 '!=' / ']'
+ rm -rf /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64
++ dirname /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64
+ mkdir -p /home/dell/rpmbuild/BUILDROOT
+ mkdir /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64
+ cd libmad-0.15.1b
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64
+ make install DESTDIR=/home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64
make  install-recursive
make[1]: Entering directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
make[2]: Entering directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
make[3]: Entering directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
mkdir -p -- . /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64
 /bin/sh ./libtool --mode=install /usr/bin/install -c  libmad.la /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64/libmad.la
/usr/bin/install -c .libs/libmad.so.0.2.1 /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64/libmad.so.0.2.1
(cd /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64 && rm -f libmad.so.0 && ln -s libmad.so.0.2.1 libmad.so.0)
(cd /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64 && rm -f libmad.so && ln -s libmad.so.0.2.1 libmad.so)
/usr/bin/install -c .libs/libmad.lai /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64/libmad.la
/usr/bin/install -c .libs/libmad.a /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64/libmad.a
ranlib /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64/libmad.a
chmod 644 /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64/libmad.a
libtool: install: warning: remember to run `libtool --finish /usr/lib64'
mkdir -p -- . /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/include
 /usr/bin/install -c -m 644 mad.h /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/include/mad.h
make[3]: Leaving directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
make[2]: Leaving directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
make[1]: Leaving directory `/home/dell/rpmbuild/BUILD/libmad-0.15.1b'
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id /home/dell/rpmbuild/BUILD/libmad-0.15.1b
extracting debug info from /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64/usr/lib64/libmad.so.0.2.1
symlinked /usr/lib/debug/usr/lib64/libmad.so.0.2.1.debug to /usr/lib/debug/usr/lib64/libmad.so.0.debug
symlinked /usr/lib/debug/usr/lib64/libmad.so.0.2.1.debug to /usr/lib/debug/usr/lib64/libmad.so.debug
516 blocks
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: libmad-0.15.1b-1.el6.x86_64
Provides: libmad.so.0()(64bit) libtool(/usr/lib64/libmad.la)
Requires(interp): /sbin/ldconfig
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(postun): /sbin/ldconfig
Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libmad.so.0()(64bit) rtld(GNU_HASH)
Processing files: libmad-devel-0.15.1b-1.el6.x86_64
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: libmad.so.0()(64bit)
Processing files: libmad-debuginfo-0.15.1b-1.el6.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64
Wrote: /home/dell/rpmbuild/RPMS/x86_64/libmad-0.15.1b-1.el6.x86_64.rpm
Wrote: /home/dell/rpmbuild/RPMS/x86_64/libmad-devel-0.15.1b-1.el6.x86_64.rpm
Wrote: /home/dell/rpmbuild/RPMS/x86_64/libmad-debuginfo-0.15.1b-1.el6.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.42uzjc
+ umask 022
+ cd /home/dell/rpmbuild/BUILD
+ cd libmad-0.15.1b
+ rm -rf /home/dell/rpmbuild/BUILDROOT/libmad-0.15.1b-1.el6.x86_64
+ exit 0
[dell@localhost rpmbuild]$ ls
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS
[dell@localhost rpmbuild]$ ls
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS
[dell@localhost rpmbuild]$ ls RPMS/
x86_64
[dell@localhost rpmbuild]$ ls RPMS/x86_64/
libmad-0.15.1b-1.el6.x86_64.rpm  libmad-debuginfo-0.15.1b-1.el6.x86_64.rpm  libmad-devel-0.15.1b-1.el6.x86_64.rpm



[dell@localhost rpmbuild]$ ls
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS
[dell@localhost rpmbuild]$ cd RPMS/x86_64/
[dell@localhost x86_64]$ ls
libmad-0.15.1b-1.el6.x86_64.rpm  libmad-debuginfo-0.15.1b-1.el6.x86_64.rpm  libmad-devel-0.15.1b-1.el6.x86_64.rpm
[dell@localhost x86_64]$ su
Password: 
[root@localhost x86_64]# rpm -ivh libmad-0.15.1b-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:libmad                 ########################################### [100%]
[root@localhost x86_64]# ls
libmad-0.15.1b-1.el6.x86_64.rpm  libmad-debuginfo-0.15.1b-1.el6.x86_64.rpm  libmad-devel-0.15.1b-1.el6.x86_64.rpm
[root@localhost x86_64]# rpm -ivh libmad-debuginfo-0.15.1b-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:libmad-debuginfo       ########################################### [100%]
[root@localhost x86_64]# ls
libmad-0.15.1b-1.el6.x86_64.rpm  libmad-debuginfo-0.15.1b-1.el6.x86_64.rpm  libmad-devel-0.15.1b-1.el6.x86_64.rpm
[root@localhost x86_64]# rpm -ivh libmad-devel-0.15.1b-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:libmad-devel           ########################################### [100%]
[root@localhost x86_64]# ls
libmad-0.15.1b-1.el6.x86_64.rpm  libmad-debuginfo-0.15.1b-1.el6.x86_64.rpm  libmad-devel-0.15.1b-1.el6.x86_64.rpm

参考:

http://blog.chinaunix.net/uid-23069658-id-3944462.html

http://www.centoscn.com/CentOS/Intermediate/2014/0918/3765.html

https://fedoraproject.org/wiki/How_to_create_an_RPM_package


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:566455次
    • 积分:8408
    • 等级:
    • 排名:第2409名
    • 原创:208篇
    • 转载:307篇
    • 译文:10篇
    • 评论:44条
    My Github
    最新评论