view src/system-init.pl @ 34:6422228dfea7

better name.
author Robert McIntyre <rlm@mit.edu>
date Sun, 10 Feb 2013 05:52:35 -0500
parents 4c49f8e6d79d
children
line wrap: on
line source
1 #!/usr/bin/perl
2 use Cwd;
5 sub create_install_dir{
6 @install_cmd =
7 ("install", "-d", "-m",
8 "775", "-o", "root", "-g",
9 "install", $_[0]);
10 print "@install_cmd\n";
11 system(@install_cmd) and die $!;}
13 @install_dirs = qw(
14 /usr/bin
15 /usr/sbin
16 /usr/include
17 /usr/lib
18 /usr/man/man1
19 /usr/man/man2
20 /usr/man/man3
21 /usr/man/man4
22 /usr/man/man5
23 /usr/man/man6
24 /usr/man/man7
25 /usr/man/man8
26 /usr/doc
27 /usr/info
28 /usr/share
29 /usr/share/dict
30 /usr/share/doc
31 /usr/share/info
32 /usr/share/locale
33 /usr/share/man/man1
34 /usr/share/man/man2
35 /usr/share/man/man3
36 /usr/share/man/man4
37 /usr/share/man/man5
38 /usr/share/man/man6
39 /usr/share/man/man7
40 /usr/share/man/man8
41 /usr/share/nls
42 /usr/share/misc
43 /usr/share/terminfo
44 /usr/share/zoneinfo
45 /usr/share/i18n
46 /usr/share/aclocal
47 /opt
48 /opt/doc
49 /opt/info
50 /opt/bin
51 /opt/include
52 /opt/lib
53 /opt/man/man1
54 /opt/man/man2
55 /opt/man/man3
56 /opt/man/man4
57 /opt/man/man5
58 /opt/man/man6
59 /opt/man/man7
60 /opt/man/man8
61 /var
62 /var/lib
63 /var/opt
64 /etc
65 /etc/opt
66 );
69 sub execute{
70 print "\t$_[0]\n";
71 `$_[0]`;
72 if ($?){die $!;}
73 }
75 execute("groupadd --force install");
77 foreach $install_dir(@install_dirs){
78 create_install_dir($install_dir);}
81 execute("find /.hg -type d -print0 | xargs -0 chmod 2770");
82 execute("find /.hg -type f -print0 | xargs -0 chmod 660");
84 execute("install -d -o root -g root -m 755 /pkg/skel");
86 execute("chown -Rv root:root /.hg");
88 $pwd = cwd();
89 execute("ln -sf $pwd/profile /pkg/skel/.profile");
90 execute("ln -sf $pwd/hg-wrapper /pkg/skel/");
91 execute("ln -sf $pwd/save-acls /pkg/skel/");
92 execute("ln -sf `which hg` /pkg/skel/");
94 execute("install -o root -g root -m 660 $pwd/hgignore /.hgignore");
95 execute("install -o root -g root -m 660 $pwd/hgrc /.hg/");
101 ## other install dirs
102 # /usr/local/man/man1
103 # /usr/local/man/man2
104 # /usr/local/man/man3
105 # /usr/local/man/man4
106 # /usr/local/man/man5
107 # /usr/local/man/man6
108 # /usr/local/man/man7
109 # /usr/local/man/man8
110 # /usr/local/doc
111 # /usr/local/info
112 # /usr/local/bin
113 # /usr/local/etc
114 # /usr/local/include
115 # /usr/local/lib
116 # /usr/local/sbin
117 # /usr/local/share
118 # /usr/local/share/dict
119 # /usr/local/share/doc
120 # /usr/local/share/info
121 # /usr/local/share/locale
122 # /usr/local/share/man/man1
123 # /usr/local/share/man/man2
124 # /usr/local/share/man/man3
125 # /usr/local/share/man/man4
126 # /usr/local/share/man/man5
127 # /usr/local/share/man/man6
128 # /usr/local/share/man/man7
129 # /usr/local/share/man/man8
130 # /usr/local/share/nls
131 # /usr/local/share/misc
132 # /usr/local/share/terminfo
133 # /usr/local/share/zoneinfo
134 # /sbin
135 # /bin
136 # /lib