summaryrefslogtreecommitdiff
path: root/dists/rpm/ledgersmb.spec
blob: dfef1671bc3d47d200ef3f01615592a6b86d1da9 (plain)
  1. # RPM spec written for and tested on Fedora Core 6
  2. Summary: LedgerSMB - Open Source accounting software
  3. Name: ledger-smb
  4. Version: svn
  5. Release: 1
  6. License: GPL
  7. URL: http://www.ledgersmb.org/
  8. Group: Applications/Productivity
  9. Source0: http://prdownloads.sourceforge.net/ledger-smb/%{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-server >= 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 ledger-smb installation:
  26. Start the PostgreSQL service, let /var/lib/pgsql/data/pg_hba.conf start with:
  27. local all postgres ident sameuser
  28. local all all md5
  29. host all all 127.0.0.1/32 md5
  30. (Remember to restart PostgreSQL.)
  31. In %{_sysconfdir}/%{name}/ledger-smb.conf set DBPassword to something
  32. and create the ledgersmb master user and database:
  33. su - postgres -c "createuser -d ledgersmb --createdb --createrole --superuser -P"
  34. su - postgres -c "createdb ledgersmb"
  35. su - postgres -c "createlang plpgsql ledgersmb"
  36. su - postgres -c "psql ledgersmb < %{_datadir}/%{name}/sql/Pg-central.sql"
  37. Bleeding edge hint: Set password to avoid bogus web prompt:
  38. su - postgres -c "psql ledgersmb -c \"update users_conf set password = md5('yada') where id = 1;\""
  39. Visit http://localhost/ledger-smb/admin.pl with password "yada" and create an
  40. application database and users.
  41. %prep
  42. %setup -q -n ledger-smb
  43. # Include code from perl packages not available in the standard distribution
  44. mkdir .tmperl
  45. cd .tmperl
  46. tar xzf %SOURCE1
  47. tar xzf %SOURCE2
  48. tar xzf %SOURCE3
  49. mv */lib/* ..
  50. cd ..
  51. chmod 0644 $(find . -type f)
  52. chmod 0755 $(find . -type d)
  53. chmod +x *.pl
  54. chmod -x pos.conf.pl custom.pl # FIXME: Config???
  55. chmod +x utils/*/*.pl utils/devel/find-use utils/pos/pos-hardware-client-startup-script
  56. %build
  57. cat << TAK > rpm-ledger-smb-httpd.conf
  58. Alias /ledger-smb/doc/LedgerSMB-manual.pdf %{_docdir}/%{name}-%{version}/LedgerSMB-manual.pdf
  59. <Files %{_docdir}/%{name}-%{version}/LedgerSMB-manual.pdf>
  60. </Files>
  61. TAK
  62. perl -p -e "s,/some/path/to/ledger-smb,%{_datadir}/%{name},g" ledger-smb-httpd.conf >> rpm-ledger-smb-httpd.conf
  63. %install
  64. rm -rf $RPM_BUILD_ROOT
  65. mkdir -p -m0755 $RPM_BUILD_ROOT%{_datadir}/%{name} # /usr/lib/ledger-smb - readonly code and cgi directory
  66. mkdir -p -m0750 $RPM_BUILD_ROOT%{_sysconfdir}/%{name} # /etc/ledger-smb - configs
  67. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} # /var/lib/ledger-smb - data files, modified by cgi
  68. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} # /var/spool/ledger-smb - spool files, modified by cgi
  69. # the conf, placed in etc, symlinked back in place
  70. mv ledger-smb.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/ledger-smb/ledger-smb.conf
  71. ln -s ../../..%{_sysconfdir}/ledger-smb/ledger-smb.conf \
  72. $RPM_BUILD_ROOT%{_datadir}/%{name}/ledger-smb.conf
  73. # install relevant parts in data/cgi directory
  74. cp -rp *.pl favicon.ico index.html ledger-smb.gif ledger-smb.png ledger-smb_small.png menu.ini \
  75. bin LedgerSMB sql utils locale drivers \
  76. Config Class Locale \
  77. $RPM_BUILD_ROOT%{_datadir}/%{name}/
  78. rm $RPM_BUILD_ROOT%{_datadir}/%{name}/{setup.pl,SL2LS.pl} # FIXME - install somewhere else...
  79. rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/locale/legacy
  80. # users - written to by cgi
  81. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/users
  82. ln -s ../../..%{_localstatedir}/lib/%{name}/users \
  83. $RPM_BUILD_ROOT%{_datadir}/%{name}/users
  84. # css - written to by cgi
  85. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/css
  86. ln -s ../../..%{_localstatedir}/lib/%{name}/css \
  87. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  88. cp -rp css/* \
  89. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  90. # templates - written to by cgi
  91. mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/templates
  92. ln -s ../../..%{_localstatedir}/lib/%{name}/templates \
  93. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  94. cp -rp templates/* \
  95. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  96. # spool - written to by cgi
  97. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
  98. ln -s ../../..%{_localstatedir}/spool/%{name} \
  99. $RPM_BUILD_ROOT%{_datadir}/%{name}/spool
  100. # apache config file
  101. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
  102. install -m 644 rpm-ledger-smb-httpd.conf \
  103. $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ledger-smb.conf
  104. %clean
  105. rm -rf $RPM_BUILD_ROOT
  106. %files
  107. %defattr(-,root,root)
  108. %{_datadir}/%{name}
  109. %attr(-, apache, apache) %config(noreplace) %{_localstatedir}/lib/%{name}
  110. %attr(-, apache, apache) %dir %{_localstatedir}/spool/%{name}
  111. %attr(0750, root, apache) %dir %{_sysconfdir}/%{name}
  112. %attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/%{name}/*
  113. %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
  114. %doc doc/{COPYRIGHT,LedgerSMB-manual.pdf,README,faq.html,release_notes}
  115. %doc LICENSE README.sql-ledger README.translations TODO Changelog CONTRIBUTORS
  116. %changelog
  117. * Fri Nov 10 2006 Mads Kiilerich <mads@kiilerich.com> - 1.2 alpha
  118. - Updating towards 1.2
  119. * Wed Oct 18 2006 Mads Kiilerich <mads@kiilerich.com> - 1.1.1d-1
  120. - Initial version