summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Di Luigi2015-06-23 00:27:27 +0200
committerWilliam Di Luigi2015-06-23 00:27:27 +0200
commit45b8345f0b027230ffeffc853b6f8cde3174176f (patch)
treef438b28595ae3104b5b2a82466d5c2aea9cd70cc
downloadaur-45b8345f0b027230ffeffc853b6f8cde3174176f.tar.gz
Initial import
-rw-r--r--.SRCINFO43
-rw-r--r--PKGBUILD53
-rw-r--r--cms.patch224
3 files changed, 320 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..aa3401e0b5da
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,43 @@
+pkgbase = cms-git
+ pkgdesc = CMS, or Contest Management System, is a distributed system for running and (to some extent) organizing a programming contest.
+ pkgver = 1.3.0
+ pkgrel = 2
+ url = http://cms-dev.github.io/
+ arch = any
+ license = AGPL3
+ makedepends = git
+ depends = postgresql
+ depends = postgresql-libs
+ depends = python2
+ depends = python2-setuptools
+ depends = python2-tornado
+ depends = python2-psycopg2
+ depends = python2-sqlalchemy
+ depends = python2-psutil
+ depends = python2-netifaces
+ depends = python2-crypto
+ depends = python2-pytz
+ depends = python2-six
+ depends = iso-codes
+ depends = shared-mime-info
+ depends = python2-beautifulsoup3
+ depends = python2-mechanize
+ depends = python2-mock
+ depends = python2-requests
+ depends = python2-werkzeug
+ depends = python2-gevent
+ depends = python2-coverage
+ depends = libcgroup
+ depends = patool-py2
+ optdepends = fpc: support for Pascal submissions
+ optdepends = sgi-stl-doc: support for STL documentation inside the contest
+ optdepends = python2-yaml: support for cmsMake (for tasks in the "italian format")
+ provides = cms
+ conflicts = cms
+ source = git://github.com/cms-dev/cms.git
+ source = cms.patch
+ sha256sums = SKIP
+ sha256sums = edb4e5c5da138a4598d1c728e9e02041fcb0acfdb84911ba9aeefb85488fb323
+
+pkgname = cms-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..8df5fbdd702f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,53 @@
+# Maintainer: William Di Luigi <williamdiluigi@gmail.com>
+#
+# https://github.com/wil93/aur/tree/master/cms-git
+
+pkgname=cms-git
+pkgver=1.3.0
+pkgrel=2
+pkgdesc="CMS, or Contest Management System, is a distributed system for running and (to some extent) organizing a programming contest."
+arch=('any')
+url="http://cms-dev.github.io/"
+license=('AGPL3')
+depends=(
+ 'postgresql' 'postgresql-libs' 'python2' 'python2-setuptools'
+ 'python2-tornado' 'python2-psycopg2' 'python2-sqlalchemy' 'python2-psutil'
+ 'python2-netifaces' 'python2-crypto' 'python2-pytz' 'python2-six'
+ 'iso-codes' 'shared-mime-info' 'python2-beautifulsoup3' 'python2-mechanize'
+ 'python2-mock' 'python2-requests' 'python2-werkzeug' 'python2-gevent'
+ 'python2-coverage' 'libcgroup' 'patool-py2'
+)
+optdepends=(
+ 'fpc: support for Pascal submissions'
+ 'sgi-stl-doc: support for STL documentation inside the contest'
+ 'python2-yaml: support for cmsMake (for tasks in the "italian format")'
+)
+makedepends=('git')
+provides=('cms')
+conflicts=('cms')
+
+source=(
+ 'git://github.com/cms-dev/cms.git'
+ 'cms.patch'
+)
+sha256sums=(
+ 'SKIP'
+ 'edb4e5c5da138a4598d1c728e9e02041fcb0acfdb84911ba9aeefb85488fb323'
+)
+
+prepare() {
+ cd "cms"
+ patch -p1 -i $srcdir/cms.patch
+ sed "s|MAKEPKG_INSTALL_ROOT|$pkgdir|g" -i setup.py
+}
+
+build() {
+ cd "cms"
+ git submodule update --init
+ python2 setup.py build
+}
+
+package() {
+ cd "cms"
+ python2 setup.py install --prefix="/usr" --root="$pkgdir"
+}
diff --git a/cms.patch b/cms.patch
new file mode 100644
index 000000000000..d85392f27cf2
--- /dev/null
+++ b/cms.patch
@@ -0,0 +1,224 @@
+diff --git a/README.md b/README.md
+index 3c5833d..4258339 100644
+--- a/README.md
++++ b/README.md
+@@ -57,8 +57,8 @@ proposals and critics, get opinions and reviews, etc.) is
+ [github](https://github.com/cms-dev/cms/issues) instead.**
+
+ To help with the troubleshooting, you can collect the complete log
+-files that are placed in /var/local/log/cms/ (if CMS was running
+-installed) or in ./log (if it was running from the local copy).
++files that are placed in /var/log/cms/ (if CMS was running installed) or
++in ./log (if it was running from the local copy).
+
+
+ Testimonials
+diff --git a/cms/conf.py b/cms/conf.py
+index bf6446c..65535ba 100644
+--- a/cms/conf.py
++++ b/cms/conf.py
+@@ -127,12 +127,11 @@ class Config(object):
+ sys.argv[0] != '/usr/bin/python'
+
+ if self.installed:
+- self.log_dir = os.path.join("/", "var", "local", "log", "cms")
+- self.cache_dir = os.path.join("/", "var", "local", "cache", "cms")
+- self.data_dir = os.path.join("/", "var", "local", "lib", "cms")
+- self.run_dir = os.path.join("/", "var", "local", "run", "cms")
+- paths = [os.path.join("/", "usr", "local", "etc", "cms.conf"),
+- os.path.join("/", "etc", "cms.conf")]
++ self.log_dir = os.path.join("/", "var", "log", "cms")
++ self.cache_dir = os.path.join("/", "var", "cache", "cms")
++ self.data_dir = os.path.join("/", "var", "lib", "cms")
++ self.run_dir = os.path.join("/", "var", "run", "cms")
++ paths = [os.path.join("/", "etc", "cms.conf")]
+ else:
+ self.log_dir = "log"
+ self.cache_dir = "cache"
+@@ -143,8 +142,7 @@ class Config(object):
+ paths += [os.path.abspath(os.path.join(
+ os.path.dirname(__file__),
+ '..', 'config', 'cms.conf'))]
+- paths += [os.path.join("/", "usr", "local", "etc", "cms.conf"),
+- os.path.join("/", "etc", "cms.conf")]
++ paths += [os.path.join("/", "etc", "cms.conf")]
+
+ # Allow user to override config file path using environment
+ # variable 'CMS_CONFIG'.
+diff --git a/cms/server/AdminWebServer.py b/cms/server/AdminWebServer.py
+index 470eaf1..05f0b75 100644
+--- a/cms/server/AdminWebServer.py
++++ b/cms/server/AdminWebServer.py
+@@ -207,8 +207,7 @@ class BaseHandler(CommonRequestHandler):
+ self.contest = None
+
+ if config.installed:
+- localization_dir = os.path.join("/", "usr", "local", "share",
+- "locale")
++ localization_dir = os.path.join("/", "usr", "share", "locale")
+ else:
+ localization_dir = os.path.join(os.path.dirname(__file__), "mo")
+ if os.path.exists(localization_dir):
+diff --git a/cms/server/ContestWebServer.py b/cms/server/ContestWebServer.py
+index 122f55d..bea0001 100644
+--- a/cms/server/ContestWebServer.py
++++ b/cms/server/ContestWebServer.py
+@@ -440,7 +440,7 @@ class ContestWebServer(WebService):
+ # Retrieve the available translations.
+ if config.installed:
+ self.localization_dir = os.path.join(
+- "/", "usr", "local", "share", "locale")
++ "/", "usr", "share", "locale")
+ else:
+ self.localization_dir = os.path.join(
+ os.path.dirname(__file__), "mo")
+diff --git a/cmscontrib/PolygonLoader.py b/cmscontrib/PolygonLoader.py
+index 76c668d..f79606d 100644
+--- a/cmscontrib/PolygonLoader.py
++++ b/cmscontrib/PolygonLoader.py
+@@ -330,7 +330,7 @@ class PolygonLoader(Loader):
+ if os.path.exists(checker_src):
+ logger.info("Checker found, compiling")
+ checker_exe = os.path.join(task_path, "files", "checker")
+- testlib_path = "/usr/local/include/cms/testlib.h"
++ testlib_path = "/usr/include/cms/testlib.h"
+ if not config.installed:
+ testlib_path = os.path.join(os.path.dirname(__file__),
+ "polygon", "testlib.h")
+diff --git a/cmsranking/Config.py b/cmsranking/Config.py
+index 02f80b6..72432d9 100644
+--- a/cmsranking/Config.py
++++ b/cmsranking/Config.py
+@@ -60,19 +60,13 @@ class Config(object):
+
+ self.web_dir = pkg_resources.resource_filename("cmsranking", "static")
+ if self.installed:
+- self.log_dir = os.path.join("/", "var", "local", "log",
+- "cms", "ranking")
+- self.lib_dir = os.path.join("/", "var", "local", "lib",
+- "cms", "ranking")
+- paths = [os.path.join("/", "usr", "local", "etc",
+- "cms.ranking.conf"),
+- os.path.join("/", "etc", "cms.ranking.conf")]
++ self.log_dir = os.path.join("/", "var", "log", "cms", "ranking")
++ self.lib_dir = os.path.join("/", "var", "lib", "cms", "ranking")
++ paths = [os.path.join("/", "etc", "cms.ranking.conf")]
+ else:
+ self.log_dir = os.path.join("log", "ranking")
+ self.lib_dir = os.path.join("lib", "ranking")
+ paths = [os.path.join(".", "config", "cms.ranking.conf"),
+- os.path.join("/", "usr", "local", "etc",
+- "cms.ranking.conf"),
+ os.path.join("/", "etc", "cms.ranking.conf")]
+
+ try:
+diff --git a/cmstestsuite/RunFunctionalTests.py b/cmstestsuite/RunFunctionalTests.py
+index 349fbf3..6e2975c 100755
+--- a/cmstestsuite/RunFunctionalTests.py
++++ b/cmstestsuite/RunFunctionalTests.py
+@@ -421,7 +421,7 @@ def main():
+ CONFIG["TEST_DIR"] = git_root
+ CONFIG["CONFIG_PATH"] = "%s/config/cms.conf" % CONFIG["TEST_DIR"]
+ if CONFIG["TEST_DIR"] is None:
+- CONFIG["CONFIG_PATH"] = "/usr/local/etc/cms.conf"
++ CONFIG["CONFIG_PATH"] = "/etc/cms.conf"
+ cms_config = get_cms_config()
+
+ if not config_is_usable(cms_config):
+diff --git a/cmstestsuite/RunUnitTests.py b/cmstestsuite/RunUnitTests.py
+index b1d4249..c8df039 100755
+--- a/cmstestsuite/RunUnitTests.py
++++ b/cmstestsuite/RunUnitTests.py
+@@ -185,7 +185,7 @@ def main():
+ CONFIG["TEST_DIR"] = git_root
+ CONFIG["CONFIG_PATH"] = "%s/config/cms.conf" % CONFIG["TEST_DIR"]
+ if CONFIG["TEST_DIR"] is None:
+- CONFIG["CONFIG_PATH"] = "/usr/local/etc/cms.conf"
++ CONFIG["CONFIG_PATH"] = "/etc/cms.conf"
+
+ if CONFIG["TEST_DIR"] is not None:
+ # Set up our expected environment.
+diff --git a/docs/Internals.rst b/docs/Internals.rst
+index 5ee50ce..0acb587 100644
+--- a/docs/Internals.rst
++++ b/docs/Internals.rst
+@@ -65,8 +65,8 @@ Setting the ``backdoor`` configuration key to true causes services to
+ serve a Python console (accessible with netcat), running in the same
+ interpreter instance as the service, allowing to inspect and modify its
+ data, live. It will be bound to a local UNIX domain socket, usually at
+-:file:`/var/local/run/cms/{service}_{shard}`. Access is granted only to
+-users belonging to the cmsuser group.
++:file:`/var/run/cms/{service}_{shard}`. Access is granted only to users
++belonging to the cmsuser group.
+ Although there's no authentication mechanism to prevent unauthorized
+ access, the restrictions on the file should make it safe to run the
+ backdoor everywhere, even on workers that are used as contestants'
+@@ -76,7 +76,7 @@ following is a complete working connection command:
+
+ .. sourcecode:: bash
+
+- rlwrap netcat -U /var/local/run/cms/EvaluationService_0
++ rlwrap netcat -U /var/run/cms/EvaluationService_0
+
+ Substitute ``netcat`` with your implementation (``nc``, ``ncat``, etc.)
+ if needed.
+diff --git a/docs/RankingWebServer.rst b/docs/RankingWebServer.rst
+index bcc3762..e24fcc0 100644
+--- a/docs/RankingWebServer.rst
++++ b/docs/RankingWebServer.rst
+@@ -48,7 +48,7 @@ You also need to make sure that RWS is able to keep enough simultaneously active
+ Managing it
+ ===========
+
+-RWS doesn't use the PostgreSQL database. Instead, it stores its data in :file:`/var/local/lib/cms/ranking` (or whatever directory is given as ``lib_dir`` in the configuration file) as a collection of JSON files. Thus, if you want to backup the RWS data, just make a copy of that directory. RWS modifies this data in response to specific (authenticated) HTTP requests it receives.
++RWS doesn't use the PostgreSQL database. Instead, it stores its data in :file:`/var/lib/cms/ranking` (or whatever directory is given as ``lib_dir`` in the configuration file) as a collection of JSON files. Thus, if you want to backup the RWS data, just make a copy of that directory. RWS modifies this data in response to specific (authenticated) HTTP requests it receives.
+
+ The intended way to get data to RWS is to have the rest of CMS send it. The service responsible for that is ProxyService (PS for short). When PS is started for a certain contest, it will send the data for that contest to all RWSs it knows about (i.e. those in its configuration). This data includes the contest itself (its name, its begin and end times, etc.), its tasks, its users and the submissions received so far. Then it will continue to send new submissions as soon as they are scored and it will update them as needed (for example when a user uses a token). Note that hidden users (and their submissions) will not be sent to RWS.
+
+diff --git a/setup.py b/setup.py
+index da5a67d..db78e5c 100755
+--- a/setup.py
++++ b/setup.py
+@@ -42,8 +42,10 @@ from setuptools import setup
+
+
+ # Root directories for the /usr and /var trees.
+-USR_ROOT = os.path.join("/", "usr", "local")
+-VAR_ROOT = os.path.join("/", "var", "local")
++ROOT = "MAKEPKG_INSTALL_ROOT"
++USR_ROOT = os.path.join(ROOT, "usr")
++VAR_ROOT = os.path.join(ROOT, "var")
++ETC_ROOT = os.path.join(ROOT, "etc")
+
+
+ def do_setup():
+@@ -279,16 +281,16 @@ def install():
+ root = pwd.getpwnam("root")
+ cmsuser_grp = grp.getgrnam("cmsuser")
+
+- print("copying isolate to /usr/local/bin/.")
++ print("copying isolate to /usr/bin/.")
+ makedir(os.path.join(USR_ROOT, "bin"), root, 0755)
+ copyfile(os.path.join(".", "isolate", "isolate"),
+ os.path.join(USR_ROOT, "bin", "isolate"),
+ root, 04750, group=cmsuser_grp)
+
+- print("copying configuration to /usr/local/etc/.")
+- makedir(os.path.join(USR_ROOT, "etc"), root, 0755)
++ print("copying configuration to /etc/.")
++ makedir(ETC_ROOT, root, 0755)
+ for conf_file_name in ["cms.conf", "cms.ranking.conf"]:
+- conf_file = os.path.join(USR_ROOT, "etc", conf_file_name)
++ conf_file = os.path.join(ETC_ROOT, conf_file_name)
+ # Skip if destination is a symlink
+ if os.path.islink(conf_file):
+ continue
+@@ -316,7 +318,7 @@ def install():
+ dirs = [os.path.join(VAR_ROOT, "log"),
+ os.path.join(VAR_ROOT, "cache"),
+ os.path.join(VAR_ROOT, "lib"),
+- os.path.join(VAR_ROOT, "run"),
++ os.path.join(ROOT, "run"), # On Archlinux /var/run is a symlink to /run
+ os.path.join(USR_ROOT, "include"),
+ os.path.join(USR_ROOT, "share")]
+ for _dir in dirs: