1 ## |
1 ## |
2 ## bacula.spec -- OpenPKG RPM Package Specification |
2 ## bacula.spec -- OpenPKG RPM Package Specification |
3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> |
3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/> |
4 ## |
4 ## |
5 ## Permission to use, copy, modify, and distribute this software for |
5 ## Permission to use, copy, modify, and distribute this software for |
6 ## any purpose with or without fee is hereby granted, provided that |
6 ## any purpose with or without fee is hereby granted, provided that |
7 ## the above copyright notice and this permission notice appear in all |
7 ## the above copyright notice and this permission notice appear in all |
8 ## copies. |
8 ## copies. |
38 Packager: OpenPKG Foundation e.V. |
38 Packager: OpenPKG Foundation e.V. |
39 Distribution: OpenPKG Community |
39 Distribution: OpenPKG Community |
40 Class: PLUS |
40 Class: PLUS |
41 Group: System |
41 Group: System |
42 License: GPL |
42 License: GPL |
43 Version: 3.0.3 |
43 Version: 5.0.3 |
44 Release: 20091028 |
44 Release: 20120208 |
45 |
45 |
46 # package options |
46 # package options |
47 %option with_server yes |
47 %option with_server yes |
48 %option with_ssl yes |
48 %option with_ssl yes |
49 %option with_wrap no |
49 %option with_wrap no |
50 %option with_dvd no |
50 %option with_dvd no |
51 %option with_mtx no |
51 %option with_mtx no |
52 %option with_python no |
52 %option with_python no |
53 %option with_dbback sqlite |
53 %option with_db_sqlite no |
|
54 %option with_db_pgsql no |
|
55 %option with_db_mysql no |
|
56 |
|
57 # package option sanity check |
|
58 %if "%{with_db_sqlite}" == "no" && "%{with_db_mysql}" == "no" && "%{with_db_pgsql}" == "no" |
|
59 %undefine with_db_sqlite |
|
60 %define with_db_sqlite yes |
|
61 %endif |
54 |
62 |
55 # list of sources |
63 # list of sources |
56 Source0: http://switch.dl.sourceforge.net/bacula/bacula-%{version}.tar.gz |
64 Source0: http://switch.dl.sourceforge.net/bacula/bacula-%{version}.tar.gz |
57 Source1: rc.bacula |
65 Source1: rc.bacula |
58 Source2: bexec.sh |
66 Source2: bexec.sh |
61 # build information |
69 # build information |
62 Prefix: %{l_prefix} |
70 Prefix: %{l_prefix} |
63 BuildRoot: %{l_buildroot} |
71 BuildRoot: %{l_buildroot} |
64 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes |
72 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes |
65 PreReq: OpenPKG, openpkg >= 20060823 |
73 PreReq: OpenPKG, openpkg >= 20060823 |
66 BuildPreReq: ncurses, readline, zlib, gawk |
74 BuildPreReq: ncurses, readline, zlib |
67 PreReq: ncurses, readline, zlib, gawk |
75 PreReq: ncurses, readline, zlib |
68 %if "%{with_ssl}" == "yes" |
76 %if "%{with_ssl}" == "yes" |
69 BuildPreReq: openssl >= 0.9.8, openssl::with_threads = yes |
77 BuildPreReq: openssl >= 0.9.8, openssl::with_threads = yes |
70 PreReq: openssl >= 0.9.8, openssl::with_threads = yes |
78 PreReq: openssl >= 0.9.8, openssl::with_threads = yes |
71 %endif |
79 %endif |
72 %if "%{with_wrap}" == "yes" |
80 %if "%{with_wrap}" == "yes" |
73 BuildPreReq: tcpwrappers |
81 BuildPreReq: tcpwrappers |
74 PreReq: tcpwrappers |
82 PreReq: tcpwrappers |
75 %endif |
83 %endif |
76 %if "%{with_dbback}" == "sqlite" |
84 %if "%{with_db_sqlite}" == "yes" |
77 BuildPreReq: sqlite |
85 BuildPreReq: sqlite |
78 PreReq: sqlite |
86 PreReq: sqlite |
79 %endif |
87 %endif |
80 %if "%{with_dbback}" == "mysql" |
88 %if "%{with_db_mysql}" == "yes" |
81 BuildPreReq: mysql |
89 BuildPreReq: mysql |
82 PreReq: mysql |
90 PreReq: mysql |
83 %endif |
91 %endif |
84 %if "%{with_dbback}" == "postgresql" |
92 %if "%{with_db_pgsql}" == "yes" |
85 BuildPreReq: postgresql |
93 BuildPreReq: postgresql |
86 PreReq: postgresql |
94 PreReq: postgresql |
87 %endif |
95 %endif |
88 %if "%{with_dvd}" == "yes" |
96 %if "%{with_dvd}" == "yes" |
89 BuildPreReq: dvdrw-tools |
97 BuildPreReq: dvdrw-tools |
143 configure |
151 configure |
144 |
152 |
145 # configure |
153 # configure |
146 LIBS= |
154 LIBS= |
147 case "%{l_platform -t}" in |
155 case "%{l_platform -t}" in |
148 *-linux*) LIBS="-L/usr/lib/termcap";; |
156 *-linux*) ldfl="-L/usr/lib/termcap" ;; |
|
157 *-sunos*) ldfl="-ldl" ;; |
149 esac |
158 esac |
150 CC="%{l_cc}" \ |
159 CC="%{l_cc}" \ |
151 CFLAGS="%{l_cflags -O}" \ |
160 CFLAGS="%{l_cflags -O}" \ |
152 CPPFLAGS="%{l_cppflags ncurses}" \ |
161 CPPFLAGS="%{l_cppflags ncurses}" \ |
153 LDFLAGS="%{l_ldflags} $LIBS" \ |
162 LDFLAGS="%{l_ldflags} $ldfl" \ |
154 LIBS="$libs" \ |
163 LIBS="$libs -lz" \ |
155 GREP="grep" \ |
164 GREP="grep" \ |
156 ./configure \ |
165 ./configure \ |
157 --prefix=%{l_prefix} \ |
166 --prefix=%{l_prefix} \ |
158 --with-dir-user=%{l_rusr} \ |
167 --with-dir-user=%{l_rusr} \ |
159 --with-dir-group=%{l_rgrp} \ |
168 --with-dir-group=%{l_rgrp} \ |
177 --with-openssl=%{l_prefix} \ |
186 --with-openssl=%{l_prefix} \ |
178 %endif |
187 %endif |
179 %if "%{with_wrap}" == "yes" |
188 %if "%{with_wrap}" == "yes" |
180 --with-tcp-wrappers=yes \ |
189 --with-tcp-wrappers=yes \ |
181 %endif |
190 %endif |
182 %if "%{with_dbback}" == "sqlite" |
191 %if "%{with_db_sqlite}" == "yes" |
183 --with-sqlite3=%{l_prefix} \ |
192 --with-sqlite3=%{l_prefix} \ |
184 %endif |
193 %endif |
185 %if "%{with_dbback}" == "mysql" |
194 %if "%{with_db_mysql}" == "yes" |
186 --with-mysql=%{l_prefix} \ |
195 --with-mysql=%{l_prefix} \ |
187 %endif |
196 %endif |
188 %if "%{with_dbback}" == "postgresql" |
197 %if "%{with_db_pgsql}" == "yes" |
189 --with-postgresql=%{l_prefix} \ |
198 --with-postgresql=%{l_prefix} \ |
190 %endif |
199 %endif |
191 %if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" |
200 %if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" |
192 --with-python=%{l_prefix} \ |
201 --with-python=%{l_prefix} \ |
193 %endif |
202 %endif |
207 |
216 |
208 # build |
217 # build |
209 %{l_make} %{l_mflags -O} |
218 %{l_make} %{l_mflags -O} |
210 |
219 |
211 %install |
220 %install |
|
221 # clean up build cruft |
212 rm -rf $RPM_BUILD_ROOT |
222 rm -rf $RPM_BUILD_ROOT |
213 |
223 |
214 # create installation hierarchy |
224 # create installation hierarchy |
215 %{l_shtool} mkdir -f -p -m 755 \ |
225 %{l_shtool} mkdir -f -p -m 755 \ |
216 $RPM_BUILD_ROOT%{l_prefix}/bin \ |
226 $RPM_BUILD_ROOT%{l_prefix}/bin \ |