Magellan Linux

Annotation of /trunk/core/initscripts/initscripts-0.5.7-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5617 - (hide annotations) (download)
Wed Jul 14 14:54:33 2010 UTC (13 years, 11 months ago) by niro
File size: 4621 byte(s)
auto added: ver bump to 0.5.7-r1
1 niro 5617 # $Id$
2    
3     PNAME="initscripts"
4     PVER="0.5.7"
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     # always keep this files even if the user edited them
85     local config_protect_ignore
86     config_protect_ignore="/etc/fstab"
87     config_protect_ignore+=" /etc/group"
88     config_protect_ignore+=" /etc/hostname"
89     config_protect_ignore+=" /etc/hosts"
90     config_protect_ignore+=" /etc/inittab"
91     config_protect_ignore+=" /etc/passwd"
92     config_protect_ignore+=" /etc/conf.d/net.eth0"
93     config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.4"
94     config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.6"
95     config_protect_ignore+=" /etc/modules.autoload"
96     echo "CONFIG_PROTECT_IGNORE=\"${config_protect_ignore}\"" >> ${BINDIR}/etc/env.d/01initscripts || die
97    
98     # fix mageversion if any release version is given
99     if [[ ! -z ${RELEASE_MAGEVERSION} ]]
100     then
101     echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die
102     fi
103     }
104    
105     postinstall()
106     {
107     # emulate seq; its needed to run rc-config
108     # this fixes some annyoing warning when building
109     # livecd or bootstrapping a system.
110     # this hack will be removed when the toolchain is fixed
111     if [ ! -f /usr/bin/seq ]
112     then
113     echo "Using fake 'seq' command ..."
114     seq() {
115     start=$1
116     end=$2
117     for ((i=start; i < end+1; i++))
118     do
119     echo $i
120     done
121     }
122     export -f seq
123     fi
124    
125     # create service state dir mountpoint
126     # needed by >=initscripts-0.3.2-r1
127     [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d
128    
129     # mark this dir as undeletable
130     touch ${MROOT}/var/lib/init.d/.keep
131    
132     echo "Creating Runlevels ..."
133     local i
134     for i in checkfs cleanfs halt \
135     loadkeys localnet modules mountfs \
136     network reboot sendsignals \
137     setclock swap sysctl consolefont
138     do
139     echo -e "\tAdded ${i} ..."
140     ${MROOT}/sbin/rc-config del ${i} > /dev/null
141     ${MROOT}/sbin/rc-config add ${i} > /dev/null
142     done
143    
144     # keep this only for transitional purposes
145     # do not ask the user about following files
146     #
147     # if they exist let config_protect process them
148     # but then remove the protected files, to keep only the original file
149     #
150     # file-root is ${MROOT}/etc
151     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 modules.autoload"
152     local i file path
153     for i in ${CONFIG_IGNORE}
154     do
155     file="$(basename ${i})"
156     path="$(dirname ${i})/"
157     [[ ${path} == ./ ]] && path=""
158    
159     rm -f ${MROOT}/etc/${path}._cfg????_${file}
160     done
161    
162     # initscripts >= 0.5.0: rc file moved to /etc/conf.d/rc
163     if [[ -f ${MROOT}/etc/conf.d/rc ]] && [[ -f ${MROOT}/etc/sysconfig/rc ]]
164     then
165     rm -f ${MROOT}/etc/sysconfig/rc
166     fi
167    
168     # aliases and i368 got renamed to *.conf
169     local i
170     for i in aliases i386
171     do
172     if [[ -f ${MROOT}/etc/modules.d/${i} ]]
173     then
174     rm ${MROOT}/etc/modules.d/${i}
175     fi
176     done
177     }

Properties

Name Value
svn:keywords Id