Hello community, here is the log from the commit of package ypbind for openSUSE:12.2 checked in at 2012-07-14 13:19:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:12.2/ypbind (Old) and /work/SRC/openSUSE:12.2/.ypbind.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ypbind", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:12.2/ypbind/ypbind.changes 2012-06-25 16:18:54.000000000 +0200 +++ /work/SRC/openSUSE:12.2/.ypbind.new/ypbind.changes 2012-07-14 13:19:05.000000000 +0200 @@ -1,0 +2,6 @@ +Tue Jul 10 15:26:38 UTC 2012 - [email protected] + +- Add native systemd support (ypbind.service and friends). + bnc#769405 + +------------------------------------------------------------------- New: ---- ypbind-systemd-post ypbind-systemd-pre ypbind.service ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ypbind.spec ++++++ --- /var/tmp/diff_new_pack.Cz8yHh/_old 2012-07-14 13:19:06.000000000 +0200 +++ /var/tmp/diff_new_pack.Cz8yHh/_new 2012-07-14 13:19:06.000000000 +0200 @@ -16,10 +16,20 @@ # +%if 0%{?suse_version} >= 1220 +%define with_systemd 1 +%else +%define with_systemd 0 +%endif + Name: ypbind BuildRequires: dbus-1-devel BuildRequires: openslp-devel BuildRequires: pkgconfig +%if %{with_systemd} +BuildRequires: systemd +%{?systemd_requires} +%endif %if %{suse_version} > 1010 BuildRequires: dbus-1-glib-devel %endif @@ -38,6 +48,9 @@ Group: Productivity/Networking/NIS Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2 Source1: SuSEfirewall.ypbind +Source2: ypbind.service +Source3: ypbind-systemd-pre +Source4: ypbind-systemd-post %description This package provides the ypbind daemon. The ypbind daemon binds NIS @@ -73,21 +86,40 @@ touch $RPM_BUILD_ROOT/etc/yp.conf # Create filelist with translatins %{find_lang} ypbind-mt +# Install systemd stuff +%if %{with_systemd} +install -D -m 644 %SOURCE2 %{buildroot}%{_unitdir}/ypbind.service +install -D -m 755 %SOURCE3 $RPM_BUILD_ROOT/usr/share/ypbind/ypbind-systemd-pre +install -m 755 %SOURCE4 $RPM_BUILD_ROOT/usr/share/ypbind/ypbind-systemd-post +%endif + +%if %{with_systemd} + +%pre +%service_add_pre ypbind.service +%endif %post %{fillup_and_insserv ypbind} +%if %{with_systemd} +%service_add_post ypbind.service +%endif %preun %stop_on_removal ypbind +%if %{with_systemd} +%service_del_preun ypbind.service +%endif if [ "$1" = "0" ]; then rm -f var/yp/binding/* fi -exit 0 %postun %restart_on_update ypbind %insserv_cleanup -exit 0 +%if %{with_systemd} +%service_del_postun ypbind.service +%endif %files -f ypbind-mt.lang %defattr(-,root,root) @@ -105,5 +137,10 @@ #/usr/share/locale/de/LC_MESSAGES/ypbind-mt.mo %dir /var/yp %dir /var/yp/binding +%if %{with_systemd} +%{_unitdir}/ypbind.service +%dir /usr/share/ypbind +/usr/share/ypbind/* +%endif %changelog ++++++ ypbind-systemd-post ++++++ #!/bin/sh # # ypbind-domain # # description: This is part of former ypbind init script, which is used # to fix problems with the init scripts continuing even when # we are really not bound yet to a server, and then things # that need NIS fail. # if [ "$YPBIND_DBUS" = "no" ]; then # Only check if we don't use NetworkManager if [ $? -eq 0 ]; then notfound=1 for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do ypwhich &>/dev/null && { notfound=0 ; break; }; echo -n " ." sleep 1; done if [ $notfound -eq 1 ]; then echo -n " ${warn}No NIS server found${norm}"; fi else exit 1 fi fi ++++++ ypbind-systemd-pre ++++++ #!/bin/sh # # ypbind-domain # # description: This is part of former ypbind init script, which is used # to setup proper domainname before starting ypbind daemon # itself. ## If we don't have a /etc/yp.conf file, skip starting of ## ypbind and return with "program not configured" ## if you add the -broadcast Option later, comment this out. if [ ! -f /etc/yp.conf -a "$YPBIND_BROADCAST" != "yes" ] ; then # Tell the user this has skipped echo -n " . . . . . . . . . . ${attn}/etc/yp.conf not found${norm}" exit 1 fi # evaluate the OPTIONS for ypbind-mt OTHER_YPBIND_OPTS="" test "$YPBIND_VERBOSE" = "yes" && OTHER_YPBIND_OPTS="-verbose $OTHER_YPBIND_OPTS" test "$YPBIND_LOCAL_ONLY" = "yes" && OTHER_YPBIND_OPTS="-local-only $OTHER_YPBIND_OPTS" test "$YPBIND_BROADCAST" = "yes" && OTHER_YPBIND_OPTS="-broadcast $OTHER_YPBIND_OPTS" test "$YPBIND_BROKEN_SERVER" = "yes" && OTHER_YPBIND_OPTS="-broken-server $OTHER_YPBIND_OPTS" test "X$YPBIND_PING_INTERVAL" != "X" && OTHER_YPBIND_OPTS="-ping-interval $YPBIND_PING_INTERVAL $OTHER_YPBIND_OPTS" test "$YPBIND_DBUS" = "no" && OTHER_YPBIND_OPTS="-no-dbus $OTHER_YPBIND_OPTS" test -n "$YPBIND_OPTIONS" && OTHER_YPBIND_OPTS="$YPBIND_OPTIONS $OTHER_YPBIND_OPTS" echo ++++++ ypbind.service ++++++ [Unit] Description=NIS/YP (Network Information Service) Clients to NIS Domain Binder Requires=rpcbind.service After=network.target rpcbind.service ypserv.service Before=systemd-user-sessions.service [Service] Type=simple EnvironmentFile=-/etc/sysconfig/ypbind # Do not call ypbind-systemd-pre from ExecStartPre to keep the # keep OTHER_YPBIND_OPTS options which have to be passed as options # suggested by [email protected] ExecStart=/bin/sh -c "/usr/share/ypbind/ypbind-systemd-pre; exec /usr/sbin/ypbind -n $OTHER_YPBIND_OPTS" ExecStartPost=/usr/share/ypbind/ypbind-systemd-post ExecStopPost=/bin/sh -c "/bin/rm -f /var/yp/binding/* /var/run/ypbind.pid" [Install] WantedBy=multi-user.target -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
