Просмотр исходного кода

upgrading package: sendmail 8.12.6 -> 8.12.7

Ralf S. Engelschall 23 лет назад
Родитель
Сommit
e7aedcb62e
2 измененных файлов с 24 добавлено и 244 удалено
  1. 0 207
      sendmail/sendmail-db4.patch
  2. 24 37
      sendmail/sendmail.spec

+ 0 - 207
sendmail/sendmail-db4.patch

@@ -1,207 +0,0 @@
-diff -Naur sendmail-8.12.6.orig/libsmdb/smdb2.c sendmail-8.12.6/libsmdb/smdb2.c
---- sendmail-8.12.6.orig/libsmdb/smdb2.c	Wed Dec  4 17:24:48 2002
-+++ sendmail-8.12.6/libsmdb/smdb2.c	Tue Dec 10 14:05:09 2002
-@@ -523,7 +523,11 @@
- 		}
- 	}
- 
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+	result = (*db)->open(*db, NULL, db_name, NULL, db_type, db_flags, DBMMODE);
-+#else
- 	result = (*db)->open(*db, db_name, NULL, db_type, db_flags, DBMMODE);
-+#endif
- 	if (result != 0)
- 	{
- 		(void) (*db)->close(*db, 0);
-@@ -571,7 +575,10 @@
- 	SMDB_USER_INFO *user_info;
- 	SMDB_DBPARAMS *db_params;
- {
--	bool lockcreated = false;
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+#else
-+    bool lockcreated = false;
-+#endif
- 	int result;
- 	int db_flags;
- 	int lock_fd;
-@@ -580,7 +587,6 @@
- 	SMDB_DB2_DATABASE *db2;
- 	DB *db;
- 	DBTYPE db_type;
--	struct stat stat_info;
- 	char db_file_name[MAXPATHLEN];
- 
- 	*database = NULL;
-@@ -590,27 +596,33 @@
- 	if (result != SMDBE_OK)
- 		return result;
- 
--	result = smdb_setup_file(db_name, SMDB2_FILE_EXTENSION,
--				 mode_mask, sff, user_info, &stat_info);
--	if (result != SMDBE_OK)
--		return result;
--
--	lock_fd = -1;
--
--	if (stat_info.st_mode == ST_MODE_NOFILE &&
--	    bitset(mode, O_CREAT))
--		lockcreated = true;
--
--	result = smdb_lock_file(&lock_fd, db_name, mode, sff,
--				SMDB2_FILE_EXTENSION);
--	if (result != SMDBE_OK)
--		return result;
--
--	if (lockcreated)
--	{
--		mode |= O_TRUNC;
--		mode &= ~(O_CREAT|O_EXCL);
--	}
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+#else
-+    result = smdb_setup_file(db_name, SMDB2_FILE_EXTENSION,
-+                 mode_mask, sff, user_info, &stat_info);
-+    if (result != SMDBE_OK)
-+        return result;
-+#endif
-+
-+    lock_fd = -1;
-+
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+#else
-+    if (stat_info.st_mode == ST_MODE_NOFILE &&
-+        bitset(mode, O_CREAT))
-+        lockcreated = true;
-+
-+    result = smdb_lock_file(&lock_fd, db_name, mode, sff,
-+                SMDB2_FILE_EXTENSION);
-+    if (result != SMDBE_OK)
-+        return result;
-+
-+    if (lockcreated)
-+    {
-+        mode |= O_TRUNC;
-+        mode &= ~(O_CREAT|O_EXCL);
-+    }
-+#endif
- 
- 	smdb_db = smdb_malloc_database();
- 	if (smdb_db == NULL)
-@@ -620,8 +632,6 @@
- 	if (db2 == NULL)
- 		return SMDBE_MALLOC;
- 
--	db2->smdb2_lock_fd = lock_fd;
--
- 	db_type = smdb_type_to_db2_type(type);
- 
- 	db = NULL;
-@@ -634,7 +644,7 @@
- 	if (mode == O_RDONLY)
- 		db_flags |= DB_RDONLY;
- # if !HASFLOCK && defined(DB_FCNTL_LOCKING)
--	db_flags |= DB_FCNTL_LOCKING;
-+    db_flags |= DB_FCNTL_LOCKING;
- # endif /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
- 
- 	result = smdb_db_open_internal(db_file_name, db_type,
-@@ -645,6 +655,8 @@
- 		result = db->fd(db, &db_fd);
- 		if (result == 0)
- 			result = SMDBE_OK;
-+        else
-+			result = SMDBE_BAD_OPEN;
- 	}
- 	else
- 	{
-@@ -655,12 +667,25 @@
- 			result = SMDBE_BAD_OPEN;
- 	}
- 
--	if (result == SMDBE_OK)
--		result = smdb_filechanged(db_name, SMDB2_FILE_EXTENSION, db_fd,
--					  &stat_info);
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+    if (result == SMDBE_OK) {
-+        result = smdb_lock_file(&lock_fd, db_name, mode, sff,
-+                    SMDB2_FILE_EXTENSION);
-+        if (result != SMDBE_OK)
-+            lock_fd = -1; /* paranoia */
-+    }
-+#else
-+    if (result == SMDBE_OK)
-+        result = smdb_filechanged(db_name, SMDB2_FILE_EXTENSION, db_fd,
-+                      &stat_info);
-+#endif
- 
- 	if (result == SMDBE_OK)
- 	{
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+        db2->smdb2_lock_fd = lock_fd;
-+#endif
-+
- 		/* Everything is ok. Setup driver */
- 		db2->smdb2_db = db;
- 
-@@ -680,10 +705,18 @@
- 		return SMDBE_OK;
- 	}
- 
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+    if (lock_fd != -1)
-+        smdb_unlock_file(lock_fd);
-+#endif
-+
- 	if (db != NULL)
- 		db->close(db, 0);
- 
--	smdb_unlock_file(db2->smdb2_lock_fd);
-+#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1)
-+#else
-+    smdb_unlock_file(db2->smdb2_lock_fd);
-+#endif
- 	free(db2);
- 	smdb_free_database(smdb_db);
- 
-diff -Naur sendmail-8.12.6.orig/sendmail/map.c sendmail-8.12.6/sendmail/map.c
---- sendmail-8.12.6.orig/sendmail/map.c	Sat Aug 10 00:23:13 2002
-+++ sendmail-8.12.6/sendmail/map.c	Mon Oct 14 22:37:35 2002
-@@ -2115,7 +2115,11 @@
- #  endif /* DB_HASH_NELEM */
- 		if (ret == 0 && db != NULL)
- 		{
-+#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1)
-+			ret = db->open(db, NULL, buf, NULL, dbtype, flags, DBMMODE);
-+#else
- 			ret = db->open(db, buf, NULL, dbtype, flags, DBMMODE);
-+#endif
- 			if (ret != 0)
- 			{
- #ifdef DB_OLD_VERSION
-diff -Naur sendmail-8.12.6.orig/sendmail/udb.c sendmail-8.12.6/sendmail/udb.c
---- sendmail-8.12.6.orig/sendmail/udb.c	Tue Sep 11 06:05:17 2001
-+++ sendmail-8.12.6/sendmail/udb.c	Mon Oct 14 22:44:32 2002
-@@ -1012,12 +1012,22 @@
- 				}
- 				else
- 				{
-+#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1)
-+					ret = up->udb_dbp->open(up->udb_dbp,
-+								NULL,
-+								up->udb_dbname,
-+								NULL,
-+								DB_BTREE,
-+								flags,
-+								0644);
-+#else
- 					ret = up->udb_dbp->open(up->udb_dbp,
- 								up->udb_dbname,
- 								NULL,
- 								DB_BTREE,
- 								flags,
- 								0644);
-+#endif
- 					if (ret != 0)
- 					{
- #ifdef DB_OLD_VERSION

+ 24 - 37
sendmail/sendmail.spec

@@ -23,15 +23,19 @@
 ##  SUCH DAMAGE.
 ##
 
-# TODO:
-# 1 User, group ids in %files must be reviewed
-# 2 default config files use 8.11.6 options
-
-#   build options
-%{!?with_tls:                %define  with_tls               yes}
-%{!?with_sasl:               %define  with_sasl               no}
-%{!?with_milter:             %define  with_milter             no}
-%{!?with_ldap:               %define  with_ldap               no}
+#   package options
+%ifndef with_tls
+%define with_tls      no
+%endif
+%ifndef with_sasl
+%define with_sasl     no
+%endif
+%ifndef with_milter
+%define with_milter   no
+%endif
+%ifndef with_ldap
+%define with_ldap     no
+%endif
 
 #   package information
 Name:         sendmail
@@ -42,8 +46,8 @@ Packager:     The OpenPKG Project
 Distribution: OpenPKG [EVAL]
 Group:        Mail
 License:      BSD
-Version:      8.12.6
-Release:      20021211
+Version:      8.12.7
+Release:      20021230
 
 #   list of sources
 Source0:      ftp://ftp.sendmail.org/pub/sendmail/sendmail.%{version}.tar.gz
@@ -51,16 +55,11 @@ Source1:      etc.sendmail.tar
 Source2:      cf.tar
 Source3:      fsl.sendmail
 Source4:      rc.sendmail
-Patch0:       http://www.sendmail.org/patches/smrsh-20020924.patch
-Patch1:       http://www.sendmail.org/patches/proto.m4.8.649.2.13
-Patch2:       http://www.sendmail.org/~ca/email/patches/recipient.c.8.330.2.1
-Patch3:       http://www.sendmail.org/~ca/email/patches/proto.m4.8.646
-Patch4:       sendmail-db4.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg, m4, fsl, tar, gcc, make, db
+BuildPreReq:  OpenPKG, openpkg, m4, fsl, tar, gcc, make, db >= 4.1.25
 PreReq:       OpenPKG, openpkg, m4, fsl, make, perl
 %if "%{with_tls}" == "yes"
 BuildPreReq:  openssl
@@ -77,33 +76,21 @@ Provides:     MTA
 Conflicts:    ssmtp, exim, postfix
 
 %description
-    Sendmail is the most popular Mail Transfer Agent (MTA). This copy contains
-    features specific to the OpenPKG distribution including fsl(3) logging
-    rather than syslog(3) and STARTTLS support by default.
+    Sendmail is the most popular Mail Transfer Agent (MTA). This copy
+    contains features specific to the OpenPKG distribution including
+    fsl(3) logging rather than syslog(3) and optional STARTTLS,
+    SMTPAUTH, Milter and LDAP support.
 
     Options:
-    --define 'with_tls                  %{with_tls}'
-    --define 'with_sasl                 %{with_sasl}'
-    --define 'with_milter               %{with_milter}'
-    --define 'with_ldap                 %{with_ldap}'
+    --define 'with_tls    %{with_tls}'
+    --define 'with_sasl   %{with_sasl}'
+    --define 'with_milter %{with_milter}'
+    --define 'with_ldap   %{with_ldap}'
 
 %prep
     #   unpack standard tarballs
     %setup0 -q -c
     %setup1 -q -T -D -a 1
-    ( cd sendmail-%{version}/smrsh
-      %patch0 -p0
-    )
-    ( cd sendmail-%{version}/cf/m4
-      %patch1 -p0
-    )
-    ( cd sendmail-%{version}/sendmail
-      %patch2 -p0
-    )
-    ( cd sendmail-%{version}/cf/m4
-      %patch3 -p0
-    )
-    %patch4 -p0
 
     #   add own M4 stuff to Sendmail configuration set
     ( cd sendmail-%{version}