James McDonald wrote, On 04/05/2008 08:01 AM:
Mads Kiilerich wrote:For 1.2.11 that was changed with the reason that "Extra perl packages are now available in rpmforge". AFAICS that isn't documented anywhere. Rpmforge is rpmforge.net, which now is about to merge with rpmrepo.org. (FWIW I preferred the old approach as I don't like to depend on externel repositories.)I concur. If you configure a Linux box for work purposes, adding external repositories may be a security risk. For example; any packages
Yeah, yeah, (don't) tell me about it.I have (re)updated the spec so that it works on Fedora 8 with all non-standard dependencies included. The spec probably won't work on CentOS as it is.
I suggest that this f8 spec is added to dists/rpm. The specs have different goals, so merging them isn't a good idea.
(I have tried to test the rpm, but different issues prevented it from being successful)
/Mads
# RPM spec written for and tested on Fedora 8 # Non-standard dependencies are included in the rpm %define configstd Config-Std-v0.0.4 %define classstd Class-Std-v0.0.8 Summary: LedgerSMB - Open Source accounting software Name: ledgersmb Version: 1.2.13 Release: 2 License: GPL URL: http://www.ledgersmb.org/ Group: Applications/Productivity Source0: %{name}-%{version}.tar.gz Source2: http://www.cpan.org/modules/by-module/Config/%{configstd}.tar.gz Source3: http://www.cpan.org/modules/by-module/Class/%{classstd}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildArch: noarch Requires: perl >= 5.8, httpd, postgresql >= 8.1, tetex-latex Requires: perl-MIME-Lite Requires: perl-Locale-Maketext-Lexicon >= 0.62 BuildRequires: perl, perl-ExtUtils-MakeMaker # 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 ledgersmb installation, assuming local database server with postgresql-server installed: - Create database instance () by running "service postgresql initdb" - Enable local password autentication in PosgreSQL while keeping ident login for the postgres user by editing /var/lib/pgsql/data/pg_hba.conf to start with: local all postgres ident sameuser local all all md5 host all all 127.0.0.1/32 md5 - Restart PostgreSQL to apply changes by running "service postgresql restart" In %{_sysconfdir}/%{name}/ledgersmb.conf set DBPassword to something and create the ledgersmb master user with this password and database: su - postgres -c "createuser -d ledgersmb --createdb --superuser -P" su - postgres -c "createdb ledgersmb" su - postgres -c "createlang plpgsql ledgersmb" su - postgres -c "psql ledgersmb < %{_datadir}/%{name}/sql/Pg-central.sql" Set initial password for admin logon: su - postgres -c "psql ledgersmb -c \"update users_conf set password = md5('yada') where id = 1;\"" Ensure that Apache httpd is properly running / restarted by running "service httpd restart". Visit http://localhost/ledgersmb/admin.pl with password "yada" and create an application database and users. %prep %setup -q -n ledgersmb find . -type f | xargs chmod 0644 find . -type d | xargs chmod 0755 chmod +x *.pl chmod -x pos.conf.pl custom.pl # FIXME: Config??? chmod +x utils/*/*.pl utils/devel/find-use utils/pos/pos-hardware-client-startup-script mkdir modules tar -xf %{SOURCE2} -C modules tar -xf %{SOURCE3} -C modules %build cat << TAK > rpm-ledgersmb-httpd.conf Alias /ledgersmb/doc/LedgerSMB-manual.pdf %{_docdir}/%{name}-%{version}/LedgerSMB-manual.pdf <Files %{_docdir}/%{name}-%{version}/LedgerSMB-manual.pdf> </Files> TAK perl -p -e "s,WORKING_DIR,%{_datadir}/%{name},g" ledgersmb-httpd.conf >> rpm-ledgersmb-httpd.conf pushd modules/%{configstd} %{__perl} Makefile.PL PREFIX="%{buildroot}%{_datadir}/%{name}" LIB="%{buildroot}%{_datadir}/%{name}" %{__make} %{?_smp_mflags} OPTIMIZE="%{optflags}" popd pushd modules/%{classstd} %{__perl} Makefile.PL PREFIX="%{buildroot}%{_datadir}/%{name}" LIB="%{buildroot}%{_datadir}/%{name}" %{__make} %{?_smp_mflags} OPTIMIZE="%{optflags}" popd %install rm -rf $RPM_BUILD_ROOT mkdir -p -m0755 $RPM_BUILD_ROOT%{_datadir}/%{name} # /usr/lib/ledgersmb - readonly code and cgi directory mkdir -p -m0750 $RPM_BUILD_ROOT%{_sysconfdir}/%{name} # /etc/ledgersmb - configs mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} # /var/lib/ledgersmb - data files, modified by cgi mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} # /var/spool/ledgersmb - spool files, modified by cgi # the conf, placed in etc, symlinked back in place mv ledgersmb.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/ledgersmb/ledgersmb.conf ln -s ../../..%{_sysconfdir}/ledgersmb/ledgersmb.conf \ $RPM_BUILD_ROOT%{_datadir}/%{name}/ledgersmb.conf # install relevant parts in data/cgi directory cp -rp *.pl favicon.ico index.html ledger-smb.eps ledger-smb.gif ledger-smb.png ledger-smb_small.png menu.ini \ bin LedgerSMB sql utils locale drivers \ $RPM_BUILD_ROOT%{_datadir}/%{name}/ rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/locale/legacy # css - written to by cgi mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/css ln -s ../../..%{_localstatedir}/lib/%{name}/css \ $RPM_BUILD_ROOT%{_datadir}/%{name}/css cp -rp css/* \ $RPM_BUILD_ROOT%{_datadir}/%{name}/css # templates - written to by cgi mkdir -p -m0750 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/templates ln -s ../../..%{_localstatedir}/lib/%{name}/templates \ $RPM_BUILD_ROOT%{_datadir}/%{name}/templates cp -rp templates/* \ $RPM_BUILD_ROOT%{_datadir}/%{name}/templates # spool - written to by cgi mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} ln -s ../../..%{_localstatedir}/spool/%{name} \ $RPM_BUILD_ROOT%{_datadir}/%{name}/spool # apache config file mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d install -m 644 rpm-ledgersmb-httpd.conf \ $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ledgersmb.conf pushd modules/%{configstd} %makeinstall popd pushd modules/%{classstd} %makeinstall popd %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_datadir}/%{name} %attr(-, apache, apache) %config(noreplace) %{_localstatedir}/lib/%{name} %attr(-, apache, apache) %dir %{_localstatedir}/spool/%{name} %attr(0750, root, apache) %dir %{_sysconfdir}/%{name} %attr(0640, root, apache) %config(noreplace) %{_sysconfdir}/%{name}/* %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf %doc doc/{COPYRIGHT,faq.html,LedgerSMB-manual.pdf,README,release_notes} %doc BUGS Changelog CONTRIBUTORS INSTALL LICENSE README.translations TODO UPGRADE %changelog * Mon Dec 31 2007 Christopher Murtagh <..hidden..> - 1.2.11 - updating to 1.2.11 - removing users directory * Wed Jun 13 2007 David Fetter <..hidden..> 1.25-2 - Updated to 1.25 - Use perl-* RPM packages rather than bundling them * Fri Nov 10 2006 Mads Kiilerich <..hidden..> - 1.2-alpha - Updating towards 1.2 * Wed Oct 18 2006 Mads Kiilerich <..hidden..> - 1.1.1d-1 - Initial version
--- ledgersmb.spec.org 2008-04-05 12:44:00.000000000 +0200 +++ ledgersmb-f8.spec 2008-04-05 14:52:14.000000000 +0200 @@ -1,19 +1,25 @@ -# RPM spec written for and tested on CentOS 4, CentOS 5 +# RPM spec written for and tested on Fedora 8 +# Non-standard dependencies are included in the rpm + +%define configstd Config-Std-v0.0.4 +%define classstd Class-Std-v0.0.8 + Summary: LedgerSMB - Open Source accounting software Name: ledgersmb Version: 1.2.13 -Release: 1 +Release: 2 License: GPL URL: http://www.ledgersmb.org/ Group: Applications/Productivity Source0: %{name}-%{version}.tar.gz +Source2: http://www.cpan.org/modules/by-module/Config/%{configstd}.tar.gz +Source3: http://www.cpan.org/modules/by-module/Class/%{classstd}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildArch: noarch Requires: perl >= 5.8, httpd, postgresql >= 8.1, tetex-latex -Requires: perl-DBD-Pg, perl-DBI >= 1.48, perl-version, perl-Smart-Comments -Requires: perl-MIME-Lite, perl-Class-Std >= 0.0.8 -Requires: perl-Config-Std >= 0.0.4, perl-Locale-Maketext-Lexicon >= 0.62 -BuildRequires: perl +Requires: perl-MIME-Lite +Requires: perl-Locale-Maketext-Lexicon >= 0.62 +BuildRequires: perl, perl-ExtUtils-MakeMaker # avoid bogus autodetection of perl modules: AutoReqProv: no @@ -25,26 +31,29 @@ This package does not work in SELinux restricted mode. -To finalize the ledgersmb installation: +To finalize the ledgersmb installation, assuming local database server with +postgresql-server installed: -Enable local password autentication in PosgreSQL, leaving ident login for the -postgres user: -- Start PostgreSQL to create database instance (service postgres start) -- Let /var/lib/pgsql/data/pg_hba.conf start with: +- Create database instance () by running "service postgresql initdb" +- Enable local password autentication in PosgreSQL while keeping ident login for the + postgres user by editing /var/lib/pgsql/data/pg_hba.conf to start with: local all postgres ident sameuser local all all md5 host all all 127.0.0.1/32 md5 -- Restart PostgreSQL to apply changes (service postgres restart) +- Restart PostgreSQL to apply changes by running "service postgresql restart" In %{_sysconfdir}/%{name}/ledgersmb.conf set DBPassword to something -and create the ledgersmb master user and database: +and create the ledgersmb master user with this password and database: su - postgres -c "createuser -d ledgersmb --createdb --superuser -P" su - postgres -c "createdb ledgersmb" su - postgres -c "createlang plpgsql ledgersmb" su - postgres -c "psql ledgersmb < %{_datadir}/%{name}/sql/Pg-central.sql" -Bleeding edge hint: Set password to avoid bogus web prompt: + +Set initial password for admin logon: su - postgres -c "psql ledgersmb -c \"update users_conf set password = md5('yada') where id = 1;\"" +Ensure that Apache httpd is properly running / restarted by running "service httpd restart". + Visit http://localhost/ledgersmb/admin.pl with password "yada" and create an application database and users. @@ -52,12 +61,15 @@ %prep %setup -q -n ledgersmb -chmod 0644 $(find . -type f) -chmod 0755 $(find . -type d) +find . -type f | xargs chmod 0644 +find . -type d | xargs chmod 0755 chmod +x *.pl chmod -x pos.conf.pl custom.pl # FIXME: Config??? chmod +x utils/*/*.pl utils/devel/find-use utils/pos/pos-hardware-client-startup-script +mkdir modules +tar -xf %{SOURCE2} -C modules +tar -xf %{SOURCE3} -C modules %build @@ -68,8 +80,16 @@ TAK -perl -p -e "s,/some/path/to/ledgersmb,%{_datadir}/%{name},g" ledgersmb-httpd.conf >> rpm-ledgersmb-httpd.conf +perl -p -e "s,WORKING_DIR,%{_datadir}/%{name},g" ledgersmb-httpd.conf >> rpm-ledgersmb-httpd.conf +pushd modules/%{configstd} +%{__perl} Makefile.PL PREFIX="%{buildroot}%{_datadir}/%{name}" LIB="%{buildroot}%{_datadir}/%{name}" +%{__make} %{?_smp_mflags} OPTIMIZE="%{optflags}" +popd +pushd modules/%{classstd} +%{__perl} Makefile.PL PREFIX="%{buildroot}%{_datadir}/%{name}" LIB="%{buildroot}%{_datadir}/%{name}" +%{__make} %{?_smp_mflags} OPTIMIZE="%{optflags}" +popd %install @@ -114,6 +134,13 @@ install -m 644 rpm-ledgersmb-httpd.conf \ $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ledgersmb.conf +pushd modules/%{configstd} +%makeinstall +popd +pushd modules/%{classstd} +%makeinstall +popd + %clean rm -rf $RPM_BUILD_ROOT
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature