Archived
1
0

Add a script to install requirements

This commit is contained in:
Mercier Pierre-Olivier 2013-09-14 10:52:59 +02:00
parent 82789d394f
commit 4857a0b228
2 changed files with 35 additions and 1 deletions

View File

@ -1,21 +1,29 @@
COPY=cp -v COPY=cp -v
DEST=/usr/local/share/perl/`ls -1 /usr/lib/perl/ | tail -1`/ DEST=/usr/local/share/perl/`ls -1 /usr/lib/perl/ | tail -1`/
GIT=/usr/bin/git
GITOLITE_DEST=/usr/share/gitolite/hooks/common GITOLITE_DEST=/usr/share/gitolite/hooks/common
MAKEDIR=mkdir MAKEDIR=mkdir
PROVER=prove -f PROVER=prove -f
RM=rm RM=rm
TESTDIR=t TESTDIR=t
SHELL=/bin/sh SHELL=/bin/sh
SU=/bin/su
launch: launch:
$(SHELL) process/launch.sh $(SU) -c "$(SHELL) process/launch.sh" intradmin
install: install:
$(SHELL) commands/first-install.sh
$(MAKEDIR) -p $(DEST) $(MAKEDIR) -p $(DEST)
$(COPY) -r ACU/ $(DEST) $(COPY) -r ACU/ $(DEST)
test -d $(GITOLITE_DEST) && $(MAKEDIR) -p $(GITOLITE_DEST)/update.secondary.d test -d $(GITOLITE_DEST) && $(MAKEDIR) -p $(GITOLITE_DEST)/update.secondary.d
test -d $(GITOLITE_DEST) && $(COPY) hooks/* $(GITOLITE_DEST)/update.secondary.d/ test -d $(GITOLITE_DEST) && $(COPY) hooks/* $(GITOLITE_DEST)/update.secondary.d/
update: unstall install
upgrade:
$GIT pull
unstall: unstall:
$(RM) -r $(DEST)/ACU/ $(RM) -r $(DEST)/ACU/
test -d $(GITOLITE_DEST) && $(RM) -rf $(GITOLITE_DEST)/update.secondary.d test -d $(GITOLITE_DEST) && $(RM) -rf $(GITOLITE_DEST)/update.secondary.d

26
commands/first-install.sh Executable file
View 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!"