You are not logged in.

#1 2011-02-21 22:16:24

bb10
Member
Registered: 2007-12-31
Posts: 73

[Request] Firefox Sync Server (python)

Hello,

I would like to run my own Sync server for Firefox. There doesn't seem to a package in AUR so I thought I'd ask here.
I've never made a PKGBUILD before (only did some edits here and there) and I thought this would be a nice opportunity to start; however, it seems this may be a little too complicated for a first PKGBUILD.

The makefile can be found here: https://hg.mozilla.org/services/server- … e/Makefile
As you can see, there is some rpm stuff going on. It also builds python-ldap, which I guess we can replace with a python2-ldap dependency?

There is also a readme here: https://hg.mozilla.org/services/server- … f3e/README

Thanks

Offline

#2 2011-02-22 02:06:35

bb10
Member
Registered: 2007-12-31
Posts: 73

Re: [Request] Firefox Sync Server (python)

So this is what I got so far:

PKGBUILD:

##
pkgname=sync-server-full
_pkgname=server-full
pkgver=0.1
pkgrel=1
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'MPL')
pkgdesc="Firefox sync server python"
url="https://hg.mozilla.org/services/server-full"
makedepends=('mercurial')
depends=('python2' 'sqlite3' 'python2-ldap' 'python-virtualenv' 'pylint' 'python2-nose')

_hgroot="https://hg.mozilla.org/services"
_hgrepo="server-full"

build() {
    cd "$srcdir/$_pkgname"
    
    make build
}

edited Makefile:

APPNAME = sync-server-full
DEPS = server-core,server-reg,server-storage 
VIRTUALENV = virtualenv
PYTHON = usr/bin/python2
EZ = bin/easy_install       // <- no idea what this is.
NOSE = usr/bin/nose -s --with-xunit
FLAKE8 = usr/bin/flake8
COVEROPTS = --cover-html --cover-html-dir=html --with-coverage --cover-package=syncreg,syncstorage,services
TESTS = deps/server-core/services/tests deps/server-reg/syncreg/tests deps/server-storage/syncstorage/tests
PKGS = deps/server-core/services deps/server-reg/syncreg deps/server-storage/syncstorage
COVERAGE = bin/coverage     // <- is this perl-pod-coverage?
PYLINT = usr/bin/pylint
SERVER = dev-auth.services.mozilla.com
SCHEME = https

.PHONY: all build mysqltest ldaptest test coverage build_extras qa oldtest hudson-coverage lint memcachedtest memcachedldaptest

all:    build

# XXX we could switch to zc.buildout here
build:
    rm -rf lib64 bin lib include                        // <- what is this removing?
    $(VIRTUALENV) --no-site-packages --distribute .
    $(PYTHON) build.py $(APPNAME) $(DEPS)
    $(EZ) nose
    $(EZ) coverage
    $(EZ) flake8
    $(EZ) mysql-python
    $(EZ) pylint
    $(EZ) pygments
    $(EZ) python-memcached
    $(EZ) pypi2rpm
    $(EZ) WebTest
    $(EZ) PasteDeploy
    $(EZ) wsgi_intercept

memcachedtest:
    WEAVE_TESTFILE=memcached $(NOSE) $(TESTS)

memcachedldaptest:
    WEAVE_TESTFILE=memcachedldap $(NOSE) $(TESTS)

mysqltest:
    WEAVE_TESTFILE=mysql $(NOSE) $(TESTS)

ldaptest:
    WEAVE_TESTFILE=ldap $(NOSE) $(TESTS)

test:
    $(NOSE) $(TESTS)

coverage:
    rm -rf html
    - WEAVE_TESTFILE=mysql $(NOSE) $(COVEROPTS) $(TESTS)
    - WEAVE_TESTFILE=ldap $(NOSE) $(COVEROPTS) $(TESTS)
    - $(NOSE) $(COVEROPTS) $(TESTS)

hudson-coverage:
    cd deps/server-core; hg pull; hg up -C
    cd deps/server-reg; hg pull; hg up -C
    cd deps/server-storage; hg pull; hg up -C
    rm -f coverage.xml
    - $(COVERAGE) run --source=syncreg,syncstorage,services $(NOSE) $(TESTS); $(COVERAGE) xml

lint:
    rm -f pylint.txt
    - $(PYLINT) -f parseable --rcfile=pylintrc $(PKGS) > pylint.txt

qa:
    rm -f deps/server-reg/syncreg/templates/*.py
    $(FLAKE8) $(PKGS)

oldtest:
    $(PYTHON) tests/functional/run_server_tests.py --scheme=$(SCHEME) --server=$(SERVER)

bench_one:
    cd tests/loadtest; ../../bin/fl-run-test simple SimpleTest.test_simple

bench:
    cd tests/loadtest; ../../bin/fl-run-bench simple SimpleTest.test_simple

PKGBUILD for flake8:

#
pkgname=flake8
pkgver=0.7
pkgrel=1
arch=('i686' 'x86_64')
license=('GPL')          // not sure
pkgdesc="Flake8"
url="http://pypi.python.org/pypi/flake8/"
makedepends=('mercurial')
depends=('python2')

_hgroot="https://bitbucket.org/tarek"
_hgrepo="flake8"

build() {
    cd "$srcdir/$pkgname"
    
    python2 ./setup.py install --prefix=/usr --root=${pkgdir}
}

Added a few comments for things I don't understand. I would appreciate any tips.

Thanks

Last edited by bb10 (2011-02-22 03:50:38)

Offline

#3 2011-07-04 20:45:37

wabi
Member
Registered: 2005-04-04
Posts: 72

Re: [Request] Firefox Sync Server (python)

Did your PKGBUILD work in the end?
I'm stil running a minimal server and would like to change to the full build. I know apache quite good so I could help with the integration there.
Please post you newest PKGBUILD on AUR if possible (even if it is not yet finished, so everybody can work on it).

Offline

Board footer

Powered by FluxBB