sysvinit/sysvinit.spec

324 lines
9.5 KiB
RPMSpec

#
# spec file for package sysvinit (Version 2.88)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: sysvinit
%define MGVER 0.9.6s
%define PDVER 2.0.2
%define KPVER 2.16
%define SCVER 1.10
%define SIVER 2.88
%define START 0.56
License: GPLv2+
Group: System/Base
AutoReqProv: on
Version: 2.88
Release: 11
Summary: SysV-Style init
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: audit-devel libselinux-devel libsepol-devel pam-devel
Url: http://savannah.nongnu.org/projects/sysvinit/
Source: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-2.88dsf.tar.bz2
Source2: killproc-2.16.tar.bz2
Source3: powerd-2.0.2.tar.bz2
Source4: showconsole-1.10.tar.bz2
Source5: startpar-0.56.tar.bz2
Source6: rc.powerd
Source7: sysvinit-rpmlintrc
Source8: mkinitrd-boot.sh
Source9: mkinitrd-kill1.sh
Source10: mkinitrd-kill2.sh
Patch: sysvinit-2.88dsf.dif
Patch1: sysvinit-2.82-startstop.patch
Patch2: sysvinit-2.88dsf-suse.patch
Patch3: sysvinit-2.88dsf-no-kill.patch
Patch4: notify-pam-dead.patch
Patch5: sysvinit-last-ipv6-heuristic.patch
Patch6: sysvinit-2.88dsf-utf8.dif
Patch7: sysvinit-2.88dsf-selinux.patch
Patch20: powerd-2.0.2.dif
Patch21: powerd-2.0.2-getaddrinfo.patch
Patch30: killproc-2.16.dif
Patch40: showconsole-1.10.dif
Patch50: startpar-0.56.dif
Requires: sysvinit-tools
Provides: sbin_init
%description
System V style init programs by Miquel van Smoorenburg that control the
booting and shutdown of your system. These support a number of system
runlevels, each one associated with a specific set of utilities. For
example, the normal system runlevel is 3, which starts a getty on
virtual consoles tty1-tty6. Runlevel 5 starts xdm. Runlevel 0 shuts
down the system. See the individual man pages for inittab, initscript,
halt, init, powerd, reboot, runlevel, shutdown, and telinit for
more information.
%package tools
License: GPLv2+
Summary: Tools for basic booting
Group: System/Base
%if 0%{suse_version} > 1120
Requires(preun): coreutils %insserv_prereq
Requires(postun): coreutils %insserv_prereq
%else
PreReq: coreutils %insserv_prereq
%endif
%description tools
Helper tools from sysvinit that support booting, including but not exclusive
to startpar, killproc and pidof. System V init specific programs are in the
sysvinit package.
%prep
%setup -n sysvinit-%{SIVER}dsf -q -b 2 -b 3 -b 4 -b 5
%patch1 -p0 -b .startstop
%patch2 -p0 -b .suse
%patch3 -p0 -b .no-kill
%patch4 -p0 -b .pam
%patch5 -p2 -b .ipv6
%patch6 -p0 -b .utf8
%patch7 -p0 -b .selinux
%patch
pushd ../powerd-%{PDVER}
%patch20
%patch21
popd
pushd ../killproc-%{KPVER}
%patch30
popd
pushd ../showconsole-%{SCVER}
%patch40
popd
pushd ../startpar-%{START}
%patch50
popd
%_fixowner .
%_fixgroup .
/bin/chmod -Rf a+rX,g-w,o-w .
%build
RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -D_FILE_OFFSET_BITS=64 -pipe"
CC=gcc
export RPM_OPT_FLAGS CC
make %{?_smp_mflags} WITH_SELINUX=yes DISTRO=SuSE
pushd ../showconsole-%{SCVER}
make %{?_smp_mflags}
popd
pushd ../killproc-%{KPVER}
make %{?_smp_mflags} INC="-I../showconsole-%{SCVER} -L../showconsole-%{SCVER}"
popd
pushd ../powerd-%{PDVER}
%ifnarch s390 s390x
./configure --prefix= --bindir='$(DESTDIR)/sbin' \
--mandir='$(DESTDIR)%{_mandir}' \
--sbindir='$(DESTDIR)/sbin'
make %{?_smp_mflags} CFLAGS="-I../sysvinit-%{SIVER}dsf/src $RPM_OPT_FLAGS "
%endif
popd
pushd ../startpar-%{START}
make %{?_smp_mflags} INC="-I../showconsole-%{SCVER} -L../showconsole-%{SCVER}"
popd
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir ${RPM_BUILD_ROOT}
mkdir -m 755 -p ${RPM_BUILD_ROOT}/bin
mkdir -m 755 -p ${RPM_BUILD_ROOT}/dev
mkdir -m 755 -p ${RPM_BUILD_ROOT}/etc
mkdir -m 755 -p ${RPM_BUILD_ROOT}/sbin
mkdir -m 755 -p ${RPM_BUILD_ROOT}/usr/bin
mkdir -m 755 -p ${RPM_BUILD_ROOT}/usr/include
mkdir -m 755 -p ${RPM_BUILD_ROOT}%{_mandir}/man1
mkdir -m 755 -p ${RPM_BUILD_ROOT}%{_mandir}/man5
mkdir -m 755 -p ${RPM_BUILD_ROOT}%{_mandir}/man8
make install -C src MANPATH=%{_mandir} ROOT=${RPM_BUILD_ROOT} WITH_SELINUX=yes DISTRO=SuSE
test -p ${RPM_BUILD_ROOT}/dev/initctl || {
rm -f ${RPM_BUILD_ROOT}/dev/initctl
mknod ${RPM_BUILD_ROOT}/dev/initctl p
chmod 600 ${RPM_BUILD_ROOT}/dev/initctl
}
pushd ../showconsole-%{SCVER}
make install MANPATH=%{_mandir} INSTBINFLAGS="-m 0700" DESTDIR=${RPM_BUILD_ROOT}
popd
pushd ../killproc-%{KPVER}
make install MANPATH=%{_mandir} INSTBINFLAGS="-m 0755" DESTDIR=${RPM_BUILD_ROOT}
popd
pushd ../powerd-%{PDVER}
%ifnarch s390 s390x
make install DESTDIR=${RPM_BUILD_ROOT}
cp README README.powerd
cp SUPPORTED SUPPORTED.powerd
cp FAQ FAQ.powerd
echo '# ' > ${RPM_BUILD_ROOT}/etc/powerd.conf
echo '# /etc/powerd.conf for powerd version-2.02' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
echo '# ' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
echo '# read manual page of detectups(8) and powerd(8) its self.' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
echo '# ' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
install -m 0744 %{SOURCE6} ${RPM_BUILD_ROOT}/etc/init.d/powerd
%endif
popd
pushd ../startpar-%{START}
make install DESTDIR=${RPM_BUILD_ROOT}
popd
#
# Install mkinitrd scriptlets
#
install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts
install -m 0755 %{SOURCE8} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-blogd.sh
install -m 0755 %{SOURCE9} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-killblogd.sh
install -m 0755 %{SOURCE10} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-killblogd2.sh
#
# Remove files not packed:
#
rm -f ${RPM_BUILD_ROOT}/usr/include/{initreq.h,libblogger.h}
rm -f ${RPM_BUILD_ROOT}/usr/lib/libblogger.a
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mesg.1*
%ifarch s390 s390x
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man8/powerd.8*
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man8/detectups.8*
rm -f ${RPM_BUILD_ROOT}/sbin/powerd
rm -f ${RPM_BUILD_ROOT}/sbin/detectups
%endif
chmod 444 ${RPM_BUILD_ROOT}%{_mandir}/man?/*
%preun tools
%stop_on_removal powered
%post tools
if test -x /sbin/telinit -a -p /dev/initctl -a -f /proc/1/exe -a -d /proc/1/root -a ! -d /.build ; then
if test $(stat -Lc '%%D-%%i' /) = $(stat -Lc '%%D-%%i' /proc/1/root) ; then
/sbin/telinit u
fi
fi
if test -x /sbin/mkinitrd_setup; then
mkinitrd_setup
fi
%postun tools
%insserv_cleanup
if test -x /sbin/mkinitrd_setup; then
mkinitrd_setup
fi
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr (-,root,root,755)
%config /etc/pam.d/init
/sbin/halt
/sbin/init
/sbin/poweroff
/sbin/reboot
/sbin/runlevel
/sbin/shutdown
/sbin/telinit
%doc %{_mandir}/man8/halt.8.gz
%doc %{_mandir}/man5/initscript.5.gz
%doc %{_mandir}/man5/inittab.5.gz
%doc %{_mandir}/man8/init.8.gz
%doc %{_mandir}/man8/poweroff.8.gz
%doc %{_mandir}/man8/reboot.8.gz
%doc %{_mandir}/man8/runlevel.8.gz
%doc %{_mandir}/man8/shutdown.8.gz
%doc %{_mandir}/man8/telinit.8.gz
%files tools
%defattr (-,root,root,755)
%ifnarch s390 s390x
%config /etc/powerd.conf
%config /etc/init.d/powerd
%doc ../powerd-%{PDVER}/README.powerd
%doc ../powerd-%{PDVER}/SUPPORTED.powerd
%doc ../powerd-%{PDVER}/FAQ.powerd
%doc ../powerd-%{PDVER}/powerd.conf.monitor
%doc ../powerd-%{PDVER}/powerd.conf.peer
%endif
# %doc contrib/bootlogd.README
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/boot-blogd.sh
/lib/mkinitrd/scripts/boot-killblogd.sh
/lib/mkinitrd/scripts/boot-killblogd2.sh
/bin/mountpoint
/bin/pidof
/bin/usleep
/bin/fsync
/usr/bin/last
/usr/bin/lastb
/usr/bin/utmpdump
# /sbin/bootlogd
# /sbin/intr
/sbin/blogger
/sbin/blogd
/sbin/fstab-decode
/sbin/showconsole
/sbin/setconsole
/sbin/isserial
/sbin/checkproc
/sbin/pidofproc
/sbin/killproc
/sbin/killall5
/sbin/pidof
%ifnarch s390 s390x
/sbin/powerd
/sbin/detectups
%endif
/sbin/startpar
/sbin/vhangup
/sbin/mkill
/sbin/startproc
/sbin/start_daemon
/sbin/sulogin
%doc %{_mandir}/man1/last.1.gz
%doc %{_mandir}/man1/lastb.1.gz
%doc %{_mandir}/man1/usleep.1.gz
%doc %{_mandir}/man1/fsync.1.gz
# /usr/include/libblogger.h
# /usr/lib/libblogger.a
%doc %{_mandir}/man1/mountpoint.1.gz
%doc %{_mandir}/man1/utmpdump.1.gz
# %doc %{_mandir}/man8/bootlogd.8.gz
%doc %{_mandir}/man8/blogger.8.gz
%doc %{_mandir}/man8/blogd.8.gz
%doc %{_mandir}/man8/fstab-decode.8.gz
%doc %{_mandir}/man8/showconsole.8.gz
%doc %{_mandir}/man8/setconsole.8.gz
%doc %{_mandir}/man8/isserial.8.gz
%doc %{_mandir}/man8/checkproc.8.gz
%doc %{_mandir}/man8/pidofproc.8.gz
#%doc %{_mandir}/man8/intr.8.gz
%doc %{_mandir}/man8/killall5.8.gz
%doc %{_mandir}/man8/killproc.8.gz
%doc %{_mandir}/man8/pidof.8.gz
%ifnarch s390 s390x
%doc %{_mandir}/man8/powerd.8.gz
%doc %{_mandir}/man8/detectups.8.gz
%endif
%doc %{_mandir}/man8/startproc.8.gz
%doc %{_mandir}/man8/start_daemon.8.gz
%doc %{_mandir}/man8/startpar.8.gz
%doc %{_mandir}/man8/sulogin.8.gz
%doc %{_mandir}/man8/vhangup.8.gz
%doc %{_mandir}/man8/mkill.8.gz
%changelog