1 |
# $Id: smeserver-devtools.spec,v 1.7 2017/05/25 15:48:49 unnilennium Exp $ |
# $Id: smeserver-mock.spec,v 1.3 2018/03/12 02:05:04 jpp Exp $ |
2 |
|
|
3 |
Summary: smeserver-mock tools for building RPMs |
Summary: smeserver-mock tools for building RPMs |
4 |
%define name e-smith-devtools |
%define name smeserver-mock |
5 |
Name: %{name} |
Name: %{name} |
6 |
%define version 1.0 |
%define version 1.0 |
7 |
%define release 1 |
%define release 3 |
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 |
|
* 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 |
|
* 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 |
* 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 |
39 |
- Initial release with SME Server mock config files |
- Initial release with SME iServer mock config files [SME: 10537] |
40 |
- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild |
- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild |
41 |
|
|
|
|
|
|
|
|
42 |
%description |
%description |
43 |
Tools for use in building RPMs for the Koozali SME server and gateway. |
Tools for use in building RPMs for the Koozali SME server and gateway. |
44 |
|
|
60 |
--file /usr/bin/createBuildDir '%attr(0755,root,root)' \ |
--file /usr/bin/createBuildDir '%attr(0755,root,root)' \ |
61 |
--file /usr/bin/prepa '%attr(0755,root,root)' \ |
--file /usr/bin/prepa '%attr(0755,root,root)' \ |
62 |
--file /usr/bin/tagbuild '%attr(0755,root,root)' \ |
--file /usr/bin/tagbuild '%attr(0755,root,root)' \ |
63 |
--file /etc/mock/* '%attr(0754,root,mock)' \ |
| grep -v /etc/mock/ \ |
64 |
> %{name}-%{version}-filelist |
> %{name}-%{version}-filelist |
65 |
|
|
66 |
%clean |
%clean |
69 |
%pre |
%pre |
70 |
%preun |
%preun |
71 |
%post |
%post |
72 |
|
|
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 |
%postun |
%postun |
97 |
|
|
98 |
%files-f %{name}-%{version}-filelist |
%files -f %{name}-%{version}-filelist |
99 |
%defattr(-,root,root,-) |
%defattr(-,root,root,-) |
100 |
|
/etc/mock/* %config %attr(0755,root,mock) |