From dd607f224d351d183418668bc090a53800484002 Mon Sep 17 00:00:00 2001 From: Bruno Cesar Ribas Date: Wed, 22 Aug 2018 00:35:17 -0300 Subject: Creating multiple packages for boca Until now we had only one package for boca that contains all files. This approach is not correct since we may have multiple machines for some specific part of boca, eg, database and autojudge. This commit starts this new approach by updating Makefile, d/rules, d/*conffiles d/*postinst Signed-off-by: Bruno Cesar Ribas --- Makefile | 17 ++++++++++---- debian/boca-web.conffiles | 1 + debian/boca-web.postinst | 11 +++++++++ debian/boca.conffiles | 1 - debian/boca.postinst | 11 --------- debian/compat | 2 +- debian/control | 59 +++++++++++++++++++++++++++++++++++++---------- debian/postinst | 6 ----- debian/rules | 6 +++-- 9 files changed, 77 insertions(+), 37 deletions(-) create mode 100644 debian/boca-web.conffiles create mode 100644 debian/boca-web.postinst delete mode 100644 debian/boca.conffiles delete mode 100644 debian/boca.postinst delete mode 100644 debian/postinst diff --git a/Makefile b/Makefile index 9246450..a0280ca 100644 --- a/Makefile +++ b/Makefile @@ -20,17 +20,26 @@ install-bocaapache: install-bocawww install-scripts: mkdir -p $(DESTDIR)/usr/sbin/ install tools/dump.sh $(DESTDIR)/usr/sbin/boca-dump - install tools/boca-createjail $(DESTDIR)/usr/sbin/boca-createjail + +install-bocadb: install tools/boca-createdb.sh $(DESTDIR)/usr/sbin/boca-createdb - install tools/boca-autojudge.sh $(DESTDIR)/usr/sbin/boca-autojudge + +install-bocacommon: + mkdir -p $(DESTDIR)/usr/sbin/ + mkdir -p $(DESTDIR)/etc/ + cp tools/boca.conf $(DESTDIR)/etc/ install tools/boca-config-dbhost.sh $(DESTDIR)/usr/sbin/boca-config-dbhost -install: install-bocawww install-bocaapache install-scripts tools/safeexec +install-bocaautojudge: tools/safeexec + mkdir -p $(DESTDIR)/usr/sbin/ mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/etc/ - cp tools/boca.conf $(DESTDIR)/etc/ install tools/safeexec $(DESTDIR)/usr/bin/safeexec chmod 4555 $(DESTDIR)/usr/bin/safeexec + install tools/boca-createjail $(DESTDIR)/usr/sbin/boca-createjail + install tools/boca-autojudge.sh $(DESTDIR)/usr/sbin/boca-autojudge + +install: install-bocawww install-bocaapache install-bocadb install-bocacommon install-bocaautojudge install-scripts install-submission-tools: tools/boca-submit-run-root-wrapper mkdir -p $(DESTDIR)/usr/bin $(DESTDIR)/usr/sbin $(DESTDIR)/etc/cron.d diff --git a/debian/boca-web.conffiles b/debian/boca-web.conffiles new file mode 100644 index 0000000..b004c7a --- /dev/null +++ b/debian/boca-web.conffiles @@ -0,0 +1 @@ +/var/www/boca/src/private/conf.php diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst new file mode 100644 index 0000000..18ce749 --- /dev/null +++ b/debian/boca-web.postinst @@ -0,0 +1,11 @@ +#!/bin/bash + +chown -R www-data.www-data /var/www/boca +chmod -R go-rwx /var/www/boca/src/private +chmod 4555 /usr/bin/safeexec + +a2ensite default-ssl +a2enmod ssl +a2enmod socache_shmcb + +service apache2 restart || true diff --git a/debian/boca.conffiles b/debian/boca.conffiles deleted file mode 100644 index b004c7a..0000000 --- a/debian/boca.conffiles +++ /dev/null @@ -1 +0,0 @@ -/var/www/boca/src/private/conf.php diff --git a/debian/boca.postinst b/debian/boca.postinst deleted file mode 100644 index 18ce749..0000000 --- a/debian/boca.postinst +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -chown -R www-data.www-data /var/www/boca -chmod -R go-rwx /var/www/boca/src/private -chmod 4555 /usr/bin/safeexec - -a2ensite default-ssl -a2enmod ssl -a2enmod socache_shmcb - -service apache2 restart || true diff --git a/debian/compat b/debian/compat index 7f8f011..f599e28 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +10 diff --git a/debian/control b/debian/control index fbac1f3..f3fdd17 100644 --- a/debian/control +++ b/debian/control @@ -2,24 +2,59 @@ Source: boca Section: misc Priority: optional Maintainer: BOCA Development Team +Uploaders: Cassio Polpo de Campos , Bruno Cesar Ribas Build-Depends: debhelper, build-essential -Package: maratona-boca -Architecture: all -Depends: boca -Description: Virtual package that depends on BOCA - Package: boca -Architecture: amd64 -Depends: php-zip, debootstrap, schroot, quotatool, makepasswd, apache2, libapache2-mod-php, sharutils, wget, coreutils, php, php-cli, php-mcrypt, php-pgsql, php-gd, postgresql, postgresql-client, libany-uri-escape-perl, php-xml +Architecture: all +Depends: boca-common, boca-web, boca-db, boca-autojudge +Provides: maratona-boca Description: BOCA is a software created to control a contest with the ACM ICPC rules. BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the interaction between judges and the system is done through a web browser. + . + This package install all boca related packages to run everything in one + single machine. + +Package: boca-db +Architecture: all +Pre-depends: postgresql +Depends: boca-common +Description: BOCA - database + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package provides a full database to run a contest on. + +Package: boca-web +Architecture: all +Depends: boca-common, apache2, php, php-fpm +Description: BOCA - WEB files + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package provides only web contents. -Package: boca-submission-tools +Package: boca-common +Architecture: all +Depends: php-zip, makepasswd, sharutils, wget, coreutils, php-cli, php-mcrypt, php-pgsql, php-gd, postgresql-client +Description: BOCA - Common files + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package contains shared files with all BOCA packages. + +Package: boca-autojudge Architecture: amd64 -Depends: sharutils, wget, coreutils, libany-uri-escape-perl, openssl, openssh-server -Description: BOCA submission tools. - This package provides tools to submit codes to a running boca server - without using the web interface. +Depends: boca-common, debootstrap, schroot, quotatool, makepasswd +Description: BOCA - AutoJudge + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package contains files to generate and run the autojudge system for + BOCA. diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 65e238f..0000000 --- a/debian/postinst +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -chown -R www-data.www-data /var/www/boca -chmod 4555 /usr/bin/safeexec - -service apache2 restart || true diff --git a/debian/rules b/debian/rules index 6c52a63..eedb9d1 100755 --- a/debian/rules +++ b/debian/rules @@ -3,8 +3,10 @@ override_dh_auto_install: mkdir -p debian/boca-submission-tools make -j1 install-submission-tools DESTDIR=debian/boca-submission-tools - mkdir -p debian/boca - make -j1 install DESTDIR=debian/boca + mkdir -p debian/boca-web + make -j1 install-bocaapache DESTDIR=debian/boca-web + mkdir -p debian/boca-autojudge + make -j1 install-bocaautojudge DESTDIR=debian/boca-autojudge %: dh $@ -- cgit v1.2.3