Add a script to install requirements
This commit is contained in:
parent
82789d394f
commit
4857a0b228
10
Makefile
10
Makefile
@ -1,21 +1,29 @@
|
||||
COPY=cp -v
|
||||
DEST=/usr/local/share/perl/`ls -1 /usr/lib/perl/ | tail -1`/
|
||||
GIT=/usr/bin/git
|
||||
GITOLITE_DEST=/usr/share/gitolite/hooks/common
|
||||
MAKEDIR=mkdir
|
||||
PROVER=prove -f
|
||||
RM=rm
|
||||
TESTDIR=t
|
||||
SHELL=/bin/sh
|
||||
SU=/bin/su
|
||||
|
||||
launch:
|
||||
$(SHELL) process/launch.sh
|
||||
$(SU) -c "$(SHELL) process/launch.sh" intradmin
|
||||
|
||||
install:
|
||||
$(SHELL) commands/first-install.sh
|
||||
$(MAKEDIR) -p $(DEST)
|
||||
$(COPY) -r ACU/ $(DEST)
|
||||
test -d $(GITOLITE_DEST) && $(MAKEDIR) -p $(GITOLITE_DEST)/update.secondary.d
|
||||
test -d $(GITOLITE_DEST) && $(COPY) hooks/* $(GITOLITE_DEST)/update.secondary.d/
|
||||
|
||||
update: unstall install
|
||||
|
||||
upgrade:
|
||||
$GIT pull
|
||||
|
||||
unstall:
|
||||
$(RM) -r $(DEST)/ACU/
|
||||
test -d $(GITOLITE_DEST) && $(RM) -rf $(GITOLITE_DEST)/update.secondary.d
|
||||
|
26
commands/first-install.sh
Executable file
26
commands/first-install.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Install missing packets
|
||||
PACKAGES_LIST="libnet-ldap-perl libxml-libxml-perl"
|
||||
|
||||
if ! whereis dpkg > /dev/null 2> /dev/null
|
||||
then
|
||||
aptitude install dpkg
|
||||
fi
|
||||
|
||||
for PK in $PACKAGES_LIST
|
||||
do
|
||||
if ! dpkg -l | grep "^ii" | grep "$PK" > /dev/null 2> /dev/null
|
||||
then
|
||||
aptitude install "$PK"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Add intradmin user if missing
|
||||
if ! getent passwd | grep "intradmin:" > /dev/null 2> /dev/null
|
||||
then
|
||||
useradd --shell /bin/false --uid 942 intradmin
|
||||
fi
|
||||
|
||||
echo "System ready!"
|
Reference in New Issue
Block a user