/[gentoo-alt]/trunk/sys-apps/freebsd-baselayout/freebsd-baselayout-0.2-r4.ebuild
Gentoo

Contents of /trunk/sys-apps/freebsd-baselayout/freebsd-baselayout-0.2-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 650 - (show annotations) (download)
Thu Aug 18 19:07:05 2005 UTC (9 years ago) by flameeyes
File size: 3684 byte(s)
Avoid collision with newer gawk (updated dependency).

1 # $Header$
2
3 inherit flag-o-matic eutils
4
5 SV=0.7
6 SVREV=-r3
7
8 S="${WORKDIR}/freebsd-rcscripts-${SV}${SVREV}"
9 DESCRIPTION="Filesystem baselayout and init scripts"
10 HOMEPAGE="http://gentoo-alt.gentoo.org"
11 SRC_URI="mirror://gentoo/freebsd-rcscripts-${SV}${SVREV}.tar.bz2
12 http://dev.gentoo.org/~spb/fbsd/freebsd-rcscripts-${SV}${SVREV}.tar.bz2"
13
14 KEYWORDS="~x86-fbsd"
15
16 RDEPEND="sys-apps/freebsd-sbin
17 >=sys-apps/gawk-3.1.4-r4"
18 DEPEND="virtual/os-headers
19 sys-devel/make"
20
21 IUSE="build"
22
23 PROVIDE="virtual/baselayout"
24
25 src_compile() {
26 use static && append-ldflags -static
27
28 make -C ${S}/src OS=BSD CC="${CC:-gcc}" LD="${CC:-gcc} ${LDFLAGS}" \
29 CFLAGS="${CFLAGS}" || die
30 }
31
32 src_install() {
33 # Create some directories...
34 dodir /dev
35 keepdir /usr/share /usr/local
36 keepdir /var/tmp /var/empty /var/at /var/backups /var/games
37 keepdir /var/log /var/mail /var/msgs /var/preserve /var/run
38 keepdir /etc /etc/portage
39 keepdir /bin /sbin /lib /libexec /usr/bin /usr/sbin /usr/lib /usr/libexec
40
41 dodir /usr/share/baselayout
42
43 cp -R ${S}/etc/* ${D}/etc
44
45 mv ${D}/etc/etc.i386/* ${D}/etc
46 rmdir ${D}/etc/etc.i386
47
48
49 mv ${D}/etc/{passwd,master.passwd,group,fstab} ${D}/usr/share/baselayout
50
51 dodir /etc/runlevels
52 keepdir /etc/init.d
53 exeinto /etc/init.d
54 doinitd ${S}/init.d/*
55
56 [[ -d ${S}/etc/conf.d ]] && doconfd ${S}/etc/conf.d/*
57
58 dodir /var/db/pkg
59
60 cp -r ${S}/rc-lists ${D}/usr/share/baselayout
61
62 echo "Gentoo/FreeBSD: FreeBSD version $(uname -r); Gentoo base version ${SV}" >${D}/etc/gentoo-release
63
64 sed -i -e "s@<FBSD-VER>@$(uname -r)@" -e "s/<RC-VER>/${SV}/" ${D}/etc/motd
65
66 into /
67
68 dobin ${S}/bin/rc-status
69
70 dosbin ${S}/sbin/functions.sh
71 dosbin ${S}/sbin/runscript.sh
72 dosbin ${S}/sbin/depscan.sh
73 dosbin ${S}/sbin/rc-update
74 dosym ../../sbin/functions.sh /etc/init.d/functions.sh
75 dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
76 dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
77
78 # Replace wrong profile from -r3
79 rm -f ${D}/etc/profile
80 insinto /etc
81 doins ${FILESDIR}/profile
82
83 if [ ! -e ${ROOT}/var/run/utmp ]; then
84 touch ${D}/var/run/utmp
85 chown root:utmp ${D}/var/run/utmp
86 chmod 664 ${D}/var/run/utmp
87 fi
88
89 cd ${S}/src
90 make OS=BSD DESTDIR="${D}" install || die
91 }
92
93 pkg_postinst() {
94 # Set up the default runlevels.
95 if [[ -z "$(/bin/ls ${ROOT}/etc/runlevels 2>/dev/null)" ]]; then
96 cd ${ROOT}/usr/share/baselayout/rc-lists
97 einfo foo
98 ls
99 for x in *; do
100 einfo "Creating default runlevel symlinks for ${x}"
101 mkdir -p ${ROOT}/etc/runlevels/${x}
102 for y in $(<${ROOT}/usr/share/baselayout/rc-lists/${x}); do
103 if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then
104 ewarn "init.d/${y} not found; skipping"
105 else
106 ln -sfn ${ROOT}/etc/init.d/${y} \
107 ${ROOT}/etc/runlevels/${x}/${y}
108 fi
109 done
110 done
111 else
112 einfo "Not creating runlevel symlinks."
113 fi
114
115 if [[ ! -e ${ROOT}/etc/hosts ]]; then
116 cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
117 fi
118
119 if use build || [[ ! -e "${ROOT}/etc/passwd" ]]; then
120 cp ${ROOT}/usr/share/baselayout/{passwd,master.passwd,group,fstab} ${ROOT}/etc
121 fi
122
123 if [[ ${ROOT} == / ]] && ! use build; then
124 /sbin/depscan.sh &>/dev/null
125 fi
126
127 # This file shouldn't be managed with etc-update; we want it
128 # written immediately.
129 if [[ -e ${ROOT}/etc/._cfg????_gentoo-release ]]; then
130 rm -f ${ROOT}/etc/gentoo-release
131 mv ${ROOT}/etc/._cfg????_gentoo-release ${ROOT}/etc/gentoo-release
132 fi
133
134 # Create the password database if it doesn't exist.
135 if [[ ! -e "${ROOT}/etc/pwd.db" || ! -e "${ROOT}/etc/spwd.db" ]]; then
136 pwd_mkdb -d "${ROOT}/etc" "${ROOT}/etc/master.passwd"
137 fi
138
139 einfo "Make sure to update all pending config files in /etc"
140 einfo "or things will break. Use etc-update or dispatch-conf to do this."
141 echo
142 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20