summaryrefslogtreecommitdiffstats
path: root/sys-apps/darklin/darklin-4.0.1.ebuild
blob: cf555222a156f45a9676fcc857328c17f759fe8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: 

inherit eutils

DESCRIPTION="DarkLin Release"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="amd64 x86"
DARKLIN_DISTRIB="Charon"
DEPEND="dev-lang/perl"

src_install() {
    dodir /etc/

    echo ${PV} > ${D}/etc/darklin-version
    echo "DarkLin IV ($DARKLIN_DISTRIB)" > ${D}/etc/darklin-release
    
    cat "${FILESDIR}"/issue | sed -e "s/@name@/$DARKLIN_DISTRIB/g" -e "s/@version@/$PV/g" > ${D}/etc/issue
}

pkg_postinst() {
perl -s -e '$^I="";
if (@argv == 2) { $PN=pop(@argv); }
$NOT_STARTED=1;$COMMENTS=1;$BL="";
while (<>)
{
    $value=$_;
    
    if ($value=~m/^\s*loginsh=/) {
	next;
    }

    if (($COMMENTS)&&($value!~m/^\s*#/)) {
	print "loginsh=1\n";
	$COMMENTS=0;
    } 
    
    if ((defined $PN)&&($value=~m/CfgStart\s*$PN/)) {
	$NOT_STARTED=0;
    } elsif ((defined $PN)&&($value=~m/CfgEnd\s*$PN/)) {
	$NOT_STARTED=1;
    } elsif ($NOT_STARTED) {
	if ($value =~ m/^\s*$/) {
	    $BLS.=$value;
	} else {
	    print $BLS;
	    print $value;
	    $BLS=""
	}
    }
}
if ($value !~ m/$\s*^/) {
    print "\n";
}' -- -PN=darklin  /etc/profile 

perl -s -e '$^I="";
if (@argv == 2) { $PN=pop(@argv); }
$NOT_STARTED=1;$COMMENTS=1;$BL="";
while (<>)
{
    $value=$_;
    
    if ((defined $PN)&&($value=~m/CfgStart\s*$PN/)) {
	$NOT_STARTED=0;
    } elsif ((defined $PN)&&($value=~m/CfgEnd\s*$PN/)) {
	$NOT_STARTED=1;
    } elsif ($NOT_STARTED) {
	if ($value =~ m/^\s*$/) {
	    $BLS.=$value;
	} else {
	    print $BLS;
	    print $value;
	    $BLS=""
	}
    }
}
if ($value !~ m/$\s*^/) {
    print "\n";
}' -- -PN=darklin  /etc/bash/bashrc

    cat "${FILESDIR}"/bashrc >> /etc/bash/bashrc
    cat "${FILESDIR}"/profile >> /etc/profile
}