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