Mercurial > pkg
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/perl2 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/bin15 /usr/sbin16 /usr/include17 /usr/lib18 /usr/man/man119 /usr/man/man220 /usr/man/man321 /usr/man/man422 /usr/man/man523 /usr/man/man624 /usr/man/man725 /usr/man/man826 /usr/doc27 /usr/info28 /usr/share29 /usr/share/dict30 /usr/share/doc31 /usr/share/info32 /usr/share/locale33 /usr/share/man/man134 /usr/share/man/man235 /usr/share/man/man336 /usr/share/man/man437 /usr/share/man/man538 /usr/share/man/man639 /usr/share/man/man740 /usr/share/man/man841 /usr/share/nls42 /usr/share/misc43 /usr/share/terminfo44 /usr/share/zoneinfo45 /usr/share/i18n46 /usr/share/aclocal47 /opt48 /opt/doc49 /opt/info50 /opt/bin51 /opt/include52 /opt/lib53 /opt/man/man154 /opt/man/man255 /opt/man/man356 /opt/man/man457 /opt/man/man558 /opt/man/man659 /opt/man/man760 /opt/man/man861 /var62 /var/lib63 /var/opt64 /etc65 /etc/opt66 );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 dirs102 # /usr/local/man/man1103 # /usr/local/man/man2104 # /usr/local/man/man3105 # /usr/local/man/man4106 # /usr/local/man/man5107 # /usr/local/man/man6108 # /usr/local/man/man7109 # /usr/local/man/man8110 # /usr/local/doc111 # /usr/local/info112 # /usr/local/bin113 # /usr/local/etc114 # /usr/local/include115 # /usr/local/lib116 # /usr/local/sbin117 # /usr/local/share118 # /usr/local/share/dict119 # /usr/local/share/doc120 # /usr/local/share/info121 # /usr/local/share/locale122 # /usr/local/share/man/man1123 # /usr/local/share/man/man2124 # /usr/local/share/man/man3125 # /usr/local/share/man/man4126 # /usr/local/share/man/man5127 # /usr/local/share/man/man6128 # /usr/local/share/man/man7129 # /usr/local/share/man/man8130 # /usr/local/share/nls131 # /usr/local/share/misc132 # /usr/local/share/terminfo133 # /usr/local/share/zoneinfo134 # /sbin135 # /bin136 # /lib