Requires(preun): systemd
-
units
Requires(postun): systemd
-
units
Requires: ntpdate = %{version}
-
%{release}
BuildRequires: libcap
-
devel openssl
-
devel libedit
-
devel perl
-
HTML
-
Parser
BuildRequires: pps
-
tools
-
devel autogen autogen
-
libopts
-
devel systemd
-
units
.....(
省略
).....
%package
-
n ntpdate
#
实这个软
件包含有很多次
件喔!
Summary: Utility to set the date and time via NTP
Group: Applications/System
Requires(pre):
shadow
-
utils
Requires(post): systemd
-
units
Requires(preun): systemd
-
units
Requires(postun): systemd
-
units
.....(
省略
).....
# 3.
编译
前的
预处
理,以及
编译过
中所需要
½
行的指令,都
#
尤其
%build
底下的
据,几乎就是
makefile
里面的信息啊!
%prep
#
部份大多在
丁的
作!
%setup
-
q
-
a 5
%patch1
-
p1
-
b .sleep
#
patch
然与前面的
PatchN
%patch2
-
p1
-
b .droproot
.....(
省略
).....
%build
#
就是
./configure, make
作!
sed
-
i 's|$CFLAGS
-
Wstrict
-
overflow|$CFLAGS|' configure sntp/configure
export CFLAGS="$RPM_OPT_FLAGS
-
fPIE
-
fno
-
strict
-
aliasing
-
fno
-
strict
-
overflow"
export LDFLAGS="
-
pie
-
Wl,
-
z,relro,
-
z,now"
%configure
\
#
不就是
./configure
的意思
--
sysconfdir=%{_sysconfdir}/ntp/crypto
\
--
with
-
openssl
-
libdir=%{_libdir}
\
--
without
-
ntpsnmpd
\
--
enable
-
all
-
clocks
--
enable
-
parse
-
clocks
\
--
enable
-
ntp
-
signd=%{_localstatedir}/run/ntp_signd
\
--
disable
-
local
-
libopts
echo '#define KEYFILE "%{_sysconfdir}/ntp/keys"' >> ntpdate/ntpdate.h
echo '#define NTP_VAR "%{_localstatedir}/log/ntpstats/"' >> config.h
make %{._smp_mflags}
#
不就是
make
.....(
省略
).....
%install
#
就是安
装过
程所
½
行的各
项动
作了!
make DESTDIR=$RPM_BUILD_ROOT bindir=%{_sbindir} install
mkdir
-
p $RPM_BUILD_ROOT%{_mandir}/man{5,8}
sed
-
i 's/sntp
\
.1/sntp
\
.8/' $RPM_BUILD_ROOT%{_mandir}/man1/sntp.1