This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xconq spec file


I had to tweak the spec file in order to get an RPM to build without
root privileges.  Thought you might be interested in the changes.

Derek

--
                *8^)

Email: oberon@alumni.engin.umich.edu
Public key available from www.pgp.net - Key ID F660EEB0
Fingerprint 720C C063 3A8F 44D3 684E  D7D4 D788 4BD9 F660 EEB0

--
Programmers are the hamsters running on the wheel inside your x86.
        - Me


--- xconq.spec.orig	Mon Dec 18 08:44:03 2000
+++ xconq.spec	Fri Feb  2 13:57:55 2001
@@ -7,10 +7,15 @@
 Source: ftp://sources.redhat.com/pub/xconq/xconq-7.4.1.tar.gz
 Copyright: GPL
 Group: Amusements/Games/Strategy
+Prefix: %{_prefix}
+BuildRoot: %{_tmppath}/%{name}-root
 
 Requires: tcl
 Requires: tk
 
+# FIXME - this should come _out_ of configure, not go in, but I don't know how
+%define _scoresdir /var/lib/xconq/scores
+
 # The description should generally be the same as first part of the
 # main README.
 
@@ -41,21 +46,40 @@
 %setup
 
 %build
-configure
+%configure --enable-alternate-scoresdir=%{_scoresdir}
 make
 
 %install
-make install
+rm -rf $RPM_BUILD_ROOT
+# FIXME - the makefile doesn't know how to create /var/lib before its
+# children
+test -d $RPM_BUILD_ROOT/var/lib || mkdir -p $RPM_BUILD_ROOT/var/lib
+# FIXME
+# okay, now - the makefile should know that, by default, the datadir it
+# used during the build step is the same one to use during the install step
+#
+# maybe rpm is messing it up?  I haven't had that problem with any other
+# packages
+#
+# I had to override the [ug]ids/perms and set them in the %files section using
+# RPMs mechanism since chmods & chgrps & chowns that can't be done without
+# root privledges were happening during install
+%makeinstall \
+	scoresdir=$RPM_BUILD_ROOT%{_scoresdir} \
+	datadir=$RPM_BUILD_ROOT%{_datadir}/xconq \
+	GAMEUID=%(id -un) GAMEGRP=%(id -gn) GAMEPERM=0755
 
 %files
-/usr/local/bin/imf2x
-/usr/local/bin/x2imf
-/usr/local/bin/xconq
-/usr/local/bin/ximfapp
-/usr/local/share/xconq
+%defattr(-,root,root)
+%{_bindir}/imf2x
+%{_bindir}/x2imf
+%{_bindir}/ximfapp
+%{_datadir}/xconq
+%defattr(04755,games,bin)
+%{_bindir}/xconq
 # Need to fix this
 #/usr/info/xconq.info
 #/usr/info/xcdesign.info
 # Just want the directory, not any scorefiles that might be in it
-%dir /var/lib/xconq/scores
-
+%defattr(-,games,bin)
+%dir %{_scoresdir}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]