]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blobdiff - systemd/systemd.nm
systemd: Create missing system groups
[people/amarx/ipfire-3.x.git] / systemd / systemd.nm
index 0d0aba99c0aa5b6fd1c19ef94c5206248ddd95d7..0b8e604e2624ae296bf9d3803af00b52f53360e9 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = systemd
-version    = 185
+version    = 221
 release    = 3
 
 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
@@ -18,51 +18,73 @@ description
        SysV and LSB init scripts.
 end
 
-source_dl  = http://cgit.freedesktop.org/systemd/systemd/snapshot/
+source_dl  = http://www.freedesktop.org/software/systemd/
+sources    = %{thisapp}.tar.xz
 
 build
        unitdir = %{prefix}/lib/systemd/system
 
        requires
+               attr-devel
                audit-devel
-               automake
-               autoconf
                cryptsetup-luks-devel >= 1.4.2
                dbus-devel
                docbook-utils
                docbook-xsl
+               elfutils-devel
                gettext-devel
                glib2-devel
                gobject-introspection-devel >= 1.31
                gperf
                hwdata
                intltool
-               kmod-devel >= 5
+               kmod-devel >= 15
                libacl-devel
                libblkid-devel
                libcap-devel
+               libgcrypt-devel
+               libmount-devel
                libselinux-devel
-               libtool
+               libuuid-devel
+               m4
                pam-devel
                pciutils-devel
                usbutils
                vala
                xz-devel
+               zlib-devel
        end
 
        configure_options += \
-               --with-distro=ipfire \
+               --with-sysvinit-path= \
+               --with-sysvrcnd-path= \
+               --enable-introspection \
+               --enable-zlib \
+               --enable-compat-libs \
+               --disable-smack \
+               --disable-backlight \
+               --disable-firstboot \
+               --disable-hibernate \
+               --disable-importd \
+               --disable-libiptc \
+               --disable-machined \
+               --disable-networkd \
+               --disable-resolved \
+               --disable-sysusers \
+               --disable-timesyncd \
+               --disable-timedated \
+               --disable-polkit \
+               --disable-kdbus \
                --disable-static
 
        prepare_cmds
-               ./autogen.sh ac
-       end
-
-       test
-               make check
+               %{create_groups}
        end
 
        install_cmds
+               # Create folder in log to store the journal.
+               mkdir -pv %{BUILDROOT}/var/log/journal
+
                # Create sysv compatible symlinks.
                mkdir -pv %{BUILDROOT}%{sbindir}
                ln -svf ../lib/systemd/systemd  %{BUILDROOT}/%{sbindir}/init
@@ -99,18 +121,56 @@ build
 
                # Replace absolute symlinks by relative ones.
                cd %{BUILDROOT}%{unitdir}/../user
-               for i in bluetooth local-fs printer remote-fs shutdown sockets sound swap; do
+               for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
                        ln -svf ../system/${i}.target ${i}.target || exit 1
                done
 
                # Remove tmpfile for X11
                rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
 
-               # Remove unneeded symlink for xdg
-               rm -rfv %{BUILDROOT}/etc/xdg/systemd
+               # Remove unneeded stuff for xdg
+               rm -rfv %{BUILDROOT}/etc/xdg
+
+               # Remove unneeded stuff for rpm.
+               rm -rvf %{BUILDROOT}/etc/rpm
+               rm -rvf %{BUILDROOT}/usr/lib/rpm
+
+               # Use journald. Enable the import of kernel messages.
+               # Stop forwarding to a syslog daemon.
+               sed \
+                       -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \
+                       -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \
+                       -i %{BUILDROOT}/etc/systemd/journald.conf
+
+               # Install legacy tmpfile to autocreate /run/lock on startup.
+               install -v -m 644 %{DIR_APP}/tmpfiles.d/legacy.conf %{BUILDROOT}%{prefix}/lib/tmpfiles.d/
+
+               # Remove udev rules for "predictable" network device renaming.
+               # http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
+               rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-name-slot.rules
+
+               # Create journald related folders.
+               mkdir -pv %{BUILDROOT}/run/log/journal
+               chown root:systemd-journal %{BUILDROOT}/run/log/journal
+
+               mkdir -pv %{BUILDROOT}/var/log/journal
+               chown root:systemd-journal %{BUILDROOT}/var/log/journal
        end
 end
 
+create_groups
+       # Create groups for udev.
+       getent group cdrom >/dev/null || groupadd -g 11 cdrom || :
+       getent group tape >/dev/null || groupadd -g 33 tape || :
+       getent group dialout >/dev/null || groupadd -g 18 dialout || :
+       getent group floppy >/dev/null || groupadd -g 19 floppy || :
+       getent group input >/dev/null || groupadd -r input || :
+       getent group utmp >/dev/null || groupadd -r -g 22 utmp || :
+
+       # Create group for journald.
+       getent group systemd-journal >/dev/null || /usr/sbin/groupadd -r systemd-journal
+end
+
 packages
        package %{name}
                groups += Base
@@ -122,6 +182,8 @@ packages
                        hwdata
                        python-cairo
                        python-dbus
+                       python-gobject3
+                       %{name}-libs=%{thisver}
                        %{name}-units=%{thisver}
                        util-linux>=2.19
                end
@@ -134,12 +196,15 @@ packages
                        /sbin/reboot
                        /sbin/shutdown
 
+                       syslog
                        udev = %{thisver}
                end
 
                conflicts
+                       bash-completion < 2.1
                        dracut < 019
                        filesystem < 002
+                       rsyslog < 5.8.6-4
                        upstart
                end
 
@@ -159,11 +224,7 @@ packages
                end
 
                script prein
-                       # Create groups for udev.
-                       getent group cdrom >/dev/null || groupadd -g 11 cdrom || :
-                       getent group tape >/dev/null || groupadd -g 33 tape || :
-                       getent group dialout >/dev/null || groupadd -g 18 dialout || :
-                       getent group floppy >/dev/null || groupadd -g 19 floppy || :
+                       %{create_groups}
                end
 
                script postin
@@ -193,12 +254,23 @@ packages
                        # Be sure to stop the old udev before updating.
                        /usr/bin/systemctl stop udev.service udev-trigger.service \
                                udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
+
+                       %{create_groups}
                end
 
                script postup
+                       # Re-exec systemd after update.
+                       /usr/bin/systemctl daemon-reexec
+
                        # Restart login service after update
                        /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
                        /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
+
+                       # Use the new journald configuration file and restart the service.
+                       if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
+                               mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf
+                               /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
+                       fi
                end
 
                # Be sure to start the new udev after everything is done.
@@ -244,9 +316,75 @@ packages
                end
        end
 
+       package %{name}-libs
+               template LIBS
+       
+               groups += Base
+
+               prerequires
+                       /etc/nsswitch.conf
+               end
+
+               provides
+                       nss-myhostname = %{thisver}
+               end
+
+               obsoletes
+                       nss-myhostname <= 0.3-3
+               end
+
+               conflicts
+                       # Ensure that the version of systemd matches systemd-libs.
+                       systemd > %{thisver}
+                       systemd < %{thisver}
+               end
+
+               # Add myhostname to the hosts line of /etc/nsswitch.conf
+               script postin
+                       if [ -f "/etc/nsswitch.conf" ]; then
+                               sed -i.bak -e '
+                                       /^hosts:/ !b
+                                       /\<myhostname\>/ b
+                                       s/[[:blank:]]*$/ myhostname/
+                                       ' /etc/nsswitch.conf
+                       fi
+               end
+
+               # Remove myhostname from the hosts line of /etc/nsswitch.conf
+               script postun
+                       if [ -f "/etc/nsswitch.conf" ]; then
+                               sed -i.bak -e '
+                                       /^hosts:/ !b
+                                       s/[[:blank:]]\+myhostname\>//
+                                       ' /etc/nsswitch.conf
+                       fi
+               end
+       end
+
+       package %{name}-compat-libs
+               summary = systemd compatibility libraries.
+               description
+                       Compatibility libraries for systemd. If your package requires this
+                       package, you need to update your link options and build.
+               end
+
+               requires
+                       %{name}-libs = %{thisver}
+               end
+
+               files
+                       %{libdir}/libsystemd-daemon.so.*
+                       %{libdir}/libsystemd-login.so.*
+                       %{libdir}/libsystemd-journal.so.*
+                       %{libdir}/libsystemd-id128.so.*
+               end
+       end
+
        package %{name}-devel
                template DEVEL
 
+               requires += %{name}-compat-libs = %{thisver}
+
                files += %{prefix}/lib/pakfire/macros/
        end
 
@@ -263,7 +401,7 @@ packages
                end
 
                files
-                       %{libdir}/libgudev*.so.*
+                       %{libdir}/lib*udev*.so.*
                        %{libidr}/girepository*/
                end
        end
@@ -281,9 +419,10 @@ packages
                end
 
                files
-                       %{libdir}/libgudev*.so
+                       %{libdir}/lib*udev*.so
                        %{libdir}/pkgconfig/lib*udev.pc
                        %{libdir}/pkgconfig/gudev*
+                       %{includedir}/lib*udev.h
                        %{includedir}/gudev*
                        %{datadir}/gir-*
                        %{datadir}/gtk-doc/html/gudev