dbmail-vl.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. # http://trac.vinelinux.org/wiki/WellKnownUigGid
  2. %define registry_uid 38
  3. %define registry_name dbmail
  4. %define services dbmail-imapd dbmail-pop3d dbmail-lmtpd dbmail-timsieved
  5. Name: dbmail
  6. Version: 2.2.11
  7. Release: 1%{?_dist_release}
  8. Summary: A database backend mail storage system
  9. Summary(ja): メールストレージシステムのデータベースバックエンド
  10. Group: System Environment/Daemons
  11. # db_getopot.c is licensed MIT
  12. License: GPLv2+ and MIT
  13. URL: http://www.dbmail.org
  14. Source0: http://www.dbmail.org/download/2.2/dbmail-%{version}.tar.gz
  15. Source1: dbmail-imapd
  16. Source2: dbmail-pop3d
  17. Source3: dbmail-lmtpd
  18. Source4: dbmail-timsieved
  19. Source5: dbmail.cron
  20. Source6: dbmail.logrotate
  21. Source7: README.dbmail
  22. Source10: find-provides-dbmail.sh
  23. Patch0: 0001-backport-fix-to-prevent-showing-mailboxes-more-than.patch
  24. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  25. BuildRequires: gmime-devel >= 2.1.19
  26. BuildRequires: fileutils, openssl-devel >= 0.9.7a
  27. BuildRequires: glib2-devel >= 2.8
  28. BuildRequires: libsieve-devel >= 2.1.13
  29. BuildRequires: mysql-devel >= 4.1.3, postgresql-devel
  30. BuildRequires: openldap-devel
  31. BuildRequires: sqlite3-devel
  32. Requires: glib2
  33. Requires: initscripts
  34. Requires: /usr/sbin/sendmail
  35. Requires(pre): shadow-utils
  36. Requires(postun):shadow-utils
  37. Requires: sqlite3
  38. Obsoletes: dbmail-sqlite < 2.2.5
  39. Provides: dbmail-sqlite = %{version}
  40. %description
  41. Dbmail is the name of a group of programs that enable the possiblilty of
  42. storing and retrieving mail messages from a database.
  43. Currently dbmail supports the following database backends:
  44. MySQL
  45. PostgreSQL
  46. SQLite
  47. Please see /usr/share/doc/dbmail-*/README.dbmail for specific information on
  48. installation and configuration.
  49. %prep
  50. %setup -q
  51. %patch0 -p 1 -b .duplicate-email-boxes
  52. # we don't need README.solaris and we don't want it caught up in the %%doc
  53. # README* wildcard - but we do want our shiny new README.dbmail file to be
  54. # installed
  55. rm -f README.solaris
  56. install -p -m 644 %SOURCE7 .
  57. # make a couple of changes to the default dbmail.conf file:
  58. # 1. default driver/authdriver sqlite/sql (sqlite, if supported)
  59. # 2. effective uid/gid to dbmail/dbmail
  60. sed -i 's/\(^driver\W*=\)\(\W*$\)/\1 sqlite/' dbmail.conf
  61. sed -i -e 's,\(^db\W*=\)\(.*$\),\1 %{_localstatedir}/lib/dbmail/dbmail.db,' \
  62. -e 's/\(^authdriver\W*=\)\(\W*$\)/\1 sql/' \
  63. -e 's/\(^EFFECTIVE_USER\W*=\)\(.*$\)/\1 dbmail/' \
  64. -e 's/\(^EFFECTIVE_GROUP\W*=\)\(.*$\)/\1 dbmail/' dbmail.conf
  65. %define _use_internal_dependency_generator 0
  66. %define __find_provides %{SOURCE10}
  67. chmod +x %{__find_provides}
  68. %build
  69. %configure --disable-rpath \
  70. --disable-static \
  71. --with-ldap \
  72. --with-mysql \
  73. --with-pgsql \
  74. --with-sqlite \
  75. --with-sieve
  76. make %{?_smp_mflags}
  77. %install
  78. rm -rf $RPM_BUILD_ROOT
  79. make install DESTDIR=$RPM_BUILD_ROOT
  80. mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man{1,5,8}
  81. mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
  82. mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily
  83. mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d
  84. mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/dbmail
  85. install -p -m 755 %SOURCE1 $RPM_BUILD_ROOT/%{_initrddir}
  86. install -p -m 755 %SOURCE2 $RPM_BUILD_ROOT/%{_initrddir}
  87. install -p -m 755 %SOURCE3 $RPM_BUILD_ROOT/%{_initrddir}
  88. install -p -m 755 %SOURCE4 $RPM_BUILD_ROOT/%{_initrddir}
  89. install -p -m 755 %SOURCE5 $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily/dbmail
  90. install -p -m 644 %SOURCE6 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/dbmail
  91. install -p -m 600 dbmail.conf $RPM_BUILD_ROOT/%{_sysconfdir}/
  92. install -p -m 644 man/*1 $RPM_BUILD_ROOT/%{_mandir}/man1/
  93. install -p -m 644 man/*5 $RPM_BUILD_ROOT/%{_mandir}/man5/
  94. install -p -m 644 man/*8 $RPM_BUILD_ROOT/%{_mandir}/man8/
  95. # remove libtool archives and -devel type stuff (but leave loadable modules)
  96. find $RPM_BUILD_ROOT -name \*\.la -print | xargs rm -f
  97. rm -f $RPM_BUILD_ROOT/%{_libdir}/dbmail/libdbmail.so
  98. %clean
  99. rm -rf $RPM_BUILD_ROOT
  100. %pre
  101. /usr/sbin/groupadd -g %registry_uid -r %registry_name &> /dev/null || :
  102. /usr/sbin/useradd -u %registry_uid -r -s /sbin/nologin -d / -M \
  103. -c "DBMail Daemon Account" -g %registry_name %registry_name \
  104. &> /dev/null || :
  105. %post
  106. for s in %services; do
  107. /sbin/chkconfig --add $s &> /dev/null || :
  108. done
  109. /sbin/ldconfig
  110. %preun
  111. if [ $1 = 0 ]; then
  112. for s in %services; do
  113. /sbin/service $s stop &> /dev/null || :
  114. /sbin/chkconfig --del $s &> /dev/null || :
  115. done
  116. fi
  117. exit 0
  118. %postun
  119. if [ "$1" -eq "0" ]; then
  120. /sbin/ldconfig
  121. /usr/sbin/userdel %registry_name &> /dev/null || :
  122. /usr/sbin/groupdel %registry_name &> /dev/null || :
  123. elif [ "$1" -ge "1" ]; then
  124. for s in %services; do
  125. /sbin/service $s condrestart &> /dev/null || :
  126. done
  127. fi
  128. %files
  129. %defattr(-,root,root,-)
  130. %doc AUTHORS BUGS ChangeLog COPYING INSTALL README* THANKS
  131. %{_sbindir}/*
  132. %{_mandir}/man1/*
  133. %{_mandir}/man5/*
  134. %{_mandir}/man8/*
  135. %dir %{_libdir}/dbmail
  136. %{_libdir}/dbmail/libauth_sql*
  137. %{_libdir}/dbmail/libdbmail*
  138. %{_libdir}/dbmail/libsort_sieve*
  139. %config(noreplace) %{_sysconfdir}/dbmail.conf
  140. %{_initrddir}/dbmail-*
  141. %config(noreplace) %{_sysconfdir}/cron.daily/dbmail
  142. %config(noreplace) %{_sysconfdir}/logrotate.d/dbmail
  143. %doc sql/sqlite/*
  144. %{_libdir}/dbmail/libsqlite*
  145. %dir %attr(0775,root,dbmail) /var/lib/dbmail
  146. %package auth-ldap
  147. Summary: A database backed mail storage system - ldap authentication plugin
  148. Summary(ja): A database backed mail storage system - ldap authentication plugin
  149. Group: System Environment/Daemons
  150. Requires: dbmail = %{version}-%{release}, openldap
  151. %description auth-ldap
  152. This is the auth-ldap libraries for authentication against a ldap server with
  153. dbmail.
  154. %files auth-ldap
  155. %defattr(-,root,root,-)
  156. %attr(-,root,root) %{_libdir}/dbmail/libauth_ldap*
  157. %package mysql
  158. Summary: A database backed mail storage system - mysql backend
  159. Summary(ja): A database backed mail storage system - mysql backend
  160. Group: System Environment/Daemons
  161. Requires: dbmail = %{version}-%{release}, mysql-server
  162. %description mysql
  163. This is the mysql libraries for dbmail.
  164. %files mysql
  165. %defattr(-,root,root,-)
  166. %doc sql/mysql/*
  167. %{_libdir}/dbmail/libmysql*
  168. %package pgsql
  169. Summary: A database backed mail storage system - postgresql backend
  170. Summary(ja): A database backed mail storage system - postgresql backend
  171. Group: System Environment/Daemons
  172. Requires: dbmail = %{version}-%{release}, postgresql-server
  173. %description pgsql
  174. This is the postgresql libraries for dbmail.
  175. %files pgsql
  176. %defattr(-,root,root,-)
  177. %doc sql/postgresql/*
  178. %{_libdir}/dbmail/libpgsql*
  179. %changelog
  180. * Mon Sep 14 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.11-1
  181. - initial build for Vine Linux
  182. * Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.2.11-9
  183. - rebuilt with new openssl
  184. * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.11-8
  185. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  186. * Mon Jul 06 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-7
  187. - fix left out ? in comparison
  188. * Sun Jul 05 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-6
  189. - fix conditional comparison to be 0 for no value
  190. * Sun Jul 05 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-5
  191. - patch to remove duplicate email boxes from being listed
  192. - consider cron file a config file
  193. - add -b option to cron job to rebuild body/header/envelope cache tables
  194. - change order of redirection in cron job
  195. - fix typo in dbmail-pop3d that causes LSB info to not be recognized
  196. - add provides for dbmail-sqlite
  197. - conditional to compile with gmime22 when needed
  198. * Thu Mar 19 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-4
  199. - build agaist old gmime22 (bz #490316)
  200. * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.11-3
  201. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  202. * Thu Feb 05 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-2
  203. - change BR from openssl to openssl-devel
  204. * Tue Feb 03 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-1
  205. - v 2.2.11
  206. - updated summaries
  207. - fix bug in dbmail-pop3d init script
  208. * Mon Jul 7 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.9-2
  209. - fix conditional comparison
  210. * Thu Apr 24 2008 Bernard Johnson <bjohnson@symetrix.com> - 2.2.9-1
  211. - v 2.2.9
  212. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2.8-2
  213. - Autorebuild for GCC 4.3
  214. * Fri Jan 18 2008 Bernard Johnson <bjohnson@symetrix.com> - 2.2.8-1
  215. - 2.2.8-1
  216. * Thu Dec 06 2007 Release Engineering <rel-eng at fedoraproject dot org> - 2.2.7-2
  217. - Rebuild for deps
  218. * Wed Oct 31 2007 Bernard Johnson <bjohnson@symetrix.com> - 2.2.7-1
  219. - 2.2.7-1
  220. - removed unused thread references patch
  221. - removed unused hup patch
  222. - removed unused gmime segv patch
  223. - license clarification
  224. - dbmail: Initscript Review (bz #246901)
  225. * Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.2.5-7
  226. - Rebuild for selinux ppc32 issue.
  227. * Tue Jul 03 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-6
  228. - patch to fix SEGV in dbmail-imapd
  229. * Sat Jun 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-5
  230. - patch to reopen logs files on -HUP
  231. - patch to send error when thread references requested
  232. - don't filter libdbmail.so*
  233. * Sat Jun 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-4
  234. - kill ld.so config
  235. - filter private libraries from provides (bz#245326)
  236. * Wed Jun 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-3
  237. - assign uid from package user registry (bz#244611)
  238. * Tue Jun 05 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-2
  239. - fix %%setup directory
  240. * Tue Jun 05 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-1
  241. - 2.2.5
  242. - change method of restarting daemons to that suggested in dbmail bug #600
  243. * Wed May 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-0.1.rc3
  244. - update to svn 2.2.5rc3
  245. - remove unneccessary patches
  246. - make sqlite default driver for better out of the box experience
  247. * Thu Mar 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-4
  248. - actually APPLY the short write patch
  249. * Thu Mar 22 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-3
  250. - patch to eliminate short write messages
  251. - use /sbin/service instead of running init scripts directly
  252. - requires for initscripts because daemon function in initfile requires it
  253. - modern tarballs do not require xmlto and asciidoc to build the docs
  254. - change conditionals to give everything sqlite support unless it's built in
  255. the fedora buildsystem and %%{fedora} < 4
  256. * Tue Mar 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-2
  257. - patch to fix expunge bug
  258. * Tue Mar 13 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-1
  259. - v. 2.2.4
  260. - remove umask patch as it's included upstream now
  261. * Wed Feb 28 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.3-1
  262. - v. 2.2.3
  263. - tab removal in dbmail.conf no longer required
  264. - libsqlite.so in not built anymore unless specified, remove fix
  265. - libauth-ldap.so wasn't be built properly, fixed
  266. - rework umask patch, still want a stronger umask on log files
  267. * Tue Feb 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-9
  268. - fix source0 location
  269. * Tue Feb 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-8
  270. - change /etc/dbmail.conf to mode 0600
  271. - remove README.solaris, create README.fedora
  272. - add ref to README.fedora in %%desc
  273. * Tue Feb 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-7
  274. - make macro tests a little more readable
  275. - change dbmail-database to dbmail-database-driver; more descriptive
  276. - reduce gmime reqs to 2.1.19
  277. - specify sqlite req at 3 or greater
  278. * Sun Feb 18 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-6
  279. - remove bogus require for main package on mysql
  280. - virtual depend with exact %%{version}-%%{release}
  281. - remove extra mysql-devel BR
  282. - update description to include sqlite if built with sqlite
  283. - for mysql, 4.1.3 is required, not just 4.1
  284. - add requires for vixie-cron
  285. - move database specific docs to database subpackages
  286. * Sun Feb 18 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-5
  287. - fix perms on man pages
  288. * Sat Feb 17 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-4
  289. - fix a few things in scriptlets for consistency
  290. - send error output from logrotate HUP to /dev/null
  291. - explicitly require initscripts since they all use the daemon function
  292. - use explicit %%{version}-%%{release} for provides
  293. * Mon Feb 05 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-3
  294. - fix typo in logrotate script
  295. - patch umask for log files to be something more reasonable
  296. * Sat Jan 31 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-2
  297. - add some conditionals for not building sqlite on some product releases
  298. - substitude \t for tab in sed so that rpmlint doesn't complain about mixing
  299. tabs and spaces
  300. * Sat Jan 31 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-1
  301. - add logrotate for dbmail.err
  302. - sub packages depend on %%{version}-%%{release}
  303. - update to 2.2.2
  304. - remove mailbox2dbmail patch
  305. - translate tabs to space in dbmail.conf
  306. - remove errno race patch
  307. * Sat Jan 13 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-7
  308. - revert to older fedora-usermgmt macros so rpm will work with older os
  309. * Fri Jan 12 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-6
  310. - add patch to fix errno race condition
  311. - don't delete libsort_sieve.so, it's a module
  312. * Thu Dec 14 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-5
  313. - fix my local svn that caused x bit on init files to sneak in
  314. * Thu Dec 14 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-4
  315. - cleanup of spec file
  316. - use fedora-usermgmt hooks
  317. - split and build all database libraries
  318. - kill modules/.libs from the module load path
  319. * Tue Dec 05 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-3
  320. - leave the right .so files for modules
  321. * Mon Nov 27 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-2
  322. - update with Fedora Extras style spec file
  323. * Sat Nov 18 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-1.sc
  324. - version 2.2.1
  325. * Mon Nov 15 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.0-4.sc
  326. - release 2.2.0-1.sc