Annotation of /trunk/core/initscripts/initscripts-0.5.2-r1.smage2
Parent Directory
|
Revision Log
Revision 1365 -
(hide annotations)
(download)
Mon May 4 20:07:59 2009 UTC (15 years, 1 month ago) by niro
File size: 3751 byte(s)
Mon May 4 20:07:59 2009 UTC (15 years, 1 month ago) by niro
File size: 3751 byte(s)
-ver bump to 0.5.2-r1; support for udev-141
1 | niro | 1365 | # $Id$ |
2 | |||
3 | PNAME="initscripts" | ||
4 | PVER="0.5.2" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | PCATEGORIE="sys-apps" | ||
8 | STATE="unstable" | ||
9 | |||
10 | DESCRIPTION="Magellan Initscripts for sysVinit." | ||
11 | HOMEPAGE="http://magellan-linux.net" | ||
12 | |||
13 | # the pkgs "coreutils, findutils, sed, gawk, bzip2, tar, rsync, wget" | ||
14 | # are needed to fix the /etc/profile issue | ||
15 | DEPEND=">= sys-apps/coreutils-5 | ||
16 | >= sys-apps/findutils-4 | ||
17 | >= sys-apps/grep-2 | ||
18 | >= sys-apps/sed-4 | ||
19 | >= sys-apps/gawk-3 | ||
20 | >= app-arch/bzip2-1 | ||
21 | >= sys-apps/tar-1 | ||
22 | >= net-misc/rsync-2 | ||
23 | >= net-misc/wget-1 | ||
24 | >= sys-apps/sysvinit-2.85 | ||
25 | >= sys-apps/which-2.16" | ||
26 | |||
27 | SRCFILE="${PNAME}-${PVER}.tar.bz2" | ||
28 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
29 | |||
30 | sminclude cvs rsync | ||
31 | |||
32 | # available options are source/rsync | ||
33 | METHOD=source | ||
34 | |||
35 | # fixes mageversion; | ||
36 | # the makefile uses the date as version number | ||
37 | # but for release we want to use the release version | ||
38 | RELEASE_MAGEVERSION= | ||
39 | |||
40 | case ${METHOD} in | ||
41 | cvs) SDEPEND=">= dev-util/cvs-1.11" ;; | ||
42 | rsync) SDEPEND=">= net-misc/rsync-2.6.9" ;; | ||
43 | source) SDEPEND="" ;; | ||
44 | esac | ||
45 | |||
46 | [[ ${METHOD} = source ]] && SRC_URI=( mirror://${PNAME}/${SRCFILE} ) | ||
47 | |||
48 | src_prepare() | ||
49 | { | ||
50 | [[ ${METHOD} = source ]] && { munpack ${SRCFILE} || die; } | ||
51 | |||
52 | if [[ ${METHOD} = rsync ]] | ||
53 | then | ||
54 | RSYNC_URI="rsync://magellan-linux.de/${PNAME}-${PVER}-${PBUILD}" | ||
55 | rsync_fetch_source || die | ||
56 | fi | ||
57 | |||
58 | if [[ ${METHOD} = cvs ]] | ||
59 | then | ||
60 | MY_CVS_MODULE="magellan-src/magellan-initscripts" | ||
61 | # $PVER must be eg 0_3_3 | ||
62 | MY_CVS_OPTS="-r init-$(echo ${PVER}| sed -e "s|\.|\_|g")-${PBUILD}" | ||
63 | export CVSROOT=:pserver:anonymous:@magellan-linux.de:/magellan-cvs | ||
64 | cvs_fetch_source || die | ||
65 | fi | ||
66 | } | ||
67 | |||
68 | src_compile() | ||
69 | { | ||
70 | cd ${SRCDIR} | ||
71 | mmake || die | ||
72 | } | ||
73 | |||
74 | src_install() | ||
75 | { | ||
76 | cd ${SRCDIR} | ||
77 | make DESTDIR=${BINDIR} install || die | ||
78 | |||
79 | # CONFIG_PROTECT_MASK for /etc/rc.d/init.d | ||
80 | install -d ${BINDIR}/etc/env.d || die | ||
81 | echo "CONFIG_PROTECT_MASK=\"/etc/rc.d/init.d\"" > ${BINDIR}/etc/env.d/01initscripts || die | ||
82 | # always overwrite /etc/mageversion | ||
83 | echo 'CONFIG_PROTECT_MASK="/etc/mageversion"' >> ${BINDIR}/etc/env.d/01initscripts || die | ||
84 | |||
85 | # fix mageversion if any release version is given | ||
86 | if [[ ! -z ${RELEASE_MAGEVERSION} ]] | ||
87 | then | ||
88 | echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die | ||
89 | fi | ||
90 | } | ||
91 | |||
92 | postinstall() | ||
93 | { | ||
94 | # emulate seq; its needed to run rc-config | ||
95 | # this fixes some annyoing warning when building | ||
96 | # livecd or bootstrapping a system. | ||
97 | # this hack will be removed when the toolchain is fixed | ||
98 | if [ ! -f /usr/bin/seq ] | ||
99 | then | ||
100 | echo "Using fake 'seq' command ..." | ||
101 | seq() { | ||
102 | start=$1 | ||
103 | end=$2 | ||
104 | for ((i=start; i < end+1; i++)) | ||
105 | do | ||
106 | echo $i | ||
107 | done | ||
108 | } | ||
109 | export -f seq | ||
110 | fi | ||
111 | |||
112 | # create service state dir mountpoint | ||
113 | # needed by >=initscripts-0.3.2-r1 | ||
114 | [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d | ||
115 | |||
116 | # mark this dir as undeletable | ||
117 | touch ${MROOT}/var/lib/init.d/.keep | ||
118 | |||
119 | echo "Creating Runlevels ..." | ||
120 | local i | ||
121 | for i in checkfs cleanfs halt \ | ||
122 | loadkeys localnet modules mountfs \ | ||
123 | network reboot sendsignals \ | ||
124 | setclock swap sysctl consolefont | ||
125 | do | ||
126 | echo -e "\tAdded ${i} ..." | ||
127 | ${MROOT}/sbin/rc-config del ${i} > /dev/null | ||
128 | ${MROOT}/sbin/rc-config add ${i} > /dev/null | ||
129 | done | ||
130 | |||
131 | # | ||
132 | # do not ask the user about following files | ||
133 | # | ||
134 | # if they exist let config_protect process them | ||
135 | # but then remove the protected files, to keep only the original file | ||
136 | # | ||
137 | # file-root is ${MROOT}/etc | ||
138 | local CONFIG_IGNORE="fstab group hostname hosts inittab passwd conf.d/net.eth0 modules.autoload.d/kernel-2.4 modules.autoload.d/kernel-2.6" | ||
139 | local i file path | ||
140 | for i in ${CONFIG_IGNORE} | ||
141 | do | ||
142 | file="$(basename ${i})" | ||
143 | path="$(dirname ${i})/" | ||
144 | [[ ${path} == ./ ]] && path="" | ||
145 | |||
146 | rm -f ${MROOT}/etc/${path}._cfg????_${file} | ||
147 | done | ||
148 | |||
149 | # initscripts >= 0.5.0: rc file moved to /etc/conf.d/rc | ||
150 | if [[ -f ${MROOT}/etc/conf.d/rc ]] && [[ -f ${MROOT}/etc/sysconfig/rc ]] | ||
151 | then | ||
152 | rm -f ${MROOT}/etc/sysconfig/rc | ||
153 | fi | ||
154 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |