From f82c956587e36a2b6ffb6d0ff715205415600e02 Mon Sep 17 00:00:00 2001 From: =?utf8?q?K=C3=A9vin=20THIERRY?= Date: Fri, 13 Jun 2014 14:53:11 +0200 Subject: [PATCH] Update systemd recipe MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Add pre/post install/uninstall scripts. * New generated recipe from recent spec file. Change-Id: I26e2652facc7703b514cfebd3e9972cf2ddf37ab Signed-off-by: Kévin THIERRY --- recipes-tizen/systemd/systemd.inc | 92 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/recipes-tizen/systemd/systemd.inc b/recipes-tizen/systemd/systemd.inc index 26b982c..3ffb49b 100644 --- a/recipes-tizen/systemd/systemd.inc +++ b/recipes-tizen/systemd/systemd.inc @@ -121,6 +121,26 @@ do_compile() { CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; + ./autogen.sh --build=${TARGET_SYS} --host=${HOST_SYS} \ + --target=x86_64-tizen-linux \ + --program-prefix= \ + --prefix=${prefix} \ + --exec-prefix=${prefix} \ + --bindir=${prefix}/bin \ + --sbindir=${prefix}/sbin \ + --sysconfdir=${sysconfdir} \ + --datadir=${prefix}/share \ + --includedir=${prefix}/include \ + --libdir=${prefix}/lib \ + --libexecdir=${prefix}/libexec \ + --localstatedir=${localstatedir} \ + --sharedstatedir=${prefix}/com \ + --mandir=${mandir} \ + --infodir=${infodir} + + CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; + CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; + FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; autotools_do_configure --build=${TARGET_SYS} --host=${HOST_SYS} \ --target=x86_64-tizen-linux \ --program-prefix= \ @@ -255,6 +275,78 @@ do_install() { } +pkg_preinst_${PN}() { + #!/bin/sh -e + + /usr/bin/getent group cdrom >/dev/null 2>&1 || /usr/sbin/groupadd -r -g 11 cdrom >/dev/null 2>&1 || : + /usr/bin/getent group tape >/dev/null 2>&1 || /usr/sbin/groupadd -r -g 33 tape >/dev/null 2>&1 || : + /usr/bin/getent group dialout >/dev/null 2>&1 || /usr/sbin/groupadd -r -g 18 dialout >/dev/null 2>&1 || : + /usr/bin/getent group floppy >/dev/null 2>&1 || /usr/sbin/groupadd -r -g 19 floppy >/dev/null 2>&1 || : + /usr/bin/systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service >/dev/null 2>&1 || : + # Rename configuration files that changed their names + /usr/bin/mv -n ${sysconfdir}/systemd/systemd-logind.conf ${sysconfdir}/systemd/logind.conf >/dev/null 2>&1 || : + /usr/bin/mv -n ${sysconfdir}/systemd/systemd-journald.conf ${sysconfdir}/systemd/journald.conf >/dev/null 2>&1 || : + +} + +pkg_postinst_${PN}() { + #!/bin/sh -e + + /usr/bin/systemd-machine-id-setup > /dev/null 2>&1 || : + /usr/lib/systemd/systemd-random-seed save > /dev/null 2>&1 || : + /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || : + /usr/bin/systemctl start systemd-udevd.service >/dev/null 2>&1 || : + +} + +pkg_postinst_libgudev() { + #!/bin/sh -e + + /sbin/ldconfig +} + +pkg_postinst_libsystemd() { + #!/bin/sh -e + + /sbin/ldconfig +} + +pkg_prerm_${PN}() { + #!/bin/sh -e + + if [ $1 -eq 0 ] ; then + /usr/bin/systemctl disable \ + getty@.service \ + remote-fs.target \ + systemd-readahead-replay.service \ + systemd-readahead-collect.service >/dev/null 2>&1 || : + /usr/bin/rm -f /etc/systemd/system/default.target >/dev/null 2>&1 || : + fi + +} + +pkg_postrm_libgudev() { + #!/bin/sh -e + + /sbin/ldconfig +} + +pkg_postrm_libsystemd() { + #!/bin/sh -e + + /sbin/ldconfig +} + +pkg_postrm_${PN}() { + #!/bin/sh -e + + if [ $1 -ge 1 ] ; then + /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || : + /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || : + fi + +} + PACKAGES += " libsystemd " PACKAGES += " libgudev-dev " PACKAGES += " libgudev " -- 2.7.4