1 |
# $Id: smeserver-mock.spec,v 1.4 2018/03/18 03:35:10 jpp Exp $ |
2 |
|
3 |
Summary: smeserver-mock tools for building RPMs |
4 |
%define name smeserver-mock |
5 |
Name: %{name} |
6 |
%define version 1.0 |
7 |
%define release 4 |
8 |
Version: %{version} |
9 |
Release: %{release}%{?dist} |
10 |
License: GPL |
11 |
Group: Networking/Daemons |
12 |
Source: %{name}-%{version}.tgz |
13 |
Patch0: smeserver-mock-1.0-updates_values.patch |
14 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
15 |
BuildArchitectures: noarch |
16 |
Requires: e-smith-devtools |
17 |
Requires: mock |
18 |
Requires: python-ctypes |
19 |
Requires: glances |
20 |
Requires: make rpm-build rpm-sign wget |
21 |
Requires: cmake automake libtool |
22 |
Buildrequires: e-smith-devtools |
23 |
# needed for scl |
24 |
Requires: scl-utils scl-utils-build centos-release-scl centos-release-scl-rh |
25 |
Requires: python27-build |
26 |
AutoReqProv: no |
27 |
|
28 |
%changelog |
29 |
* Sun Mar 18 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-4.sme |
30 |
- update include package values according to buildsys |
31 |
|
32 |
* Sat Mar 17 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-3.sme |
33 |
- set %config on mock config files |
34 |
- a rpmsave of the previous version will be created if modified. |
35 |
- fix typo in filename |
36 |
|
37 |
* Sun Mar 11 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-2.sme |
38 |
- update of site-default.cfg via post script [SME: 10537] |
39 |
- removed e-smith-devtools of requirements |
40 |
- added Requires python27-build |
41 |
|
42 |
* Sat Mar 10 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-1.sme |
43 |
- Initial release with SME iServer mock config files [SME: 10537] |
44 |
- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild |
45 |
|
46 |
%description |
47 |
Tools for use in building RPMs for the Koozali SME server and gateway. |
48 |
|
49 |
Few tools are also provided to help you with package building. |
50 |
|
51 |
%prep |
52 |
%setup |
53 |
%patch0 -p1 |
54 |
|
55 |
%build |
56 |
|
57 |
%install |
58 |
rm -rf $RPM_BUILD_ROOT |
59 |
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) |
60 |
/bin/rm -f %{name}-%{version}-filelist |
61 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
62 |
--file /usr/bin/BogusDateBot.sh '%attr(0755,root,root)' \ |
63 |
--file /usr/bin/change-log '%attr(0755,root,root)' \ |
64 |
--file /usr/bin/clog '%attr(0755,root,root)' \ |
65 |
--file /usr/bin/createBuildDir '%attr(0755,root,root)' \ |
66 |
--file /usr/bin/prepa '%attr(0755,root,root)' \ |
67 |
--file /usr/bin/tagbuild '%attr(0755,root,root)' \ |
68 |
| grep -v /etc/mock/ \ |
69 |
> %{name}-%{version}-filelist |
70 |
|
71 |
%clean |
72 |
rm -rf $RPM_BUILD_ROOT |
73 |
|
74 |
%pre |
75 |
%preun |
76 |
%post |
77 |
|
78 |
# updates sme site defaults |
79 |
main=/etc/mock/site-defaults.cfg |
80 |
tmp=/tmp/site-defaults.cfg |
81 |
gen=/etc/mock/sme-site-defaults.cfg |
82 |
|
83 |
# position of the tags |
84 |
BEGIN_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER BEGIN GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) |
85 |
END_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER END GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) |
86 |
#if tag is absent set first to 0 |
87 |
if [[ "$BEGIN_GEN" -eq "" ]]; then BEGIN_GEN=0; fi |
88 |
if [[ "$END_GEN" -eq "" ]]; then |
89 |
# if second tag is absent just concatenate |
90 |
cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen >$tmp; |
91 |
|
92 |
else |
93 |
# if both tags are present replace content |
94 |
cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen <(tail -n +$(expr $END_GEN + 1) $main) >$tmp; |
95 |
|
96 |
fi |
97 |
# mv tmp file to main file |
98 |
mv $tmp $main |
99 |
|
100 |
|
101 |
%postun |
102 |
|
103 |
%files -f %{name}-%{version}-filelist |
104 |
%defattr(-,root,root,-) |
105 |
/etc/mock/* %config %attr(0755,root,mock) |