]> git.pld-linux.org Git - packages/util-linux.git/blobdiff - util-linux.spec
- imported OpenBSD's /sbin/nologin from fedora, doesn't hurt as to have
[packages/util-linux.git] / util-linux.spec
index 454c0667f5a80394b01231b2348edbfed1c529a5..67b3230fc620f910994b25374182d05bc7073a99 100644 (file)
@@ -1,23 +1,22 @@
 # TODO
-# - unpackaged files:
-#      /usr/share/getopt/getopt-parse.bash
-#      /usr/share/getopt/getopt-parse.tcsh
-# - fix initrd build
-# - some sysvinit binaries moved here: su(1):, sulogin(8),
-#    utmpdump(1): - has been merged from coreutils into util-linux
+# - verify initrd tools set:
+#   - I've taken list from 2.21.3 package, but there was no explicit list, so
+#     there are probably some unneeded tools
+#   - chrt is not built now (because of --disable-schedutils), but it's probably not needed
+#   - fsck is not built now (because of --disable-libmount)
+#   - maybe we want some more now?
 #
 # Conditional build:
 %bcond_with    uClibc          # link initrd version with static glibc instead of uClibc
 %bcond_without dietlibc        # link initrd version with dietlibc instead of uClibc
 %bcond_without selinux         # SELinux support
+%bcond_without su              # su/runuser programs
 %if "%{pld_release}" == "ac"
-%bcond_with            initrd          # don't build initrd version
-%bcond_with            fallocate       # fallocate utility (needs glibc 2.11 to compile)
-%bcond_with            partx           # partx utility (needs glibc 2.10 for openat to compile)
+%bcond_with    initrd          # don't build initrd version
+%bcond_with    fallocate       # fallocate utility (needs glibc 2.11 to compile)
 %else
 %bcond_without initrd          # don't build initrd version
 %bcond_without fallocate       # fallocate utility (needs glibc 2.11 to compile)
-%bcond_without partx           # partx utility (needs glibc 2.10 for openat to compile)
 %endif
 
 %if "%{pld_release}" == "ac"
@@ -36,28 +35,34 @@ Summary(ru.UTF-8):  Набор базовых системных утилит д
 Summary(tr.UTF-8):     Temel sistem araçları
 Summary(uk.UTF-8):     Набір базових системних утиліт для Linux
 Name:          util-linux
-Version:       2.22.1
-Release:       0.1
+Version:       2.22.2
+Release:       3
 License:       GPL
 Group:         Applications/System
 Source0:       https://www.kernel.org/pub/linux/utils/util-linux/v2.22/%{name}-%{version}.tar.xz
-# Source0-md5: 730cf9932531ed09b53a04ca30fcb4c9
+# Source0-md5: eeacbfdd2556acd899a2d0ffdb446185
 Source1:       http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source1-md5: 3c940c7e7fe699eaa2ddb1bffb3de2fe
 Source2:       login.pamd
 Source3:       %{name}-blockdev.init
 Source4:       %{name}-blockdev.sysconfig
 Source5:       blockdev.upstart
+Source6:       su.pamd
+Source7:       su-l.pamd
+Source8:       runuser.pamd
+Source9:       runuser-l.pamd
+Source10:      nologin.c
+Source11:      nologin.8
 Patch0:                %{name}-pl.po-update.patch
 Patch1:                %{name}-ng-union-mount.patch
+Patch2:                %{name}-runuser.patch
 Patch3:                %{name}-fdformat-ide.patch
 Patch4:                %{name}-fhs.patch
 Patch5:                %{name}-hotkeys.patch
 Patch7:                %{name}-login-lastlog.patch
 Patch8:                %{name}-procpartitions.patch
-
+Patch9:                su-paths.patch
 Patch10:       %{name}-diet.patch
-Patch11:       no-openat.patch
 URL:           http://userweb.kernel.org/~kzak/util-linux/
 BuildRequires: audit-libs-devel >= 1.0.6
 BuildRequires: autoconf >= 2.60
@@ -108,9 +113,13 @@ Obsoletes: sparc32
 Obsoletes:     util-linux-ng < 2.20-1
 Obsoletes:     util-linux-suids
 Conflicts:     SysVinit < 2.86-26
+Conflicts:     SysVinit-tools < 2.88-9
 Conflicts:     e2fsprogs < 1.41.8-5
 Conflicts:     shadow-extras < 1:4.0.3-6
 Conflicts:     upstart-SysVinit < 2.86-28
+%if %{with su}
+Conflicts:     coreutils < 8.19
+%endif
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                debugcflags     -O1 -g
@@ -637,16 +646,16 @@ etykietę lub UUID - statycznie skonsolidowane na potrzeby initrd.
 %setup -q -a1
 #%patch0 -p1
 %patch1 -p1
+%patch2 -p1
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
 %patch7 -p1
 %patch8 -p1
-
+%patch9 -p1
 %patch10 -p1
-%if %{without partx}
-%patch11 -p1
-%endif
+
+install %{SOURCE10} nologin.c
 
 %{__rm} po/stamp-po
 
@@ -664,29 +673,41 @@ export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses -DHAVE_LSEEK64_PROTOTYPE
 %{?with_dietlibc:xCC="%{__cc}"; xCC="diet ${xCC#*ccache }"}
 %configure \
 %if %{with dietlibc}
-       ac_cv_header_crypt_h="no" \
+       ac_cv_header_crypt_h=no \
+       ac_cv_header_stdio_ext_h=no \
 %endif
        CC="$xCC" \
 %if "%{?configure_cache}" == "1"
        --cache-file=%{?configure_cache_file}%{!?configure_cache_file:configure}-initrd.cache \
 %endif
+       --exec-prefix= \
+       --bindir=/bin \
+       --sbindir=/sbin \
+       --libdir=/%{_lib} \
        --disable-shared \
        --enable-static \
-       --disable-libblkid \
-       --disable-fsck \
+       --disable-agetty \
+       --disable-chfn-chsh \
        --disable-cramfs \
-       --disable-raw \
+       --disable-kill \
+       --disable-ldattach \
        --disable-libmount \
-       --disable-su \
-       --disable-sulogin \
-       --disable-chfn-chsh \
        --disable-login \
+       --disable-losetup \
+       --disable-minix \
        --disable-newgrp \
-       --disable-vipw \
+       --disable-partx \
+       --disable-raw \
+       --disable-runuser \
        --disable-schedutils \
+       --disable-setarch \
        --disable-silent-rules \
+       --disable-su \
+       --disable-sulogin \
        --disable-use-tty-group \
        --disable-utmpdump \
+       --disable-uuidd \
+       --disable-vipw \
        --disable-wall \
        --without-audit \
        --without-ncurses \
@@ -695,18 +716,17 @@ export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses -DHAVE_LSEEK64_PROTOTYPE
 # configure gets it unconditionally wrong
 %{__sed} -i -e 's/#define HAVE_WIDECHAR 1//' config.h
 
-for dir in libblkid libuuid disk-utils misc-utils fsck fdisk schedutils hwclock; do
-       %{__make} -C $dir \
-       %if %{with uClibc}
-               LDFLAGS="-Wl,-static"
-       %endif
-       %if %{with dietlibc}
-               CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" \
-               LDFLAGS="-lcompat"
-       %endif
-       # empty line required because there is a backslash up there
-       %{__make} -C $dir install DESTDIR=$(pwd)/initrd
-done
+%{__make} \
+%if %{with uClibc}
+       LDFLAGS="-Wl,-static"
+%endif
+%if %{with dietlibc}
+       CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" \
+       LDFLAGS="-lcompat"
+%endif
+
+%{__make} install \
+       DESTDIR=$(pwd)/initrd
 
 %{__make} clean
 %endif
@@ -718,26 +738,29 @@ done
        --disable-silent-rules \
        --disable-use-tty-group \
        --disable-wall \
-       --enable-su \
-       --enable-sulogin \
-       --enable-utmpdump \
-       --enable-libblkid \
+       --enable-chfn-chsh \
        --enable-chkdupexe \
        --enable-ddate \
-       --enable-chfn-chsh \
-       --enable-login \
-       --enable-newgrp \
-       --enable-vipw \
-       --enable-line \
        --enable-kill \
+       --enable-libblkid \
+       --enable-line \
+       --enable-login \
        --enable-login-chown-vcs \
+       --enable-newgrp \
        --enable-partx \
+       --enable-runuser%{!?with_su:=no} \
+       --enable-su%{!?with_su:=no} \
+       --enable-sulogin \
+       --enable-utmpdump \
+       --enable-vipw \
        --enable-write \
        --with-audit \
-       --with%{!?with_selinux:out}-selinux
+       --with-selinux%{!?with_selinux:=no}
 
 %{__make}
 
+%{__cc} %{rpmcflags} nologin.c -o nologin
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,init,security} \
@@ -747,15 +770,22 @@ install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,init,security} \
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
-%if %{with partx}
 mv $RPM_BUILD_ROOT%{_sbindir}/{addpart,delpart,partx} $RPM_BUILD_ROOT/sbin
-%endif
 mv $RPM_BUILD_ROOT/sbin/raw $RPM_BUILD_ROOT%{_bindir}
 
+install nologin $RPM_BUILD_ROOT/sbin
+install %{SOURCE11} $RPM_BUILD_ROOT%{_mandir}/man8
+
 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/login
 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/blockdev
 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/blockdev
 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/init/blockdev.conf
+%if %{with su}
+cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/su
+cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/su-l
+cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/runuser
+cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/pam.d/runuser-l
+%endif
 
 :> $RPM_BUILD_ROOT/etc/security/blacklist.login
 :> $RPM_BUILD_ROOT/var/lock/wtmpxlock
@@ -770,6 +800,8 @@ done
 ln -sf hwclock $RPM_BUILD_ROOT/sbin/clock
 echo '.so hwclock.8' > $RPM_BUILD_ROOT%{_mandir}/man8/clock.8
 
+ln -s utmpdump $RPM_BUILD_ROOT%{_bindir}/utmpx-dump
+
 for d in cs de es fi fr hu id it ja ko nl pl ; do
        for m in man1 man5 man8 ; do
                if [ -d man/$d/$m ]; then
@@ -794,21 +826,25 @@ done
        $RPM_BUILD_ROOT%{_mandir}/*/man5/nfs.5 \
        $RPM_BUILD_ROOT%{_mandir}/*/man8/{elvtune,setfdprm,sln,ramsize,raw,rdev,rootflags,vidmode}.8
 
-%ifarch sparc sparc64
+%ifarch sparc sparcv9 sparc64
+# programs not built on sparc
 %{__rm} $RPM_BUILD_ROOT%{_mandir}/*/man8/{cfdisk,sfdisk}.8
 %endif
 
+# examples
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/getopt/getopt-parse.*sh
+
 %if %{with initrd}
 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
-install -p initrd%{_bindir}/* $RPM_BUILD_ROOT%{_libdir}/initrd/
-install -p initrd%{_sbindir}/* $RPM_BUILD_ROOT%{_libdir}/initrd/
+install -p initrd/bin/* $RPM_BUILD_ROOT%{_libdir}/initrd
+install -p initrd/sbin/* $RPM_BUILD_ROOT%{_libdir}/initrd
 ln -s fsck $RPM_BUILD_ROOT%{_libdir}/initrd/e2fsck
 
 # We don't need those
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/initrd/{chkdupexe,uuidd,mcookie,whereis,mkfs*,fsck.minix,isosize,logger}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/initrd/{cal,col,colcrt,colrm,column,ctrlaltdel,cytune,dmesg,flock,fsfreeze,fstrim,getopt,hexdump,ipcmk,ipcrm,ipcs,isosize,logger,lslocks,mcookie,mkfs*,readprofile,renice,rev,rtcwake,script,scriptreplay,setsid,tailf,tunelp,wdctl,whereis}
 
 %if %{with dietlibc}
-cp -a initrd%{_libdir}/lib*.a $RPM_BUILD_ROOT%{dietlibdir}
+cp -a initrd/%{_lib}/lib*.a $RPM_BUILD_ROOT%{dietlibdir}
 %endif
 %endif
 
@@ -854,12 +890,14 @@ fi
 
 %files -f %{name}.lang
 %defattr(644,root,root,755)
-%doc */README.* NEWS
+%doc AUTHORS ChangeLog NEWS README README.licensing Documentation misc-utils/getopt-parse.{bash,tcsh}
 
 %attr(755,root,root) /sbin/clock
 %attr(755,root,root) /sbin/hwclock*
+%attr(755,root,root) /sbin/nologin
 %{_mandir}/man8/clock.8*
 %{_mandir}/man8/hwclock.8*
+%{_mandir}/man8/nologin.8*
 %lang(es) %{_mandir}/es/man8/clock.8*
 %lang(es) %{_mandir}/es/man8/hwclock.8*
 %lang(ja) %{_mandir}/ja/man8/clock.8*
@@ -905,17 +943,15 @@ fi
 %attr(755,root,root) /bin/dmesg
 %attr(755,root,root) /bin/kill
 %attr(755,root,root) /bin/more
-%attr(755,root,root) /bin/su
+
 %attr(755,root,root) /bin/wdctl
 
 %attr(755,root,root) /sbin/chcpu
 %attr(755,root,root) /sbin/ctrlaltdel
-%if %{with partx}
 %attr(755,root,root) /sbin/addpart
 %attr(755,root,root) /sbin/delpart
 %attr(755,root,root) /sbin/partx
 %attr(755,root,root) /bin/lsblk
-%endif
 %attr(755,root,root) /sbin/fsfreeze
 %attr(755,root,root) /sbin/fstrim
 %attr(755,root,root) /sbin/mkfs
@@ -966,6 +1002,7 @@ fi
 %attr(755,root,root) %{_bindir}/ul
 %attr(755,root,root) %{_bindir}/unshare
 %attr(755,root,root) %{_bindir}/utmpdump
+%attr(755,root,root) %{_bindir}/utmpx-dump
 %attr(755,root,root) %{_bindir}/whereis
 %attr(2755,root,tty) %{_bindir}/write
 %attr(755,root,root) %{_sbindir}/fdformat
@@ -1015,12 +1052,10 @@ fi
 %{_mandir}/man1/utmpdump.1*
 %{_mandir}/man1/whereis.1*
 %{_mandir}/man1/write.1*
-%if %{with partx}
 %{_mandir}/man8/addpart.8*
 %{_mandir}/man8/delpart.8*
 %{_mandir}/man8/partx.8*
 %{_mandir}/man8/lsblk.8*
-%endif
 %{_mandir}/man8/chcpu.8*
 %{_mandir}/man8/ctrlaltdel.8*
 %{_mandir}/man8/cytune.8*
@@ -1269,6 +1304,17 @@ fi
 %attr(755,root,root) /sbin/mkfs.cramfs
 %attr(755,root,root) /sbin/mkfs.bfs
 
+%if %{with su}
+%attr(755,root,root) /bin/runuser
+%attr(4755,root,root) /bin/su
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/runuser
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/runuser-l
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/su
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/su-l
+%{_mandir}/man1/runuser.1*
+%{_mandir}/man1/su.1*
+%endif
+
 %ghost /var/lock/wtmpxlock
 
 %files -n blockdev
@@ -1470,5 +1516,25 @@ fi
 %if %{with initrd}
 %files initrd
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/initrd/*
+%attr(755,root,root) %{_libdir}/initrd/blkid
+%attr(755,root,root) %{_libdir}/initrd/blockdev
+%attr(755,root,root) %{_libdir}/initrd/fdformat
+%attr(755,root,root) %{_libdir}/initrd/fdisk
+%attr(755,root,root) %{_libdir}/initrd/findfs
+%attr(755,root,root) %{_libdir}/initrd/hwclock
+%attr(755,root,root) %{_libdir}/initrd/look
+%attr(755,root,root) %{_libdir}/initrd/mkswap
+%attr(755,root,root) %{_libdir}/initrd/namei
+%attr(755,root,root) %{_libdir}/initrd/rename
+%ifnarch sparc sparcv9 sparc64
+%attr(755,root,root) %{_libdir}/initrd/sfdisk
+%endif
+%attr(755,root,root) %{_libdir}/initrd/swaplabel
+%attr(755,root,root) %{_libdir}/initrd/uuidgen
+%attr(755,root,root) %{_libdir}/initrd/wipefs
+# not needed?
+#%attr(755,root,root) %{_libdir}/initrd/chrt
+# not built because of disabled libmount
+#%attr(755,root,root) %{_libdir}/initrd/e2fsck
+#%attr(755,root,root) %{_libdir}/initrd/fsck
 %endif
This page took 0.040433 seconds and 4 git commands to generate.