recipes: data/hierarchyfs: Fix X11R6 compatibility symlink
[dragora.git] / recipes / data / hierarchyfs / post-install.multidir
blob3458ec5316b9b108164cf3ba9a337603f23c40a1
1 # Ownerships and permissions
3 chown root:games  usr/games usr/share/games usr/local/games var/games
4 chown root:log    var/log
5 chown root:mail   var/mail
6 chown root:lp     var/spool/lpd
7 chown root:news   var/spool/news
9 chmod 775         var/log
10 chmod 2775        var/mail
11 chmod 1777        var/tmp
12 # Force the symbolic link to make /var/run and /var/lock point to /run
14     cd var || exit 1
15     rm -rf run lock
16     ln -sf /run .
17     ln -sf /run/lock .
20 chmod 555         proc sys
21 chmod 750         root
22 chmod 1777        tmp
23 chmod 775         usr/games usr/share/games usr/local/games var/games
25 # Create character special files, if needed
26 test -c dev/console || mknod -m 600 dev/console c 5 1
27 test -c dev/null || mknod -m 666 dev/null c 1 3
29 # Create shm directory if does not exist
30 test -e dev/shm || mkdir -p dev/shm
32 # Create file records for logins and logouts
33 touch var/log/btmp var/log/lastlog var/log/faillog var/log/wtmp \
34       var/run/utmp
36 chgrp utmp  var/log/lastlog var/run/utmp
37 chmod 664   var/log/lastlog var/run/utmp
38 chmod 600   var/log/btmp
40 # Make symlinks at 'rootdir'
42 for link in bin lib sbin
44     if test ! -e $link
45     then
46         ln -sf usr/${link} $link
47     fi
48 done
49 unset link
52     cd opt || exit 1
53     ln -sf ../etc/opt etc
56     cd usr || exit 1
57     ln -sf share/doc   doc
58     ln -sf share/info  info
59     ln -sf share/man   man
62     cd usr/share || exit 1
63     ln -sf ../lib/pkgconfig pkgconfig
66     cd usr/local || exit 1
67     ln -sf share/doc   doc
68     ln -sf share/info  info
69     ln -sf share/man   man
72     cd usr/local/share || exit 1
73     ln -sf ../lib/pkgconfig pkgconfig
76     cd var/spool || exit 1
77     ln -sf ../mail mail
80 # Offer X11R6 compatibility symlink.
81 ln -sf /usr /usr/X11R6
83 libSuffix=X
85 if test "$libSuffix" != X
86 then
87     if test ! -e usr/lib${libSuffix}
88     then
89         (
90             cd usr || exit 1
91             rmdir lib/pkgconfig lib/ 2> /dev/null
93             mkdir -p lib${libSuffix}
94             ln -s -f lib${libSuffix} lib
95         )
96     fi
97     if test ! -e usr/local/lib${libSuffix}
98     then
99         (
100             cd usr/local || exit 1
101             rmdir lib/pkgconfig lib/ 2> /dev/null
103             mkdir -p lib${libSuffix}
104             ln -s -f lib${libSuffix} lib
105         )
106     fi
108     # Re-create pkgconfig directory
110     mkdir -p usr/lib/pkgconfig usr/local/lib/pkgconfig
112     rm -f lib
113     ln -s usr/lib${libSuffix} lib