Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1584167
 поиск   регистрация   авторизация 
 
Группа :: Система/Основа
Пакет: util-linux

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

%define main_ver 2.12a
Name: util-linux
Version: %main_ver
Release: alt4.M24.2

%def_without hwclock
%def_without getopt
%def_without chsh_chfn
%def_without vipw_vigr
%def_without newgrp

Summary: A collection of basic system utilities
License: GPL
Group: System/Base
Url: ftp://ftp.win.tue.nl/pub/linux-local/utils/%name
Packager: Util-linux Development Team <util-linux at packages.altlinux.org>

Source: %name-%version.tar.bz2
Source1: kbdrate-1.06.tar.gz
Source3: %name-2.10-chfn.pamd
Source4: %name-2.10-chsh.pamd
Source5: %name-2.9w-kbdrate.pamd
Source6: %name-2.9w-kbdrate.apps

# Extra utils.

Source10: pause.s
Source11: chstk.c
Source12: stacktest.c
Source13: nologin.c
Source14: nologin.8

Source21: mount.control
Source22: write.control

Source100: old_changelog

#General Patches

Patch0: %name-2.12q-up-20050910-fixes.patch
Patch1: %name-2.12a-alt-config.patch
Patch2: %name-2.11o-nochkdupexe.patch
Patch3: %name-2.9v-nonroot.patch
Patch4: %name-2.11t-mdk-moretc.patch
Patch5: %name-2.11w-alt-tinfo.patch
Patch6: %name-2.12-alt-pg.patch
Patch7: %name-2.10q-texinfo.patch
Patch8: %name-2.11a-gecossize.patch
Patch9: %name-2.12pre-rh-miscfixes.patch
Patch10: %name-2.11x-rh-mdk-procpartitions-37436.patch
Patch11: %name-2.11w-alt-rev-manpage.patch
Patch12: %name-2.11y-rh-sysmap-85407.patch
Patch17: %name-2.11z-alt-fdisk-arm.patch
Patch18: %name-2.12a-alt-rbind.patch

#Owl

Patch40: %name-2.12-owl-alt-mtab-umask.patch
Patch41: %name-2.10r-owl-write.patch

#splitting

Patch50: %name-2.11h-noclock.patch
Patch51: %name-2.11z-nogetopt.patch

#mount patches

Patch100: %name-2.11w-rh-swaponsymlink-57300.patch
Patch101: %name-2.12-mdk-largefile.patch
Patch102: http://www.stwing.org/~sluskyb/util-linux/losetup-combined.patch
Patch103: %name-2.12a-alt-skip_kudzu.patch

#new

Patch200: %name-2.11f-rh-rawman.patch
Patch201: %name-2.11y-rh-skipraid2.patch
Patch202: %name-2.11y-rh-fdisksegv-103954.patch
Patch204: %name-2.11y-rh-nfs.patch
Patch205: %name-2.11y-rh-base-nfsv4.patch
Patch206: %name-2.11y-rh-pipefs.patch
Patch207: %name-2.11y-rh-mountman-90588.patch
#new our crypto fixes
Patch209: %name-2.12a-alt-encryption.patch

Obsoletes: tunelp
PreReq: control
#Requires: hwclock, getopt, kbdrate, agetty, cfdisk, fdisk, sfdisk

Requires(post): %install_info
Requires(preun): %uninstall_info

Conflicts: initscripts <= 4.58, timeconfig <= 3.0.1

#for old kernels

Provides: /usr/sbin/rdev

# Automatically added by buildreq on Wed Oct 16 2002

BuildRequires: libncurses-devel libpam-devel libtinfo-devel zlib-devel


%description
The %name package contains a large variety of low-level system utilities
that are necessary for a Linux system to function.

%package -n mount
Summary: Programs for mounting and unmounting filesystems
Group: System/Base
PreReq: control

%description -n mount
The %name package contains the mount, umount, swapon and swapoff
programs.  Accessible files on your system are arranged in one big
tree or hierarchy.  These files can be spread out over several
devices. The mount command attaches a filesystem on some device to
your system's file tree.  The umount command detaches a filesystem
from the tree.  Swapon and swapoff, respectively, specify and disable
devices and files for paging and swapping.

%package -n losetup
Summary: Programs for setting up and configuring loopback devices
Group: System/Base
Requires: hashalot

%description -n losetup
Linux supports a special block device called the loop device, which
maps a normal file onto a virtual block device.  This allows for the
file to be used as a "virtual file system" inside another file.
Losetup is used to associate loop devices with regular files or block
devices, to detach loop devices and to query the status of a loop device.

%package -n agetty
Summary: Alternative Linux getty
Group: System/Base
Requires: login

%description -n agetty
The alternative getty program for Linux.

%package -n cfdisk
Summary: The partitioning program with ncurses interface
Group: System/Configuration/Hardware

%description -n cfdisk
Small user-friendly ncurses-based partitioning program, which will help you
to partition your disk easily.

%package -n fdisk
Summary: The Partitioning Program
Group: System/Configuration/Hardware

%description -n fdisk
Small partitioning program with command line interface, that will be hard
for linux newbie, but it is extra stable, and you can trust it.

%package -n sfdisk
Summary: Partitioning program with argument interface
Group: System/Configuration/Hardware

%description -n sfdisk
Small partitioning program with argument interface, that will be hard
for linux newbie, but it is extra stable, and you can trust it.

%package -n kbdrate
Summary: Reset the keyboard repeat rate and delay time
Group: System/Configuration/Hardware

%description -n kbdrate
This package is used to change the keyboard repeat rate and delay time.
The delay is the amount of time that a key must be depressed before it
will start to repeat.

%package -n kbdrate-usermode
Summary: Usermode bindings for kbdrate
Group: System/Configuration/Hardware
Requires: kbdrate = %version-%release

%description -n kbdrate-usermode
Kbdrate package is used to change the keyboard repeat rate and delay time.
The delay is the amount of time that a key must be depressed before it
will start to repeat.

This package contains usermode bindings for kbdrate.

%if_with hwclock
%package -n hwclock
Summary: Query and set the hardware clock
License: GPL
Group: System/Base
%ifarch alpha sparc sparc64
Obsoletes: clock
%endif

%description -n hwclock
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.
%endif #with hwclock


%if_with getopt
%package -n getopt
Version: 1.1.2
Release: alt1
Summary: An improved implementation of getopt
Group: System/Base
Url: http://huizen.dds.nl/~frodol/getopt.html

%description -n getopt
An improved implementation of getopt(1), a program to parse
options within a shell script. Fully compatible with other
getopt(1) implementations, but with many additions like
long options and mixing of options and parameters.
%endif #with getopt


%package -n look
Summary: Program to display lines beginning with a given string
Version: %main_ver
Group: System/Base
Requires: words

%description -n look
The look utility displays any lines in file which contain string as a prefix.

%prep
%setup -q -a1


#begin general

%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%ifarch armv4b armv4l armv5b armv5l
%patch17 -p1
%endif
%patch18 -p1
#end general

#begin owl

%patch40 -p1
%patch41 -p1
#end owl



%if_without hwclock
rm -rf hwclock
%patch50 -p1
grep -v '^hwclock/' po/POTFILES.in >po/POTFILES.in.tmp && mv -f po/POTFILES.in.tmp po/POTFILES.in
%endif #without hwclock

%if_with getopt
# We do not want dependencies on csh
chmod a-x getopt*/*.*sh
%else #without getopt
rm -rf getopt*
%patch51 -p1
grep -v '^getopt.*/' po/POTFILES.in >po/POTFILES.in.tmp && mv -f po/POTFILES.in.tmp po/POTFILES.in
%endif #with getopt


#begin mount

%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
mv mount/README.mount mount/README
#end mount

#begin new

%patch200 -p1
%patch201 -p1
%patch202 -p1
#%patch204 -p1
#%patch205 -p1
%patch206 -p1
%patch207 -p1
%patch209 -p1
#end new

#begin agetty

mkdir -p agetty
mv login-utils/README.getty agetty/README
mv login-utils/README.modems-with-agetty agetty/modems-with-agetty.README
#end agetty

#begin *fdisk

mkdir -p {c,s}fdisk
mv fdisk/README.fdisk fdisk/README
mv fdisk/README.cfdisk cfdisk/README
mv fdisk/sfdisk.examples sfdisk/examples
#end *fdisk

install -p -m644 %SOURCE10 %SOURCE11 %SOURCE12 .

find -type f -name '*.[1-9]' -print0 |
xargs -r0 %__grep -FZl /usr/man |
xargs -r0 %__subst 's|/usr/man|%_mandir|g'

#nologin

install -p -m644 %SOURCE13 %SOURCE14 .

%build
%add_optflags -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
%configure
%make_build OPT="$RPM_OPT_FLAGS" LDFLAGS=

pushd sys-utils
makeinfo ipc.texi
popd

pushd rescuept
gcc $RPM_OPT_FLAGS -o rescuept rescuept.c
popd

pushd kbdrate
   cc $RPM_OPT_FLAGS -o kbdrate kbdrate.c
popd

gcc -nostartfiles -nodefaultlibs -nostdlib pause.s -o pause
gcc $RPM_OPT_FLAGS chstk.c -o chstk
gcc $RPM_OPT_FLAGS stacktest.c -o stacktest

gcc $RPM_OPT_FLAGS -o nologin nologin.c

mkdir -p docs
install -p -m644 */README.* docs
install -p -m644 rescuept/README docs/README.rescuept

%install
mkdir -p $RPM_BUILD_ROOT/{bin,sbin,etc/{pam.d,security/console.apps}}
mkdir -p $RPM_BUILD_ROOT{%_bindir,%_sbindir,%_libdir,%_infodir,%_mandir/man{1,8}}

for f in `cd po; echo *.po`; do
mkdir -p $RPM_BUILD_ROOT%_datadir/locale/${f%.po}/LC_MESSAGES
done

%make_install install \
DESTDIR=$RPM_BUILD_ROOT \
MANDIR=$RPM_BUILD_ROOT%_mandir \
INFODIR=$RPM_BUILD_ROOT%_infodir

%ifarch sparc sparc64
rm -rf $RPM_BUILD_ROOT%_bindir/sunhostid
cat << E-O-F > $RPM_BUILD_ROOT%_bindir/sunhostid
#!/bin/sh
this should be /usr/bin/sunhostid or somesuch.
Copyright 1999 Peter Jones, <pjones at redhat.com> .
GPL and all that good stuff apply.
(
idprom=\`cat /proc/openprom/idprom\`
echo \$idprom|dd bs=1 skip=2 count=2
echo \$idprom|dd bs=1 skip=27 count=6
echo
) 2>/dev/null
E-O-F
chmod 755 $RPM_BUILD_ROOT%_bindir/sunhostid
%endif

%if_with chsh_chfn
install -p -m640 $RPM_SOURCE_DIR/%name-2.10-chsh.pamd $RPM_BUILD_ROOT%_sysconfdir/pam.d/chsh
install -p -m640 $RPM_SOURCE_DIR/%name-2.10-chsh.pamd $RPM_BUILD_ROOT%_sysconfdir/pam.d/chfn
%endif

install -p -m640 $RPM_SOURCE_DIR/%name-2.9w-kbdrate.pamd $RPM_BUILD_ROOT%_sysconfdir/pam.d/kbdrate
install -p -m640 $RPM_SOURCE_DIR/%name-2.9w-kbdrate.apps $RPM_BUILD_ROOT%_sysconfdir/security/console.apps/kbdrate

install -pD -m755 $RPM_SOURCE_DIR/mount.control $RPM_BUILD_ROOT/etc/control.d/facilities/mount
install -pD -m755 $RPM_SOURCE_DIR/write.control $RPM_BUILD_ROOT/etc/control.d/facilities/write

install -p -m755 rescuept/rescuept $RPM_BUILD_ROOT%_sbindir
install -p -m755 pause chstk stacktest $RPM_BUILD_ROOT%_bindir
install -p -m755 nologin $RPM_BUILD_ROOT/sbin/
install -p -m644 nologin.8 $RPM_BUILD_ROOT%_man8dir/

install -p -m755 kbdrate/kbdrate $RPM_BUILD_ROOT/sbin/
install -p -m644 kbdrate/kbdrate.8 $RPM_BUILD_ROOT%_man8dir/
%__ln_s %_libdir/helper/consolehelper $RPM_BUILD_ROOT%_bindir/kbdrate

# This has dependencies on stuff in /usr

%ifnarch sparc sparc64 sparcv9
mv $RPM_BUILD_ROOT/sbin/cfdisk $RPM_BUILD_ROOT%_sbindir/
%endif

%if_with hwclock
%__rm -f $RPM_BUILD_ROOT/sbin/clock
%__ln_s hwclock $RPM_BUILD_ROOT/sbin/clock
%endif #with hwclock

pushd $RPM_BUILD_ROOT

%if_with chsh_chfn
chmod 4711 .%_bindir/ch{sh,fn}
%else #without chsh_chfn
rm -fv .{%_bindir/ch{sh,fn},%_man1dir/ch{sh,fn}.*}
%endif #with chsh_chfn
%if_without vipw_vigr
rm -fv .{%_sbindir/vi{pw,gr},%_man8dir/vi{pw,gr}.*}
%endif #without vipw_vigr
%if_with newgrp
chmod 4711 .%_bindir/newgrp
%else #without newgrp
rm -fv .{%_bindir/newgrp,%_man1dir/newgrp.*}
%endif #with newgrp

# goes to glibc

rm -f ./sbin/sln
# goes to sh-utils
rm -f .%_mandir/man1/hostid.1*
# goes to procps
rm -f .%_mandir/man1/kill.1*

%ifnarch alpha %ix86 ia64
rm -f ./sbin/sfdisk
rm -f .%_man8dir/sfdisk.8*
%endif

%ifnarch alpha armv4l %ix86
rm -f .%_bindir/cytune
rm -f .%_man8dir/cytune.8*
%endif

%ifnarch %ix86
rm -f .%_sbindir/{rdev,ramsize,rootflags,swapdev,vidmode}
rm -f .%_man8dir/{rdev,ramsize,rootflags,swapdev,vidmode}.8*
%endif

%ifnarch sparc sparc64
rm -f .%_bindir/sunhostid
%endif

chmod 755 ./bin/login

popd

%find_lang %name

#bindir

echo '%_defattr' >>%name.lang
/bin/ls -1 $RPM_BUILD_ROOT%_bindir |
egrep -v '^(write|getopt|kbdrate|look)$' |
sed -e 's|^\(.*\)$|%%_bindir/\1|g' >>%name.lang

#sbindir

/bin/ls -1 $RPM_BUILD_ROOT%_sbindir |
       egrep -v 'cfdisk' |
       sed -e 's|^\(.*\)$|%%_sbindir/\1|g' >>%name.lang

# mandir

/bin/ls -1 $RPM_BUILD_ROOT%_man1dir |
egrep -v '^(getopt|login|look)' |
sed -e 's|^\(.*\)$|%%_mandir/man1/\1*|g' >>%name.lang
/bin/ls -1 $RPM_BUILD_ROOT%_man8dir |
egrep -v '(mount|^swapo|losetup|^kbdrate|clock|getty|fdisk)' |
sed -e 's|^\(.*\)$|%%_man8dir/\1*|g' >>%name.lang

#/bin

/bin/ls -1 $RPM_BUILD_ROOT/bin |
egrep -v '(login|mount)' |
sed -e 's|^\(.*\)$|/bin/\1|g' >>%name.lang

#/sbin

/bin/ls -1 $RPM_BUILD_ROOT/sbin |
egrep -v '(^swapo|^losetup|^kbdrate|clock|getty|fdisk)' |
sed -e 's|^\(.*\)$|/sbin/\1|g' >>%name.lang

%pre
[ $1 -eq 1 ] || /usr/sbin/control-dump write

%post
[ $1 -eq 1 ] || /usr/sbin/control-restore write
%install_info ipc.info

%preun
%uninstall_info ipc.info

%pre -n mount
[ $1 -eq 1 ] || /usr/sbin/control-dump mount

%post -n mount
[ $1 -eq 1 ] || /usr/sbin/control-restore mount

%files -f %name.lang
%doc MAINTAINER HISTORY docs/*
%if_with chsh_chfn
%config(noreplace) %_sysconfdir/pam.d/ch??
%endif #with chsh_chfn
%config /etc/control.d/facilities/write
%attr(2711,root,tty) %_bindir/write
%_infodir/*.info*

%files -n mount
%config /etc/control.d/facilities/mount
/bin/*mount
/sbin/swapo*
%_man5dir/*
%_man8dir/*mount*
%_man8dir/swapo*
%doc mount/README

%files -n losetup
/sbin/losetup
%_man8dir/losetup*

%if_with hwclock
%files -n hwclock
/sbin/*clock
%_mandir/man?/*clock.*
%doc hwclock/README*
%endif #with hwclock

%if_with getopt
%files -n getopt
%_bindir/getopt
%_man1dir/getopt.*
%doc getopt*/{Changelog,README,TODO,*.*sh}
%endif #with getopt

%files -n agetty
/sbin/agetty
%_man8dir/agetty.*
%doc agetty/*

%files -n cfdisk
%_sbindir/cfdisk
%_man8dir/cfdisk.*
%doc cfdisk/*

%files -n fdisk
/sbin/fdisk
%_man8dir/fdisk.*
%doc fdisk/README

%files -n sfdisk
/sbin/sfdisk
%_man8dir/sfdisk.*
%doc sfdisk/*

%files -n kbdrate
/sbin/kbdrate
%_man8dir/kbdrate.*

%files -n kbdrate-usermode
%config(noreplace) %_sysconfdir/pam.d/kbdrate
%config(noreplace) %_sysconfdir/security/console.apps/kbdrate
%_bindir/kbdrate

%files -n look
%_bindir/look
%_man1dir/look.*

%changelog

Полный changelog можно просмотреть здесь

 
design & coding: Vladimir Lettiev aka crux © 2004-2005