]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - util-linux/util-linux.nm
Merge remote-tracking branch 'stevee/compat-packages'
[people/ms/ipfire-3.x.git] / util-linux / util-linux.nm
index d403c9b549657784108db25878042d2339f765c3..60a54fcf03edd72db34c9362fe40b09a7c4c0fee 100644 (file)
@@ -4,10 +4,12 @@
 ###############################################################################
 
 name       = util-linux
-version    = 2.19
-major_ver  = 2.19
-release    = 3
+major_ver  = 2.22
+minor_ver  = 1
+version    = %{major_ver}.%{minor_ver}
+release    = 1
 
+maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
 groups     = System/Base
 url        = http://kernel.org/~kzak/util-linux/
 license    = GPLv2 and GPLv2+ and BSD with advertising and Public Domain
@@ -25,12 +27,14 @@ source_dl  = ftp://ftp.kernel.org/pub/linux/utils/util-linux/v%{major_ver}/
 build
        requires
                audit-devel
+               coreutils >= 8.19
                gettext
                libcap-devel
                libselinux-devel
                libsepol-devel
                ncurses-devel
                pam-devel
+               libudev-devel
                zlib-devel
        end
 
@@ -40,16 +44,18 @@ build
                -D_FILE_OFFSET_BITS=64
 
        configure_options += \
-               --bindir=/bin \
-               --sbindir=/sbin \
+               --with-systemdsystemunitdir=%{unitdir} \
                --disable-wall \
+               --enable-eject \
                --enable-kill \
-               --enable-login-utils \
                --enable-partx \
                --enable-write \
+               --enable-su \
+               --enable-socket-activation \
                --enable-libmount-mount \
                --with-selinux \
                --with-audit \
+               --with-udev \
                --disable-makeinstall-chown \
                --disable-static
 
@@ -64,34 +70,35 @@ build
        end
 
        install_cmds
-               mkdir -pv %{BUILDROOT}/sbin \
+               mkdir -pv \
+                       %{BUILDROOT}/var/lib/libuuid \
                        %{BUILDROOT}/var/lib/hwclock \
                        %{BUILDROOT}/usr/share/man/man8 \
+                       %{BUILDROOT}/run/uuidd \
                        %{BUILDROOT}/var/log
 
-               install -m 755 %{DIR_APP}/nologin %{BUILDROOT}/sbin
+               install -m 755 %{DIR_APP}/nologin %{BUILDROOT}%{sbindir}
                install -m 644 %{DIR_SOURCE}/nologin.8 %{BUILDROOT}/usr/share/man/man8/
 
                touch %{BUILDROOT}/var/log/lastlog
 
                # Remove deprecated commands
-               rm -fv %{BUILDROOT}/{sbin,usr/share/man/man*}/{fsck,mkfs}.{bfs,minix}* \
-                       %{BUILDROOT}/usr/bin/chkdupexe %{BUILDROOT}/usr/bin/vi{gr,pw} \
-                       %{BUILDROOT}/sbin/{sln,shutdown} %{BUILDROOT}/bin/{line,newgrp,pg}
+               rm -fv %{BUILDROOT}/{%{sbindir},usr/share/man/man*}/{fsck,mkfs}.{bfs,minix}* \
+                       %{BUILDROOT}{%{bindir},%{sbindir}}/{chkdupexe,newgrp,vi{gr,pw}} \
+                       %{BUILDROOT}%{sbindir}/{sln,shutdown} %{BUILDROOT}%{bindir}/{line,pg}
+               rm -fv %{BUILDROOT}/usr/share/man/man1/{chkdupexe,line,pg,newgrp}.* \
+                       %{BUILDROOT}/usr/share/man/man8/{vipw,vigr}.*
                rm -fv %{BUILDROOT}/usr/share/getopt/*.tcsh
 
-               # Create /etc/mtab symlink
-               mkdir -pv %{BUILDROOT}/etc
-               ln -svf /proc/mounts %{BUILDROOT}/etc/mtab
-       end
-
-       export PKG_REQUIRES_FILTER = /proc/.*/mounts
-end
+               # Set capabilities
+               chmod -v -s %{BUILDROOT}%{bindir}/mount
+               setcap CAP_DAC_OVERRIDE,CAP_SYS_ADMIN=ep %{BUILDROOT}%{bindir}/mount
+               chmod -v -s %{BUILDROOT}%{bindir}/umount
+               setcap CAP_DAC_OVERRIDE,CAP_SYS_ADMIN=ep %{BUILDROOT}%{bindir}/umount
 
-# This symlink is allowed to be absolute.
-quality-agent
-       whitelist_symlink
-               /etc/mtab
+               # su (set right capabilities)
+               chmod -v u-s %{BUILDROOT}%{bindir}/su
+               setcap cap_setgid,cap_setuid+ep %{BUILDROOT}%{bindir}/su
        end
 end
 
@@ -103,14 +110,46 @@ packages
                        /etc/pam.d/system-auth
                end
 
-               obsoletes = util-linux-ng
+               provides
+                       eject = %{thisver}
+                       /bin/dmesg
+                       /bin/eject
+                       /bin/kill
+                       /bin/more
+                       /bin/mount
+                       /bin/su
+                       /bin/umount
+                       /sbin/blkid
+                       /sbin/blockdev
+                       /sbin/findfs
+                       /sbin/fsck
+                       /sbin/nologin
+               end
+
+               obsoletes
+                       util-linux-ng
+                       eject <= 2.1.5
+               end
 
                conflicts
-                       setup<3.0-2
+                       filesystem < 002
+                       coreutils < 8.19
+                       setup < 3.0-2
                        util-linux-ng
+                       sysvinit <= 2.86-2
+               end
+
+               preprequires += coreutils
+
+               script postin
+                       touch /var/log/lastlog
+
+                       # mtab symlink
+                       rm -f /etc/mtab
+                       ln -s /proc/mounts /etc/mtab
                end
        end
-       
+
        # Package information for libblkid
        package libblkid
                summary =  Block device ID library.
@@ -118,25 +157,31 @@ packages
                        This is the block device identification library,
                        part of util-linux.
                end
-       
+
+               conflicts = filesystem < 002
+
                files
-                       /lib/libblkid.*
+                       %{libdir}/libblkid.*
                end
        end
-       
+
        # Package information for libblkid-devel
-       package libblikid-devel
+       package libblkid-devel
                summary =  Development library and header of libblkid.
                description = %{summary}
-       
+
+               requires
+                       libuuid-devel
+               end
+
                files
-                       /usr/include/blkid/
-                       /usr/lib/libblkid.*
-                       /usr/lib/pkgconfig/blkid.pc
-                       /usr/share/man/man3/*blkid*
+                       %{includedir}/blkid/
+                       %{libdir}/libblkid.so
+                       %{libdir}/pkgconfig/blkid.pc
+                       %{mandir}/man3/*blkid*
                end
        end
-       
+
        # Package information for libuuid
        package libuuid
                summary =  Universally unique ID library.
@@ -144,25 +189,31 @@ packages
                        This is the universally unique ID library,
                        part of util-linux.
                end
-       
+
+               requires
+                       uuidd=%{thisver}
+               end
+
+               conflicts = filesystem < 002
+
                files
-                       /lib/libuuid.*
+                       %{libdir}/libuuid.*
                end
        end
-       
+
        # Package information for libuuid-devel
        package libuuid-devel
                summary =  Development library and header of libuuid.
                description = %{summary}
-       
+
                files
-                       /usr/include/uuid/
-                       /usr/lib/libuuid.*
-                       /usr/lib/pkgconfig/uuid.pc
-                       /usr/share/man/man3/*uuid*
+                       %{includedir}/uuid/
+                       %{libdir}/libuuid.so
+                       %{libdir}/pkgconfig/uuid.pc
+                       %{mandir}/man3/*uuid*
                end
        end
-       
+
        # Package information for libmount
        package libmount
                summary =  Device mounting library.
@@ -170,22 +221,75 @@ packages
                        This is the device mounting library,
                        part of util-linux.
                end
-       
+
+               conflicts = filesystem < 002
+
                files
-                       /lib/libmount.*
+                       %{libdir}/libmount.*
                end
        end
-       
+
        # Package information for libmount-devel
        package libmount-devel
                summary =  Development library and header of libmount.
                description = %{summary}
-       
+
                files
-                       /usr/include/mount/
-                       /usr/lib/libmount.*
-                       /usr/lib/pkgconfig/mount.pc
-                       /usr/share/man/man3/*mount*
+                       %{includedir}/libmount/
+                       %{libdir}/libmount.so
+                       %{libdir}/pkgconfig/mount.pc
+                       %{mandir}/man3/*mount*
+               end
+       end
+
+       package uuidd
+               summary = Helper daemon to guarantee uniqueness of time-based UUIDs.
+               description
+                       The uuidd package contains a userspace daemon (uuidd) which guarantees
+                       uniqueness of time-based UUID generation even at very high rates on
+                       SMP systems.
                end
+
+               groups += Base
+
+               files
+                       %{sbindir}/uuidd
+                       %{mandir}/man8/uuidd.8*
+                       %{sharedstatedir}/libuuid
+                       %{unitdir}/uuidd*
+                       /run/uuidd
+               end
+
+               prerequires += shadow-utils
+
+               script prein
+                       getent group uuidd >/dev/null || groupadd -r uuidd
+                       getent passwd uuidd >/dev/null || \
+                               useradd -r -g uuidd -d %{sharedstatedir}/libuuid -s /sbin/nologin \
+                                       -c "UUID generator helper daemon" uuidd
+               end
+       
+               script postin
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl enable uuidd.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       systemctl --no-reload disable uuidd.service >/dev/null 2>&1 || :
+                       systemctl stop uuidd.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl try-restart uuidd.service >/dev/null 2>&1 || :
+               end
+       end
+       
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end