blob: 3b9d35aee75669fa2b042c5897b521f77bc8d3de [file] [log] [blame]
Siobhan Tully44fd4cc2014-02-23 00:07:12 -05001Summary: OpenCloud core services
2Name: opencloud
Scott Baker8ccabb92014-06-25 23:07:54 -07003Version: 1.0.20
4Release: 1
Siobhan Tully44fd4cc2014-02-23 00:07:12 -05005License: GPL+
6Group: Development/Tools
7Source0: %{_tmppath}/%{name}-%{version}.tar.gz
8BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
9requires: postgresql
10requires: postgresql-server
11requires: python-psycopg2
12requires: graphviz
13requires: graphviz-devel
14requires: graphviz-python
15requires: libxslt-devel
16requires: python-pip
17requires: tar
18requires: gcc
Scott Baker524acdb2014-03-19 23:45:49 -070019requires: python-httplib2
Scott Baker09c7af42014-04-14 11:00:25 -070020requires: GeoIP
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050021
22%description
23%{summary}
24
25%prep
26%setup -q
27
28%build
29# Empty section.
30
31%pre
Scott Baker8ccabb92014-06-25 23:07:54 -070032#pip-python install django==1.5
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050033pip-python install djangorestframework
34pip-python install markdown # Markdown support for the browseable API.
35pip-python install pyyaml # YAML content-type support.
36pip-python install django-filter # Filtering support
37pip-python install lxml # XML manipulation library
38pip-python install netaddr # IP Addr library
39pip-python install pytz
40pip-python install django-timezones
41pip-python install requests
42pip-python install django-crispy-forms
43pip-python install django-geoposition
44pip-python install django-extensions
45pip-python install django-suit
46pip-python install django-evolution
Scott Baker524acdb2014-03-19 23:45:49 -070047pip-python install django-bitfield
Scott Baker09c7af42014-04-14 11:00:25 -070048pip-python install django-ipware
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050049
50easy_install django_evolution
Scott Baker524acdb2014-03-19 23:45:49 -070051easy_install python_gflags
52easy_install google_api_python_client
53
54wget -P /usr/lib/python2.7/site-packages/suit/static/suit/js http://code.jquery.com/jquery-1.9.1.min.js
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050055
Scott Baker566c0022014-04-18 16:14:04 -070056if [ ! -f /usr/share/GeoIP/GeoLiteCity.dat ]; then
57 rm -f /usr/share/GeoIP/GeoLiteCity.*
58 wget -P /usr/share/GeoIP http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
59 gzip -d /usr/share/GeoIP/GeoLiteCity*.gz
60fi
Scott Bakeredec3322014-04-14 23:51:04 -070061
Scott Baker91d769f2014-05-15 14:23:22 -070062if [ "$1" == 2 ] ; then
Scott Baker8ccabb92014-06-25 23:07:54 -070063 if [[ -e /opt/planetstack/scripts/opencloud ]]; then
64 echo "UPGRADE - saving current state"
65 /opt/planetstack/scripts/opencloud dumpdata
66 fi
Scott Baker91d769f2014-05-15 14:23:22 -070067fi
68
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050069%install
70rm -rf %{buildroot}
71mkdir -p %{buildroot}
72install -d %{buildroot}/opt/planetstack
73
74# in builddir
Scott Bakerc00bbfc2014-05-13 17:43:02 -070075cp -rp ./planetstack %{buildroot}/opt/.
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050076
Scott Baker140f15a2014-05-15 15:14:23 -070077find %{buildroot}/opt/planetstack -type f -print | sed "s@^$RPM_BUILD_ROOT@@g" > %{_tmppath}/tmp-filelist
78cp %{_tmppath}/tmp-filelist /tmp/tmp-filelist
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050079
80%clean
81rm -rf %{buildroot}
82
83%files -f %{_tmppath}/tmp-filelist
84%defattr(-,root,root,-)
Scott Baker140f15a2014-05-15 15:14:23 -070085%config /opt/planetstack/plstackapi_config
Scott Baker8ccabb92014-06-25 23:07:54 -070086%config /opt/planetstack/deployment_auth.py
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050087
88%post
Scott Bakere7df4a12014-05-15 14:21:31 -070089if [ "$1" == 1 ] ; then
90 echo "NEW INSTALL - initializing database"
91 /opt/planetstack/scripts/opencloud initdb
92else
93 echo "UPGRADE - doing evolution"
94 /opt/planetstack/scripts/opencloud evolvedb
95fi
96# start the server
97/opt/planetstack/scripts/opencloud runserver
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050098
99%preun
Scott Baker4cd29252014-04-08 23:47:11 -0700100if [ "$1" = 0 ] ; then
Scott Bakere7df4a12014-05-15 14:21:31 -0700101 echo "UNINSTALL - destroying planetstack"
Scott Baker4cd29252014-04-08 23:47:11 -0700102 rm -rf /opt/planetstack
103fi
Siobhan Tully44fd4cc2014-02-23 00:07:12 -0500104
105%changelog
106* Sat Feb 22 2014 Siobhan Tully 1.0.0
107- First Build
108