From 3c1201518190a7e93da4dcbb12559156ef516559 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 26 Jun 2018 16:19:31 +0200 Subject: [PATCH] build rpm package during ci * .gitignore: don't commit spot.spec * Makefile.am: write version number to spot.spec.in * .gitlab-ci.yml: new job builds the tarball and rpm package * spot.spec.in: spot.spec is used by rpmbuild to build the package --- .gitignore | 1 + .gitlab-ci.yml | 22 ++++++ Makefile.am | 6 +- spot.spec.in | 187 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 215 insertions(+), 1 deletion(-) create mode 100755 spot.spec.in diff --git a/.gitignore b/.gitignore index 92e041696..7392a79db 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,4 @@ GTAGS *.changes *.dsc *.gcov +spot.spec diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 521baaff3..d8ec8eec2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -200,6 +200,28 @@ debpkg-unstable: paths: - _build_unstable/ +rpm-pkg: + stage: build + only: + - /-rpm$/ + - master + - next + - stable + image: registry.lrde.epita.fr/spot-rpm + script: + - autoreconf -vfi + - ./configure + - make + - make dist + - cp spot-*.tar.gz ~/rpmbuild/SOURCES/ + - cp spot.spec ~/rpmbuild/SPECS/ + - rpmbuild -bb ~/rpmbuild/SPECS/spot.spec + - mv ~/rpmbuild/RPMS/x86_64/*.rpm . + artifacts: + when: always + paths: + - ./*.rpm + publish-stable: only: - stable diff --git a/Makefile.am b/Makefile.am index 2b3ff8001..186472e94 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,7 +68,8 @@ debian/changelog: configure.ac EXTRA_DIST = HACKING ChangeLog.1 tools/gitlog-to-changelog \ tools/help2man tools/man2html.pl \ tools/test-driver-teamcity $(UTF8) $(DEBIAN) \ - m4/gnulib-cache.m4 .dir-locals.el + m4/gnulib-cache.m4 .dir-locals.el \ + spot.spec spot.spec.in dist-hook: gen-ChangeLog @@ -111,3 +112,6 @@ deb: dist tar Jcvf spot_$(VERSION)$(GITPATCH).orig.tar.xz \ spot-$(VERSION)$(GITPATCH) cd spot-$(VERSION)$(GITPATCH) && debuild $(DEBUILDFLAGS) -us -uc + +spot.spec: configure.ac spot.spec.in + sed 's/[@]VERSION[@]/$(VERSION)/;s/[@]GITPATCH[@]/@@@$(GITPATCH)/;s/@@@\.//' spot.spec.in > $@.tmp && mv $@.tmp $@ diff --git a/spot.spec.in b/spot.spec.in new file mode 100755 index 000000000..e59339c16 --- /dev/null +++ b/spot.spec.in @@ -0,0 +1,187 @@ +Name: spot +Version: @VERSION@ +Release: @GITPATCH@%{?dist} +Summary: Model checking and omega-automata manipulation library + +License: GPLv3 +URL: https://spot.lrde.epita.fr + +Source0: http://www.lrde.epita.fr/dload/spot/%{name}-%{version}.tar.gz + +BuildRequires: make +BuildRequires: automake +BuildRequires: autoconf +BuildRequires: gcc-c++ +BuildRequires: swig +BuildRequires: python3-devel +BuildRequires: python3-ipykernel +BuildRequires: python3-nbformat +BuildRequires: graphviz +BuildRequires: chrpath + +#-- main spot rpm ------------------------------------------------------------- +Requires: libspot = %{version}-%{release} + +%description +Tools to manipulate omega-automata as well as linear-time temporal +logic (LTL & PSL). + +%files +%{_bindir}/autcross +%{_bindir}/autfilt +%{_bindir}/dstar2tgba +%{_bindir}/genaut +%{_bindir}/genltl +%{_bindir}/ltl2tgba +%{_bindir}/ltl2tgta +%{_bindir}/ltlcross +%{_bindir}/ltldo +%{_bindir}/ltlfilt +%{_bindir}/ltlgrind +%{_bindir}/ltlsynt +%{_bindir}/randaut +%{_bindir}/randltl +%{_mandir}/man1/autcross.1* +%{_mandir}/man1/autfilt.1* +%{_mandir}/man1/dstar2tgba.1* +%{_mandir}/man1/genaut.1* +%{_mandir}/man1/genltl.1* +%{_mandir}/man1/ltl2tgba.1* +%{_mandir}/man1/ltl2tgta.1* +%{_mandir}/man1/ltlcross.1* +%{_mandir}/man1/ltldo.1* +%{_mandir}/man1/ltlfilt.1* +%{_mandir}/man1/ltlgrind.1* +%{_mandir}/man1/ltlsynt.1* +%{_mandir}/man1/randaut.1* +%{_mandir}/man1/randltl.1* +%{_mandir}/man7/spot-x.7* +%{_mandir}/man7/spot.7* +%license COPYING +%doc AUTHORS COPYING NEWS README THANKS + +#-- the spot library ---------------------------------------------------------- +%package -n libspot +Summary: Model checking and omega-automata manipulation library +Provides: libspot = %{version}-%{release} + +%description -n libspot +Library to manipulate omega-automata as well as linear-time temporal +logic (LTL & PSL). + +%files -n libspot +%{_libdir}/libbddx.a +%{_libdir}/libbddx.la +%{_libdir}/libbddx.so* +%{_libdir}/libspot.a +%{_libdir}/libspot.la +%{_libdir}/libspot.so* +%{_libdir}/libspotgen.a +%{_libdir}/libspotgen.la +%{_libdir}/libspotgen.so* +%{_libdir}/libspotltsmin.a +%{_libdir}/libspotltsmin.la +%{_libdir}/libspotltsmin.so* +%license COPYING +%doc AUTHORS COPYING NEWS README THANKS + +#-- development headers for libspot ------------------------------------------- +%package devel +Summary: Headers for the Spot model checking library +Requires: libspot = %{version}-%{release} + +%description devel +C++ headers for the Spot library. + +%files devel +%{_libdir}/pkgconfig/libbddx.pc +%{_libdir}/pkgconfig/libspot.pc +%{_libdir}/pkgconfig/libspotgen.pc +%{_libdir}/pkgconfig/libspotltsmin.pc +%{_includedir}/bddx.h +%{_includedir}/bvecx.h +%{_includedir}/fddx.h +%dir %{_includedir}/spot +%{_includedir}/spot/* +%license COPYING +%doc AUTHORS COPYING NEWS README THANKS + +#-- python bindings ----------------------------------------------------------- +%package -n python3-spot +Summary: Python 3 binding for Spot +Requires: libspot = %{version}-%{release} + +%description -n python3-spot +Spot allows manipulation of omega-automata as well as linear-time +temporal logic (LTL & PSL). + +%files -n python3-spot +%{python3_sitearch}/__pycache__/buddy.cpython-36.opt-1.pyc +%{python3_sitearch}/__pycache__/buddy.cpython-36.pyc +%{python3_sitearch}/buddy.py +%dir %{python3_sitearch}/spot +%{python3_sitearch}/spot/* +%{python3_sitearch}/_buddy.a +%{python3_sitearch}/_buddy.la +%{python3_sitearch}/_buddy.so +%license COPYING +%doc AUTHORS COPYING NEWS README THANKS + +#-- separate documentation package -------------------------------------------- +%package doc +Summary: Documentation for Spot + +%description doc +HTML and PDF documentation for Spot. + +%files doc +%doc doc/userdoc +%doc /usr/share/doc/spot/tl.pdf +%license COPYING +%doc AUTHORS COPYING NEWS README THANKS + + +#-- build --------------------------------------------------------------------- +%prep +%autosetup + + +%build +%configure +%make_build + + +%install +%make_install + +# remove rpaths +chrpath --delete $RPM_BUILD_ROOT%{python3_sitearch}/spot/_ltsmin.so +chrpath --delete $RPM_BUILD_ROOT%{python3_sitearch}/spot/_gen.so +chrpath --delete $RPM_BUILD_ROOT%{python3_sitearch}/spot/_impl.so +chrpath --delete $RPM_BUILD_ROOT%{python3_sitearch}/_buddy.so +chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libspotgen.so.0.0.0 +chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libspotltsmin.so.0.0.0 +chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libspot.so.0.0.0 +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/autcross +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/autfilt +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/dstar2tgba +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/genaut +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/genltl +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/ltl2tgba +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/ltl2tgta +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/ltlcross +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/ltldo +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/ltlfilt +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/ltlgrind +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/ltlsynt +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/randaut +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/randltl + + +%check +make check + + +%changelog +* Tue Jun 19 2018 Antoine Martin +- Initial packaging