download and install GeoIP city database
[plstackapi.git] / opencloud.spec
1 Summary: OpenCloud core services
2 Name: opencloud
3 Version: 1.0.7
4 Release: 1
5 License: GPL+
6 Group: Development/Tools
7 Source0: %{_tmppath}/%{name}-%{version}.tar.gz
8 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
9 requires: postgresql
10 requires: postgresql-server
11 requires: python-psycopg2
12 requires: graphviz
13 requires: graphviz-devel
14 requires: graphviz-python
15 requires: libxslt-devel
16 requires: python-pip
17 requires: tar
18 requires: gcc
19 requires: python-httplib2
20 requires: GeoIP
21
22 %description
23 %{summary}
24
25 %prep
26 %setup -q
27
28 %build
29 # Empty section.
30
31 %pre
32 pip-python install django==1.5
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
50 easy_install django_evolution
51 easy_install python_gflags
52 easy_install google_api_python_client
53
54 wget -P /usr/lib/python2.7/site-packages/suit/static/suit/js http://code.jquery.com/jquery-1.9.1.min.js
55
56 rm -f /usr/share/GeoIP/GeoLiteCity*
57 wget -P /usr/share/GeoIP http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
58 gzip -d /usr/share/GeoIP/GeoLiteCity*.gz
59
60 %install
61 rm -rf %{buildroot}
62 mkdir -p  %{buildroot}
63 install -d %{buildroot}/opt/planetstack
64
65 # in builddir
66 cp -rp /opt/plstackapi/planetstack %{buildroot}/opt/.
67
68 find %{buildroot}/opt/planetstack -type f -print | sed "s@^$RPM_BUILD_ROOT@@g"  > %{_tmppath}/tmp-filelist
69
70 %clean
71 rm -rf %{buildroot}
72
73 %files -f %{_tmppath}/tmp-filelist
74 %defattr(-,root,root,-)
75
76 %post
77 /opt/planetstack/scripts/opencloud initdb
78
79 %preun
80 if [ "$1" = 0 ] ; then
81     echo "doing preuninstall"
82     rm -rf /opt/planetstack
83 fi
84
85 %changelog
86 * Sat Feb 22 2014  Siobhan Tully  1.0.0
87 - First Build
88