%global commit 12d1d6563fd2f20b07cf18bddf98383a637a74e0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: libgeneral Version: 0.0 Release: 55.git%{shortcommit}%{?dist} Summary: libgeneral is (in its core) a collection of macros, which aid in employing a certain coding style License: LGPLv2.1 URL: https://github.com/tihmstar/libgeneral Source0: https://github.com/tihmstar/libgeneral/archive/%{commit}.tar.gz BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: gcc-c++ %description libgeneral is (in its core) a collection of macros, which aid in employing a certain coding style used throughout my projects. %package devel Summary: Development package for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Files for development with %{name}. %prep %autosetup -n %{name}-%{commit} sed -i -e "s|^AC_INIT.*$|AC_INIT([libgeneral], [55], [tihmstar@gmail.com])|g" configure.ac sed -i -e "12,15d" configure.ac sed -i -e '12a AC_DEFINE([VERSION_COMMIT_COUNT], "55", [Git commit count])\nAC_DEFINE([VERSION_COMMIT_SHA], "%{shortcommit}", [Git commit sha])\nAC_SUBST([VERSION_COMMIT_COUNT], ["55"])\nAC_SUBST([VERSION_COMMIT_SHA], ["%{shortcommit}"])' configure.ac ./autogen.sh %build %configure --disable-static %make_build %install %make_install find %{buildroot} -name '*.la' -delete %files %license LICENSE %doc README.md %{_libdir}/%{name}.so.* %files devel %{_libdir}/pkgconfig/%{name}.pc %{_libdir}/%{name}.so %dir %{_includedir}/%{name} %{_includedir}/%{name}/* %changelog * Sat Jun 12 2021 Carlos Mogas da Silva - 0.1-55.git12d1d65 - Initial release