<commit_before>sudo apt-get -y update

# OPEN JDK
sudo apt-get -y install icedtea-7-plugin openjdk-7-jre openjdk-7-jdk

# Postgre SQL
sudo apt-get -y install postgresql

# Enable TCP/IP Postgre connections
sudo sed -i.bak s/"#listen_addresses = 'localhost'/listen_addresses = '\*'"/ /etc/postgresql/9.3/main/postgresql.conf 
sudo rm /etc/postgresql/9.3/main/postgresql.conf.bak

# Further PostgreSQL configuration
sudo cp /vagrant/pg_hba.conf /etc/postgresql/9.3/main/
sudo /etc/init.d/postgresql restart

# Servlet Engine: Apache Tomcat 7
sudo apt-get -y install tomcat7

# Create user dspace
sudo newusers /vagrant/users
sudo cp /vagrant/setenvvars.sh /etc/profile.d/

# Move Tomcat to port 80
# 80 is a privileged port and dspace is not authorized to run an app in that space
# sudo sed -i.bak s/8080/80/g /etc/tomcat7/server.xml 
# sudo rm /etc/tomcat7/server.xml.bak 

# Install installation tools
sudo apt-get -y install git
sudo apt-get -y install maven
sudo apt-get -y install ant

# Download source code
sudo -u dspace git clone https://github.com/inia-es/DSpace.git /home/dspace/dspace-source
cd /home/dspace/dspace-source/

# Move to version DSpace4.1
git checkout origin/dspace-4_x
git checkout -b dspace-4_x
git checkout dspace-4.1

# Create database and user
sudo -u postgres psql --file=/vagrant/create.sql

# Create DSpace folder
sudo mkdir /dspace
sudo chown dspace /dspace

# Load dspace setup files
sudo cp /vagrant/build.properties /home/dspace/dspace-source/
sudo cp /vagrant/pom.xml /home/dspace/dspace-source/

# Build installation package
cp /home/dspace/dspace-source/dspace
sudo -u dspace mvn package

# Install DSpace and initialize database
cp /home/dspace/dspace-source/target/dspace-4.1-build
sudo -u dspace ant fresh-install

# Deploying web applications
sudo cp /vagrant/xmlui.xml /etc/tomcat7/Catalina/localhost
sudo cp /vagrant/jspui.xml /etc/tomcat7/Catalina/localhost
sudo cp /vagrant/oai.xml /etc/tomcat7/Catalina/localhost

# Should create administrator account in non interactive way
# ...

# Initial Startup - restart tomcat<commit_msg>Remove vagrant references.<commit_after>sudo apt-get -y update

# OPEN JDK
sudo apt-get -y install icedtea-7-plugin openjdk-7-jre openjdk-7-jdk

# Postgre SQL
sudo apt-get -y install postgresql

# Enable TCP/IP Postgre connections
sudo sed -i.bak s/"#listen_addresses = 'localhost'/listen_addresses = '\*'"/ /etc/postgresql/9.3/main/postgresql.conf 
sudo rm /etc/postgresql/9.3/main/postgresql.conf.bak

# Further PostgreSQL configuration
sudo cp ./pg_hba.conf /etc/postgresql/9.3/main/
sudo /etc/init.d/postgresql restart

# Servlet Engine: Apache Tomcat 7
sudo apt-get -y install tomcat7

# Create user dspace
sudo newusers ./users
sudo cp ./setenvvars.sh /etc/profile.d/

# Move Tomcat to port 80
# 80 is a privileged port and dspace is not authorized to run an app in that space
# sudo sed -i.bak s/8080/80/g /etc/tomcat7/server.xml 
# sudo rm /etc/tomcat7/server.xml.bak 

# Install installation tools
sudo apt-get -y install git
sudo apt-get -y install maven
sudo apt-get -y install ant

# Download source code
sudo -u dspace git clone https://github.com/inia-es/DSpace.git /home/dspace/dspace-source
cd /home/dspace/dspace-source/

# Move to version DSpace4.1
git checkout origin/dspace-4_x
git checkout -b dspace-4_x
git checkout dspace-4.1

# Create database and user
sudo -u postgres psql --file=./create.sql

# Create DSpace folder
sudo mkdir /dspace
sudo chown dspace /dspace

# Load dspace setup files
sudo cp ./build.properties /home/dspace/dspace-source/
sudo cp ./pom.xml /home/dspace/dspace-source/

# Build installation package
cp /home/dspace/dspace-source/dspace
sudo -u dspace mvn package

# Install DSpace and initialize database
cp /home/dspace/dspace-source/target/dspace-4.1-build
sudo -u dspace ant fresh-install

# Deploying web applications
sudo cp ./xmlui.xml /etc/tomcat7/Catalina/localhost
sudo cp ./jspui.xml /etc/tomcat7/Catalina/localhost
sudo cp ./oai.xml /etc/tomcat7/Catalina/localhost

# Should create administrator account in non interactive way
# ...

# Initial Startup - restart tomcat
{'fraction_non_alphanumeric': 0.10068259385665529, 'fraction_numerical': 0.01657727937591419, 'mean_word_length': 3.7269585253456223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6053064', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1432, 'n_words': 435}