分类: LINUX
2005-10-21 08:44:06
公用规则简单模板的定义。
name { package name}
ver { version}
rel { release}
prefix /usr
Name: %{ name}
Version: %{ ver}
Source0:
Patch0:
URL:
Serial:
Distribution: TurboLinux
BuildRoot: /var/tmp/%{ name}-%{ ver}-root
ldconfig, bash
0
%changelog
#--------------------------------------------------
%prep
rm -rf $RPM_BUILD_ROOT
%setup -n %{ name}-%{ ver}
%patch0 -p0 -b .XXX
%build
%ifarch alpha
CFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=%{ prefix} --cnable-alpha
%else
CFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=%{ prefix}
%endif
make
%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{ prefix} install
strip `file $RPM_BUILD_ROOT%{ prefix}/bin/* | awk -F':' '/executable/ { print $1 }'`
gzip -9f $RPM_BUILD_ROOT%{ prefix}/man/*/*
gzip -9f $RPM_BUILD_ROOT%{ prefix}/share/info/*info*
%clean
rm -rf $RPM_BUILD_ROOT
% post -p /sbin/ldconfig
% postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc
%dir
%config
%{ prefix}/bin/abc
%{ prefix}/lib/libabc
# in case of PERL
%{ prefix}/lib/perl5/5.005003/*-linux/*/*. pm