diff options
author | Márcio Alexandre Silva Delgado <coadde@lavabit.com> | 2013-07-17 05:19:48 -0300 |
---|---|---|
committer | Márcio Alexandre Silva Delgado <coadde@lavabit.com> | 2013-07-17 05:19:48 -0300 |
commit | 0a32dd5aab83123487e6988ec37e7e5385c3aef6 (patch) | |
tree | 760f093c15bf512361439acc7b998f04fdd0cb5b /libre/parabolaweb-utils | |
parent | 7d3151cb257dcb2aeacf52bad5d96041677754a2 (diff) | |
parent | 201a3a8a986287b2f54d01e7c5e4bbeba8c37040 (diff) | |
download | abslibre-0a32dd5aab83123487e6988ec37e7e5385c3aef6.tar.gz abslibre-0a32dd5aab83123487e6988ec37e7e5385c3aef6.tar.bz2 abslibre-0a32dd5aab83123487e6988ec37e7e5385c3aef6.zip |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'libre/parabolaweb-utils')
-rw-r--r-- | libre/parabolaweb-utils/PKGBUILD | 70 | ||||
-rw-r--r-- | libre/parabolaweb-utils/helper.sh | 25 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb-download | 47 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb-fcgi | 12 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb-update | 86 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb.conf | 6 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb.rc | 44 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb.service | 13 |
8 files changed, 22 insertions, 281 deletions
diff --git a/libre/parabolaweb-utils/PKGBUILD b/libre/parabolaweb-utils/PKGBUILD index 4220394dc..0a49ce048 100644 --- a/libre/parabolaweb-utils/PKGBUILD +++ b/libre/parabolaweb-utils/PKGBUILD @@ -1,63 +1,37 @@ # Maintainer: Luke Shumaker <lukeshu@sbcglobal.net> -. "${startdir:-.}/helper.sh" -# provides: -# _get_depends -# _get_depends_nover (no version requirements) - -pkgname=parabolaweb-utils -pkgver=20120425.0657 -pkgdesc="Utils for the Parabola website" -url="https://projects.parabolagnulinux.org/parabolaweb.git/" +pkgname=(parabolaweb-utils parabolaweb-dev) +pkgver=20130717 +pkgdesc="Utilities for managing the parabolaweb website application" +url="https://projects.parabolagnulinux.org/packages/parabolaweb-utils.git/" license=('GPL2') pkgrel=1 epoch=1 arch=('any') -depends=( - 'python2' # duh - 'python2-flup' # for fcgi - 'postgresql' # for database - 'git' # used in parabolaweb-download - 'libretools' # used in parabolaweb-{download,update} (libremessages) - `_get_depends`) -conflicts=('django>=1.5') # hold it at 1.4 -makedepends=(makepkg-git) -backup=('etc/conf.d/parabolaweb') -source=(git://parabolagnulinux.org/parabolaweb.git - parabolaweb-download - parabolaweb-update - parabolaweb-fcgi - parabolaweb.rc - parabolaweb.service - parabolaweb.conf) +source=( + "https://projects.parabolagnulinux.org/packages/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2" + "https://projects.parabolagnulinux.org/parabolaweb.git/plain/requirements_prod.txt" +) -pkgver() { - cd "$srcdir/parabolaweb" - # get the date requirements_prod.txt was last modified - gitdate="$(git log -n1 --date=iso --format=format:'%cd' ./requirements_prod.txt)" - date -u +%Y%m%d.%H%M -d "$gitdate" +build() { + cd "$srcdir/$pkgname-$pkgver" + prod_file="file://${srcdir}/requirements_prod.txt" make } -build() { - : +package_parabolaweb-utils() { + cd "$srcdir/$pkgbase-$pkgver" + depends=($(cat depends.txt)) + backup=('etc/conf.d/parabolaweb') + make install DESTDIR="$pkgdir" } -package() { - cd "${srcdir}" - install -Dm755 parabolaweb-download "${pkgdir}/usr/sbin/parabolaweb-download" - install -Dm755 parabolaweb-update "${pkgdir}/usr/sbin/parabolaweb-update" - install -Dm755 parabolaweb-fcgi "${pkgdir}/usr/sbin/parabolaweb-fcgi" - install -Dm755 parabolaweb.rc "${pkgdir}/etc/rc.d/parabolaweb" - install -Dm644 parabolaweb.service "${pkgdir}/usr/lib/systemd/system/parabolaweb.service" - install -Dm644 parabolaweb.conf "${pkgdir}/etc/conf.d/parabolaweb" +package_parabolaweb-dev() { + cd "$srcdir/$pkgbase-$pkgver" + pkgdesc="Depends on packages needed to develop parabolaweb" + depends=($(sed -r -e 's/\s*#.*//' depends_make.txt)) } -md5sums=('SKIP' - 'f162c2ce49b4cafe0a14bd4767dfea04' - '7c212024c134fdd0d0318b52a5448ddb' - 'd5294495f42df29d29519ebd0a8f6093' - 'cc15e153f99fba82e7bb032896f655c2' - 'a468016a7155b5da46521dcfc6428384' - 'ffd37a19b1a72fbac2c58504aa17b355') +md5sums=('a6734335001c7695d5a57fb509f8a745' + 'c84e52d81683cb3d572571ac19be89ac') diff --git a/libre/parabolaweb-utils/helper.sh b/libre/parabolaweb-utils/helper.sh deleted file mode 100644 index ce8638e7e..000000000 --- a/libre/parabolaweb-utils/helper.sh +++ /dev/null @@ -1,25 +0,0 @@ -_mksource() { - pushd "${startdir:-.}" >/dev/null - if [[ -z $_DO_NOT_RUN_MKSOURCE && $0 =~ ^makepkg ]]; then - local flags=(-o) - (( EUID )) || flags+=(--asroot) - _DO_NOT_RUN_MKSOURCE=true "${0}" "${flags[@]}" - fi - popd >/dev/null -} - -_get_depends() { - _mksource 1>&2 - if [[ -f "${srcdir:-${startdir:-.}/src}/parabolaweb/requirements_prod.txt" ]]; then - pushd "${srcdir:-src}" >/dev/null - < parabolaweb/requirements_prod.txt sed -r \ - -e 's/.*/\L&/' -e 's/==/>=/' \ - -e 's/^(python2?-)?/python2-/' \ - -e 's/python2-django/django/' - popd >/dev/null - fi -} - -_get_depends_nover() { - _get_depends | sed 's/[<>=].*//' -} diff --git a/libre/parabolaweb-utils/parabolaweb-download b/libre/parabolaweb-utils/parabolaweb-download deleted file mode 100644 index e124295d4..000000000 --- a/libre/parabolaweb-utils/parabolaweb-download +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -. /etc/conf.d/parabolaweb -. /usr/bin/libremessages - -dir=$WEBDIR -repo=$GITURL -ref=$GITREF - -cd_safe() { - if ! cd "$1"; then - error "$(gettext "Failed to change to directory %s")" "$1" - plain "$(gettext "Aborting...")" - exit 1 - fi -} - -download_git() { - if [[ ! -d "$dir/.git" ]] ; then - msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git" - if ! git clone "$repo" "$dir"; then - error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" - plain "$(gettext "Aborting...")" - exit 1 - fi - else - cd_safe "$dir" - # Make sure we are fetching the right repo - if [[ "$repo" != "$(git config --get remote.origin.url)" ]] ; then - error "$(gettext "%s is not a clone of %s")" "$dir" "$repo" - plain "$(gettext "Aborting...")" - exit 1 - fi - msg2 "$(gettext "Updating %s %s repo...")" "${repo}" "git" - if ! git pull origin "$ref"; then - # only warn on failure to allow offline builds - warning "$(gettext "Failure while updating %s %s repo")" "${repo}" "git" - fi - fi -} - -main() { - [[ -d "${dir%/*}" ]] || mkdir -p "${dir%/*}" - download_git -} - -main "$@" diff --git a/libre/parabolaweb-utils/parabolaweb-fcgi b/libre/parabolaweb-utils/parabolaweb-fcgi deleted file mode 100644 index e42aec3cd..000000000 --- a/libre/parabolaweb-utils/parabolaweb-fcgi +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -e - -. /etc/conf.d/parabolaweb - -[[ -e ${WEBDIR}/manage.py ]] - -sudo -u "${WEBUSER:-$USER}" python2 "${WEBDIR}/manage.py" runfcgi \ - host=${HOST} \ - port=${PORT} \ - --settings=settings \ - "$@" diff --git a/libre/parabolaweb-utils/parabolaweb-update b/libre/parabolaweb-utils/parabolaweb-update deleted file mode 100644 index 2da9eea8a..000000000 --- a/libre/parabolaweb-utils/parabolaweb-update +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -set -e - -. /etc/conf.d/parabolaweb -. /usr/bin/libremessages - -find_makefiles() { - pushd "$WEBDIR" > /dev/null - echo ./sitestatic - find . -name static -type d | while read dir; do - if [[ -e "$WEBDIR/$dir/Makefile" ]]; then - printf '%s\n' "$dir" - fi - done -} - -clean() { - cd "$WEBDIR" - msg "Purging old .pyc files..." - find . -name '*.pyc' -delete - msg "Purging old GNU Make generated files..." - for dir in `find_makefiles`; do - make -C "$WEBDIR/$dir" clean - done -} - -configure() { - cd "$WEBDIR" - msg "Checking configuration..." - if [[ ! -f local_settings.py ]]; then - msg2 "Configuration file missing, opening editor..." - cp local_settings.py.example local_settings.tmp.$$.py - if "$EDITOR" local_settings.tmp.$$.py; then - mv local_settings.tmp.$$.py local_settings.py - else - rm local_settings.tmp.$$.py - msg "Failed to configure, exiting" - exit 1 - fi - msg2 "Creating database..." - ./manage.py syncdb - else - msg2 "Current configuration checks out" - fi -} - -update-database() { - cd "$WEBDIR" - msg "Updating database..." - msg2 "Running migrations..." - ./manage.py migrate - if [[ -f devel/management/commands/update_types_permissions.py ]]; then - msg2 "Updating permissions..." - ./manage.py update_types_permissions - fi - msg2 "Loading fixtures..." - ./manage.py loaddata */fixtures/*.json -} - -update-filesystem() { - msg "Updating filesystem..." - for dir in `find_makefiles`; do - msg2 "Updating $dir with GNU Make..." - make -C "$WEBDIR/$dir" - done - cd "$WEBDIR" - msg2 "Collecting static files..." - echo yes | ./manage.py collectstatic -l -} - -main() { - if [[ -z "$EDITOR" ]]; then - error 'Please set the $EDITOR variable' - exit 1 - fi - - if [[ -d "$WEBDIR" ]]; then - clean - fi - parabolaweb-download - configure - update-database - update-filesystem -} - -main "$@" diff --git a/libre/parabolaweb-utils/parabolaweb.conf b/libre/parabolaweb-utils/parabolaweb.conf deleted file mode 100644 index 5363479b3..000000000 --- a/libre/parabolaweb-utils/parabolaweb.conf +++ /dev/null @@ -1,6 +0,0 @@ -HOST=127.0.0.1 -PORT=8090 # 80 is nginx -WEBDIR=/srv/http/web -WEBUSER=nobody -GITURL=git://parabolagnulinux.org/parabolaweb.git -GITREF=master diff --git a/libre/parabolaweb-utils/parabolaweb.rc b/libre/parabolaweb-utils/parabolaweb.rc deleted file mode 100644 index 5e310b01d..000000000 --- a/libre/parabolaweb-utils/parabolaweb.rc +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -. /etc/rc.conf -. /etc/rc.d/functions - -PIDFILE=/run/web/parabolaweb.pid - -case $1 in -start) - stat_busy "Starting ParabolaWeb" - install -dm777 ${PIDFILE%/*} - if parabolaweb-fcgi pidfile=${PIDFILE}; then - add_daemon parabolaweb - stat_done - exit 0 - else - stat_fail - exit 1 - fi - ;; - -stop) - stat_busy "Stopping ParabolaWeb" - if [[ -f ${PIDFILE} ]]; then - pid=$(cat ${PIDFILE}) - kill ${pid} - rm_daemon parabolaweb - stat_done - else - stat_fail - exit 1 - fi - ;; - -restart) - $0 stop - $0 start - ;; - -*) - echo "Usage: $0 {start|stop|restart}" >&2 - exit 1 - -esac diff --git a/libre/parabolaweb-utils/parabolaweb.service b/libre/parabolaweb-utils/parabolaweb.service deleted file mode 100644 index a59d58512..000000000 --- a/libre/parabolaweb-utils/parabolaweb.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Requires=postgresql.service -After=postgresql.service -Description=ParabolaWeb - -[Service] -Type=forking -PIDFile=/run/web/parabolaweb.pid -ExecStartPre=/usr/bin/install -dm777 /run/web -ExecStart=/usr/sbin/parabolaweb-fcgi pidfile=/run/web/parabolaweb.pid - -[Install] -WantedBy=multi-user.target |