After finding myself struggling to alter the MAXWIN value (without
hard-coding it into any header files) and having it successfully
change when I compiled screen, I made a small modification to the
configure script to make it a little friendlier.  This allows you to
specify --with-maxwin=50 or whatever number you like.

I also attached a modified the rpm spec file which I grabbed from:
http://download.opensuse.org/repositories/home:/jnweiger/openSUSE_10.2/src/screen-4.0.3-164.1.src.rpm

Not a lot of changes, but it allows you to define some stuff during rpmbuild.



    # rpmbuild screen.spec --define "MAXWIN 50" --define
"NO_SYS_SCREENRC 1" --define "NO_ENABLE_TELNET 1" --define
"NO_ENABLE_LOCALE 1"

... would build screen with 50 windows and suppress the creation of a
global screenrc file, as well as suppressing the telnet and locale
options.


-- 
Andy Harrison
public key: 0x67518262
diff -N -a -B -b -U 3 screen-configure.old/configure screen-configure.new/configure
--- screen-configure.old/configure	2008-06-10 10:07:48.000000000 -0400
+++ screen-configure.new/configure	2008-06-10 10:24:55.000000000 -0400
@@ -2990,6 +2990,18 @@
 sh etc/toolcheck 1>&6
 fi
 
+# Check whether --with-maxwin was given
+if test "${with_maxwin+set}" = set; then
+    withval="$with_maxwin"
+   MAXWIN=${withval}
+fi;
+	echo "$as_me:$LINENO: result: ${MAXWIN}" >&5
+echo "${ECHO_T}MAXWIN is ${MAXWIN}"
+echo "${ECHO_T}MAXWIN is ${MAXWIN}" >&6
+	cat >>confdefs.h <<_ACEOF
+#define MAXWIN $MAXWIN
+_ACEOF
+
 
 
 echo "$as_me:$LINENO: checking if a system-wide socket dir should be used" >&5
diff -N -a -B -b -U 3 screen.spec.old/screen.spec screen.spec.new/screen.spec
--- screen.spec.old/screen.spec	2008-06-10 10:01:09.000000000 -0400
+++ screen.spec.new/screen.spec	2008-06-10 09:57:49.000000000 -0400
@@ -43,6 +43,9 @@
     Juergen Weigert   <[EMAIL PROTECTED]>
     Michael Schroeder <[EMAIL PROTECTED]>
 
+%if %{!?MAXWIN:1}0
+%define MAXWIN 40
+%endif
 %prep
 %setup
 %patch
@@ -52,37 +55,50 @@
 %patch4 -p1
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --infodir=%{_infodir} \
+CFLAGS="$RPM_OPT_FLAGS" ./configure \
+    --prefix=%{_prefix} \
+    --infodir=%{_infodir} \
 				--mandir=%{_mandir} \
-				--with-socket-dir='(eff_uid ? "/var/run/uscreens" : "/var/run/screens")' \
-				--with-sys-screenrc=/etc/screenrc \
-				--with-pty-group=5 \
+    --with-socket-dir='(eff_uid ? "%{_var}/run/uscreens" : "%{_var}/run/screens")' \
+%if %{!?NO_SYS_SCREENRC:1}0
+    --with-sys-screenrc=%{_sysconfdir}/screenrc \
+%endif
+%if %{!?NO_ENABLE_LOCALE:1}0
 				--enable-locale \
+%endif
+%if %{!?NO_ENABLE_TELNET:1}0
 				--enable-telnet \
+%endif
+    --with-pty-group=5 \
+    --with-maxwin=%{MAXWIN} \
 				--enable-colors256 \
 				--verbose
 make
 
 %install
-make install DESTDIR=$RPM_BUILD_ROOT
-rm -f $RPM_BUILD_ROOT/usr/bin/screen
-mv $RPM_BUILD_ROOT/usr/bin/screen-%version $RPM_BUILD_ROOT/usr/bin/screen
-chmod 755 $RPM_BUILD_ROOT/usr/bin/screen
-mkdir -p $RPM_BUILD_ROOT/etc
-mkdir -p $RPM_BUILD_ROOT/var/run/screens
-chmod 755 $RPM_BUILD_ROOT/var/run/screens
-mkdir -p $RPM_BUILD_ROOT/var/run/uscreens
-chmod 1777 $RPM_BUILD_ROOT/var/run/uscreens
-install -m 644 screenrc $RPM_BUILD_ROOT/etc/screenrc
+make install DESTDIR=${RPM_BUILD_ROOT}
+rm -f ${RPM_BUILD_ROOT}/%{_bindir}/screen
+mv ${RPM_BUILD_ROOT}/%{_bindir}/screen-%version ${RPM_BUILD_ROOT}/%{_bindir}/screen
+chmod 755 ${RPM_BUILD_ROOT}/%{_bindir}/screen
+mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}
+mkdir -p ${RPM_BUILD_ROOT}/%{_var}/run/screens
+chmod 755 ${RPM_BUILD_ROOT}/%{_var}/run/screens
+mkdir -p ${RPM_BUILD_ROOT}/%{_var}/run/uscreens
+chmod 1777 ${RPM_BUILD_ROOT}/%{_var}/run/uscreens
+%if %{!?NO_SYS_SCREENRC:1}0
+install -m 644 screenrc ${RPM_BUILD_ROOT}/%{_sysconfdir}/screenrc
+%endif
 
 %files
 %defattr(-,root,root)
-%config /etc/screenrc
-%attr(555,root,root) /usr/bin/screen
-%dir /usr/share/screen
-/usr/share/screen/utf8encodings
-%dir /var/run/screens
-%dir /var/run/uscreens
+%if %{!?NO_SYS_SCREENRC:1}0
+%config %{_sysconfdir}/screenrc
+%endif
+%attr(555,root,root) %{_bindir}/screen
+%dir %{_datadir}/screen
+%{_datadir}/screen/utf8encodings
+%dir %{_var}/run/screens
+%dir %{_var}/run/uscreens
 %doc %{_infodir}/screen.info*.gz
 %doc %{_mandir}/man1/screen.1.gz
 
_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to