- from PLD with systemd stuff removed
[packages/netcf.git] / netcf-systemd.patch
1 --- netcf-0.2.4/configure.ac.orig       2014-05-14 12:01:08.000000000 +0200
2 +++ netcf-0.2.4/configure.ac    2014-05-24 07:27:55.530147003 +0200
3 @@ -104,7 +104,7 @@
4  AC_MSG_CHECKING([for system init flavor])
5  AC_ARG_WITH([sysinit],
6    [AS_HELP_STRING([--with-sysinit@<:@=STYLE@:>@],
7 -    [Style of init script to install: initscripts, systemd,
8 +    [Style of init script to install: initscripts, systemd, both,
9       check, none @<:@default=check@:>@])],
10    [],[with_sysinit=check])
11  
12 @@ -113,6 +113,8 @@
13         ;;
14      initscripts)
15         ;;
16 +    both)
17 +       ;;
18      none)
19         ;;
20      check)
21 @@ -135,8 +137,8 @@
22    with_sysinit=none
23  fi
24  
25 -AM_CONDITIONAL([NETCF_USE_INITSCRIPTS], test "$with_sysinit" = "initscripts")
26 -AM_CONDITIONAL([NETCF_USE_SYSTEMD], test "$with_sysinit" = "systemd")
27 +AM_CONDITIONAL([NETCF_USE_INITSCRIPTS], test "$with_sysinit" = "initscripts" -o "$with_sysinit" = "both")
28 +AM_CONDITIONAL([NETCF_USE_SYSTEMD], test "$with_sysinit" = "systemd" -o "$with_sysinit" = "both")
29  AM_CONDITIONAL([NETCF_TRANSACTION_SUPPORT], test "$with_sysinit" != "none")
30  AC_MSG_RESULT($with_sysinit)
31  if test "$with_sysinit" != "none" && test "$with_driver" != "redhat"; then
32 --- netcf-0.2.4/src/Makefile.am.orig    2014-05-09 13:37:17.000000000 +0200
33 +++ netcf-0.2.4/src/Makefile.am 2014-05-24 07:51:17.630117778 +0200
34 @@ -119,10 +119,6 @@
35  
36  if NETCF_DRIVER_REDHAT
37  
38 -install-data-local: install-sysinit
39 -
40 -uninstall-local: uninstall-sysinit
41 -
42  # This is for the shell script that handles network config change
43  # transactions. It is used by both the initscripts and systemd
44  # flavors, as well as by libnetcf.so itself
45 @@ -136,13 +132,19 @@
46  
47  BUILT_SOURCES += netcf-transaction.sh
48  
49 +INSTALL_TARGETS =
50 +UNINSTALL_TARGETS =
51 +
52  if NETCF_USE_INITSCRIPTS
53 -install-sysinit: netcf-transaction.init
54 +INSTALL_TARGETS += install-sysinit-init
55 +UNINSTALL_TARGETS += uninstall-sysinit-init
56 +
57 +install-sysinit-init: netcf-transaction.init
58         $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
59         $(INSTALL_SCRIPT) netcf-transaction.init \
60           $(DESTDIR)$(sysconfdir)/rc.d/init.d/netcf-transaction
61  
62 -uninstall-sysinit:
63 +uninstall-sysinit-init:
64         rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/netcf-transaction \
65           $(DESTDIR)$(sysconfdir)/sysconfig/netcf-transaction
66  
67 @@ -157,17 +159,20 @@
68  
69  BUILT_SOURCES += netcf-transaction.init
70  
71 -else ! NETCF_USE_INITSCRIPTS
72 +endif NETCF_USE_INITSCRIPTS
73  
74  if NETCF_USE_SYSTEMD
75 +INSTALL_TARGETS += install-sysinit-systemd
76 +UNINSTALL_TARGETS += uninstall-sysinit-systemd
77 +
78  SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
79  
80 -install-sysinit: netcf-transaction.service
81 +install-sysinit-systemd: netcf-transaction.service
82         $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
83         $(INSTALL_DATA) netcf-transaction.service \
84           $(DESTDIR)$(SYSTEMD_UNIT_DIR)/netcf-transaction.service
85  
86 -uninstall-sysinit:
87 +uninstall-sysinit-systemd:
88         rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/netcf-transaction.service
89         rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
90  
91 @@ -180,11 +185,12 @@
92  
93  BUILT_SOURCES += netcf-transaction.service
94  
95 -else ! NETCF_USE_SYSTEMD
96 -install-sysinit:
97 -uninstall-sysinit:
98 -endif ! NETCF_USE_SYSTEMD
99 -endif ! NETCF_USE_INITSCRIPTS
100 +endif NETCF_USE_SYSTEMD
101 +
102 +install-data-local: $(INSTALL_TARGETS)
103 +
104 +uninstall-local: $(UNINSTALL_TARGETS)
105 +
106  endif NETCF_DRIVER_REDHAT
107  
108  DISTCLEANFILES += $(BUILT_SOURCES)