Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37865527
en ru br
ALT Linux repos
4.1: 2.24-alt2
4.0: 2.24-alt2
3.0: 2.23-alt6

Group :: System/Base
RPM: hwclock

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Name: hwclock
Version: 2.23
Release: alt6

Summary: Query and set the hardware clock
License: GPL
Group: System/Base
Url: ftp://ibiblio.org/pub/Linux/system/hardware

Source0: %url/%name-%version.tar.bz2
Source1: clock_unsynced.c

Patch1: %name-2.22-alt-build.patch
Patch2: %name-2.23-alt-tzoffset.patch
Patch3: %name-2.23-alt-tzoffset_check.patch
Patch4: %name-2.23-alt-x86_64.patch
Patch5: %name-2.23-alt-sparc.patch

Conflicts: startup <= 0:0.6-alt1

#BuildPreReq: kernel-headers-std


# Automatically added by buildreq on Mon May 21 2001

BuildRequires: libshhopt-devel

%description
Hwclock is a program that runs under Linux and sets and queries the
Hardware Clock, which is often called the Real Time Clock, RTC, or
CMOS clock.

You can set the Hardware Clock to a particular time or from the Linux
System Time.  You can set the Linux System Time from the Hardware
Clock, and a typical usage is to invoke Hwclock from a system startup
script to initialize the System Time.

Hwclock's --adjust function corrects systematic drift in the Hardware
Clock.  You just invoke it regularly and it corrects for a fast or
slow Hardware Clock.  Hwclock automatically computes how fast or slow
the Hardware Clock is every time you set it.

Hwclock uses /dev/rtc if it is available.  Otherwise, it uses its own
direct I/O to do what the rtc device driver would normally do.

%prep
%setup -q -n %name
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
find -type f -print0 |
xargs -r0 %__grep -FZl /var/state -- |
xargs -r0 %__subst -p 's,/var/state,%_localstatedir/%name,g' --
find -type f -name \*.orig -print -delete
%__install -pm644 %_sourcedir/clock_unsynced.c .

%build
make clean -C src
%make_build -C src
%__cc $RPM_OPT_FLAGS clock_unsynced.c -o clock_unsynced

%install
%__install -pD -m755 src/%name %buildroot/sbin/%name
%__ln_s %name %buildroot/sbin/clock
%__install -pD -m644 src/%name.8 %buildroot%_man8dir/%name.8
%__install -pD -m755 clock_unsynced %buildroot/bin/clock_unsynced
%__mkdir_p %buildroot%_localstatedir/%name
%__install -pD -m644 /dev/null %buildroot%_sysconfdir/adjtime

%triggerpostun -- startup <= 0.6-alt1, initscripts < 1:5.49.1-alt1
f=%_sysconfdir/adjtime
if [ ! -f "$f" ]; then
if [ -f "$f".rpmsave ]; then
%__cp -pf "$f".rpmsave "$f"
elif [ -f "$f".rpmnew ]; then
%__cp -pf "$f".rpmnew "$f"
fi
fi

%files
%config(noreplace) %_sysconfdir/adjtime
/bin/*
/sbin/*
%_man8dir/*
%dir %_localstatedir/%name
%doc README src/HISTORY *.lsm

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin