summaryrefslogtreecommitdiff
path: root/dists/rpm/ledgersmb.spec
blob: 4a0ba630e38fd0740efdae385cb21eb07eeddf0f (plain)
  1. # RPM spec written for and tested on CentOS 4 and CentOS 5
  2. Summary: LedgerSMB - Open Source accounting software
  3. Name: ledgersmb
  4. Version: 1.2.11
  5. Release: 1
  6. License: GPL
  7. URL: http://www.ledgersmb.org/
  8. Group: Applications/Productivity
  9. Source0: %{name}-%{version}.tar.gz
  10. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  11. BuildArch: noarch
  12. Requires: perl >= 5.8, httpd, postgresql >= 8.1, tetex-latex
  13. Requires: perl-DBD-Pg, perl-DBI >= 1.48, perl-version, perl-Smart-Comments
  14. Requires: perl-MIME-Lite, perl-Class-Std >= 0.0.8
  15. Requires: perl-Config-Std >= 0.0.4, perl-Locale-Maketext-Lexicon >= 0.62
  16. BuildRequires: perl
  17. # avoid bogus autodetection of perl modules:
  18. AutoReqProv: no
  19. %description
  20. LedgerSMB is a double-entry accounting system written in perl.
  21. LedgerSMB is a fork of sql-ledger offering better security and data integrity,
  22. and many advanced features.
  23. This package does not work in SELinux restricted mode.
  24. To finalize the ledgersmb installation:
  25. Enable local password autentication in PosgreSQL, leaving ident login for the
  26. postgres user:
  27. - Start PostgreSQL to create database instance (service postgres start)
  28. - Let /var/lib/pgsql/data/pg_hba.conf start with:
  29. local all postgres ident sameuser
  30. local all all md5
  31. host all all 127.0.0.1/32 md5
  32. - Restart PostgreSQL to apply changes (service postgres restart)
  33. In %{_sysconfdir}/%{name}/ledgersmb.conf set DBPassword to something
  34. and create the ledgersmb master user and database:
  35. su - postgres -c "createuser -d ledgersmb --createdb --superuser -P"
  36. su - postgres -c "createdb ledgersmb"
  37. su - postgres -c "createlang plpgsql ledgersmb"
  38. su - postgres -c "psql ledgersmb < %{_datadir}/%{name}/sql/Pg-central.sql"
  39. Bleeding edge hint: Set password to avoid bogus web prompt:
  40. su - postgres -c "psql ledgersmb -c \"update users_conf set password = md5('yada') where id = 1;\""
  41. Visit http://localhost/ledgersmb/admin.pl with password "yada" and create an
  42. application database and users.
  43. %prep
  44. %setup -q -n ledgersmb
  45. chmod 0644 $(find . -type f)
  46. chmod 0755 $(find . -type d)
  47. chmod +x *.pl
  48. chmod -x pos.conf.pl custom.pl # FIXME: Config???
  49. chmod +x utils/*/*.pl utils/devel/find-use utils/pos/pos-hardware-client-startup-script
  50. %build
  51. cat << TAK > rpm-ledgersmb-httpd.conf
  52. Alias /ledgersmb/doc/LedgerSMB-manual.pdf %{_docdir}/%{name}-%{version}/LedgerSMB-manual.pdf
  53. <Files %{_docdir}/%{name}-%{version}/LedgerSMB-manual.pdf>
  54. </Files>
  55. TAK
  56. perl -p -e "s,/some/path/to/ledgersmb,%{_datadir}/%{name},g" ledgersmb-httpd.conf >> rpm-ledgersmb-httpd.conf
  57. %install
  58. rm -rf $RPM_BUILD_ROOT
  59. mkdir -p -m0755 $RPM_BUILD_ROOT%{_datadir}/%{name} # /usr/lib/ledgersmb - readonly code and cgi directory
  60. mkdir -p -m0750 $RPM_BUILD_ROOT%{_sysconfdir}/%{name} # /etc/ledgersmb - configs
  61. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} # /var/lib/ledgersmb - data files, modified by cgi
  62. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} # /var/spool/ledgersmb - spool files, modified by cgi
  63. # the conf, placed in etc, symlinked back in place
  64. mv ledgersmb.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/ledgersmb/ledgersmb.conf
  65. ln -s ../../..%{_sysconfdir}/ledgersmb/ledgersmb.conf \
  66. $RPM_BUILD_ROOT%{_datadir}/%{name}/ledgersmb.conf
  67. # install relevant parts in data/cgi directory
  68. cp -rp *.pl favicon.ico index.html ledger-smb.eps ledger-smb.gif ledger-smb.png ledger-smb_small.png menu.ini \
  69. bin LedgerSMB sql utils locale drivers \
  70. $RPM_BUILD_ROOT%{_datadir}/%{name}/
  71. rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/locale/legacy
  72. # css - written to by cgi
  73. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/css
  74. ln -s ../../..%{_localstatedir}/lib/%{name}/css \
  75. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  76. cp -rp css/* \
  77. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  78. # templates - written to by cgi
  79. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/templates
  80. ln -s ../../..%{_localstatedir}/lib/%{name}/templates \
  81. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  82. cp -rp templates/* \
  83. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  84. # spool - written to by cgi
  85. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
  86. ln -s ../../..%{_localstatedir}/spool/%{name} \
  87. $RPM_BUILD_ROOT%{_datadir}/%{name}/spool
  88. # apache config file
  89. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
  90. install -m 644 rpm-ledgersmb-httpd.conf \
  91. $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ledgersmb.conf
  92. %clean
  93. rm -rf $RPM_BUILD_ROOT
  94. %files
  95. %defattr(-,root,root)
  96. %{_datadir}/%{name}
  97. %attr(-, apache, apache) %config(noreplace) %{_localstatedir}/lib/%{name}
  98. %attr(-, apache, apache) %dir %{_localstatedir}/spool/%{name}
  99. %attr(0750, root, apache) %dir %{_sysconfdir}/%{name}
  100. %attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/%{name}/*
  101. %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
  102. %doc doc/{COPYRIGHT,faq.html,LedgerSMB-manual.pdf,README,release_notes}
  103. %doc BUGS Changelog CONTRIBUTORS INSTALL LICENSE README.translations TODO UPGRADE
  104. %changelog
  105. * Mon Dec 31 2007 Christopher Murtagh <cmurtagh@ledgersmb.org> - 1.2.11
  106. - updating to 1.2.11
  107. - removing users directory
  108. * Wed Jun 13 2007 David Fetter <david@fetter.org> 1.25-2
  109. - Updated to 1.25
  110. - Use perl-* RPM packages rather than bundling them
  111. * Fri Nov 10 2006 Mads Kiilerich <mads@kiilerich.com> - 1.2-alpha
  112. - Updating towards 1.2
  113. * Wed Oct 18 2006 Mads Kiilerich <mads@kiilerich.com> - 1.1.1d-1
  114. - Initial version