[sword-devel] spec file

Michael A. Peters sword-devel@crosswire.org
Tue, 20 Apr 2004 07:03:53 -0700


--=-DUKVROaR8Uo7fDVyD7Rn
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I checked out the cvs version and make a couple changes to some files.

The spec file -

Change 1:
changed the version from static 1.5.7 to @VERSION@

This is so that ./autogen.sh && ./configure && make dist
will always have the proper version in the resulting spec file.

Change 2: changed the buildroot from /var/tmp/sword-root to
%_tmppath/sword-root

Usually %_tmppath expands to /var/tmp anyway.
But if you prefer to have your buildroots elsewhere (by defining
_tmppath in your .rpmmacros file) the spec file should respect that.

After applying the patch, the file needs to be renamed from sword.spec
to sword.spec.in

-=-
The second attached patch is for configure.ac and Makefile.am

Change 1 (to configure.ac) -
Tells configure to create sword.spec from sword.spec.in

Change 2 (to Makefile.am)
adds a $(DESTDIR) to the path for the install_config target so that the
system /etc/sword.conf file will not be overwritten when building rpm as
root, and so that non root users can build the rpm.

The spec file specified a DESTDIR in make install_config but the
Makefile did not respect it.

Anyway - if the developers with write want to commit, here they are.
The spec file does need the .in appended to the file name for these to
matter though.

-- 
Cheap Linux CD's - http://mpeters.us/linux/

--=-DUKVROaR8Uo7fDVyD7Rn
Content-Disposition: attachment; filename=sword-rpm.autoconf.patch
Content-Type: text/x-patch; name=sword-rpm.autoconf.patch; charset=utf-8
Content-Transfer-Encoding: 7bit

diff -ur sword/configure.ac sword-patched/configure.ac
--- sword/configure.ac	2004-04-12 06:47:21.000000000 -0700
+++ sword-patched/configure.ac	2004-04-20 06:37:30.000000000 -0700
@@ -319,6 +319,6 @@
 AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile tests/refsys/Makefile \
 	utilities/Makefile examples/Makefile \
 	examples/cmdline/Makefile \
-	utilities/diatheke/Makefile icu/Makefile sword.pc)
+	utilities/diatheke/Makefile icu/Makefile sword.pc sword.spec)
 AC_OUTPUT
 
diff -ur sword/Makefile.am sword-patched/Makefile.am
--- sword/Makefile.am	2004-04-12 06:47:21.000000000 -0700
+++ sword-patched/Makefile.am	2004-04-20 06:38:35.000000000 -0700
@@ -149,8 +149,8 @@
 	@echo ""
 
 install_config: 
-	@echo "[Install]" > $(sysconfdir)/sword.conf
-	@echo "DataPath=$(pkgdatadir)/" >> $(sysconfdir)/sword.conf
+	@echo "[Install]" > $(DESTDIR)$(sysconfdir)/sword.conf
+	@echo "DataPath=$(pkgdatadir)/" >> $(DESTDIR)$(sysconfdir)/sword.conf
 	@echo "sword.conf generated"
 
 dist-hook:

--=-DUKVROaR8Uo7fDVyD7Rn
Content-Disposition: attachment; filename=sword-spec.patch
Content-Type: text/x-patch; name=sword-spec.patch; charset=utf-8
Content-Transfer-Encoding: 7bit

--- sword.spec	2004-04-20 06:24:39.000000000 -0700
+++ sword.spec.in	2004-04-20 05:51:55.000000000 -0700
@@ -1,6 +1,6 @@
 Summary:	The SWORD Project framework for manipulating Bible texts
 Name:		sword
-%define version 1.5.7
+%define version @VERSION@
 Version:	%{version}
 Release:	1
 #Icon:		sword.gif
@@ -9,7 +9,7 @@
 URL:		http://www.crosswire.org/sword
 Source:		http://www.crosswire.org/download/ftpmirror.tmp/pub/sword/source/v1.5/sword-%{version}.tar.gz
 Group:		System Environment/Libraries
-BuildRoot:	/var/tmp/sword-root
+BuildRoot:	%_tmppath/sword-root
 Requires:	curl
 Requires:	zlib
 # Requires:	icu >= 2.6

--=-DUKVROaR8Uo7fDVyD7Rn--