summaryrefslogtreecommitdiff
path: root/dists/rpm/ledgersmb.spec
blob: 67bb53e4ea59ad4134c1ab96702547fa11d91c94 (plain)
  1. # RPM spec written for and tested on Fedora Core 6
  2. Summary: LedgerSMB - Open Source accounting software
  3. Name: ledgersmb
  4. Version: 1.2.5
  5. Release: 2
  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. # users - written to by cgi
  73. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/users
  74. ln -s ../../..%{_localstatedir}/lib/%{name}/users \
  75. $RPM_BUILD_ROOT%{_datadir}/%{name}/users
  76. # css - written to by cgi
  77. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/css
  78. ln -s ../../..%{_localstatedir}/lib/%{name}/css \
  79. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  80. cp -rp css/* \
  81. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  82. # templates - written to by cgi
  83. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/templates
  84. ln -s ../../..%{_localstatedir}/lib/%{name}/templates \
  85. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  86. cp -rp templates/* \
  87. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  88. # spool - written to by cgi
  89. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
  90. ln -s ../../..%{_localstatedir}/spool/%{name} \
  91. $RPM_BUILD_ROOT%{_datadir}/%{name}/spool
  92. # apache config file
  93. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
  94. install -m 644 rpm-ledgersmb-httpd.conf \
  95. $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ledgersmb.conf
  96. %clean
  97. rm -rf $RPM_BUILD_ROOT
  98. %files
  99. %defattr(-,root,root)
  100. %{_datadir}/%{name}
  101. %attr(-, apache, apache) %config(noreplace) %{_localstatedir}/lib/%{name}
  102. %attr(-, apache, apache) %dir %{_localstatedir}/spool/%{name}
  103. %attr(0750, root, apache) %dir %{_sysconfdir}/%{name}
  104. %attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/%{name}/*
  105. %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
  106. %doc doc/{COPYRIGHT,faq.html,LedgerSMB-manual.pdf,README,release_notes}
  107. %doc BUGS Changelog CONTRIBUTORS INSTALL LICENSE README.translations TODO UPGRADE
  108. %changelog
  109. * Wed Jun 13 2007 David Fetter <david@fetter.org> 1.25-2
  110. - Updated to 1.25
  111. - Use perl-* RPM packages rather than bundling them
  112. * Fri Nov 10 2006 Mads Kiilerich <mads@kiilerich.com> - 1.2-alpha
  113. - Updating towards 1.2
  114. * Wed Oct 18 2006 Mads Kiilerich <mads@kiilerich.com> - 1.1.1d-1
  115. - Initial version