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
This commit is contained in:
Antoine Martin 2018-06-26 16:19:31 +02:00 committed by Antoine Martin
parent f5f5daec9a
commit 3c12015181
4 changed files with 215 additions and 1 deletions

1
.gitignore vendored
View file

@ -80,3 +80,4 @@ GTAGS
*.changes
*.dsc
*.gcov
spot.spec

View file

@ -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

View file

@ -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 $@

187
spot.spec.in Executable file
View file

@ -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 <amartin@lrde.epita.fr>
- Initial packaging