[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Patch removing some installation problems



Building PAM rpm I faced with some problems.
The changes I made are:

  - some modules handle FAKEROOT variable incorrectly or ignore it

  - FAKEROOT is set to RPM_BUILD_ROOT instead of RPM_ROOT_DIR;
    rpm Root directive is declared to be absolete

  - FORCEINSTALL make variable is added to force installation of config
    files (if target file doesn't exist) without any questions

  - INSTPAMCONF make variable is added to specify separate target for
    installation of default pam.conf file;
    the variable affects only installation process, pam library
    search for config file independently

The same version of the patch is available as
    ftp://castle.nmd.msu.ru/pub/Linux/patches/Linux-PAM-0.57preD-install1.patch
with signature
    ftp://castle.nmd.msu.ru/pub/Linux/patches/Linux-PAM-0.57preD-install1.patch.asc


					Andrey V.
					Savochkin


diff -r -u Linux-PAM-0.57.orig/Makefile Linux-PAM-0.57/Makefile
--- Linux-PAM-0.57.orig/Makefile	Thu Feb 27 06:41:47 1997
+++ Linux-PAM-0.57/Makefile	Mon Mar 24 15:18:38 1997
@@ -169,6 +169,8 @@
 export SECUREDIR		# where the modules will be placed
 export INCLUDED			# where to store pam---.h files
 export CONFIGED			# where pam.conf and pam.d/ go
+export INSTPAMCONF		# under this name default pam.conf should be
+				# installed
 
 #
 # Conditional exporting ( ... these go on for a while... )
@@ -187,6 +189,9 @@
 endif
 ifdef MEMORY_DEBUG
 export MEMORY_DEBUG
+endif
+ifdef FORCEINSTALL
+export FORCEINSTALL
 endif
 
 ##
diff -r -u Linux-PAM-0.57.orig/conf/install_conf Linux-PAM-0.57/conf/install_conf
--- Linux-PAM-0.57.orig/conf/install_conf	Thu Feb 27 06:50:00 1997
+++ Linux-PAM-0.57/conf/install_conf	Mon Mar 24 15:10:21 1997
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-CONFILE="$FAKEROOT"$CONFIGED/pam.conf
+CONFILE="$FAKEROOT"$INSTPAMCONF
 IGNORE_AGE=./.ignore_age
 CONF=./pam.conf
 
@@ -15,10 +15,14 @@
 An older Linux-PAM configuration file already exists ($CONFILE)"
 		WRITE=overwrite
 	fi
-	echo -n "\
+	if [ "foo$FORCEINSTALL" = "foo" -o "foo$WRITE" = "foooverwrite" ]; then
+		echo -n "\
 Do you wish to copy the $CONF file in this distribution
 to $CONFILE ? (y/n) [n] "
-	read yes
+		read yes
+	else
+		yes=y
+	fi
 else
 	yes=n
 fi
diff -r -u Linux-PAM-0.57.orig/default.defs Linux-PAM-0.57/default.defs
--- Linux-PAM-0.57.orig/default.defs	Thu Feb 27 06:37:39 1997
+++ Linux-PAM-0.57/default.defs	Mon Mar 24 15:10:21 1997
@@ -24,3 +24,4 @@
 SECUREDIR=$(LIBDIR)/security
 INCLUDED=/usr/include/security
 CONFIGED=/etc
+INSTPAMCONF=/etc/pam.conf
diff -r -u Linux-PAM-0.57.orig/defs/linux.defs Linux-PAM-0.57/defs/linux.defs
--- Linux-PAM-0.57.orig/defs/linux.defs	Thu Feb 27 06:37:39 1997
+++ Linux-PAM-0.57/defs/linux.defs	Mon Mar 24 15:10:21 1997
@@ -24,3 +24,4 @@
 SECUREDIR=$(LIBDIR)/security
 INCLUDED=/usr/include/security
 CONFIGED=/etc
+INSTPAMCONF=/etc/pam.conf
diff -r -u Linux-PAM-0.57.orig/defs/redhat.defs Linux-PAM-0.57/defs/redhat.defs
--- Linux-PAM-0.57.orig/defs/redhat.defs	Thu Feb 27 18:40:21 1997
+++ Linux-PAM-0.57/defs/redhat.defs	Mon Mar 24 15:10:21 1997
@@ -20,10 +20,11 @@
 LDCONFIG=/sbin/ldconfig
 AR=ar -cr
 RANLIB=ranlib
-FAKEROOT=$(RPM_ROOT_DIR)
+FAKEROOT=$(RPM_BUILD_ROOT)
 PREFIX=
 SUPLEMENTED=$(PREFIX)/sbin
 LIBDIR=$(PREFIX)/lib
 SECUREDIR=$(LIBDIR)/security
 INCLUDED=/usr/include/security
 CONFIGED=/etc
+INSTPAMCONF=/etc/pam.conf-example
diff -r -u Linux-PAM-0.57.orig/defs/solaris.defs Linux-PAM-0.57/defs/solaris.defs
--- Linux-PAM-0.57.orig/defs/solaris.defs	Thu Feb 27 06:52:41 1997
+++ Linux-PAM-0.57/defs/solaris.defs	Mon Mar 24 15:10:21 1997
@@ -38,3 +38,4 @@
 SECUREDIR=$(LIBDIR)/security
 INCLUDED=/usr/include/security
 CONFIGED=/etc
+INSTPAMCONF=/etc/pam.conf
diff -r -u Linux-PAM-0.57.orig/modules/pam_deny/Makefile Linux-PAM-0.57/modules/pam_deny/Makefile
--- Linux-PAM-0.57.orig/modules/pam_deny/Makefile	Thu Feb 27 07:21:49 1997
+++ Linux-PAM-0.57/modules/pam_deny/Makefile	Mon Mar 24 15:10:21 1997
@@ -99,7 +99,7 @@
 endif
 
 remove:
-	rm -f $(SECUREDIR)/$(TITLE).so
+	rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
 
 clean:
 	rm -f $(LIBOBJD) $(LIBOBJS) core *~
diff -r -u Linux-PAM-0.57.orig/modules/pam_env/install_conf Linux-PAM-0.57/modules/pam_env/install_conf
--- Linux-PAM-0.57.orig/modules/pam_env/install_conf	Fri Feb 28 19:07:44 1997
+++ Linux-PAM-0.57/modules/pam_env/install_conf	Mon Mar 24 15:10:21 1997
@@ -16,10 +16,14 @@
 An older $MODULE configuration file already exists ($CONFILE)"
 		WRITE=overwrite
 	fi
-	echo -n "\
+	if [ "foo$FORCEINSTALL" = "foo" -o "foo$WRITE" = "foooverwrite" ]; then
+		echo -n "\
 Do you wish to copy the $CONF file in this distribution
 to $CONFILE ? (y/n) [skip] "
-	read yes
+		read yes
+	else
+		yes=y
+	fi
 else
 	yes=skip
 fi
diff -r -u Linux-PAM-0.57.orig/modules/pam_group/install_conf Linux-PAM-0.57/modules/pam_group/install_conf
--- Linux-PAM-0.57.orig/modules/pam_group/install_conf	Thu Feb 27 07:36:43 1997
+++ Linux-PAM-0.57/modules/pam_group/install_conf	Mon Mar 24 15:10:21 1997
@@ -16,10 +16,14 @@
 An older $MODULE configuration file already exists ($CONFILE)"
 		WRITE=overwrite
 	fi
-	echo -n "\
+	if [ "foo$FORCEINSTALL" = "foo" -o "foo$WRITE" = "foooverwrite" ]; then
+		echo -n "\
 Do you wish to copy the $CONF file in this distribution
 to $CONFILE ? (y/n) [n] "
-	read yes
+		read yes
+	else
+		yes=y
+	fi
 else
 	yes=skip
 fi
diff -r -u Linux-PAM-0.57.orig/modules/pam_limits/Makefile Linux-PAM-0.57/modules/pam_limits/Makefile
--- Linux-PAM-0.57.orig/modules/pam_limits/Makefile	Thu Feb 27 07:38:56 1997
+++ Linux-PAM-0.57/modules/pam_limits/Makefile	Mon Mar 24 15:10:21 1997
@@ -76,14 +76,14 @@
 endif
 
 install: all
-	$(MKDIR) $(SECUREDIR)
+	$(MKDIR) $(FAKEROOT)$(SECUREDIR)
 ifdef DYNAMIC
-	$(INSTALL) -m 644 $(LIBSHARED) $(SECUREDIR)
+	$(INSTALL) -m 644 $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
 endif
 	bash -f ./install_conf
 
 remove:
-	rm -f $(SECUREDIR)/$(TITLE).so
+	rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
 
 clean:
 	rm -f $(LIBOBJD) $(LIBOBJS) core *~ *.so
diff -r -u Linux-PAM-0.57.orig/modules/pam_limits/install_conf Linux-PAM-0.57/modules/pam_limits/install_conf
--- Linux-PAM-0.57.orig/modules/pam_limits/install_conf	Thu Feb 27 07:39:50 1997
+++ Linux-PAM-0.57/modules/pam_limits/install_conf	Mon Mar 24 15:10:21 1997
@@ -16,10 +16,14 @@
 An older $MODULE configuration file already exists ($CONFILE)"
 		WRITE=overwrite
 	fi
-	echo -n "\
+	if [ "foo$FORCEINSTALL" = "foo" -o "foo$WRITE" = "foooverwrite" ]; then
+		echo -n "\
 Do you wish to copy the $CONF file in this distribution
 to $CONFILE ? (y/n) [n] "
-	read yes
+		read yes
+	else
+		yes=y
+	fi
 else
 	yes=skip
 fi
diff -r -u Linux-PAM-0.57.orig/modules/pam_time/install_conf Linux-PAM-0.57/modules/pam_time/install_conf
--- Linux-PAM-0.57.orig/modules/pam_time/install_conf	Thu Feb 27 08:08:26 1997
+++ Linux-PAM-0.57/modules/pam_time/install_conf	Mon Mar 24 15:10:21 1997
@@ -16,10 +16,14 @@
 An older $MODULE configuration file already exists ($CONFILE)"
 		WRITE=overwrite
 	fi
-	echo -n "\
+	if [ "foo$FORCEINSTALL" = "foo" -o "foo$WRITE" = "foooverwrite" ]; then
+		echo -n "\
 Do you wish to copy the $CONF file in this distribution
 to $CONFILE ? (y/n) [n] "
-	read yes
+		read yes
+	else
+		yes=y
+	fi
 else
 	yes=skip
 fi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []