[Box Backup-commit] COMMIT r1330 - box/chris/general/distribution/boxbackup/contrib/rpm

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sat Mar 3 22:06:22 GMT 2007


Author: chris
Date: 2007-03-03 22:06:22 +0000 (Sat, 03 Mar 2007)
New Revision: 1330

Modified:
   box/chris/general/distribution/boxbackup/contrib/rpm/boxbackup.spec
Log:
Fix spec file so that RPMs can be built from unofficial distribution
tarballs (from chris/merge)


Modified: box/chris/general/distribution/boxbackup/contrib/rpm/boxbackup.spec
===================================================================
--- box/chris/general/distribution/boxbackup/contrib/rpm/boxbackup.spec	2007-03-03 22:05:06 UTC (rev 1329)
+++ box/chris/general/distribution/boxbackup/contrib/rpm/boxbackup.spec	2007-03-03 22:06:22 UTC (rev 1330)
@@ -1,6 +1,20 @@
 %define bb_user_id 171
 %define ident %{name}-%{version}
 
+# In official distribution tarballs, distribution files are copied to
+# the base directory (where configure is), so distribution_dir should be empty.
+# This is the default, overridden by the following block in non-distribution
+# builds.
+%define distribution_dir ''
+
+# BOX_PRIVATE_BEGIN
+# In unofficial tarballs, made from svn, distribution files are still in 
+# distribution/boxbackup, so the following line overrides the default above:
+# (this section will be removed automatically from distribution tarballs
+# by infrastructure/makedistribution.pl)
+%define distribution_dir distribution/boxbackup/
+# BOX_PRIVATE_END
+
 # Detect distribution. So far we only special-case SUSE. If you need to make
 # any distro specific changes to get the package building on your system
 # please email them to boxbackup-dev at fluffy.co.uk
@@ -72,6 +86,7 @@
 %setup -q
 
 %build
+echo -e '%{version}\n%{name}' > VERSION.txt
 test -e configure || ./bootstrap
 %configure
 
@@ -88,19 +103,28 @@
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/box/bbstored
 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/box
 
-install -m 644 BUGS.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 LINUX.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 VERSION.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 CONTACT.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 DOCUMENTATION.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 ExceptionCodes.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 THANKS.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 LICENSE.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
-install -m 644 TODO.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 BUGS.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 VERSION.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 ExceptionCodes.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 LICENSE.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
 
+install -m 644 %{distribution_dir}CONTACT.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 %{distribution_dir}DOCUMENTATION.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 %{distribution_dir}LINUX.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 %{distribution_dir}THANKS.txt \
+	$RPM_BUILD_ROOT%{_docdir}/%{ident}
+
 # Client
 touch $RPM_BUILD_ROOT%{_sysconfdir}/box/bbackupd.conf
-install -m 755 contrib/%{dist}/bbackupd $RPM_BUILD_ROOT%{init_dir}
+install -m 755 %{distribution_dir}contrib/%{dist}/bbackupd \
+	$RPM_BUILD_ROOT%{init_dir}
 %if %{is_suse}
 ln -s ../../%{init_dir}/bbackupd $RPM_BUILD_ROOT%{_sbindir}/rcbbackupd
 %endif
@@ -113,7 +137,8 @@
 # Server
 touch $RPM_BUILD_ROOT%{_sysconfdir}/box/bbstored.conf
 touch $RPM_BUILD_ROOT%{_sysconfdir}/box/raidfile.conf
-install -m 755 contrib/%{dist}/bbstored $RPM_BUILD_ROOT%{init_dir}
+install -m 755 %{distribution_dir}contrib/%{dist}/bbstored \
+	$RPM_BUILD_ROOT%{init_dir}
 %if %{is_suse}
 ln -s ../../%{init_dir}/bbstored $RPM_BUILD_ROOT%{_sbindir}/rcbbstored
 %endif
@@ -195,6 +220,11 @@
 %{_sbindir}/raidfile-config
 
 %changelog
+* Sat Jan 13 2006 Chris Wilson <chris+box at qwirx.com>
+- Support building from an unofficial tarball (from svn) by changing
+  %{distribution_dir} at the top.
+- Write our RPM version number into VERSION.txt and hence compile it in
+
 * Wed Dec 28 2005 Martin Ebourne <martin at zepler.org>
 - Box now uses autoconf so use configure macro
 




More information about the Boxbackup-commit mailing list