[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rpm progress ;-)



Mads Kiilerich wrote, On 11/10/2006 11:46 PM:
I have attached a new ledgersmb.spec file, tested with the svn version

I really did try to remember to attach it...

/Mads

# RPM spec written for and tested on Fedora Core 6
Summary: LedgerSMB - Open Source accounting software
Name: ledger-smb
Version: svn
Release: 1
License: GPL
URL: http://www.ledgersmb.org/
Group: Applications/Office
Source0: http://prdownloads.sourceforge.net/ledger-smb/%{name}-%{version}.tar.gz
Source1: Class-Std-v0.0.8.tar.gz   
Source2: Config-Std-v0.0.4.tar.gz  
Source3: Locale-Maketext-Lexicon-0.62.tar.gz  
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
Requires: perl >= 5.8, httpd, postgresql-server >= 8.1, tetex-latex
Requires: perl-DBD-Pg, perl-DBI, perl-version, perl-Smart-Comments, perl-MIME-Lite
BuildRequires: perl
# avoid bogus autodetection of perl modules:
AutoReqProv: no 


%description
LedgerSMB is a double-entry accounting system written in perl.
LedgerSMB is a fork of sql-ledger offering better security and data integrity, 
and many advanced features.

This package does not work in SELinux restricted mode.

To finalize the ledger-smb installation:

Start the PostgreSQL service, let /var/lib/pgsql/data/pg_hba.conf start with:
local   all         postgres                          ident sameuser
local   all         all                               md5
host    all         all         127.0.0.1/32          md5
(Remember to restart PostgreSQL.)

In %{_sysconfdir}/%{name}/ledger-smb.conf set DBPassword to something
and create the ledgersmb master user and database:
su - postgres -c "createuser -d ledgersmb --createdb --createrole --superuser -P"
su - postgres -c "createdb ledgersmb"
su - postgres -c "createlang plpgsql ledgersmb"
su - postgres -c "psql ledgersmb < %{_libdir}/%{name}/sql/Pg-central.sql"
Bleeding edge hint: Set password to avoid bogus web prompt:
su - postgres -c "psql ledgersmb -c \"update users_conf set password = md5('yada') where id = 1;\""

Visit http://localhost/ledger-smb/admin.pl with password "yada" and create an
application database and users.


%prep
%setup -q -n ledger-smb

# Include code from perl packages not available in the standard distribution
mkdir .tmperl
cd .tmperl
tar xzf %SOURCE1
tar xzf %SOURCE2
tar xzf %SOURCE3
mv */lib/* ..


%build

# Fix sample httpd.conf to be usable
perl -pi -e "s,/some/path/to/ledger-smb,%{_libdir}/%{name},g" ledger-smb-httpd.conf


%install

rm -rf $RPM_BUILD_ROOT
mkdir -p -m0755 $RPM_BUILD_ROOT%{_libdir}/%{name} # /usr/lib/ledger-smb - readonly code and cgi directory
mkdir -p -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name} # /etc/ledger-smb - configs
mkdir -p -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} # /var/lib/ledger-smb - data files, modified by cgi
mkdir -p -m0755 $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} # /var/spool/ledger-smb - spool files, modified by cgi

# the conf, placed in etc, symlinked back in place
mv ledger-smb.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/ledger-smb/ledger-smb.conf
ln -s ../../..%{_sysconfdir}/ledger-smb/ledger-smb.conf \
  $RPM_BUILD_ROOT%{_libdir}/%{name}/ledger-smb.conf

# install relevant parts in data/cgi directory
cp -rp *.pl favicon.ico index.html ledger-smb.gif ledger-smb.png ledger-smb_small.png menu.ini \
  bin LedgerSMB sql utils locale drivers \
  Config Class Locale \
  $RPM_BUILD_ROOT%{_libdir}/%{name}/
rm $RPM_BUILD_ROOT%{_libdir}/%{name}/{setup.pl,SL2LS.pl} # FIXME - install somewhere else...

# users - written to by cgi
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/users
ln -s ../../..%{_localstatedir}/lib/%{name}/users \
  $RPM_BUILD_ROOT%{_libdir}/%{name}/users

# css - written to by cgi
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/css
ln -s ../../..%{_localstatedir}/lib/%{name}/css \
 $RPM_BUILD_ROOT%{_libdir}/%{name}/css
cp -rp css/* \
 $RPM_BUILD_ROOT%{_libdir}/%{name}/css

# templates - written to by cgi
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/templates
ln -s ../../..%{_localstatedir}/lib/%{name}/templates \
 $RPM_BUILD_ROOT%{_libdir}/%{name}/templates
cp -rp templates/* \
 $RPM_BUILD_ROOT%{_libdir}/%{name}/templates

# spool - written to by cgi
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
ln -s ../../..%{_localstatedir}/spool/%{name} \
 $RPM_BUILD_ROOT%{_libdir}/%{name}/spool

# apache config file
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
install -m 644 ledger-smb-httpd.conf \
 $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)

%{_libdir}/%{name}
%attr(0700, apache, apache) %config(noreplace) %{_localstatedir}/lib/%{name}
%attr(0700, apache, apache) %dir %{_localstatedir}/spool/%{name}

%attr(0750, root, apache) %dir %{_sysconfdir}/%{name}
%attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/%{name}/*
%attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf

%doc doc/{COPYRIGHT,LedgerSMB-manual.pdf,README,faq.html,release_notes}
%doc LICENSE README.sql-ledger README.translations TODO Changelog CONTRIBUTORS


%changelog
* Fri Nov 10 2006  <..hidden..> - 1.2 alpha
- Updating towards 1.2

* Wed Oct 18 2006 Mads Kiilerich <..hidden..> - 1.1.1d-1
- Initial version