dbmail-vl.spec 14 KB

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