dbmail-vl.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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.18
  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: 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. * Sat Jun 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2.18-1
  182. - update to 2.2.18
  183. * Sun Apr 11 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2.15-1
  184. - new upstream release
  185. - add BuildRequires: zlib-devel
  186. - change BuildRequires: gmime-devel -> gmime22-devel
  187. - drop Patch0
  188. * Mon Sep 14 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.11-1
  189. - initial build for Vine Linux
  190. * Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.2.11-9
  191. - rebuilt with new openssl
  192. * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.11-8
  193. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  194. * Mon Jul 06 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-7
  195. - fix left out ? in comparison
  196. * Sun Jul 05 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-6
  197. - fix conditional comparison to be 0 for no value
  198. * Sun Jul 05 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-5
  199. - patch to remove duplicate email boxes from being listed
  200. - consider cron file a config file
  201. - add -b option to cron job to rebuild body/header/envelope cache tables
  202. - change order of redirection in cron job
  203. - fix typo in dbmail-pop3d that causes LSB info to not be recognized
  204. - add provides for dbmail-sqlite
  205. - conditional to compile with gmime22 when needed
  206. * Thu Mar 19 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-4
  207. - build agaist old gmime22 (bz #490316)
  208. * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.11-3
  209. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  210. * Thu Feb 05 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-2
  211. - change BR from openssl to openssl-devel
  212. * Tue Feb 03 2009 Bernard Johnson <bjohnson@symetrix.com> - 2.2.11-1
  213. - v 2.2.11
  214. - updated summaries
  215. - fix bug in dbmail-pop3d init script
  216. * Mon Jul 7 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.9-2
  217. - fix conditional comparison
  218. * Thu Apr 24 2008 Bernard Johnson <bjohnson@symetrix.com> - 2.2.9-1
  219. - v 2.2.9
  220. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2.8-2
  221. - Autorebuild for GCC 4.3
  222. * Fri Jan 18 2008 Bernard Johnson <bjohnson@symetrix.com> - 2.2.8-1
  223. - 2.2.8-1
  224. * Thu Dec 06 2007 Release Engineering <rel-eng at fedoraproject dot org> - 2.2.7-2
  225. - Rebuild for deps
  226. * Wed Oct 31 2007 Bernard Johnson <bjohnson@symetrix.com> - 2.2.7-1
  227. - 2.2.7-1
  228. - removed unused thread references patch
  229. - removed unused hup patch
  230. - removed unused gmime segv patch
  231. - license clarification
  232. - dbmail: Initscript Review (bz #246901)
  233. * Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.2.5-7
  234. - Rebuild for selinux ppc32 issue.
  235. * Tue Jul 03 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-6
  236. - patch to fix SEGV in dbmail-imapd
  237. * Sat Jun 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-5
  238. - patch to reopen logs files on -HUP
  239. - patch to send error when thread references requested
  240. - don't filter libdbmail.so*
  241. * Sat Jun 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-4
  242. - kill ld.so config
  243. - filter private libraries from provides (bz#245326)
  244. * Wed Jun 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-3
  245. - assign uid from package user registry (bz#244611)
  246. * Tue Jun 05 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-2
  247. - fix %%setup directory
  248. * Tue Jun 05 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-1
  249. - 2.2.5
  250. - change method of restarting daemons to that suggested in dbmail bug #600
  251. * Wed May 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.5-0.1.rc3
  252. - update to svn 2.2.5rc3
  253. - remove unneccessary patches
  254. - make sqlite default driver for better out of the box experience
  255. * Thu Mar 23 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-4
  256. - actually APPLY the short write patch
  257. * Thu Mar 22 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-3
  258. - patch to eliminate short write messages
  259. - use /sbin/service instead of running init scripts directly
  260. - requires for initscripts because daemon function in initfile requires it
  261. - modern tarballs do not require xmlto and asciidoc to build the docs
  262. - change conditionals to give everything sqlite support unless it's built in
  263. the fedora buildsystem and %%{fedora} < 4
  264. * Tue Mar 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-2
  265. - patch to fix expunge bug
  266. * Tue Mar 13 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.4-1
  267. - v. 2.2.4
  268. - remove umask patch as it's included upstream now
  269. * Wed Feb 28 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.3-1
  270. - v. 2.2.3
  271. - tab removal in dbmail.conf no longer required
  272. - libsqlite.so in not built anymore unless specified, remove fix
  273. - libauth-ldap.so wasn't be built properly, fixed
  274. - rework umask patch, still want a stronger umask on log files
  275. * Tue Feb 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-9
  276. - fix source0 location
  277. * Tue Feb 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-8
  278. - change /etc/dbmail.conf to mode 0600
  279. - remove README.solaris, create README.fedora
  280. - add ref to README.fedora in %%desc
  281. * Tue Feb 20 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-7
  282. - make macro tests a little more readable
  283. - change dbmail-database to dbmail-database-driver; more descriptive
  284. - reduce gmime reqs to 2.1.19
  285. - specify sqlite req at 3 or greater
  286. * Sun Feb 18 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-6
  287. - remove bogus require for main package on mysql
  288. - virtual depend with exact %%{version}-%%{release}
  289. - remove extra mysql-devel BR
  290. - update description to include sqlite if built with sqlite
  291. - for mysql, 4.1.3 is required, not just 4.1
  292. - add requires for vixie-cron
  293. - move database specific docs to database subpackages
  294. * Sun Feb 18 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-5
  295. - fix perms on man pages
  296. * Sat Feb 17 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-4
  297. - fix a few things in scriptlets for consistency
  298. - send error output from logrotate HUP to /dev/null
  299. - explicitly require initscripts since they all use the daemon function
  300. - use explicit %%{version}-%%{release} for provides
  301. * Mon Feb 05 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-3
  302. - fix typo in logrotate script
  303. - patch umask for log files to be something more reasonable
  304. * Sat Jan 31 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-2
  305. - add some conditionals for not building sqlite on some product releases
  306. - substitude \t for tab in sed so that rpmlint doesn't complain about mixing
  307. tabs and spaces
  308. * Sat Jan 31 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.2-1
  309. - add logrotate for dbmail.err
  310. - sub packages depend on %%{version}-%%{release}
  311. - update to 2.2.2
  312. - remove mailbox2dbmail patch
  313. - translate tabs to space in dbmail.conf
  314. - remove errno race patch
  315. * Sat Jan 13 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-7
  316. - revert to older fedora-usermgmt macros so rpm will work with older os
  317. * Fri Jan 12 2007 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-6
  318. - add patch to fix errno race condition
  319. - don't delete libsort_sieve.so, it's a module
  320. * Thu Dec 14 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-5
  321. - fix my local svn that caused x bit on init files to sneak in
  322. * Thu Dec 14 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-4
  323. - cleanup of spec file
  324. - use fedora-usermgmt hooks
  325. - split and build all database libraries
  326. - kill modules/.libs from the module load path
  327. * Tue Dec 05 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-3
  328. - leave the right .so files for modules
  329. * Mon Nov 27 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-2
  330. - update with Fedora Extras style spec file
  331. * Sat Nov 18 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.1-1.sc
  332. - version 2.2.1
  333. * Mon Nov 15 2006 Bernard Johnson <bjohnson@symetrix.com> 2.2.0-4.sc
  334. - release 2.2.0-1.sc