~carbslinux/repository

ref: 2356b251838cdb86fbd0c0a602f5d7e3f53ba6f3 repository/core/runit/build -rwxr-xr-x 847 bytes
2356b251Cem Keylan gcc: bump to 11.2.0 9 months ago
                                                                                
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
#!/bin/sh -e

for patch in ./*.patch ; do patch -p0 < "$patch" ; done
cd "runit-$2"

(
    cd src
    
    clsed 's@sbin/runit@usr/bin/runit@g' runit.h
    printf '%s -D_GNU_SOURCE -static\n' "${CC-cc}" "$CFLAGS" > conf-cc
    printf '%s %s -static -Wl,-z -Wl,noexecstack\n' "${CC-cc}" "$CFLAGS" > conf-ld
    clsed 's:^char \*varservice ="/service/";$:char \*varservice ="/var/service/";:' sv.c
    
    make
    
    clinst -Dm755 -t "$1/usr/bin" chpst runit runit-init runsv runsvchdir \
                                  runsvdir sv svlogd utmpset ../../poweroff \
                                  ../../reboot
)

clman -d "$1" man/*

mkdir -p "$1/var/service" "$1/etc/runit"
ln -s runit-init "$1/usr/bin/init"
ln -s /usr/lib/init/rc.boot "$1/etc/runit/1"
ln -s /usr/lib/init/rc.shutdown "$1/etc/runit/3"

clinst -Dm755 ../2 "$1/etc/runit/2"