smeserver-mock/smeserver-mock.spec

184 lines
6.6 KiB
RPMSpec
Raw Permalink Normal View History

# $Id: smeserver-mock.spec,v 1.27 2023/07/16 13:34:25 terryfage Exp $
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
Summary: smeserver-mock tools for building RPMs
%define name smeserver-mock
Name: %{name}
%define version 1.0
%define release 23
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.xz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArchitectures: noarch
Requires: e-smith-devtools
Requires: mock
Requires: glances
Requires: make rpm-build rpm-sign wget
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
* Thu Oct 26 2023 cvs2git.sh aka Brian Read <brianr@koozali.org> 1.0-23.sme
- Roll up patches and move to git repo [SME: 12338]
* Thu Oct 26 2023 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Sun Jul 16 2023 TerryFage <terry.fage@gmail.com> 1.0-22.sme
- add to mock*.cfg facilitate build with external packages [SME: 12381]
* Mon Jun 05 2023 TerryFage <terry.fage@gmail.com> 1.0-21.sme
- add to mock*.cfg facilitate build with external packages [SME: 12350]
- attribute solutions Trevor Batley, Terry Fage
* Thu May 04 2023 TerryFage <terry.fage@gmail.com> 1.0-20.sme
- add to mock*.cfg facilitate build with external packages [SME: 12350]
- attribute solutions Trevor Batley, Terry Fage
* Sun Apr 30 2023 TerryFage <terry.fage@gmail.com> 1.0-19.sme
- add package to mock*.cfg facilitate cvm build [SME: 12350]
- attribute solution to Trevor batley
* Thu Apr 13 2023 Jean-Philippe Pialasse <tests@pialasse.com> 1.0-18.sme
- fixpost scriptled not working [SME: 12349]
- add smeos and smeupdates in mock file
* Wed Apr 12 2023 Jean-Philippe Pialasse <tests@pialasse.com> 1.0-17.sme
- fix change-log [SME: 12340]
- update smeserver 10 base mockfile
- perl.prov workaround in mock file
* Fri Nov 18 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.0-16.sme
- fix change-log not handling tab for version or release
* Thu Jun 30 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.0-15.sme
- update sme10 mock files [SME: 12089]
- remove python scl dependencies blocks a lot from using the rpm
almost never needed [SME: 12090]
- cleaning remove sme8 and sme9 mock files
- added workaround to perl.prov not working [SME: 11958]
added mock plugin copy.py and an updated perl.prov
- update embded bins
* Mon Dec 27 2021 Michel Begue <mab974@misouk.com> 1.0-13.sme
- fix build deps for Mojo::JWT [SME: 11005]
* Thu Nov 26 2020 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-12.sme
- fix build deps for spamassassin [SME: 11203]
* Fri Sep 04 2020 Michel Begue <mab974@gmail.com> 1.0-11.sme
- update dependencies to build Mojo::JWT package [SME: 11005]
* Tue Aug 18 2020 Michel Begue <mab974@gmail.com> 1.0-10.sme
- update dependencies to build kmod packages [SME: 10993]
* Thu May 14 2020 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-9.sme
- fix nspawn and package_manager set to yum [SME: 10946]
- updating list of included packages for SME10 and SME9 repo
- updating the attached bins to help building [SME: 10924]
* Mon Sep 30 2019 Michel Begue <mab974@gmail.com> 1.0-8.sme
- added include pkg ocaml, camlp5 [SME: 10809]
* Tue Nov 13 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-7.sme
- fix non needed Requires python-ctypes [SME: 10647]
* Wed Jun 20 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-6.sme
- added include pkg for video tools [SME: 1600]
- applied patch for previous bug fix [SME: 10599]
* Tue Jun 19 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-5.sme
- update dependencies to build spamassassin [SME: 10599]
* Sun Mar 18 2018 Jean-Philipe Pialasse <tests@pialasse.com> 1.0-4.sme
- update include package values according to buildsys
* Sat Mar 17 2018 Jean-Philipe Pialasse <tests@pialasse.com> 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 <tests@pialasse.com> 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 <tests@pialasse.com> 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.
Few tools are also provided to help you with package building.
%prep
%setup
%build
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
/bin/rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--file /usr/bin/BogusDateBot.sh '%attr(0755,root,root)' \
--file /usr/bin/change-log '%attr(0755,root,root)' \
--file /usr/bin/clog '%attr(0755,root,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/perl.prov '%attr(0755,root,root)' \
--ignoredir /usr/lib/python3.6/site-packages/mockbuild/plugins \
--ignoredir /usr/lib/python3.6/site-packages/mockbuild \
--ignoredir /usr/lib/python3.6/site-packages \
--ignoredir /usr/lib/python3.6 \
--ignoredir /etc/mock \
| grep -v copy.pyc \
| grep -v copy.pyo \
> %{name}-%{version}-filelist
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%preun
%post -p /bin/bash
# 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
%defattr(-,root,root,-)
/etc/mock/* %config %attr(0755,root,mock)