http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.31.tar.gz
[xscreensaver] / Makefile.in
index 0c7821b24365da3150a3d93bcda54a88df86a7f1..d33dc24b35758fd3776f79e874e66754d418ac15 100644 (file)
@@ -13,13 +13,11 @@ TARFILES    = README README.VMS README.debugging INSTALL xscreensaver.lsm \
                  config.sub makevms.com screenblank.txt \
                  xscreensaver.lsm.sh xscreensaver.spec
 TAR            = tar
-COMPRESS       = gzip --verbose --best
-COMPRESS_EXT   = gz
-# COMPRESS     = compress
-# COMPRESS_EXT = Z
 
 MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done
 
+default::
+       @$(MAKE_SUBDIR)
 all::
        @$(MAKE_SUBDIR)
 install:
@@ -73,10 +71,9 @@ tar:
       | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\"                           \
       ` ";                                                                 \
     cd $$d ; done ;                                                        \
-  echo creating tar file $${NAME}.tar.$(COMPRESS_EXT)... ;                 \
-  $(TAR) -vchf -                                                           \
-    `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" `      \
-   | $(COMPRESS) > $${NAME}.tar.$(COMPRESS_EXT) ;                          \
+  echo creating tar file $${NAME}.tar.gz... ;                              \
+  GZIP="-9v" $(TAR) -vchzf $${NAME}.tar.gz                                 \
+    `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" ` ;            \
   rm $$NAME
 
 
@@ -85,7 +82,7 @@ tar:
 # nearly impossible to customize --help blurb.  This horrid set of regexps
 # go through and clean up the help text, by inserting whitespace and ripping
 # out options we don't use.  Odds are good that this will fail with any version
-# of autoconf other than 2.12.
+# of autoconf other than the ones I've tried (2.12 and 2.13.)
 #
 configure::
        autoconf
@@ -129,7 +126,7 @@ bump-version::
   MAJOR="$$1"; MINOR="$$2";                                                \
   NEW=`echo $$MINOR + 1 | bc` ;                                                    \
   NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ;                           \
-  D=`date '+%d-%b-%y'`;                                                            \
+  D=`date '+%d-%b-%Y'`;                                                            \
   if [ ! -f xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then                            \
     echo "WARNING: xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";    \
   fi ;                                                                     \
@@ -159,7 +156,7 @@ update_spec_version::
        V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
        echo -n "Updating version number in $$S to \"$$V\"... " ;           \
        T=/tmp/xs.$$$$ ;                                                    \
-       sed "s/^\(Version:[^0-9]*\)\(.*\)/\1$$V/"                           \
+       sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$V/"                    \
          < $$S > $$T ;                                                     \
        if cmp -s $$S $$T ; then                                            \
          echo "unchanged." ;                                               \
@@ -170,10 +167,26 @@ update_spec_version::
        rm $$T
 
 rpm::
-       @                                                                   \
-  VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
-  cp -p xscreensaver-$$VERS.tar.gz /usr/src/redhat/SOURCES/ ;              \
-  rpm -ba xscreensaver.spec
+       @                                                                  \
+  VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ; \
+  DIR=`pwd`/rpm_build ;                                                           \
+  ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ;                           \
+  rm -rf $$DIR ;                                                          \
+  mkdir $$DIR ;                                                                   \
+  ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ;        \
+  cp -p xscreensaver-$$VERS.tar.gz $$DIR/SOURCES/ ;                       \
+  rpm -vba --define "_topdir $$DIR"                                       \
+           --define "USE_GL yes" xscreensaver.spec ;                      \
+  echo '' ;                                                               \
+  echo 'RPM build complete' ;                                             \
+  echo '' ;                                                               \
+  rm -f $$DIR/xscreensaver-$$VERS.tar.gz ;                                \
+  rm -rf $$DIR/BUILD/xscreensaver-$$VERS ;                                \
+  mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ;                                   \
+  mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ;                     \
+  rm -rf $$DIR ;                                                          \
+  echo '' ;                                                               \
+  ls -lFG xscreensaver*-$$VERS-*.rpm
 
 test-tar::
        @                                                                   \
@@ -197,36 +210,27 @@ test-tar::
   chmod -R a-w . ;                                                         \
   chmod u+w . ;                                                                    \
   mkdir BIN ;                                                              \
-  mkdir BIN/athena ;                                                       \
   mkdir BIN/motif ;                                                        \
   mkdir BIN/lesstif ;                                                      \
   chmod a-w . ;                                                                    \
                                                                            \
-  ( cd BIN/athena ;                                                        \
-    CC=cc ;                                                                \
-    export CC ;                                                                    \
-    ../../configure --with-athena ;                                        \
-    echo --------------------------------------------------------------- ;  \
-    gmake ;                                                                \
-    echo --------------------------------------------------------------- ); \
-                                                                           \
   ( cd BIN/motif ;                                                         \
     CC=cc ;                                                                \
     export CC ;                                                                    \
-    ../../configure --without-xpm --with-motif=/usr/local/motif ;          \
+    ../../configure --without-xpm --without-xdbe --without-xshm            \
+                   --with-motif=/usr/local/motif ;                         \
     echo --------------------------------------------------------------- ;  \
-    gmake ;                                                                \
-    ( cd driver; gmake xscreensaver-demo-Xaw ) ;                           \
+    gmake all ;                                                                    \
+    ( cd driver; gmake tests ) ;                                           \
     echo --------------------------------------------------------------- ); \
                                                                            \
   ( cd BIN/lesstif ;                                                       \
     CC=cc ;                                                                \
     export CC ;                                                                    \
-    ../../configure --with-motif=/usr/local/lesstif ;                      \
+    ../../configure --with-motif=/usr/local/lesstif --without-gnome ;      \
     echo --------------------------------------------------------------- ;  \
-    ( cd utils; gmake ) ;                                                  \
-    ( cd driver; gmake ) ;                                                 \
-    ( cd driver; gmake xscreensaver-demo-Xaw ) ;                           \
+    ( cd utils; gmake all ) ;                                              \
+    ( cd driver; gmake all ) ;                                             \
     echo --------------------------------------------------------------- ); \
                                                                            \
   chmod -R u+w .
@@ -243,6 +247,7 @@ www::
     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;        \
     exit 1 ;                                                               \
   fi ;                                                                     \
+  chmod a-w $$NAME ;                                                       \
   if [ -f $$DEST/$$NAME ]; then                                                    \
     echo -n "WARNING: $$DEST/$$NAME already exists!  Overwrite? ";         \
     read line;                                                             \