Skip to content

Commit

Permalink
Download all the modules into a bundle and add as a source for the RPM
Browse files Browse the repository at this point in the history
  • Loading branch information
smarthall committed Dec 31, 2013
1 parent 6a955f5 commit c798ef0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
29 changes: 16 additions & 13 deletions build/rpm/RatticWeb.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ Summary: RatticWeb is password management for humans.
License: GPL
URL: http://rattic.org/
Source0: https://github.com/tildaslash/%{name}/archive/%{version}.tar.gz
Source1: RatticWeb.pybundle

BuildArch: noarch
BuildRequires: python Django14 Django-south httpd mod_wsgi mod_ssl MySQL-python
BuildRequires: python-mimeparse python-six python-crypto
BuildRequires: python-pip
Requires: python Django14 Django-south httpd mod_wsgi mod_ssl MySQL-python

BuildRequires: python httpd mod_wsgi mod_ssl
BuildRequires: python-pip python-virtualenv openldap-devel mysql-devel

Requires: python httpd mod_wsgi mod_ssl openldap mysql

%description

Expand All @@ -30,24 +32,25 @@ rm -rf %{buildroot}
# Remove things we don't want to package
rm .gitignore
rm .travis.yml
rm Vagrantfile

# Copy RatticWeb into place
mkdir -p %{buildroot}/opt/apps/RatticWeb
cp -av . %{buildroot}/opt/apps/RatticWeb
mkdir -p %{buildroot}/opt/apps/Rattic/web
cp -av . %{buildroot}/opt/apps/Rattic/web/

# Install dependencies
mkdir -p %{buildroot}/opt/apps/RatticWeb-pip/
pip-python install --install-option="--prefix=%{buildroot}/opt/apps/RatticWeb-pip/" django-tastypie
pip-python install --install-option="--prefix=%{buildroot}/opt/apps/RatticWeb-pip/" markdown
mkdir -p %{buildroot}/opt/apps/RatticWeb/venv
virtualenv %{buildroot}/opt/apps/RatticWeb/venv
source %{buildroot}/opt/apps/RatticWeb/venv/bin/activate
pip install %{SOURCE1}

# Test
cd %{buildroot}/opt/apps/RatticWeb
export PYTHONPATH=%{buildroot}/opt/apps/RatticWeb-pip/lib/python2.6/site-packages/
cd %{buildroot}/opt/apps/Rattic/web/
source %{buildroot}/opt/apps/RatticWeb/venv/bin/activate
./manage.py test

%files
/opt/apps/RatticWeb/*
/opt/apps/RatticWeb-pip/*
/opt/apps/Rattic/*
%doc README.md

%changelog
1 change: 1 addition & 0 deletions build/rpm/mockbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mkdir ${SRCDIR} ${SRPMBUILDDIR} ${RPMBUILDDIR}
mkdir -p out

spectool -gf ${SPEC} -C ${SRCDIR}
pip bundle $SRCDIR/RatticWeb.pybundle -r ../../requirements.txt
mock --buildsrpm --spec ${SPEC} --sources ${SRCDIR} --resultdir ${SRPMBUILDDIR}
mock --rebuild ${SRPMBUILDDIR}/${NAME}-*.src.rpm --resultdir ${RPMBUILDDIR}
cp ${SRPMBUILDDIR}/${NAME}-*.src.rpm out/
Expand Down

0 comments on commit c798ef0

Please sign in to comment.