Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37563488
en ru br
ALT Linux repositórios
S:2.39.2-alt1
5.0: 2.14.1-alt1
4.1: 2.13-alt8
4.0: 2.12r-alt6
3.0: 2.12q-alt1

Group :: Sistema/Base
RPM: util-linux

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

### Header
Summary: A collection of basic system utilities
Name: util-linux
Version: 2.14.1
Release: alt1
License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain
Group: System/Base
URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng
Packager: Alexey Gladkov <legion at altlinux.ru>

### Macros

%define floppyver 0.16
%define include_raw 1

%def_with hwclock
%def_with getopt
%def_with setarch
%def_without login-utils
%def_with schedutils
%def_without nfs
%def_with nfsv4

### Dependences

# Automatically added by buildreq on Mon Mar 24 2008
BuildRequires: cvs gcc-c++ glibc-devel-static klibc-devel libblkid-devel
BuildRequires: libncurses-devel libpopt-devel udev zlib-devel

### Sources

# ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/util-linux-ng-2.14.tar.bz2
Source0: util-linux-%version.tar
Source1: util-linux-ng-login.pamd
Source3: util-linux-ng-chsh-chfn.pamd
Source4: util-linux-ng-60-raw.rules
Source5: mount.control
Source6: write.control
# http://download.sourceforge.net/floppyutil/floppy-%{floppyver}.tar.bz2
#Source7: floppy.tar
Source8: nologin.c
Source9: nologin.8
Source10: pause.c
Source11: stacktest.c
Source12: clock_unsynced.c

### Obsoletes & Conflicts & Provides

Obsoletes: tunelp
Obsoletes: util-linux-ng

Conflicts: initscripts <= 4.58, timeconfig <= 3.0.1
Provides: util-linux-ng = %version-%release

#for old kernels

Provides: /usr/sbin/rdev
Conflicts: kernel < 2.2.12-7

PreReq: %name-control = %version-%release
Requires: coreutils > 6.10-alt2
Requires(post): %install_info
Requires(preun): %uninstall_info

# 91174 - Patch to enabled remote service for login/pam

Patch0: util-linux-ng-2.13-login-pamstart.patch
# RHEL/Fedora specific mount options
Patch1: util-linux-ng-2.13-mount-managed.patch
Patch2: util-linux-ng-2.13-mount-pamconsole.patch
# add note about ATAPI IDE floppy to fdformat.8
Patch3: util-linux-ng-2.13-fdformat-man-ide.patch
# 169628 - /usr/bin/floppy doesn't work with /dev/fd0
Patch4: util-linux-ng-2.13-floppy-generic.patch
# 151635 - makeing /var/log/lastlog
Patch5: util-linux-ng-2.13-login-lastlog.patch
# 199745 - Non-existant simpleinit(8) mentioned in ctrlaltdel(8)
Patch6: util-linux-ng-2.13-ctrlaltdel-man.patch
# 218915 - fdisk -b 4K (move to upstream?)
Patch7: util-linux-ng-2.13-fdisk-b-4096.patch
# 231192 - ipcs is not printing correct values on pLinux
Patch8: util-linux-ng-2.13-ipcs-32bit.patch
# add a missing header
Patch11: util-linux-ng-2.13-floppy-locale.patch
# remove partitions
Patch12: util-linux-ng-2.13-blockdev-rmpart.patch
# move /var/lib/lastdate -> /var/lib/hwclock/lastdate
Patch13: util-linux-2.14-alt-hwclock-badyear.patch

#Owl

Patch40: util-linux-ng-2.13-owl-alt-mtab-umask.patch
Patch41: util-linux-ng-2.13-owl-write.patch

Patch50: util-linux-2.12-alt-pg.patch
Patch51: util-linux-2.10q-texinfo.patch
Patch52: util-linux-2.11a-gecossize.patch
Patch53: util-linux-2.12a-rh-partlimit.patch
Patch54: util-linux-2.11f-rh-rawman.patch
Patch55: util-linux-2.11y-rh-fdisksegv-103954.patch
Patch56: util-linux-2.12r-cal-trim_trailing_spaces.patch
Patch58: util-linux-2.12r-alt-mount-MS_SILENT.patch

%description
The util-linux-ng package contains a large variety of low-level system
utilities that are necessary for a Linux system to function. Among
others, Util-linux contains the fdisk configuration tool and the login
program.

%package control
Summary: Control scripts for %name and mount
Group: System/Base
BuildArch: noarch

%description control
This package contains control(8) scripts used by %name and mount packages.

%package -n mount
Summary: Programs for mounting and unmounting filesystems
Group: System/Base
PreReq: %name-control = %version-%release
%{!?_with_nfs:Requires: nfs-utils >= 1:1.0.10-alt3}

%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.

%if_with hwclock
%package -n hwclock
Summary: Query and set the hardware clock
License: GPL
Group: System/Base
Serial: 1
%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
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

%if_with login-utils
%package -n login
Summary: Start an interactive session on the system
Group: System/Base
Requires: pam >= 0.75-alt12

%description -n login
The login application opens an interactive session with a Linux workstation.
It is one of the first applications a user interacts with, but is generally
not invoked by a normal user.  Instead some program like mingetty(8) will
invoke login.
%endif #with login-utils

%if_with setarch
%package -n setarch
Summary: Personality setter
Group: System/Kernel and hardware

%ifarch sparc sparcv9 sparc64
Provides: sparc32
Obsoletes: sparc32
%endif

%description -n setarch
This utility tells the kernel to report a different architecture than
the current one, then runs a program in that environment.  It can also
set various personality flags.
%endif #with setarch

%if_with schedutils
%package -n schedutils
Summary: Utilities for manipulating process scheduler attributes
Group: System/Kernel and hardware

%description -n schedutils
schedutils is a set of utilities for retrieving and manipulating process
scheduler-related attributes, such as real-time parameters and CPU affinity.

This package includes the chrt and taskset utilities.

Install this package if you need to set or get scheduler-related attributes.
%endif #with schedutils

%package -n look
Summary: Program to display lines beginning with a given string
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
cp -r -- rpm/floppy %SOURCE8 %SOURCE9 %SOURCE10 %SOURCE11 %SOURCE12 .

%patch0 -p1
#patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1

%patch40 -p1
%patch41 -p1

%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch58 -p1

%build
#add_optflags %(getconf LFS_CFLAGS) -D_LARGEFILE64_SOURCE
export SUID_CFLAGS="-fpie"
export SUID_LDFLAGS="-pie"

%autoreconf
%configure \
--bindir=/bin \
--sbindir=/sbin \
--disable-kill \
--disable-wall \
--disable-arch \
--enable-partx \
--enable-write \
--enable-rdev \
%if %include_raw
--enable-raw \
%endif
\
%if_without login-utils
--disable-login-utils \
%endif
\
%if_without schedutils
--disable-schedutils \
%endif
\
--with-pam \
--with-fsprobe=blkid \
--disable-makeinstall-chown

# build util-linux-ng

%make_build

# build floppy stuff

pushd floppy
%configure --disable-gtk2
%make_build
popd

# build nologin

%ifarch %ix86 x86_64
%__cc %optflags stacktest.c -o stacktest
%endif
%__cc -Os -static -nostartfiles -o pause pause.c
klcc -Wall -Wextra -Werror nologin.c -o nologin

%if_with hwclock
%__cc %optflags clock_unsynced.c -o clock_unsynced
%endif

%install
mkdir -p %buildroot/{bin,sbin,etc/pam.d}
mkdir -p %buildroot/{%_bindir,%_sbindir,%_libdir,%_infodir,%_mandir/man{1,6,5,8}}

# install util-linux-ng

%make_install install DESTDIR=%buildroot

# inslall floppy stuff

pushd floppy
%make_install DESTDIR=%buildroot
popd

install -pD -m755 %SOURCE5 %buildroot%_controldir/mount
install -pD -m755 %SOURCE6 %buildroot%_controldir/write

%ifarch %ix86 x86_64
install -p -m755 stacktest %buildroot/%_bindir
%endif
install -p -m755 pause %buildroot/%_bindir
install -p -m755 nologin %buildroot/sbin/
install -p -m644 nologin.8 %buildroot/%_man8dir/

%if %include_raw
echo '.so man8/raw.8' > %buildroot/%_man8dir/rawdevices.8
ln -sf ../../bin/raw %buildroot/%_bindir/raw

# see RH bugzilla #216664

install -pD -m 644 %SOURCE4 %buildroot/%_sysconfdir/udev/rules.d/60-raw.rules
%endif

%if_with login-utils
chmod 4711 %buildroot/%_bindir/{ch{sh,fn},newgrp}
install -m 644 %SOURCE3 %buildroot/%_sysconfdir/pam.d/chsh
install -m 644 %SOURCE3 %buildroot/%_sysconfdir/pam.d/chfn
%endif

%if_with hwclock
install -pD -m755 clock_unsynced %buildroot/bin/clock_unsynced
ln -sf ../../sbin/hwclock %buildroot/%_sbindir/hwclock
ln -sf hwclock %buildroot/sbin/clock
mkdir -p -- %buildroot/%_localstatedir/hwclock
install -pD -m644 /dev/null %buildroot/%_localstatedir/hwclock/lastdate
install -pD -m644 /dev/null %buildroot/%_sysconfdir/adjtime
%else
rm -f -- \
%buildroot/sbin/*clock \
%buildroot/%_man8dir/*clock.*
%endif

%if_without getopt
rm -f -- \
%buildroot/%_bindir/getopt \
%buildroot/%_man1dir/getopt.*
%endif

# deprecated commands

for prog in \
/sbin/fsck.minix /sbin/mkfs.{bfs,minix} /sbin/sln /sbin/shutdown /bin/kill \
%_bindir/chkdupexe %_bindir/newgrp %_bindir/scriptreplay \
\
%_man1dir/chkdupexe.1 %_man1dir/newgrp.1 %_man1dir/scriptreplay.1 \
%_man8dir/fsck.minix.8 %_man8dir/mkfs.minix.8 %_man8dir/mkfs.bfs.8 \
\
%_datadir/getopt;
do
rm -rf -- %buildroot/$prog
done

# deprecated docs

for I in text-utils/README.pg misc-utils/README.reset floppy/README.html; do
rm -rf -- $I
done

# rename docs

mv floppy/README floppy/README.floppy

# we install getopt/getopt-*.{bash,tcsh} as doc files

chmod 644 getopt/getopt-*.{bash,tcsh}

# /sbin -> /usr/sbin

for I in cfdisk; do
[ ! -e %buildroot/sbin/$I ] ||
mv -- %buildroot/sbin/$I %buildroot/%_sbindir/$I
done

# /usr/sbin -> /sbin

for I in addpart delpart partx; do
[ ! -e %buildroot/%_sbindir/$I ] ||
mv -- %buildroot/%_sbindir/$I %buildroot/sbin/$I
done

# /usr/bin -> /bin

for I in getopt taskset; do
[ -e %buildroot/%_bindir/$I ] ||
continue
mv -- %buildroot/%_bindir/$I %buildroot/bin/$I
path="$(relative "%buildroot/bin/$I" "%buildroot/%_bindir/$I")"
ln -s "$path" %buildroot/%_bindir/$I
done

# /sbin -> /bin

for I in raw; do
[ ! -e %buildroot/sbin/$I ] ||
mv -- %buildroot/sbin/$I %buildroot/bin/$I
done

LINKS="linux32 linux64"
%ifarch s390 s390x
LINKS="$LINKS s390 s390x"
%endif
%ifarch %ix86 x86_64 amd64 ia32e
LINKS="$LINKS i386 i486 i586 i686 x86_64"
%endif
%ifarch ppc ppc64
LINKS="$LINKS ppc ppc64 ppc32"
%endif
%ifarch sparc sparc64
LINKS="$LINKS sparc sparc64 sparc32"
%endif
%ifarch mips mips64
LINKS="$LINKS mips mips64 mips32"
%endif
%ifarch ia64
LINKS="$LINKS i386 ia64"
%endif

exclude_archs='setarch'
for i in $LINKS; do
exclude_archs="$exclude_archs|$i"

%if_with setarch
ln -sf -- setarch %buildroot/%_bindir/$i
echo '.so man8/setarch.8' > %buildroot/%_man8dir/$i.8

echo "%_bindir/$i"
echo "%_man8dir/$i.8.*"
%endif #with setarch
done > setarch.files

{
# bindir
ls -1 %buildroot/%_bindir |
egrep -v "^($exclude_archs)\$" |
egrep -v '^(write|getopt|look|taskset|chrt|ionice)$' |
sed -e 's|^\(.*\)$|%%_bindir/\1|g'

# sbindir

ls -1 %buildroot/%_sbindir |
egrep -v '(fdisk|hwclock)' |
    sed -e 's|^\(.*\)$|%%_sbindir/\1|g'

# man1dir

ls -1 %buildroot%_man1dir |
egrep -v '^(getopt|login|look|taskset|chrt|ionice)' |
sed -e 's|^\(.*\)$|%%_man1dir/\1*|g'

# man8dir

ls -1 %buildroot%_man8dir |
egrep -v "^($exclude_archs)\.8*\$" |
egrep -v '(mount|^swapo|losetup|clock|getty|fdisk|part)' |
sed -e 's|^\(.*\)$|%%_man8dir/\1*|g'

# /bin

ls -1 %buildroot/bin |
egrep -v '(getopt|login|mount|taskset|clock_unsynced)' |
sed -e 's|^\(.*\)$|/bin/\1|g'

# /sbin

ls -1 %buildroot/sbin |
egrep -v '(^swapo|^losetup|addpart|delpart|partx|clock|getty|fdisk)' |
sed -e 's|^\(.*\)$|/sbin/\1|g'
} > %name.files

# omit info/dir file

rm -f -- %buildroot/%_infodir/dir

# find MO files

%find_lang %name-ng
cat %name-ng.lang >> %name.files

%if_with hwclock
%triggerpostun -n hwclock -- 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
%endif #with hwclock

%pre
%pre_control write

%post
%post_control write
%install_info ipc.info

%preun
%uninstall_info ipc.info

%pre -n mount
%pre_control mount

%post -n mount
%post_control mount

%files control
%config %_controldir/mount
%config %_controldir/write

%files -n mount
/bin/*mount
/sbin/swapo*
%_man5dir/fstab.*
%_man8dir/*mount*
%_man8dir/swapo*
%if_with nfs
%_man5dir/nfs.*
%endif #with nfs

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

%if_with hwclock
%files -n hwclock
%config(noreplace) %_sysconfdir/adjtime
%config(noreplace) %_localstatedir/hwclock/lastdate
/bin/clock_unsynced
/sbin/*clock
%_sbindir/hwclock
%dir %_localstatedir/hwclock
%_man8dir/*clock.*
%doc hwclock/README.hwclock
%endif #with hwclock

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

%files -n agetty
/sbin/agetty
%_man8dir/agetty.*
%doc login-utils/README.{modems-with-agetty,poeigl}

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

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

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

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

%if_with login-utils
%files -n login-utils
/bin/login
%_man8dir/login.8*
%config(noreplace) %_sysconfdir/pam.d/login
%config(noreplace) %_sysconfdir/pam.d/ch??
%endif #with login-utils

%if_with schedutils
%files -n schedutils
/bin/taskset
%_bindir/chrt
%_bindir/ionice
%_bindir/taskset
%_man1dir/chrt.*
%_man1dir/ionice.*
%_man1dir/taskset.*
%endif #with schedutils

%if_with setarch
%files -n setarch -f setarch.files
%_bindir/setarch
%_man8dir/setarch.*
%endif #with setarch

%files -f %name.files
%attr(2711,root,tty) %_bindir/write
%_infodir/*.info*
%_sysconfdir/udev/rules.d/60-raw.rules
%doc */README.* NEWS AUTHORS DEPRECATED licenses/* README*

%changelog

Todas as alterações você pod ver aqui

 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009