Created
May 24, 2012 21:41
-
-
Save uggedal/2784406 to your computer and use it in GitHub Desktop.
mediaqueri.es deployment with pacman
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION=1.0 | |
.PHONY: all with-venv | |
all: with-venv | |
@./manage.py assets build | |
@python setup.py sdist | |
@cp dist/mediaqueries-$(VERSION).tar.gz pkg/ | |
@cd pkg && makepkg -f --skipchecksums | |
@./manage.py assets clean | |
@rm -rf build/ dist/ mediaqueries.egg-info/ | |
@rm pkg/mediaqueries-$(VERSION).tar.gz | |
with-venv: | |
ifndef VIRTUAL_ENV | |
$(error can not run wihout a venv) | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Eivind Uggedal <eivind@uggedal.com> | |
pkgname=mediaqueries | |
pkgver=1.0 | |
pkgrel=6 | |
pkgdesc='Source and static files for mediaqueri.es.' | |
arch=('any') | |
url='http://mediaqueri.es' | |
license=('custom') | |
depends=('python2' 'python2-virtualenv' 'phantomjs') | |
source=("mediaqueries-$pkgver.tar.gz") | |
md5sums=() | |
build() { | |
local venv_dest="$pkgdir/usr/local/venv/$pkgname" | |
local http_root="$pkgdir/srv/http" | |
local http_dest="$http_root/$pkgname" | |
# Static content served directly by nginx: | |
install -d $http_dest/static | |
install ../../$pkgname/static/*.css -t $http_dest/static | |
install ../../$pkgname/static/*.js -t $http_dest/static | |
install ../../$pkgname/static/*.png -t $http_dest/static | |
install ../../$pkgname/static/*-webfont.* -t $http_dest/static | |
install ../../$pkgname/static/.webassets-manifest -t $http_dest/static | |
install ../../$pkgname/static/favicon.ico -t $http_dest | |
# Preserve original /srv/http mode | |
chmod 0750 $http_root | |
# Create venv and install mediaqueries and all deps into it | |
cd "$srcdir/$pkgname-$pkgver" | |
sed -i -e's/env = "Development"/env = "Production"/' mediaqueries/__init__.py | |
virtualenv --distribute $venv_dest | |
"$venv_dest/bin/python" setup.py install --optimize=1 | |
virtualenv --relocatable $venv_dest | |
# The http user should own all files and directories | |
chown -R http: $http_dest $venv_dest | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment