Merge remote branch 'origin/demonstration'
[deska.git] / deska.spec
blob39e261e195b9be020e6f451754fae3329c43d5be
1 %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
2 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
3 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
4 %endif
6 %define with_doc %{?_with_doc: 1} %{?!_with_doc: 0}
8 # Yeah, a braindead file URL
9 %global redminefile FIXME
11 Name: deska
12 Version: 1.0
13 Release: 1%{?dist}
14 Group: Applications/System
15 Summary: Tool for Central Administration of a Grid Site
16 License: GPLv2+
17 URL: http://deska.flaska.net/
18 Source0: https://projects.flaska.net/attachments/download/%{redminefile}/%{name}-%{version}.tar.bz2
19 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
21 ### Patches ###
23 ### Dependencies ###
25 ### Build Dependencies ###
27 BuildRequires: cmake >= 2.6
28 BuildRequires: boost-devel >= 1.41.0
29 BuildRequires: cpp
30 BuildRequires: readline-devel
31 BuildRequires: python-devel
32 %if %{with_doc}
33 BuildRequires: texlive-a4wide
34 BuildRequires: texlive-etoolbox
35 BuildRequires: texlive-minted
36 BuildRequires: texlive-todonotes
37 BuildRequires: texlive-iopart-num
38 %endif
40 %description
41 Empty, as this package shall not be generated at all -- we use subpackages.
43 %package libs
44 Summary: The Deska shared libraries
45 Group: Applications/System
46 License: GPLv2+
47 Requires: boost-system >= 1.41.0
48 Requires: boost-filesystem >= 1.41.0
49 Requires: boost-date-time >= 1.41.0
50 Requires: boost-python >= 1.41.0
52 %description libs
53 Shared libraries and scripts for the Deska system
55 %package python-libs
56 Summary: Library for accessing the Deska database from Python
57 Group: Applications/System
58 License: GPLv2+
59 Requires: deska-libs
61 %description python-libs
62 This package contains the deska Python library which provides native object
63 hierarchy for a high-level access to the Deska database.
65 %package client
66 Summary: The Deska CLI application
67 Group: Applications/System
68 License: GPLv2+
69 Requires: deska-libs
71 %description client
72 The command line client application for accessing the Deska database
74 %package devel
75 Summary: Development files for the Deska system
76 Group: Application/System
77 License: GPLv2+
78 Requires: deska-libs
79 Requires: deska-python-libs
81 %description devel
82 The include files required for compiling against the libDeskaDb library
84 %package server
85 Summary: The Deska server daemon
86 Group: Application/System
87 License: GPLv2+
88 Requires: deska-python-libs
89 Requires: deska-client
90 Requires: python3
91 Requires: postgresql90-server
92 Requires: python-psycopg2
94 %description server
95 The server daemon responsible for talking to the PostgreSQL database and the supporting utilities
97 %if %{with_doc}
98 %package doc
99 Summary: Documentation for the Deska system
100 Group: Application/System
101 License: GPLv2+
103 %description doc
104 User's guide and complete developer documentation for the Deska system
105 %endif
107 %prep
108 %setup -q
110 %if %{with_doc}
111 %global doc_opts -DBUILD_DOCS=1 -DSKIP_INSTALL_DOCS=1
112 %else
113 %global doc_opts -DBUILD_DOCS=0
114 %endif
116 %build
117 mkdir _build && cd _build
118 %cmake \
119 -DPYTHON_SITE_PACKAGES=%{python_sitelib} \
120 -DPYTHON_SITE_PACKAGES_ARCH=%{python_sitearch} \
121 -DRUN_SQL_TESTS=1 \
122 %{doc_opts} \
124 make -j20
125 %py_byte_compile %{__python} %{buildroot}/src/deska/python/deska
126 %py_byte_compile %{__python} %{buildroot}/src/deska/server/app/deska_server_utils
127 %py_byte_compile %{__python} %{buildroot}/src/deska/server/app/deska_server_utils/config_generators
128 %py_byte_compile %{__python} %{buildroot}/src/deska/server/db/gen_sql
129 %if %{with_doc}
130 mv doc/technical/deska.pdf ../deska.pdf
131 %endif
132 #make %{?_smp_mflags}
134 %check
135 cd _build
136 PATH=/usr/pgsql-9.0/bin:$PATH ../run-standalone-tests.sh
138 %install
139 cd _build
140 rm -rf $RPM_BUILD_ROOT
141 make install DESTDIR=$RPM_BUILD_ROOT
143 %clean
144 rm -rf $RPM_BUILD_ROOT
146 %files libs
147 %defattr(-,root,root,-)
148 %{_libdir}/libDeskaDb.so.1.0
149 %{_libdir}/libDeskaCli.so.1.0
151 %files python-libs
152 %defattr(-,root,root,-)
153 %{python_sitearch}/deska/libLowLevelPyDeska.so
154 %{python_sitelib}/deska/*.py*
156 %files client
157 %defattr(-,root,root,-)
158 %{_bindir}/deska-cli
160 %files devel
161 %defattr(-,root,root,-)
162 %{_includedir}/deska/db/*.h
163 %{_libdir}/libDeskaDb.so
164 %{_libdir}/libDeskaCli.so
166 %files server
167 %defattr(-,root,root,-)
168 %{_bindir}/deska-server
169 %{python_sitelib}/deska_server_utils/*.py*
170 %{python_sitelib}/deska_server_utils/config_generators/*.py*
171 %attr(755,root,root)%{python_sitelib}/deska_server_utils/config_generators/git-new-workdir
172 %attr(755,root,root)%{_datadir}/deska/install-scripts/install/*.sh
173 %attr(755,root,root)%{_datadir}/deska/install-scripts/tests/*.sh
174 %attr(755,root,root)%{_datadir}/deska/install-scripts/tests/sql/*.sh
175 %{_datadir}/deska/install-scripts/install/*.sql
176 %{_datadir}/deska/install-scripts/install/modules/demo/*.sql
177 %{_datadir}/deska/install-scripts/install/modules/fzu/*.sql
178 %attr(755,root,root)%{_datadir}/deska/install-scripts/src/deska/server/db/gen_sql/*.py*
179 %{_datadir}/deska/install-scripts/src/deska/server/db/*.py*
180 %{_datadir}/deska/install-scripts/src/deska/server/db/*.sql
182 %if %{with_doc}
183 %files doc
184 %defattr(-,root,root,-)
185 %doc deska.pdf
186 %endif
188 %post -p /sbin/ldconfig
190 %postun -p /sbin/ldconfig
192 %post client -p /sbin/ldconfig
194 %postun client -p /sbin/ldconfig
196 %changelog
197 * Thu Dec 29 2011 Jan Kundrát <kundratj@fzu.cz> - 1.0-1
198 - Initial release