1 |
# $Id: smeserver-devtools.spec,v 1.7 2017/05/25 15:48:49 unnilennium Exp $ |
# $Id: smeserver-mock.spec,v 1.6 2018/06/20 03:46:35 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 5 |
8 |
Version: %{version} |
Version: %{version} |
9 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
10 |
License: GPL |
License: GPL |
11 |
Group: Networking/Daemons |
Group: Networking/Daemons |
12 |
Source: %{name}-%{version}.tgz |
Source: %{name}-%{version}.tgz |
13 |
|
Patch0: smeserver-mock-1.0-updates_values.patch |
14 |
|
Patch1: smeserver-mock-1.0-sme10599-spamassassin.patch |
15 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
16 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
17 |
Requires: e-smith-devtools |
Requires: e-smith-devtools |
23 |
Buildrequires: e-smith-devtools |
Buildrequires: e-smith-devtools |
24 |
# needed for scl |
# needed for scl |
25 |
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 |
26 |
|
Requires: python27-build |
27 |
AutoReqProv: no |
AutoReqProv: no |
28 |
|
|
29 |
%changelog |
%changelog |
30 |
* Sat Mar 10 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-1.sme |
* Tue Jun 19 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-5.sme |
31 |
- Initial release with SME Server mock config files |
- update dependencies to build spamassassin [SME: 10599] |
|
- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild |
|
32 |
|
|
33 |
|
* Sun Mar 18 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-4.sme |
34 |
|
- update include package values according to buildsys |
35 |
|
|
36 |
|
* Sat Mar 17 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-3.sme |
37 |
|
- set %config on mock config files |
38 |
|
- a rpmsave of the previous version will be created if modified. |
39 |
|
- fix typo in filename |
40 |
|
|
41 |
|
* Sun Mar 11 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-2.sme |
42 |
|
- update of site-default.cfg via post script [SME: 10537] |
43 |
|
- removed e-smith-devtools of requirements |
44 |
|
- added Requires python27-build |
45 |
|
|
46 |
|
* Sat Mar 10 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-1.sme |
47 |
|
- Initial release with SME iServer mock config files [SME: 10537] |
48 |
|
- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild |
49 |
|
|
50 |
%description |
%description |
51 |
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. |
54 |
|
|
55 |
%prep |
%prep |
56 |
%setup |
%setup |
57 |
|
%patch0 -p1 |
58 |
|
%patch1 -p1 |
59 |
|
|
60 |
%build |
%build |
61 |
|
|
70 |
--file /usr/bin/createBuildDir '%attr(0755,root,root)' \ |
--file /usr/bin/createBuildDir '%attr(0755,root,root)' \ |
71 |
--file /usr/bin/prepa '%attr(0755,root,root)' \ |
--file /usr/bin/prepa '%attr(0755,root,root)' \ |
72 |
--file /usr/bin/tagbuild '%attr(0755,root,root)' \ |
--file /usr/bin/tagbuild '%attr(0755,root,root)' \ |
73 |
--file /etc/mock/* '%attr(0754,root,mock)' \ |
| grep -v /etc/mock/ \ |
74 |
> %{name}-%{version}-filelist |
> %{name}-%{version}-filelist |
75 |
|
|
76 |
%clean |
%clean |
79 |
%pre |
%pre |
80 |
%preun |
%preun |
81 |
%post |
%post |
82 |
|
|
83 |
|
# updates sme site defaults |
84 |
|
main=/etc/mock/site-defaults.cfg |
85 |
|
tmp=/tmp/site-defaults.cfg |
86 |
|
gen=/etc/mock/sme-site-defaults.cfg |
87 |
|
|
88 |
|
# position of the tags |
89 |
|
BEGIN_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER BEGIN GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) |
90 |
|
END_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER END GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) |
91 |
|
#if tag is absent set first to 0 |
92 |
|
if [[ "$BEGIN_GEN" -eq "" ]]; then BEGIN_GEN=0; fi |
93 |
|
if [[ "$END_GEN" -eq "" ]]; then |
94 |
|
# if second tag is absent just concatenate |
95 |
|
cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen >$tmp; |
96 |
|
|
97 |
|
else |
98 |
|
# if both tags are present replace content |
99 |
|
cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen <(tail -n +$(expr $END_GEN + 1) $main) >$tmp; |
100 |
|
|
101 |
|
fi |
102 |
|
# mv tmp file to main file |
103 |
|
mv $tmp $main |
104 |
|
|
105 |
|
|
106 |
%postun |
%postun |
107 |
|
|
108 |
%files-f %{name}-%{version}-filelist |
%files -f %{name}-%{version}-filelist |
109 |
%defattr(-,root,root,-) |
%defattr(-,root,root,-) |
110 |
|
/etc/mock/* %config %attr(0755,root,mock) |