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