Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37568805
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 

# -*- rpm-spec -*-
# $Id: util-linux.spec,v 1.4 2005/04/06 23:48:53 ivan Exp ivan $

%define main_ver 2.12r
Name: util-linux
Version: 2.12r
Release: alt6

%def_without hwclock
%def_without getopt
%def_without chsh_chfn
%def_without vipw_vigr
%def_without newgrp
%def_without nfs
%def_with nfsv4

#RH: 'raw' support is deprecated, only ship it if we need compatibility stuff.

%def_without raw

Summary: A collection of basic system utilities
License: GPL
Group: System/Base
Url: ftp://ftp.kernel.org/pub/linux/utils/%name
Packager: Dmitry V. Levin <ldv at altlinux.org>

Source: %name-%version.tar
Source3: %name-2.10-chfn.pamd
Source4: %name-2.10-chsh.pamd

# Extra utils.

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

Source21: mount.control
Source22: write.control

# Backported from util-linux-2.13-pre7 (#9946)

Source30: flock.c
Source31: flock.1

Source100: old_changelog

#General Patches

Patch1: %name-2.11o-nochkdupexe.patch
Patch2: %name-2.9v-nonroot.patch
Patch3: %name-2.11t-mdk-moretc.patch
Patch4: %name-2.12r-alt-tinfo.patch
Patch5: %name-2.12-alt-pg.patch
Patch6: %name-2.10q-texinfo.patch
Patch7: %name-2.11a-gecossize.patch
Patch8: %name-2.12a-rh-partlimit.patch
Patch9: %name-2.11f-rh-rawman.patch
Patch10: %name-2.11y-rh-skipraid2.patch
Patch11: %name-2.11y-rh-fdisksegv-103954.patch
Patch12: %name-2.12r-cal-trim_trailing_spaces.patch

#Owl

Patch40: %name-2.12p-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.12p-rh-swaponsymlink-57300.patch
Patch101: %name-2.12r-mdk-alt-largefile.patch
#http://www.stwing.org/~sluskyb/util-linux/losetup-combined.patch
Patch102: %name-2.12p-cryptoloop.patch
Patch103: %name-2.12p-alt-encryption.patch
Patch104: %name-2.12r-alt-mount-MS_SILENT.patch
Patch105: %name-2.12r-rh-mount-comment.patch

#new

Patch201: %name-2.12p-alt-lseek64.patch
Patch202: %name-2.12p-rh-raw-handle-nonpresent-devs.patch
Patch203: %name-2.12a-rh-mountbylabel-dm.patch
Patch204: %name-2.13-rh-mount-drop-privileges.patch
#new our crypto fixes

# nfs4 patches from citi

Patch300: %name-2.12p-alt-citi-01-nfs.patch
Patch301: %name-2.12p-alt-citi-02-nfs4.patch
Patch302: %name-2.12p-alt-citi-03-krb5.patch
Patch303: %name-2.12p-alt-citi-04-multiple-sec-flavours.patch
Patch304: %name-2.12p-alt-citi-05-mount-sloppy-fix.patch
Patch305: %name-2.12p-alt-citi-06-rh-nfsmount.patch
Patch310: %name-2.12p-alt-nonfs.patch

# FIXME seems make behaviour was changed in beta2

Patch400: %name-2.12p-alt-make.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

BuildRequires: glibc-devel-static libe2fs-devel libncurses-devel libpam-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
%{!?_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
%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

#setup config

%__subst 's,^HAVE_PAM=.*,HAVE_PAM=yes,
s,^HAVE_SHADOW=.*,HAVE_SHADOW=no,
s,^HAVE_PASSWD=.*,HAVE_PASSWD=yes,
s,^HAVE_KILL=.*,HAVE_KILL=yes,
s,^HAVE_FDUTILS=.*,HAVE_FDUTILS=yes,
s,^[#[:space:]]*HAVE_SLANG=.*,HAVE_SLANG=no,
s,^SUIDMODE=.*,SUIDMODE=       4711,
s,^INSTALLSUID.*,INSTALLSUID=    $(INSTALL) -m $(SUIDMODE),
' MCONFIG
%if_with raw
echo "ADD_RAW=yes">>MCONFIG
%endif
#end setup config


#begin general

%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%if_with raw
%patch9 -p1
%endif
%patch10 -p1
%patch11 -p1
%patch12 -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
%patch104 -p1
%patch105 -p1
mv mount/README.mount mount/README
#end mount

#begin new

%patch201 -p1

%if_with raw
%patch202 -p1
%endif

%patch203 -p1
%patch204 -p1
#end new

# nfs

%if_with nfs
%if_with nfsv4
%patch300 -p1
%patch301 -p1
%patch302 -p1
%patch303 -p1
%patch304 -p1
%patch305 -p1
%endif
%else
%patch310 -p1
%endif

%patch400 -p1

#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

#begin flock

# replace to fresh version of flock
install -p -m644 %_sourcedir/flock.c sys-utils/
install -p -m644 %_sourcedir/flock.1 sys-utils/
#end flock

install -p -m644 %SOURCE10 %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 .

find -type f -name \*.orig -delete -print

%build
%add_optflags %(getconf LFS_CFLAGS) -D_LARGEFILE64_SOURCE
%configure
%make_build OPT="%optflags" LDFLAGS=

pushd sys-utils
makeinfo ipc.texi
popd

pushd rescuept
%__cc %optflags -o rescuept rescuept.c
popd

%__cc -nostartfiles -nodefaultlibs -nostdlib pause.s -o pause
%__cc %optflags stacktest.c -o stacktest
%__cc %optflags -U_FORTIFY_SOURCE -fno-stack-protector -static \
-nostartfiles -nodefaultlibs -nostdlib nologin.c -o nologin

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

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

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

%make_install install \
DESTDIR=%buildroot \
MANDIR=%buildroot%_mandir \
INFODIR=%buildroot%_infodir

%ifarch sparc sparc64
rm -rf %buildroot%_bindir/sunhostid
cat << E-O-F > %buildroot%_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 %buildroot%_bindir/sunhostid
%endif

%if_with chsh_chfn
install -p -m640 %_sourcedir/%name-2.10-chsh.pamd %buildroot%_sysconfdir/pam.d/chsh
install -p -m640 %_sourcedir/%name-2.10-chsh.pamd %buildroot%_sysconfdir/pam.d/chfn
%endif

install -pD -m755 %_sourcedir/mount.control %buildroot/etc/control.d/facilities/mount
install -pD -m755 %_sourcedir/write.control %buildroot/etc/control.d/facilities/write

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

# This has dependencies on stuff in /usr

%ifnarch sparc sparc64 sparcv9
mv %buildroot/sbin/cfdisk %buildroot%_sbindir/
%endif

%if_with hwclock
rm -f %buildroot/sbin/clock
ln -s hwclock %buildroot/sbin/clock
%endif #with hwclock

pushd %buildroot

%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 x86_64
rm -f ./sbin/sfdisk
rm -f .%_man8dir/sfdisk.8*
%endif

%ifnarch alpha armv4l %ix86 x86_64
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 %buildroot%_bindir |
egrep -v '^(write|getopt|look)$' |
sed -e 's|^\(.*\)$|%%_bindir/\1|g' >>%name.lang

#sbindir

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

# mandir

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

#/bin

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

#/sbin

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

# Remove unpackaged files (to pass RPM check):

rm %buildroot/bin/login %buildroot/usr/share/man/man1/login.*

%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*
%if_with nfs
%_man5dir/nfs.*
%endif
%_man5dir/fstab.*
%_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 look
%_bindir/look
%_man1dir/look.*

%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