Package sysvinit: Specfile

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
Name: sysvinit
Version: 2.88
Release: alt6

%def_enable selinux
%def_enable initramfs

Summary: Programs which control basic system processes
License: GPLv2+
Group: System/Configuration/Boot and Init
Url: http://savannah.nongnu.org/projects/%name

# ftp://ftp.twaren.net/Unix/NonGNU/%name/%name-%version.tar.bz2
Source: %name-%version.tar

# Debian
Patch11: %name-2.88-deb-doc-manuals.patch
Patch12: %name-2.88-deb-init-keep-utf8-ttyflag.patch
Patch13: %name-2.88-deb-init-selinux.patch

# Owl/ALT
Patch101: %name-2.88-alt-progname.patch
Patch102: %name-2.88-alt-usage.patch
Patch103: %name-2.88-alt-umask.patch
Patch104: %name-2.88-alt-execv-path.patch
Patch105: %name-2.88-rh-alt-owl-pidof.patch
Patch106: %name-2.88-owl-initcmd_setenv.patch
Patch107: %name-2.88-owl-alt-fixes.patch
Patch108: %name-2.88-alt-signedness.patch
Patch109: %name-2.88-alt-makefile.patch
Patch110: %name-2.88-alt-doc.patch
Patch111: %name-2.88-alt-wur.patch
Patch112: %name-2.88-alt-wall-line-size.patch
Patch113: %name-2.88-alt-halt-poweroff.patch
Patch114: %name-2.88-alt-gentoo-kexec.patch
Patch115: %name-2.88-alt-sysmacros.patch

# SuSE
Patch201: %name-2.88-suse-SETSIG.patch

Provides: SysVinit = %version-%release
Obsoletes: SysVinit < %version-%release

Requires: /sbin/sulogin
Requires: %name-utils = %version-%release
Conflicts: glibc < 6:2.2.1-ipl0.2mdk,
BuildConflicts: openssl-devel < 0.9.6a
# Required for SELinux support.
%{?_enable_selinux:BuildRequires: libselinux-devel}

%description
This package contains a group of programs that control the
very basic functions of your system.  sysvinit includes the init
program, the first program started by the Linux kernel when the
system boots.  init then controls the startup, running and shutdown
of all other programs.

%package utils
Summary: Commonly used utilites from sysvinit
Group: System/Base
Conflicts: SysVinit < 2.86-alt2

%description utils
The package contains commonly used non-boot-specific utilities from sysvinit:
bootlogd, killall5, last, lastb, mesg, mountpoint, pidof, pidof, wall.

%if_enabled initramfs
%package initramfs
Summary: Init for initramfs
Group: System/Base

%description initramfs
Simplified version of init (used in initfamfs).
%endif

%prep
%setup

# Debian
%patch11 -p1
%patch12 -p1
%patch13 -p1

# Owl/ALT
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch115 -p1

# rest
%patch201 -p1

pushd src
find -type f -print0 |
	xargs -r0 grep -FZl '"paths.h"' -- |
	xargs -r0 sed -i 's/"paths\.h"/"paths_init.h"/g' --
mv paths.h paths_init.h
echo '#include <paths.h>' >>paths_init.h
popd

find -type f -name \*.orig -delete

%build
%if_enabled initramfs
%make_build -C src init \
	DISTRO=ALT \
	CFLAGS='%optflags -fomit-frame-pointer' \
	LDFLAGS= \
	LCRYPT= \
	WITH_SELINUX= \
	#
mv -f src/init{,.initrd}

%make_build -C src clean
%endif

%make_build -C src \
	DISTRO=ALT \
	CFLAGS='%optflags -fomit-frame-pointer' \
	LDFLAGS= \
	LCRYPT= \
	%{?_enable_selinux:WITH_SELINUX=yes} \
	#
%install
mkdir -p %buildroot{/{s,}bin,/dev,%_bindir,%_includedir,%_mandir/man{1,3,5,8}}
%make_install install -C src \
	ROOT=%buildroot \
	DISTRO=ALT \
	#

install -pm755 src/bootlogd src/init.initrd %buildroot/sbin/

mkfifo -m600 %buildroot/dev/initctl

%pre
# This is tricky.  We don't want to let RPM remove the only link to the
# old init as that would actually leave it pending for delete on process
# termination.  That delete is a filesystem write operation meaning that
# the root filesystem would need to stay mounted read/write.  But we
# absolutely want to be able to remount it read-only during shutdown,
# possibly with the old init still alive!
if [ -e /sbin/init -a ! -e /sbin/.init-working ]; then
	ln /sbin/init /sbin/.init-working
fi

%post
# If /proc is mounted and /sbin/.init-working is running, tell init to
# invoke the replaced version of itself.
if pidof /sbin/.init-working >/dev/null 2>&1; then
	/sbin/telinit u
	sleep 1
fi

# If /proc is not mounted or /sbin/.init-working is no longer running,
# remove it.
if ! pidof /sbin/.init-working >/dev/null 2>&1; then
	rm -f /sbin/.init-working
fi

%files
%attr(700,root,root) /sbin/init
%attr(700,root,root) /sbin/shutdown
/sbin/halt
/sbin/fstab-decode
/sbin/poweroff
/sbin/reboot
/sbin/runlevel
/sbin/telinit
%_man5dir/initscript.*
%_man5dir/inittab.*
%_man8dir/halt.*
%_man8dir/fstab-decode.*
%_man8dir/init.*
%_man8dir/poweroff.*
%_man8dir/reboot.*
%_man8dir/runlevel.*
%_man8dir/shutdown.*
%_man8dir/telinit.*
%_includedir/*
%ghost /dev/initctl

%if_enabled initramfs
%files initramfs
%attr(700,root,root) /sbin/init.initrd
%endif

%files utils
%attr(700,root,root) /sbin/bootlogd
/sbin/killall5
/sbin/pidof
/bin/mountpoint
/bin/pidof
%_bindir/last
%_bindir/lastb
%_bindir/mesg
%attr(2711,root,tty) %_bindir/wall
%_man1dir/last.*
%_man1dir/lastb.*
%_man1dir/mesg.*
%_man1dir/mountpoint.*
%_man1dir/wall.*
%_man8dir/bootlogd.*
%_man8dir/killall5.*
%_man8dir/pidof.*

%changelog
* Mon Nov 11 2019 Dmitry V. Levin <ldv@altlinux.org> 2.88-alt6
- Fixed build with glibc >= 2.28.
- Removed explicit "PreReq: coreutils".

* Thu Feb 19 2015 Alexey Gladkov <legion@altlinux.ru> 2.88-alt5
- Add subpackage for initramfs (closes: #30738).

* Wed Jun 13 2012 Sergey Bolshakov <sbolshakov@altlinux.ru> 2.88-alt4
- halt: do kexec instead of reboot if another kernel is loaded

* Wed Oct 05 2011 Dmitry V. Levin <ldv@altlinux.org> 2.88-alt3
- poweroff: pass "-P" option to shutdown (closes: #26391).
- halt: pass "-H" option to shutdown.

* Tue Apr 05 2011 Dmitry V. Levin <ldv@altlinux.org> 2.88-alt2
- Renamed SysVinit to sysvinit.

* Thu Aug 05 2010 Dmitry V. Levin <ldv@altlinux.org> 2.88-alt1
- Updated to 2.88-11.
- Enabled SELinux support.
- sysvinit-utils: added controversial Conflict (closes: #15625).
- Fixed wall(1) output.

* Fri Apr 25 2008 Dmitry V. Levin <ldv@altlinux.org> 2.86-alt2
- Moved commonly used non-boot-specific utilities to sysvinit-utils
  subpackage, based on work made by Dmitry M. Maslennikov.

* Sat Jan 06 2007 Dmitry V. Levin <ldv@altlinux.org> 2.86-alt1
- Updated to 2.85-36.
- Reviewed patches.

* Mon May 15 2006 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt9
- Fixed build with gcc-4.1.0.

* Tue May 24 2005 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt8
- Fixed 64bit compilation issues.

* Sat Jan 03 2004 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt7
- Updated to 2.85-9.
  + Merged upstream patches:
    owl-wall-longjmp-clobbering
    owl-format
    alt-owl-bootlogd
    owl-mount-proc
    owl-typos
    rh-alt-owl-shutdown-log
    owl-alt-makefile
  + Updated patches:
    alt-progname-umask
    rh-alt-pidof
    alt-doc
- Do not try to exec /sbin/mount.
- Fixed three potential problems introduced in 2.85-9.
- Fixed few signedness (harmless though) issues.

* Wed Aug 20 2003 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt6
- Fixed build.
- Build with -Werror.
- Fixed annoying 'must be superuser' error messages.

* Mon May 12 2003 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt5
- Removed rh-alt-halt patch,
  install startup >= 0.1-alt1 package is recommended.
- Do not package start-stop-daemon by default,
  moved to service >= 0.1-alt1 package.

* Tue May 06 2003 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt4
- PreReq: coreutils (#0002562).

* Sun Apr 27 2003 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt3
- Synced with 2.85-owl4:
  + Don't build sulogin, use new implementation from msulogin package.
  + Don't mount /proc in pidof, and mount it as "proc" rather than "none"
    in killall5 such that umount and others can reasonably refer to it in
    error messages.
- Do not package utmpdump.

* Wed Apr 23 2003 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt2
- Synced with 2.85-owl1:
  + New/updated patches:
    owl-wall-longjmp-clobbering
    owl-format
    owl-alt-sulogin
    alt-owl-start-stop-daemon
    alt-owl-bootlogd
    owl-mount-path
    owl-typos
    rh-alt-owl-shutdown-log

* Sun Apr 20 2003 Dmitry V. Levin <ldv@altlinux.org> 2.85-alt1
- Updated to 2.85.
  + Following patches are merged upstream:
    alt-wall-alarm
    alt-init-spawn
    alt-sulogin-notty
    rh-alt-wait
    owl-alt-bound
    owl-alt-format
    alt-wall-tty
    alt-man-wall
  + Updated patches:
    owl-alt-sulogin
- /sbin/start-stop-daemon:
  + various safety fixes;
  + changed pid_is_exec check.
- Provides: /sbin/start-stop-daemon.

* Tue Apr 15 2003 Dmitry V. Levin <ldv@altlinux.org> 2.84-alt8
- Reworked patches: following patches are going upstream:
  alt-wall-alarm
  alt-init-spawn
  alt-sulogin-notty
  rh-alt-wait
  owl-alt-bound
  owl-alt-format
  alt-wall-tty
  alt-man-wall

* Fri Apr 04 2003 Dmitry V. Levin <ldv@altlinux.org> 2.84-alt7
- Updated to 2.84-3.
- wall: fixed alarm handling (#0002460).

* Sat Mar 01 2003 Dmitry V. Levin <ldv@altlinux.org> 2.84-alt6
- Fixed build in system without /dev/initctl available.
- pidof: honor full pathname.
- wall: avoid writing to non-tty devices.
- last: added '-t' option for checking state at certain times (rh).
- shutdown: added logging on shutdown/reboot (rh).
- shutdown: spawn: fixed child process handling and program execution (rh).

* Tue Dec 10 2002 Dmitry V. Levin <ldv@altlinux.org> 2.84-alt5
- src/init.c(spawn): fixed bug reported by Vladimir N. Oleynik.
- Packaged /sbin/bootlogd and /sbin/start-stop-daemon.

* Tue Sep 17 2002 Dmitry V. Levin <ldv@altlinux.org> 2.84-alt4
- Revert back /sbin/halt permissions (to reenable -usermode).
- Use subst instead of perl in build scripts.

* Tue Aug 06 2002 Dmitry V. Levin <ldv@altlinux.org> 2.84-alt3
- Marked /dev/initctl socket as %%ghost (#0001125).

* Sat Jul 13 2002 Dmitry V. Levin <ldv@altlinux.org> 2.84-alt2
- Reviewed patches, dropped obsolete ones.
- Added building of bootlogd and start-stop-daemon.
- Restricted permissions on root-only programs.

* Thu Feb 28 2002 Dmitry V. Levin <ldv@alt-linux.org> 2.84-alt1
- 2.84
- Added initreq.h

* Wed Nov 14 2001 Dmitry V. Levin <ldv@alt-linux.org> 2.83-alt1
- 2.83
- Moved usermode stuff to separate package.

* Tue Sep 11 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.82-alt2
- usermode: fixed pam config.

* Wed Aug 29 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.82-alt1
- 2.82

* Mon Aug 27 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.81-alt2
- Fixed version display info.
- Changed usermode subpackage requirements.

* Wed Aug 22 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.81-alt1
- 2.81
- Added usermode subpackage with consolehelpr bindings.

* Fri Jun 01 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.78-ipl5mdk
- Progname patch.
- Various bound and format checks from Owl project.
- Ensure the umask is no less restrictive than 022 (owl).
- Use getpass(3) in sulogin - the old code was unreliable (owl).

* Tue May 29 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.78-ipl4mdk
- Fixed umask (rh).

* Fri Feb 09 2001 Dmitry V. Levin <ldv@fandra.org> 2.78-ipl3mdk
- Merged RH patches:
  + document '-n' option to wall, make it root-only (rh).
  + don't open files in sulogin unless they're really ttys (rh).

* Wed Jan 10 2001 Dmitry V. Levin <ldv@fandra.org> 2.78-ipl2mdk
- Added blowfish crypt support (from libcrypt).

* Wed Oct 18 2000 Dmitry V. Levin <ldv@fandra.org> 2.78-ipl1mdk
- Merged MDK, RH and BCL patches.
- Re-execute /sbin/init in %post.

* Sun Feb 20 2000 Dmitry V. Levin <ldv@fandra.org>
- Fandra adaptions

* Wed Jan  5 2000 Dmitry V. Levin <ldv@fandra.org>
- Merge with mdk

* Fri Oct 22 1999 Dmitry V. Levin <ldv@fandra.org>
- Fandra adaptions

* Tue Oct 19 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Merge with redhat changes.

* Tue Sep 28 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
- nologin patch isn't needed

* Tue Sep 14 1999 Daouda LO <daouda@mandrakesoft.com>
- 2.77

* Wed May 19 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com>
- We can't hardlink /bin/pidof anywhere, because it's a symlink itself.
  Fix...

* Tue May 18 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Linking /bin/pidof to /sbin/pidof for RH compatibilities.

* Mon Apr 12 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- The normal source doen't work, we need to remove the orphan link to rebuild.

* Fri Apr  9 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com>
- update to 2.76
- bzip2 man pages
- handle RPM_OPT_FLAGS
- remove some RH patches because they're not required with 2.76
- add de, fr, tr locales
- Move pidof from /sbin to /bin - can't hurt.

* Wed Jan 06 1999 Cristian Gafton <gafton@redhat.com>
- glibc 2.1

* Sun Aug 23 1998 Jeff Johnson <jbj@redhat.com>
- poweroff symlink not included (problem #762)

* Thu Jul 09 1998 Chris Evans <chris@ferret.lmh.ox.ac.uk>
- Fix a securelevel releated security hole. Go on, try and break append
  only files + securelevel now ;-)

* Wed Jul  8 1998 Jeff Johnson <jbj@redhat.com>
- remove /etc/nologin at end of shutdown.
- compile around missing SIGPWR on sparc

* Thu May 07 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Wed Apr 08 1998 Cristian Gafton <gafton@redhat.com>
- upgraded to 2.74
- fixed the package source url... (yeah, it was wrong !)

* Wed Oct 1 1997 Cristian Gafton <gafton@redhat.com>
- fixed the MD5 check in sulogin (128 hash bits encoded with base64 gives
  22 bytes, not 24...). Fix in -md5.patch

* Thu Sep 11 1997 Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
- /etc/initrunlvl gets linked to /tmp/init-root/var/run/initrunlvl which is
  just plain wrong..
- /usr/bin/utmpdump was missing in the files section, although it was
  explicitly patched into PROGS.
- added attr's to the files section.
- various small fixes.

* Tue Jun 17 1997 Erik Troan <ewt@redhat.com>
- updated to 2.71
- built against glibc 2.0.4

* Fri Feb 07 1997 Michael K. Johnson <johnsonm@redhat.com>
- Added sulogin.8 man page to file list.