1 Summary: Programs which control basic system processes
7 Url: http://savannah.nongnu.org/projects/sysvinit
11 Source: %{name}-%{version}dsf.tar.gz
15 Source1001: %{name}.manifest
17 Patch0: 21_ifdown_kfreebsd.patch
18 Patch1: 50_bootlogd_devsubdir.patch
19 Patch2: 54_bootlogd_findptyfail.patch
20 Patch3: 55_bootlogd_flush.patch
21 Patch4: 60_init_selinux_ifdef.patch
22 Patch5: 62_init_freebsdterm.patch
23 Patch6: 63_init_keep_utf8_ttyflag.patch
24 Patch7: 70_compiler_warnings.patch
25 Patch8: 91_sulogin_lockedpw.patch
26 Patch9: 94_fstab-decode.patch
27 Patch10: 96_shutdown_acctoff.patch
28 Patch11: 97_init_starttest.patch
29 Patch12: 98_installtarget.patch
30 Patch13: startpar.patch
31 Patch14: always_use_lcrypt.patch
32 Patch15: dont_set_ownership.patch
33 Patch16: add_initscripts.patch
34 Patch18: 64_init_add_cmd_for_reboot.dpatch
35 Patch19: 0001-Fixing-syntax-error-in-start-stop-daemon.c.patch
36 Patch20: systemd_param.patch
37 Patch21: 99_ftbfs_define_enoioctlcmd.patch
40 The sysvinit package contains a group of processes that control
41 the very basic functions of your system. sysvinit includes the init
42 program, the first program started by the Linux kernel when the
43 system boots. Init then controls the startup, running, and shutdown
44 of all other programs.
47 Summary: System-V-like utilities
49 Provides: /usr/sbin/service
53 This package contains the important System-V-like utilities.
54 Specifically, this package includes:
55 killall5, last, lastb, mesg, pidof, service, sulogin
57 %package -n initscripts
58 Summary: scripts for initializing the system
60 Requires: /lib/lsb/init-functions
62 %description -n initscripts
63 scripts for initializing and shutting down the system
64 The scripts in this package initialize a system at boot time
65 and shut it down at halt or reboot time.
70 %setup -q -n %{name}-%{version}dsf
72 %patch0 -p1 -b .ifdown_kfreebsd
73 %patch1 -p1 -b .bootlogd_devsubdir
74 %patch2 -p1 -b .bootlogd_findptyfail
75 %patch3 -p1 -b .bootlogd_flush
76 %patch4 -p1 -b .init_selinux_ifdef
77 %patch5 -p1 -b .init_freebsdterm
78 %patch6 -p1 -b .init_keep_utf8_ttyflag
79 %patch7 -p1 -b .compiler_warnings
80 %patch8 -p1 -b .sulogin_lockedpw
81 %patch9 -p1 -b .fstab-decode
82 %patch10 -p1 -b .shutdown_acctoff
83 %patch11 -p1 -b .init_starttest
84 %patch12 -p1 -b .installtarget
85 %patch13 -p1 -b .startpar
86 %patch14 -p1 -b .always_use_lcrypt
87 %patch15 -p1 -b .dont_set_ownership
99 export CFLAGS='-ansi -W -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE'
101 gcc $LDFLAGS -o start-stop-daemon contrib/start-stop-daemon.c
104 make -C src ROOT=$RPM_BUILD_ROOT install
105 make -C startpar DESTDIR=$RPM_BUILD_ROOT install
106 make -C initscripts DESTDIR=$RPM_BUILD_ROOT install
108 install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}/
109 install %SOURCE1 $RPM_BUILD_ROOT/%{_datadir}/%{name}/
110 install %SOURCE2 $RPM_BUILD_ROOT/%{_datadir}/%{name}/
111 install -d $RPM_BUILD_ROOT/usr/sbin/
112 install %SOURCE3 $RPM_BUILD_ROOT/usr/sbin/
114 install start-stop-daemon $RPM_BUILD_ROOT/usr/sbin/
116 rm -f $RPM_BUILD_ROOT/usr/bin/wall
117 rm -f $RPM_BUILD_ROOT/usr/bin/lastb
118 rm -f $RPM_BUILD_ROOT/usr/bin/utmpdump
119 rm -f $RPM_BUILD_ROOT/usr/share/man/man1/wall.1*
120 rm -f $RPM_BUILD_ROOT%{_includedir}/initreq.h
122 rm -rf %{buildroot}/%{_docdir}
124 mkdir -p $RPM_BUILD_ROOT%{_datadir}/license
125 for keyword in LICENSE COPYING COPYRIGHT;
127 for file in `find %{_builddir} -name $keyword`;
129 cat $file >> $RPM_BUILD_ROOT%{_datadir}/license/%{name};
135 mkdir -p %{buildroot}/usr/share/license
136 cp LICENSE %{buildroot}/usr/share/license/%{name}
139 echo ".... sysvinit post ....."
140 [ -f /etc/inittab ] || /bin/cp -p /usr/share/sysvinit/inittab /etc/inittab
148 # Initialize rcS default file.
150 if [ ! -f /etc/default/rcS ]
152 cp -p /usr/share/initscripts/default.rcS /etc/default/rcS
156 # When installing for the first time or upgrading from version before
157 # 2.86.ds1-27, a reboot is needed to make the /lib/init/rw/ tmpfs
158 # available. Flag this using notify-reboot-required. Not mounting it
159 # here as it creates problem for debootstrap, vservers, pbuilder and
162 if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
163 /usr/share/update-notifier/notify-reboot-required
167 # Create initial log files
169 for F in /var/log/dmesg /var/log/boot /var/log/fsck/checkroot /var/log/fsck/checkfs
171 if [ ! -f "$F" ] && touch "$F" >/dev/null 2>&1
173 echo "(Nothing has been logged yet.)" >| "$F"
174 # root UID is 0, adm GID is ordinary 4
181 # Set up nologin symlink so that dynamic-login-disabling will work
182 # (when DELAYLOGIN is set to "yes")
184 if [ ! -L /etc/nologin ] && [ ! -e /etc/nologin ]
186 rm -f /var/lib/initscripts/nologin
187 ln -s /var/lib/initscripts/nologin /etc/nologin
191 # Set up motd stuff, putting variable file in /var/run/
193 if [ ! -f /etc/motd.tail ]
197 sed 1d /etc/motd > /etc/motd.tail
198 [ -s /etc/motd.tail ] || rm -f /etc/motd.tail
201 if [ ! -f /var/run/motd ]
205 cat /etc/motd > /var/run/motd
210 if [ ! -L /etc/motd ]
212 [ -f /etc/default/rcS ] && . /etc/default/rcS
213 if [ "$EDITMOTD" = no ]
215 cat /var/run/motd > /etc/motd.static
216 ln -sf motd.static /etc/motd
218 ln -sf /var/run/motd /etc/motd
223 # Mount kernel virtual filesystems...not.
224 # This causes problems in pbuilder.
227 #if [ -x /etc/init.d/mountkernfs.sh ]
229 # if which invoke-rc.d >/dev/null 2>&1
231 # invoke-rc.d mountkernfs.sh start || :
233 # /etc/init.d/mountkernfs.sh start
238 # Create /dev/pts, /dev/shm directories
240 if [ "$(uname -s)" = Linux ]
243 # Only create /dev/{pts,shm} if /dev is on the
244 # root file system. If some package has mounted a
245 # seperate /dev (ramfs from udev, devfs) it is
246 # responsible for the presence of those subdirs.
247 # (it is OK for these to fail under fakechroot)
249 if ! mountpoint -q /dev
252 [ -d /dev/pts ] || { mkdir --mode=755 /dev/pts ; chown 0:0 /dev/pts || [ "$FAKECHROOT" = true ]; }
253 [ -d /dev/shm ] || { mkdir --mode=755 /dev/shm ; chown 0:0 /dev/shm || [ "$FAKECHROOT" = true ]; }
258 # Create /etc/rc.local on first time install and when upgrading from
259 # versions before "2.86.ds1-16"
261 if [ ! -e /etc/rc.local ]; then
262 cat << EOF > /etc/rc.local
267 # This script is executed at the end of each multiuser runlevel.
268 # Make sure that the script will "exit 0" on success or any other
271 # In order to enable or disable this script just change the execution
274 # By default this script does nothing.
278 # make sure it's enabled by default.
279 chmod 755 /etc/rc.local
283 rm -rf $RPM_BUILD_ROOT
289 %manifest %{name}.manifest
290 %defattr(-,root,root)
291 %{_datadir}/license/%{name}
297 %exclude /sbin/poweroff
298 %exclude /sbin/reboot
305 %{_datadir}/%{name}/inittab
306 %{_datadir}/%{name}/update-rc.d
307 #%{_includedir}/initreq.h
310 %manifest %{name}.manifest
317 /usr/sbin/start-stop-daemon
318 %attr(755,root,root)/usr/sbin/service
321 /usr/share/license/%{name}
323 %files -n initscripts
324 %manifest %{name}.manifest
325 %{_sysconfdir}/init.d/*
326 %{_sysconfdir}/init.d/.slp
327 %{_sysconfdir}/default/*
328 %{_datadir}/initscripts/default.rcS
329 /etc/network/if-up.d/mountnfs