1 Summary: OpenCloud core services
6 Group: Development/Tools
7 Source0: %{_tmppath}/%{name}-%{version}.tar.gz
8 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
10 requires: postgresql-server
11 requires: python-psycopg2
13 requires: graphviz-devel
14 requires: graphviz-python
15 requires: libxslt-devel
19 requires: python-httplib2
32 pip-python install django==1.7
33 pip-python install djangorestframework
34 pip-python install markdown # Markdown support for the browseable API.
35 pip-python install pyyaml # YAML content-type support.
36 pip-python install django-filter # Filtering support
37 pip-python install lxml # XML manipulation library
38 pip-python install netaddr # IP Addr library
39 pip-python install pytz
40 pip-python install django-timezones
41 pip-python install requests
42 pip-python install django-crispy-forms
43 pip-python install django-geoposition
44 pip-python install django-extensions
45 pip-python install django-suit
46 pip-python install django-evolution
47 pip-python install django-bitfield
48 pip-python install django-ipware
49 pip-python install django-encrypted-fields
50 pip-python install python-keyczar
52 easy_install django_evolution
53 easy_install python_gflags
54 easy_install google_api_python_client
56 if [ ! -f /usr/lib/python2.7/site-packages/suit/static/suit/js/jquery-1.9.1.min.js ]; then
57 wget -P /usr/lib/python2.7/site-packages/suit/static/suit/js http://code.jquery.com/jquery-1.9.1.min.js
60 if [ ! -f /usr/share/GeoIP/GeoLiteCity.dat ]; then
61 rm -f /usr/share/GeoIP/GeoLiteCity.*
62 wget -P /usr/share/GeoIP http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
63 gzip -d /usr/share/GeoIP/GeoLiteCity*.gz
66 if [ "$1" == 2 ] ; then
67 if [[ -e /opt/planetstack/scripts/opencloud ]]; then
68 echo "UPGRADE - saving current state"
69 /opt/planetstack/scripts/opencloud dumpdata
76 install -d %{buildroot}/opt/planetstack
77 install -d %{buildroot}/etc/init.d
82 # don't copy symbolic links (they are handled in %post)
83 rsync -rptgoD ./planetstack %{buildroot}/opt/.
84 cp observer-initscript %{buildroot}/etc/init.d/plstackobserver
86 find %{buildroot}/opt/planetstack -type f -print | sed "s@^$RPM_BUILD_ROOT@@g" > %{_tmppath}/tmp-filelist
87 echo /etc/init.d/plstackobserver >> %{_tmppath}/tmp-filelist
89 # remove config files from the file list (see %config below)
90 cat > %{_tmppath}/config-files << "EOF"
91 /opt/planetstack/plstackapi_config
92 /opt/planetstack/deployment_auth.py
95 sort %{_tmppath}/tmp-filelist > %{_tmppath}/tmp-filelist.sorted
96 sort %{_tmppath}/config-files > %{_tmppath}/config-files.sorted
97 comm -13 %{_tmppath}/config-files.sorted %{_tmppath}/tmp-filelist.sorted > %{_tmppath}/tmp-filelist
99 cp %{_tmppath}/tmp-filelist /tmp/tmp-filelist
104 %files -f %{_tmppath}/tmp-filelist
105 %defattr(-,root,root,-)
106 %config /opt/planetstack/plstackapi_config
107 %config /opt/planetstack/deployment_auth.py
110 ln -s ec2_observer /opt/planetstack/observer
111 ln -s config-opencloud.py /opt/planetstack/syndicate_observer/syndicatelib_config/config.py
113 if [ ! -e /opt/planetstack/public_keys ]; then
115 scripts/opencloud genkeys
118 if [ "$1" == 1 ] ; then
119 echo "NEW INSTALL - initializing database"
120 /opt/planetstack/scripts/opencloud initdb
122 # scripts/opencloud will choose evolve or migrate depending on django version
123 echo "UPGRADE - doing evolution/migration"
124 /opt/planetstack/scripts/opencloud evolvedb
128 /opt/planetstack/scripts/opencloud runserver
131 if [ "$1" = 0 ] ; then
132 echo "UNINSTALL - destroying planetstack"
133 rm -rf /opt/planetstack
137 * Sat Feb 22 2014 Siobhan Tully 1.0.0