1 |
# $Id: smeserver-mock.spec,v 1.1 2018/03/11 04:57:18 jpp Exp $ |
# $Id: smeserver-mock.spec,v 1.2 2018/03/11 05:08:17 jpp Exp $ |
2 |
|
|
3 |
Summary: smeserver-mock tools for building RPMs |
Summary: smeserver-mock tools for building RPMs |
4 |
%define name smeserver-mock |
%define name smeserver-mock |
5 |
Name: %{name} |
Name: %{name} |
6 |
%define version 1.0 |
%define version 1.0 |
7 |
%define release 1 |
%define release 2 |
8 |
Version: %{version} |
Version: %{version} |
9 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
10 |
License: GPL |
License: GPL |
21 |
Buildrequires: e-smith-devtools |
Buildrequires: e-smith-devtools |
22 |
# needed for scl |
# needed for scl |
23 |
Requires: scl-utils scl-utils-build centos-release-scl centos-release-scl-rh |
Requires: scl-utils scl-utils-build centos-release-scl centos-release-scl-rh |
24 |
|
Requires: python27-build |
25 |
AutoReqProv: no |
AutoReqProv: no |
26 |
|
|
27 |
%changelog |
%changelog |
28 |
|
* Sun Mar 11 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-2.sme |
29 |
|
- update of site-default.cfg via post script [SME: 10537] |
30 |
|
- removed e-smith-devtools of requirements |
31 |
|
- added Requires python27-build |
32 |
|
|
33 |
* Sat Mar 10 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-1.sme |
* Sat Mar 10 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-1.sme |
34 |
- Initial release with SME iServer mock config files [SME: 10537] |
- Initial release with SME iServer mock config files [SME: 10537] |
35 |
- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild |
- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild |
64 |
%pre |
%pre |
65 |
%preun |
%preun |
66 |
%post |
%post |
67 |
|
|
68 |
|
# updates sme site defaults |
69 |
|
main=/etc/mock/site-defaults.cfg |
70 |
|
tmp=/tmp/site-defaults.cfg |
71 |
|
gen=/etc/mock/sme-site-defaults.cfg |
72 |
|
|
73 |
|
# position of the tags |
74 |
|
BEGIN_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER BEGIN GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) |
75 |
|
END_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER END GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) |
76 |
|
#if tag is absent set first to 0 |
77 |
|
if [[ "$BEGIN_GEN" -eq "" ]]; then BEGIN_GEN=0; fi |
78 |
|
if [[ "$END_GEN" -eq "" ]]; then |
79 |
|
# if second tag is absent just concatenate |
80 |
|
cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen >$tmp; |
81 |
|
|
82 |
|
else |
83 |
|
# if both tags are present replace content |
84 |
|
cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen <(tail -n +$(expr $END_GEN + 1) $main) >$tmp; |
85 |
|
|
86 |
|
fi |
87 |
|
# mv tmp file to main file |
88 |
|
mv $tmp $main |
89 |
|
|
90 |
|
|
91 |
%postun |
%postun |
92 |
|
|
93 |
%files -f %{name}-%{version}-filelist |
%files -f %{name}-%{version}-filelist |