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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 498 - (show annotations) (download)
Mon Jun 20 21:23:23 2005 UTC (9 years, 5 months ago) by flameeyes
File size: 3610 byte(s)
Remove rcscripts reference.

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.1-r2"
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 doexe ${S}/init.d/*
55
56 dodir /etc/conf.d
57 insinto /etc/conf.d
58 [ -d ${S}/etc/conf.d ] && doins ${S}/etc/conf.d/*
59
60 dodir /var/db/pkg
61
62 cp -r ${S}/rc-lists ${D}/usr/share/baselayout
63
64 echo "Gentoo/FreeBSD: FreeBSD version $(uname -r); Gentoo base version ${SV}" >${D}/etc/gentoo-release
65
66 sed -i -e "s@<FBSD-VER>@$(uname -r)@" -e "s/<RC-VER>/${SV}/" ${D}/etc/motd
67
68 into /
69
70 dobin ${S}/bin/rc-status
71
72 dosbin ${S}/sbin/functions.sh
73 dosbin ${S}/sbin/runscript.sh
74 dosbin ${S}/sbin/depscan.sh
75 dosbin ${S}/sbin/rc-update
76 dosym ../../sbin/functions.sh /etc/init.d/functions.sh
77 dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
78 dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
79
80 if [ ! -e ${ROOT}/var/run/utmp ]; then
81 touch ${D}/var/run/utmp
82 chown root:utmp ${D}/var/run/utmp
83 chmod 664 ${D}/var/run/utmp
84 fi
85
86 cd ${S}/src
87 make OS=BSD DESTDIR="${D}" install || die
88 }
89
90 pkg_postinst() {
91 # Set up the default runlevels.
92 if [ -z "$(/bin/ls ${ROOT}/etc/runlevels 2>/dev/null)" ]; then
93 cd ${ROOT}/usr/share/baselayout/rc-lists
94 einfo foo
95 ls
96 for x in *; do
97 einfo "Creating default runlevel symlinks for ${x}"
98 mkdir -p ${ROOT}/etc/runlevels/${x}
99 for y in $(<${ROOT}/usr/share/baselayout/rc-lists/${x}); do
100 if [ ! -e ${ROOT}/etc/init.d/${y} ]; then
101 ewarn "init.d/${y} not found; skipping"
102 else
103 ln -sfn ${ROOT}/etc/init.d/${y} \
104 ${ROOT}/etc/runlevels/${x}/${y}
105 fi
106 done
107 done
108 else
109 einfo "Not creating runlevel symlinks."
110 fi
111
112 if [ ! -e ${ROOT}/etc/hosts ]; then
113 cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
114 fi
115
116 if use build || [ ! -e "${ROOT}/etc/passwd" ]; then
117 cp ${ROOT}/usr/share/baselayout/{passwd,master.passwd,group,fstab} ${ROOT}/etc
118 fi
119
120 if [ ${ROOT} == / ] && ! use build; then
121 /sbin/depscan.sh &>/dev/null
122 fi
123
124 # This file shouldn't be managed with etc-update; we want it
125 # written immediately.
126 if [ -e ${ROOT}/etc/._cfg????_gentoo-release ]; then
127 rm -f ${ROOT}/etc/gentoo-release
128 mv ${ROOT}/etc/._cfg????_gentoo-release ${ROOT}/etc/gentoo-release
129 fi
130
131 # Create the password database if it doesn't exist.
132 if [[ ! -e "${ROOT}/etc/pwd.db" || ! -e "${ROOT}/etc/spwd.db" ]]; then
133 pwd_mkdb -d "${ROOT}/etc" "${ROOT}/etc/master.passwd"
134 fi
135
136 einfo "Make sure to update all pending config files in /etc"
137 einfo "or things will break. Use etc-update or dispatch-conf to do this."
138 echo
139 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20