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