rewrote packaging

This commit is contained in:
Jonas Heinrich 2018-03-11 21:39:07 +01:00
parent cde8b4d3a2
commit 27db7d34ef
2 changed files with 24 additions and 56 deletions

View file

@ -1,19 +1,25 @@
# Generated by mksrcinfo v8 # Generated by mksrcinfo v8
# Sun Mar 11 10:14:01 UTC 2018 # Sun Mar 11 20:38:59 UTC 2018
pkgbase = mozilla-firefox-sync-server pkgbase = mozilla-firefox-sync-server
pkgdesc = Mozilla Sync Server for built-in Firefox Sync pkgdesc = Mozilla Sync Server for built-in Firefox Sync
pkgver = 1.7.0 pkgver = 1.7.0
pkgrel = 1 pkgrel = 2
url = http://docs.services.mozilla.com/howtos/run-sync-1.5.html url = http://docs.services.mozilla.com/howtos/run-sync-1.5.html
install = mozilla-firefox-sync-server.install install = mozilla-firefox-sync-server.install
arch = any arch = any
license = GPL license = GPL
makedepends = git
depends = python2 depends = python2
depends = python-virtualenv depends = python2-pyramid
conflicts = mozilla-firefox-sync-server-hg depends = python2-mozsvc
options = !debug depends = python2-konfig
backup = opt/mozilla-firefox-sync-server/syncserver.ini depends = python2-configparser
depends = python2-tokenserver
depends = python2-simplejson
depends = python2-paste-deploy
depends = python2-syncstorage
depends = python2-pyramid-hawkauth
depends = python2-tokenlib
backup = usr/share/webapps/mozilla-firefox-sync-server/syncserver.ini
source = mozilla-firefox-sync-server-1.7.0.tar.gz::https://github.com/mozilla-services/syncserver/archive/v1.7.0.tar.gz source = mozilla-firefox-sync-server-1.7.0.tar.gz::https://github.com/mozilla-services/syncserver/archive/v1.7.0.tar.gz
source = ffsync.service source = ffsync.service
source = ffsync.tmpfiles source = ffsync.tmpfiles

View file

@ -1,16 +1,16 @@
# Maintainer: Jonas Heinrich <onny@project-insanity.org>
# Contributor: Jonas Heinrich <onny@project-insanity.org>
# Contributor: Timothée Ravier <tim@siosm.fr> # Contributor: Timothée Ravier <tim@siosm.fr>
pkgname=mozilla-firefox-sync-server pkgname=mozilla-firefox-sync-server
pkgver=1.7.0 pkgver=1.7.0
pkgrel=1 pkgrel=2
pkgdesc="Mozilla Sync Server for built-in Firefox Sync" pkgdesc="Mozilla Sync Server for built-in Firefox Sync"
arch=('any') arch=('any')
url='http://docs.services.mozilla.com/howtos/run-sync-1.5.html' url='http://docs.services.mozilla.com/howtos/run-sync-1.5.html'
license=('GPL') license=('GPL')
depends=('python2' 'python-virtualenv') depends=('python2' 'python2-pyramid' 'python2-mozsvc' 'python2-konfig' 'python2-configparser' 'python2-tokenserver'
makedepends=('git') 'python2-simplejson' 'python2-paste-deploy' 'python2-syncstorage' 'python2-pyramid-hawkauth' 'python2-tokenlib')
options=(!debug)
conflicts=('mozilla-firefox-sync-server-hg')
install=${pkgname}.install install=${pkgname}.install
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/mozilla-services/syncserver/archive/v${pkgver}.tar.gz" source=("${pkgname}-${pkgver}.tar.gz::https://github.com/mozilla-services/syncserver/archive/v${pkgver}.tar.gz"
'ffsync.service' 'ffsync.service'
@ -18,54 +18,16 @@ source=("${pkgname}-${pkgver}.tar.gz::https://github.com/mozilla-services/syncse
sha512sums=('c66aed1195138f15729ed7ef3fb31837bd74f751c0df4f93d0d6c3a8b34687d7dc02e201cfb6c218aab1d769698950ea316f688b51d90b87e8c495d573b85cc3' sha512sums=('c66aed1195138f15729ed7ef3fb31837bd74f751c0df4f93d0d6c3a8b34687d7dc02e201cfb6c218aab1d769698950ea316f688b51d90b87e8c495d573b85cc3'
'ccc56d118dce78aed3595577b489d984d1d697e6aa4cb9e2f30c7f16caaf2d2145d1e6bbabc737a867d5c5257cfa57ef0a031b11bc22c11b25523e7d889492d8' 'ccc56d118dce78aed3595577b489d984d1d697e6aa4cb9e2f30c7f16caaf2d2145d1e6bbabc737a867d5c5257cfa57ef0a031b11bc22c11b25523e7d889492d8'
'a06ac68b5379de3352369c998ef73d0ff4ef4517243e8f7856435ec21937b86af6f3b5c216cce585ea6b572043b313c70b76bd183e89ed5e48916ff209d2ac30') 'a06ac68b5379de3352369c998ef73d0ff4ef4517243e8f7856435ec21937b86af6f3b5c216cce585ea6b572043b313c70b76bd183e89ed5e48916ff209d2ac30')
backup=('opt/mozilla-firefox-sync-server/syncserver.ini') backup=('usr/share/webapps/mozilla-firefox-sync-server/syncserver.ini')
prepare() {
cd "syncserver-${pkgver}"
# Change default sqlite database location
sed -i "s|/tmp/syncserver.db|/var/lib/ffsync/sync_storage.db|g" syncserver.ini
}
build() {
cd "syncserver-${pkgver}"
make build
# PostgreSQL support
# local/bin/pip install psycopg2
# There is no install target in the Makefile, so let's do some cleaning
rm -rf .git .gitignore Dockerfile Makefile MANIFEST.in README.rst setup.py \
local/bin/pep8 local/bin/build* local/bin/easy_install* local/bin/pip* \
local/COMPLETE
# Remove compiled python files as they may cause issues
find . -name '*.pyc' -delete
# Manually fix install path
find . -type f -exec sed -i "s|${srcdir}/${pkgname}|/opt/${pkgname/-git}|g" {} \;
}
check() {
cd "syncserver-${pkgver}"
#make test
}
package() { package() {
cd "syncserver-${pkgver}" cd "syncserver-${pkgver}"
python2 setup.py install --root "${pkgdir}"
install -dm 755 "${pkgdir}/usr/share/webapps/mozilla-firefox-sync-server"
cp syncserver.ini syncserver.wsgi "${pkgdir}/usr/share/webapps/mozilla-firefox-sync-server/"
# There is no install target in the Makefile, installing manually install -Dm 644 "${srcdir}/ffsync.service" "${pkgdir}/usr/lib/systemd/system/ffsync.service"
install -dm 755 "${pkgdir}"/opt/${pkgname/-git} "${pkgdir}"/var/lib/ffsync install -Dm 644 "${srcdir}/ffsync.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/ffsync.conf"
cp -a * "${pkgdir}"/opt/${pkgname/-git}
# Manually fix permissions
cd "${pkgdir}"/opt/${pkgname/-git}
find . -exec chmod go-w {} \;
find . -type f -exec chmod a+r {} \;
install -Dm 644 "${srcdir}"/ffsync.service "${pkgdir}"/usr/lib/systemd/system/ffsync.service
install -Dm 644 "${srcdir}"/ffsync.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/ffsync.conf
} }
# vim: ft=sh syn=sh ts=2 sw=2 et: # vim: ft=sh syn=sh ts=2 sw=2 et: