From 8655f934aabe1ba64668cb9dfff6e3e65e79083a Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 25 Dec 2013 20:38:04 +0100 Subject: Initial RPM packaging Signed-off-by: David Sommerseth --- .gitignore | 4 ++++ rpm/SPECS/logactio.spec | 47 +++++++++++++++++++++++++++++++++++++++++++++++ rpm/mk-rpm.sh | 19 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 rpm/SPECS/logactio.spec create mode 100755 rpm/mk-rpm.sh diff --git a/.gitignore b/.gitignore index dcec9fe..d84d554 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ logactio.cfg build/ dist/ MANIFEST +rpm/SOURCES +rpm/BUILD +rpm/RPMS +rpm/SRPMS diff --git a/rpm/SPECS/logactio.spec b/rpm/SPECS/logactio.spec new file mode 100644 index 0000000..68829c9 --- /dev/null +++ b/rpm/SPECS/logactio.spec @@ -0,0 +1,47 @@ +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%{!?python_ver: %define python_ver %(%{__python} -c "import sys ; print sys.version[:3]")} + +Summary: A simple log tracker which acts on certain events +Name: logactio +Version: 0.01 +Release: 1 +License: GPLv2 +Group: System Environment/Daemons +URL: http://fedorapeople.org/cgit/dsommers/public_git/logactio.git/ +Source0: %{name}-%{version}.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildArch: noarch + +%description +LogActio is a modular log tracker, which observes changes and acts +through different modules based on the event. It is purely written +in Python and can easily be extended with specific actions. + +%prep +%setup -q + +%build +%{__python} setup.py build + +%install +rm -rf $RPM_BUILD_ROOT +%{__python} setup.py install --root=$RPM_BUILD_ROOT + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc COPYING +%{_bindir}/logactio +%{python_sitelib}/LogActio + +%if "%{python_ver}" >= "2.5" +%{python_sitelib}/*.egg-info +%endif + +%changelog +* Wed Dec 25 2013 David Sommerseth - 0.01-1 +- Initial RPM packaging + diff --git a/rpm/mk-rpm.sh b/rpm/mk-rpm.sh new file mode 100755 index 0000000..d769309 --- /dev/null +++ b/rpm/mk-rpm.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +{ + pushd $(git rev-parse --show-toplevel) + + # Check if setup.py version matches rpm/SPECS/logactio.spec + PYVER=$(awk -F\" '/version =/ { print $2 }' setup.py) + SPECVER=$(awk -F\ '/^Version:/{ print $2}' rpm/SPECS/logactio.spec) + if [ "$PYVER" != "$SPECVER" ]; then + echo "*** ERROR *** Version mismatch between setup.py (v$PYVER) and logactio.spec (v$SPECVER)" + exit 1 + fi + + python2 setup.py sdist --formats=bztar + cp dist/logactio-*.tar.bz2 rpm/SOURCES + rpmbuild -ba --define "_topdir $(pwd)/rpm" rpm/SPECS/logactio.spec + + popd +} -- cgit