Skip to content

Commit

Permalink
Added RPM patches submitted by Robert Napier
Browse files Browse the repository at this point in the history
  • Loading branch information
micah committed Aug 11, 2006
1 parent 6764e88 commit 28338e9
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 21 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ [email protected] -- dup handler, pgsql handler, vserver support, bug fixes
Charles Lepple -- trac handler
Petr Kl�ma <[email protected]> -- autotools, RPM support and sys checks
[email protected] -- rsnap handler
Robert Napier -- improved RPM build

Patches:

Expand All @@ -19,4 +20,3 @@ [email protected]
Martin Krafft [email protected] -- admingroup patch
Anarcat
rhatto
Robert Napier -- improved RPM build
4 changes: 3 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ version 0.9.4 -- unreleased
changed cron permissions to 644
minor documentation fixes
improved RPM build process allowing 'make rpm-package' and 'make
srpm-package' targets (thanks Robert Napier)
srpm-package' targets, also fixes permissions on man directories,
cleans up RPM-related files during distclean, and adds default
EDITOR for "autogen.sh -f" if none is set. (thanks Robert Napier)

version 0.9.3 -- February 1st, 2006
autotools fixes
Expand Down
30 changes: 18 additions & 12 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,40 @@ EXTRA_DIST = README COPYING AUTHORS INSTALL NEWS ChangeLog \

SUBDIRS = etc examples handlers lib man src

rpm_topdir=`cd $(top_srcdir) && pwd`/rpm
local_rpm_topdir=`cd $(top_srcdir) && pwd`/rpm
rpm-package: dist
if test x$(HAVE_RPM) = xyes ; then \
mkdir -p $(rpm_topdir) ; \
cd $(rpm_topdir) ; \
mkdir -p $(local_rpm_topdir) ; \
cd $(local_rpm_topdir) ; \
mkdir -p BUILD RPMS SOURCES SPECS ; \
cd SOURCES ; \
ln -sf ../../$(distdir).tar.gz ; \
$(LN_S) ../../$(distdir).tar.gz ; \
cd .. ; \
cd SPECS ; \
ln -sf ../../backupninja.spec . ; \
cd .. ; \
$(LN_S) ../../backupninja.spec . ; \
cd .. ; \
rpmbuild --define "_topdir `cd . && pwd`" -bb SPECS/backupninja.spec && \
echo "Package successfully built in `pwd`/RPMS." ; \
else \
echo "Error: RPM executable and/or source directory not found." ; \
fi

srpm-package: dist
if test x$(HAVE_RPM) = xyes ; then \
cd $(rpm_topdir) ; \
if test x$(HAVE_RPM) = xyes ; then \
mkdir -p $(local_rpm_topdir) ; \
cd $(local_rpm_topdir) ; \
mkdir -p BUILD SRPMS SOURCES SPECS ; \
cd SOURCES ; \
ln -s ../../$(distdir).tar.gz ; \
$(LN_S) ../../$(distdir).tar.gz ; \
cd .. ; \
cd SPECS ; \
ln -sf ../../backupninja.spec .
$(LN_S) ../../backupninja.spec . \
cd .. ; \
rpmbuild --define "_topdir `cd . && pwd`" -bs SPECS/backupninja.spec && \
echo "Package successfully built in `pwd`/SRPMS." ; \
else \
echo "Error: RPM executable and/or source directory not found." ; \
fi
echo "Error: RPM executable and/or source directory not found." ; \
fi

clean-local:
-rm -rf $(local_rpm_topdir)
5 changes: 5 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

if [ "x$EDITOR" = "x" ];
then
EDITOR=vi
fi

if [ "x$1" = "x-f" ]
then
autoscan
Expand Down
18 changes: 11 additions & 7 deletions backupninja.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,26 @@ touch "%{buildroot}%{_localstatedir}/log/backupninja.log"
#rm -fr %{buildroot}

%files
%defattr(0750,root,root)
%defattr(-,root,root,-)
%{_sbindir}/*
%{_datadir}/backupninja/*
%{_libdir}/backupninja/*
%{_sysconfdir}/cron.d/backupninja
%{_sysconfdir}/logrotate.d/backupninja

%defattr(0600,root,root)
%config %{_sysconfdir}/cron.d/backupninja
%config %{_sysconfdir}/logrotate.d/backupninja

%config(noreplace) %{_sysconfdir}/backupninja.conf
%dir %{_sysconfdir}/backup.d
%dir %{_localstatedir}/backups

%ghost %{_localstatedir}/log/backupninja.log

%defattr(0644,root,root)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README
%{_mandir}/*
%{_mandir}/man1/*
%{_mandir}/man5/*

%defattr(0640,root,root,0750)
%dir %{_sysconfdir}/backup.d


%changelog
* Mon Apr 29 2002 Petr Klima <[email protected]> 0.7.0
Expand Down
16 changes: 16 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ if test "x$ac_cv_have_rpm" = "xyes"; then
fi
AC_SUBST(HAVE_RPM)

AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no")
if test "x$ac_cv_have_rpm" = "xyes"; then
rpm --define '_topdir /tmp' > /dev/null 2>&1
AC_MSG_CHECKING(to see if we can redefine _topdir)
if test $? -eq 0 ; then
AC_MSG_RESULT(yes)
HAVE_RPM=yes
else
AC_MSG_RESULT(no. You'll have to build packages manually.)
HAVE_RPM=no
fi
fi
AC_SUBST(HAVE_RPM)

AC_PROG_LN_S

AC_SUBST([CFGDIR], "${sysconfdir}")

AC_CONFIG_FILES([Makefile
Expand Down
1 change: 1 addition & 0 deletions handlers/mysql
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ fi
fi
fi
done
fi

# clean up tmp config file
if [ "$dbusername" != "" -a "$dbpassword" != "" ]
Expand Down

0 comments on commit 28338e9

Please sign in to comment.