I have the RPM %config macro working for OpenERP configuration files, so now when a user upgrades their RPM, their config files will not be overwritten. The new config file will be written as CONFIGFILE.rpmnew and the user can then merge their existing config file with the new one.
=================================================
add the following files to your tree (contents are posted above):
etc/openerp-server.conf
etc/rc.d/init.d/openerp-server
etc/logrotate.d/openerp-server
add the following directories to your tree:
var/log/openerp
var/spool/openerp
=================================================
add the following lines to MANIFEST.in:
recursive-include etc *
recursive-include var *
=================================================
add the following lines to the end of rpminstall_sh.txt:
CONFIGFILES="\
%config(noreplace) /etc/openerp-server.conf
%config(noreplace) /etc/logrotate.d/openerp-server
%config(noreplace) /etc/rc.d/init.d/openerp-server
"
=================================================
add the following lines to setup.py in data_files() at about line 103: config_directory = opj('/etc') files.append((config_directory, [f for f in glob.glob('etc/*') if os.path.isfile(f)]))
config_directory = opj('/etc', 'logrotate.d') files.append((config_directory, [f for f in glob.glob('etc/logrotate.d/*') if os.path.isfile(f)]))
config_directory = opj('/etc', 'rc.d', 'init.d') files.append((config_directory, [f for f in glob.glob('etc/rc.d/init.d/*') if os.path.isfile(f)]))
work_directory = opj('/var/log/openerp') files.append((work_directory, [f for f in glob.glob('var/log/openerp/*') if os.path.isfile(f)]))
work_directory = opj('/var/spool/openerp') files.append((work_directory, [f for f in glob.glob('var/spool/openerp/*') if os.path.isfile(f)]))
=================================================
end
I have the RPM %config macro working for OpenERP configuration files, so now when a user upgrades their RPM, their config files will not be overwritten. The new config file will be written as CONFIGFILE.rpmnew and the user can then merge their existing config file with the new one.
======= ======= ======= ======= ======= ======= ======= server. conf d/init. d/openerp- server d/openerp- server
add the following files to your tree (contents are posted above):
etc/openerp-
etc/rc.
etc/logrotate.
add the following directories to your tree:
var/log/openerp
var/spool/openerp
======= ======= ======= ======= ======= ======= =======
add the following lines to MANIFEST.in:
recursive-include etc *
recursive-include var *
======= ======= ======= ======= ======= ======= ======= server. conf d/openerp- server d/init. d/openerp- server
add the following lines to the end of rpminstall_sh.txt:
CONFIGFILES="\
%config(noreplace) /etc/openerp-
%config(noreplace) /etc/logrotate.
%config(noreplace) /etc/rc.
"
echo "$CONFIGFILES" | cat INSTALLED_FILES - > INSTALLED_FILES.new
mv INSTALLED_FILES.new INSTALLED_FILES
======= ======= ======= ======= ======= ======= =======
config_ directory = opj('/etc')
files. append( (config_ directory, [f for f in glob.glob('etc/*') if os.path. isfile( f)]))
add the following lines to setup.py in data_files() at about line 103:
======= ======= ======= ======= ======= ======= =======
end