summaryrefslogtreecommitdiff
path: root/dists/rpm/spec
blob: 5d6bb47d737d7612636d19f9d3b8eb98c26faec7 (plain)
  1. Summary: LedgerSMB - Open Source accounting software
  2. Name: ledger-smb
  3. Version: 1.1.1d
  4. Release: 1
  5. License: GPL
  6. URL: http://www.ledgersmb.org/
  7. Group: Applications/Office
  8. Source0: http://prdownloads.sourceforge.net/ledger-smb/%{name}-%{version}.tar.gz
  9. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  10. BuildArch: noarch
  11. Requires: perl >= 5.8, httpd, postgresql-server >= 8.1, perl-DBD-Pg, perl-DBI
  12. BuildRequires: perl
  13. AutoReqProv: no
  14. %description
  15. LedgerSMB is a double-entry accounting system written in perl.
  16. LedgerSMB is a fork of sql-ledger offering better security and data integrity,
  17. and many advanced features.
  18. SELinux should be disabled to use this RPM.
  19. To finalize the installation:
  20. Start PostgreSQL, let /var/lib/pgsql/data/pg_hba.conf start with
  21. local all postgres ident sameuser
  22. local all all md5
  23. and restart PostgreSQL
  24. Create databaseuser, create database and initialize it
  25. su - postgres -c "createuser -d ledger-smb --no-createdb --no-createrole --no-superuser -P"
  26. (remember the password!)
  27. su - postgres -c "createdb ledger-smb"
  28. su - postgres -c "createlang plpgsql ledger-smb"
  29. Delete the "password" in %{_localstatedir}/lib/%{name}/users/members and
  30. browse http://localhost/ledger-smb/admin.pl and set a ledger-smb master password.
  31. In "Pg Database Administration" the "User" defaults to the database user "ledger-smb"
  32. we just created - specify the password and "Create Dataset".
  33. Set "Create Dataset" to the database "ledger-smb" we just created and continue.
  34. In "Add User" specify the Dataset, User and password again for each user.
  35. %prep
  36. %setup -q -n ledger-smb
  37. %build
  38. # generate .conf from default with fixes
  39. perl -p -e 's,^(\$ENV\{PATH\}),#\1,g' ledger-smb.conf.default > ledger-smb.conf
  40. # fix location
  41. perl -pi -e "s,/usr/local/ledger-smb,%{_datadir}/%{name},g" ledger-smb-httpd.conf
  42. %install
  43. # Most stuff is installed readonly in %{_datadir}/%{name}/
  44. # Some parts are installed other places with other policies and symlinked in place
  45. rm -rf $RPM_BUILD_ROOT
  46. mkdir -p -m0755 $RPM_BUILD_ROOT%{_datadir}/%{name} # /usr/share/ledger-smb - primary and cgi directory
  47. mkdir -p -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name} # /etc/ledger-smb - links to configs
  48. mkdir -p -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} # /var/lib/ledger-smb - data files, modified by cgi
  49. mkdir -p -m0755 $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} # /var/spool/ledger-smb - spool files, modified by cgi
  50. # rm setup.pl SL2LS.pl # FiXME - install somewhere else...
  51. # the executable conf
  52. mv ledger-smb.conf $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/ledger-smb.conf
  53. # link from /etc to our executable conf
  54. ln -s ../..%{_localstatedir}/lib/%{name}/ledger-smb.conf \
  55. $RPM_BUILD_ROOT%{_sysconfdir}/ledger-smb/
  56. # link from cgi stuff to our executable conf
  57. ln -s ../../..%{_localstatedir}/lib/%{name}/ledger-smb.conf \
  58. $RPM_BUILD_ROOT%{_datadir}/%{name}/ledger-smb.conf
  59. #FIXME
  60. # menu.ini is pure configuration
  61. mv menu.ini $RPM_BUILD_ROOT%{_sysconfdir}/ledger-smb/menu.ini
  62. ln -s ../../..%{_sysconfdir}/ledger-smb/menu.ini \
  63. $RPM_BUILD_ROOT%{_datadir}/%{name}/menu.ini
  64. # install forelevant parts in data / cgi directory
  65. cp -rp *.pl favicon.ico index.html ledger-smb.gif ledger-smb.png ledger-smb_small.png menu.ini \
  66. bin LedgerSMB sql utils locale \
  67. $RPM_BUILD_ROOT%{_datadir}/%{name}/
  68. # users - written by cgi
  69. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/users
  70. ln -s ../../..%{_localstatedir}/lib/%{name}/users \
  71. $RPM_BUILD_ROOT%{_datadir}/%{name}/users
  72. cat << TAK > $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/users/members
  73. # LedgerSMB Accounting members
  74. [root login]
  75. password=
  76. TAK
  77. # css - written by cgi
  78. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/css
  79. ln -s ../../..%{_localstatedir}/lib/%{name}/css \
  80. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  81. cp -rp css/* \
  82. $RPM_BUILD_ROOT%{_datadir}/%{name}/css
  83. # templates - written by cgi
  84. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/templates
  85. ln -s ../../..%{_localstatedir}/lib/%{name}/templates \
  86. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  87. cp -rp templates/* \
  88. $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
  89. # spool - written by cgi
  90. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
  91. ln -s ../../..%{_localstatedir}/spool/%{name} \
  92. $RPM_BUILD_ROOT%{_datadir}/%{name}/spool
  93. # install the apache config file
  94. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
  95. install -m 644 ledger-smb-httpd.conf \
  96. $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
  97. %clean
  98. rm -rf $RPM_BUILD_ROOT
  99. %files
  100. %defattr(-,root,root)
  101. %{_datadir}/%{name}
  102. %attr(0700, apache, apache) %config(noreplace) %{_localstatedir}/lib/%{name}
  103. %attr(0700, apache, apache) %dir %{_localstatedir}/spool/%{name}
  104. %attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/ledger-smb
  105. %attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
  106. %doc doc/*
  107. %doc LICENSE README.sql-ledger TODO Changelog CONTRIBUTORS COPYRIGHT
  108. %changelog
  109. * Wed Oct 18 2006 Mads Kiilerich <mads@kiilerich.com> - 1.1.1d-1
  110. - Initial version