--- rpms/smeserver-mock/sme10/smeserver-mock.spec 2018/03/11 04:57:18 1.1 +++ rpms/smeserver-mock/sme10/smeserver-mock.spec 2018/06/20 03:46:35 1.6 @@ -1,15 +1,16 @@ -# $Id: smeserver-devtools.spec,v 1.7 2017/05/25 15:48:49 unnilennium Exp $ +# $Id: smeserver-mock.spec,v 1.5 2018/03/18 04:37:03 jpp Exp $ Summary: smeserver-mock tools for building RPMs -%define name e-smith-devtools +%define name smeserver-mock Name: %{name} %define version 1.0 -%define release 1 +%define release 5 Version: %{version} Release: %{release}%{?dist} License: GPL Group: Networking/Daemons Source: %{name}-%{version}.tgz +Patch0: smeserver-mock-1.0-updates_values.patch BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArchitectures: noarch Requires: e-smith-devtools @@ -21,15 +22,29 @@ Requires: cmake automake libtool Buildrequires: e-smith-devtools # needed for scl Requires: scl-utils scl-utils-build centos-release-scl centos-release-scl-rh - +Requires: python27-build AutoReqProv: no %changelog -* Sat Mar 10 2018 Jean-Philipe Pialasse 1.0-1.sme -- Initial release with SME Server mock config files -- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild +* Tue Jun 19 2018 Jean-Philipe Pialasse 1.0-5.sme +- update dependencies to build spamassassin [SME: 10599] +* Sun Mar 18 2018 Jean-Philipe Pialasse 1.0-4.sme +- update include package values according to buildsys +* Sat Mar 17 2018 Jean-Philipe Pialasse 1.0-3.sme +- set %config on mock config files +- a rpmsave of the previous version will be created if modified. +- fix typo in filename + +* Sun Mar 11 2018 Jean-Philipe Pialasse 1.0-2.sme +- update of site-default.cfg via post script [SME: 10537] +- removed e-smith-devtools of requirements +- added Requires python27-build + +* Sat Mar 10 2018 Jean-Philipe Pialasse 1.0-1.sme +- Initial release with SME iServer mock config files [SME: 10537] +- tools added : BogusDateBot.sh change-log clog createBuildDir prepa tagbuild %description Tools for use in building RPMs for the Koozali SME server and gateway. @@ -38,6 +53,7 @@ Few tools are also provided to help you %prep %setup +%patch0 -p1 %build @@ -52,7 +68,7 @@ rm -rf $RPM_BUILD_ROOT --file /usr/bin/createBuildDir '%attr(0755,root,root)' \ --file /usr/bin/prepa '%attr(0755,root,root)' \ --file /usr/bin/tagbuild '%attr(0755,root,root)' \ - --file /etc/mock/* '%attr(0754,root,mock)' \ + | grep -v /etc/mock/ \ > %{name}-%{version}-filelist %clean @@ -61,7 +77,32 @@ rm -rf $RPM_BUILD_ROOT %pre %preun %post + +# updates sme site defaults +main=/etc/mock/site-defaults.cfg +tmp=/tmp/site-defaults.cfg +gen=/etc/mock/sme-site-defaults.cfg + +# position of the tags +BEGIN_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER BEGIN GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) +END_GEN=$(cat $main | grep -n '### KOOZALI SME SERVER END GENERATED CONTENT' | sed 's/\(.*\):.*/\1/g' ) +#if tag is absent set first to 0 +if [[ "$BEGIN_GEN" -eq "" ]]; then BEGIN_GEN=0; fi +if [[ "$END_GEN" -eq "" ]]; then + # if second tag is absent just concatenate + cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen >$tmp; + +else + # if both tags are present replace content + cat <(head -n $(expr $BEGIN_GEN - 1) $main) $gen <(tail -n +$(expr $END_GEN + 1) $main) >$tmp; + +fi +# mv tmp file to main file +mv $tmp $main + + %postun -%files-f %{name}-%{version}-filelist +%files -f %{name}-%{version}-filelist %defattr(-,root,root,-) +/etc/mock/* %config %attr(0755,root,mock)